Skip to content

Commit 7a2da5d

Browse files
chleroybroonie
authored andcommitted
spi: fsl: Fix driver breakage when SPI_CS_HIGH is not set in spi->mode
Commit 766c6b6 ("spi: fix client driver breakages when using GPIO descriptors") broke fsl spi driver. As now we fully rely on gpiolib for handling the polarity of chip selects, the driver shall not alter the GPIO value anymore when SPI_CS_HIGH is not set in spi->mode. Fixes: 766c6b6 ("spi: fix client driver breakages when using GPIO descriptors") Cc: stable@vger.kernel.org Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Link: https://lore.kernel.org/r/6b51cc2bfbca70d3e9b9da7b7aa4c7a9d793ca0e.1610629002.git.christophe.leroy@csgroup.eu Signed-off-by: Mark Brown <broonie@kernel.org>
1 parent 7c53f6b commit 7a2da5d

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

drivers/spi/spi-fsl-spi.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,14 +115,13 @@ static void fsl_spi_chipselect(struct spi_device *spi, int value)
115115
{
116116
struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master);
117117
struct fsl_spi_platform_data *pdata;
118-
bool pol = spi->mode & SPI_CS_HIGH;
119118
struct spi_mpc8xxx_cs *cs = spi->controller_state;
120119

121120
pdata = spi->dev.parent->parent->platform_data;
122121

123122
if (value == BITBANG_CS_INACTIVE) {
124123
if (pdata->cs_control)
125-
pdata->cs_control(spi, !pol);
124+
pdata->cs_control(spi, false);
126125
}
127126

128127
if (value == BITBANG_CS_ACTIVE) {
@@ -134,7 +133,7 @@ static void fsl_spi_chipselect(struct spi_device *spi, int value)
134133
fsl_spi_change_mode(spi);
135134

136135
if (pdata->cs_control)
137-
pdata->cs_control(spi, pol);
136+
pdata->cs_control(spi, true);
138137
}
139138
}
140139

0 commit comments

Comments
 (0)