spi: pxa2xx: Save other reg_cs_ctrl bits when configuring chip select
authorJarkko Nikula <jarkko.nikula@linux.intel.com>
Thu, 22 Oct 2015 13:44:42 +0000 (16:44 +0300)
committerMark Brown <broonie@kernel.org>
Thu, 22 Oct 2015 23:56:05 +0000 (08:56 +0900)
Upcoming Intel platforms use LPSS SPI_CS_CONTROL register bits 15:12 for
configuring the chip select polarities. Touch only chip select SW mode and
state bits when enabling the software chip select control in order to not
clear any other bits in the register.

Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-pxa2xx.c

index db9016bbd904c1a9c20118a8bbc0bd54647ef791..4dc5660d4e33b9ae446540ae49431a31d8bc9a24 100644 (file)
@@ -249,7 +249,9 @@ static void lpss_ssp_setup(struct driver_data *drv_data)
        drv_data->lpss_base = drv_data->ioaddr + config->offset;
 
        /* Enable software chip select control */
-       value = SPI_CS_CONTROL_SW_MODE | SPI_CS_CONTROL_CS_HIGH;
+       value = __lpss_ssp_read_priv(drv_data, config->reg_cs_ctrl);
+       value &= ~(SPI_CS_CONTROL_SW_MODE | SPI_CS_CONTROL_CS_HIGH);
+       value |= SPI_CS_CONTROL_SW_MODE | SPI_CS_CONTROL_CS_HIGH;
        __lpss_ssp_write_priv(drv_data, config->reg_cs_ctrl, value);
 
        /* Enable multiblock DMA transfers */