Skip to content
Commit 83b2a8fe authored by Lukas Wunner's avatar Lukas Wunner Committed by Greg Kroah-Hartman
Browse files

spi: spidev: Fix CS polarity if GPIO descriptors are used

commit 138c9c32 upstream.

Commit f3186dd8 ("spi: Optionally use GPIO descriptors for CS GPIOs")
amended of_spi_parse_dt() to always set SPI_CS_HIGH for SPI slaves whose
Chip Select is defined by a "cs-gpios" devicetree property.

This change broke userspace applications which issue an SPI_IOC_WR_MODE
ioctl() to an spidev:  Chip Select polarity will be incorrect unless the
application is changed to set SPI_CS_HIGH.  And once changed, it will be
incompatible with kernels not containing the commit.

Fix by setting SPI_CS_HIGH in spidev_ioctl() (under the same conditions
as in of_spi_parse_dt()).

Fixes: f3186dd8

 ("spi: Optionally use GPIO descriptors for CS GPIOs")
Reported-by: default avatarSimon Han <z.han@kunbus.com>
Signed-off-by: default avatarLukas Wunner <lukas@wunner.de>
Reviewed-by: default avatarLinus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/fca3ba7cdc930cd36854666ceac4fbcf01b89028.1582027457.git.lukas@wunner.de


Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org # v5.1+
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fc73ded1
  • mirror @mirror

    mentioned in commit 9aa024375428f893b681b6abd699996da275c9fe

    ·

    mentioned in commit 9aa024375428f893b681b6abd699996da275c9fe

    Toggle commit list
  • mirror @mirror

    mentioned in commit 822403fb7092a382f0d9cd0b36e1f97f80d44ccd

    ·

    mentioned in commit 822403fb7092a382f0d9cd0b36e1f97f80d44ccd

    Toggle commit list
  • mirror @mirror

    mentioned in commit 1e0eaf5c997d8a8a99b89ff58221855db2b56817

    ·

    mentioned in commit 1e0eaf5c997d8a8a99b89ff58221855db2b56817

    Toggle commit list
  • mirror @mirror

    mentioned in commit e6685ef376d491ebdd94b54abf3c6ac3017c1b6c

    ·

    mentioned in commit e6685ef376d491ebdd94b54abf3c6ac3017c1b6c

    Toggle commit list
  • mirror @mirror

    mentioned in commit a48caf1dc93db99a0479a19d081494e494a5f20d

    ·

    mentioned in commit a48caf1dc93db99a0479a19d081494e494a5f20d

    Toggle commit list
  • mirror @mirror

    mentioned in commit 9801cda4340202fd6b94592f13ccd118f7c6376b

    ·

    mentioned in commit 9801cda4340202fd6b94592f13ccd118f7c6376b

    Toggle commit list
  • mirror @mirror

    mentioned in commit 63848d362baed9da650a62374edea30062d0a12b

    ·

    mentioned in commit 63848d362baed9da650a62374edea30062d0a12b

    Toggle commit list
  • mirror @mirror

    mentioned in commit b3da5250

    ·

    mentioned in commit b3da5250

    Toggle commit list
  • mirror @mirror

    mentioned in commit 56ce3284

    ·

    mentioned in commit 56ce3284

    Toggle commit list
  • mirror @mirror

    mentioned in commit 157761d7

    ·

    mentioned in commit 157761d7

    Toggle commit list
  • mirror @mirror

    mentioned in commit 4c7f1a1c

    ·

    mentioned in commit 4c7f1a1c

    Toggle commit list
  • mirror @mirror

    mentioned in commit b4659f44

    ·

    mentioned in commit b4659f44

    Toggle commit list
  • mirror @mirror

    mentioned in commit e8a4ac0c7f87c7c8a8ef618ecbfca194c47832f3

    ·

    mentioned in commit e8a4ac0c7f87c7c8a8ef618ecbfca194c47832f3

    Toggle commit list
  • mirror @mirror

    mentioned in commit 2a75e3dbcc11c072fabe975f8cd2821e73c1b85e

    ·

    mentioned in commit 2a75e3dbcc11c072fabe975f8cd2821e73c1b85e

    Toggle commit list
  • mirror @mirror

    mentioned in commit d1601892489d13f57bebdea8fabd150307f6c085

    ·

    mentioned in commit d1601892489d13f57bebdea8fabd150307f6c085

    Toggle commit list
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment