spi: spi-omap2-mcspi.c: revert "Toggle CS after each word"
authorLouis Chauvet <louis.chauvet@bootlin.com>
Wed, 27 Mar 2024 08:43:36 +0000 (09:43 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 28 Mar 2024 15:52:31 +0000 (15:52 +0000)
Commit 5cbc7ca987fb ("spi: spi-omap2-mcspi.c: Toggle CS after each
word") introduced the toggling of CS after each word for the omap2-mcspi
controller.

The implementation is not respectful of the actual spi_message
content, so the CS can be raised after each word even if the
transfer structure asks to keep the CS active for the whole operation.

As it is not used anyway in the current Linux tree, it can be safely
removed.

Signed-off-by: Louis Chauvet <louis.chauvet@bootlin.com>
Link: https://msgid.link/r/20240327-spi-omap2-mcspi-multi-mode-v3-1-c4ac329dd5a2@bootlin.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-omap2-mcspi.c
include/linux/platform_data/spi-omap2-mcspi.h

index ddf1c684bcc7d863ede340aa196506a3a3505654..601acec37eca9f84538bab8461899e3675e7bef2 100644 (file)
@@ -1175,13 +1175,6 @@ static int omap2_mcspi_transfer_one(struct spi_controller *ctlr,
                    t->bits_per_word == spi->bits_per_word)
                        par_override = 0;
        }
-       if (cd && cd->cs_per_word) {
-               chconf = mcspi->ctx.modulctrl;
-               chconf &= ~OMAP2_MCSPI_MODULCTRL_SINGLE;
-               mcspi_write_reg(ctlr, OMAP2_MCSPI_MODULCTRL, chconf);
-               mcspi->ctx.modulctrl =
-                       mcspi_read_cs_reg(spi, OMAP2_MCSPI_MODULCTRL);
-       }
 
        chconf = mcspi_cached_chconf0(spi);
        chconf &= ~OMAP2_MCSPI_CHCONF_TRM_MASK;
@@ -1240,14 +1233,6 @@ out:
                status = omap2_mcspi_setup_transfer(spi, NULL);
        }
 
-       if (cd && cd->cs_per_word) {
-               chconf = mcspi->ctx.modulctrl;
-               chconf |= OMAP2_MCSPI_MODULCTRL_SINGLE;
-               mcspi_write_reg(ctlr, OMAP2_MCSPI_MODULCTRL, chconf);
-               mcspi->ctx.modulctrl =
-                       mcspi_read_cs_reg(spi, OMAP2_MCSPI_MODULCTRL);
-       }
-
        omap2_mcspi_set_enable(spi, 0);
 
        if (spi_get_csgpiod(spi, 0))
index 3b400b1919a9bd8a9a446da90e37a3582af15de9..9e3c15b4ac9136510c50b1442476b32f02fae0cf 100644 (file)
@@ -16,9 +16,6 @@ struct omap2_mcspi_platform_config {
 
 struct omap2_mcspi_device_config {
        unsigned turbo_mode:1;
-
-       /* toggle chip select after every word */
-       unsigned cs_per_word:1;
 };
 
 #endif