From d43f389035a789d60af7d4b2a75e556be2da3c7e Mon Sep 17 00:00:00 2001 From: Elias Kotlyar Date: Thu, 13 Feb 2020 20:32:06 +0100 Subject: [PATCH] Fixxes #1788 - Code taken from https://linux-sunxi.org/SPIdev (#1789) * Fixxes #1788 - Code taken from https://linux-sunxi.org/SPIdev * Additional Patch for 5.5 --- .../general_spi_bug_low_on_sck.patch | 27 +++++++++++++++++++ .../general_spi_bug_low_on_sck.patch | 27 +++++++++++++++++++ 2 files changed, 54 insertions(+) create mode 100644 patch/kernel/sunxi-current/general_spi_bug_low_on_sck.patch create mode 100644 patch/kernel/sunxi-dev/general_spi_bug_low_on_sck.patch diff --git a/patch/kernel/sunxi-current/general_spi_bug_low_on_sck.patch b/patch/kernel/sunxi-current/general_spi_bug_low_on_sck.patch new file mode 100644 index 0000000000..7938137213 --- /dev/null +++ b/patch/kernel/sunxi-current/general_spi_bug_low_on_sck.patch @@ -0,0 +1,27 @@ +Index: drivers/spi/spi-sun4i.c +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +--- a/drivers/spi/spi-sun4i.c (date 1581011681000) ++++ b/drivers/spi/spi-sun4i.c (date 1581070363000) +@@ -389,6 +389,7 @@ + struct spi_master *master = dev_get_drvdata(dev); + struct sun4i_spi *sspi = spi_master_get_devdata(master); + int ret; ++ u32 reg; + + ret = clk_prepare_enable(sspi->hclk); + if (ret) { +@@ -401,9 +402,10 @@ + dev_err(dev, "Couldn't enable module clock\n"); + goto err; + } ++ reg = sun4i_spi_read(sspi, SUN4I_CTL_REG); + + sun4i_spi_write(sspi, SUN4I_CTL_REG, +- SUN4I_CTL_ENABLE | SUN4I_CTL_MASTER | SUN4I_CTL_TP); ++ reg | SUN4I_CTL_ENABLE | SUN4I_CTL_MASTER | SUN4I_CTL_TP); + + return 0; + diff --git a/patch/kernel/sunxi-dev/general_spi_bug_low_on_sck.patch b/patch/kernel/sunxi-dev/general_spi_bug_low_on_sck.patch new file mode 100644 index 0000000000..7938137213 --- /dev/null +++ b/patch/kernel/sunxi-dev/general_spi_bug_low_on_sck.patch @@ -0,0 +1,27 @@ +Index: drivers/spi/spi-sun4i.c +IDEA additional info: +Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP +<+>UTF-8 +=================================================================== +--- a/drivers/spi/spi-sun4i.c (date 1581011681000) ++++ b/drivers/spi/spi-sun4i.c (date 1581070363000) +@@ -389,6 +389,7 @@ + struct spi_master *master = dev_get_drvdata(dev); + struct sun4i_spi *sspi = spi_master_get_devdata(master); + int ret; ++ u32 reg; + + ret = clk_prepare_enable(sspi->hclk); + if (ret) { +@@ -401,9 +402,10 @@ + dev_err(dev, "Couldn't enable module clock\n"); + goto err; + } ++ reg = sun4i_spi_read(sspi, SUN4I_CTL_REG); + + sun4i_spi_write(sspi, SUN4I_CTL_REG, +- SUN4I_CTL_ENABLE | SUN4I_CTL_MASTER | SUN4I_CTL_TP); ++ reg | SUN4I_CTL_ENABLE | SUN4I_CTL_MASTER | SUN4I_CTL_TP); + + return 0; +