aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChew, Chiau Ee <chiau.ee.chew@intel.com>2014-06-13 11:57:25 -0400
committerMark Brown <broonie@linaro.org>2014-06-17 10:45:52 -0400
commite61f487fd596ce570e87ccfdc0a7fc9fa87aced9 (patch)
tree7f7ac8e9170d7c41cb49f2abde20542e80309df2
parent01d7aafb3fbaafe2403780ef9ed497b3289ab1b9 (diff)
spi/pxa2xx: fix incorrect SW mode chipselect setting for BayTrail LPSS SPI
It was observed that after module removal followed by insertion, the SW mode chipselect is not properly set. Thus causing transfer failure due to incorrect CS toggling. Signed-off-by: Chew, Chiau Ee <chiau.ee.chew@intel.com> Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--drivers/spi/spi-pxa2xx.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/spi/spi-pxa2xx.c b/drivers/spi/spi-pxa2xx.c
index a98df7eeb42d..fe792106bdc5 100644
--- a/drivers/spi/spi-pxa2xx.c
+++ b/drivers/spi/spi-pxa2xx.c
@@ -118,6 +118,7 @@ static void lpss_ssp_setup(struct driver_data *drv_data)
118 */ 118 */
119 orig = readl(drv_data->ioaddr + offset + SPI_CS_CONTROL); 119 orig = readl(drv_data->ioaddr + offset + SPI_CS_CONTROL);
120 120
121 /* Test SPI_CS_CONTROL_SW_MODE bit enabling */
121 value = orig | SPI_CS_CONTROL_SW_MODE; 122 value = orig | SPI_CS_CONTROL_SW_MODE;
122 writel(value, drv_data->ioaddr + offset + SPI_CS_CONTROL); 123 writel(value, drv_data->ioaddr + offset + SPI_CS_CONTROL);
123 value = readl(drv_data->ioaddr + offset + SPI_CS_CONTROL); 124 value = readl(drv_data->ioaddr + offset + SPI_CS_CONTROL);
@@ -126,10 +127,13 @@ static void lpss_ssp_setup(struct driver_data *drv_data)
126 goto detection_done; 127 goto detection_done;
127 } 128 }
128 129
129 value &= ~SPI_CS_CONTROL_SW_MODE; 130 orig = readl(drv_data->ioaddr + offset + SPI_CS_CONTROL);
131
132 /* Test SPI_CS_CONTROL_SW_MODE bit disabling */
133 value = orig & ~SPI_CS_CONTROL_SW_MODE;
130 writel(value, drv_data->ioaddr + offset + SPI_CS_CONTROL); 134 writel(value, drv_data->ioaddr + offset + SPI_CS_CONTROL);
131 value = readl(drv_data->ioaddr + offset + SPI_CS_CONTROL); 135 value = readl(drv_data->ioaddr + offset + SPI_CS_CONTROL);
132 if (value != orig) { 136 if (value != (orig & ~SPI_CS_CONTROL_SW_MODE)) {
133 offset = 0x800; 137 offset = 0x800;
134 goto detection_done; 138 goto detection_done;
135 } 139 }