Lukas Wunner
83b2a8fe43
spi: spidev: Fix CS polarity if GPIO descriptors are used
...
commit 138c9c32f090894614899eca15e0bb7279f59865 upstream.
Commit f3186dd87669 ("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: f3186dd87669 ("spi: Optionally use GPIO descriptors for CS GPIOs")
Reported-by: Simon Han <z.han@kunbus.com>
Signed-off-by: Lukas Wunner <lukas@wunner.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/fca3ba7cdc930cd36854666ceac4fbcf01b89028.1582027457.git.lukas@wunner.de
Signed-off-by: Mark Brown <broonie@kernel.org>
Cc: stable@vger.kernel.org # v5.1+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2020-03-12 13:00:22 +01:00
..
2019-08-02 12:15:43 +01:00
2018-04-23 15:48:18 +01:00
2019-09-17 16:22:26 -07:00
2019-09-16 15:52:38 -07:00
2019-09-04 17:14:50 +01:00
2019-09-04 17:15:09 +01:00
2019-05-08 17:45:26 +09:00
2019-09-04 17:15:29 +01:00
2020-01-17 19:49:01 +01:00
2019-05-30 11:26:37 -07:00
2019-09-04 17:15:49 +01:00
2019-09-04 17:16:47 +01:00
2019-08-02 12:15:43 +01:00
2019-09-15 10:32:06 +01:00
2019-09-04 17:16:08 +01:00
2019-09-15 10:32:04 +01:00
2019-06-19 17:09:09 +02:00
2017-11-02 11:10:55 +01:00
2019-06-10 18:52:53 +01:00
2019-06-19 17:09:09 +02:00
2019-07-31 14:13:13 -06:00
2019-12-31 16:45:59 +01:00
2019-09-04 17:17:27 +01:00
2020-01-12 12:21:20 +01:00
2017-11-02 11:10:55 +01:00
2019-09-04 17:17:36 +01:00
2019-09-04 17:17:56 +01:00
2019-05-30 11:26:37 -07:00
2019-06-05 17:37:10 +02:00
2019-06-05 17:36:37 +02:00
2019-09-04 17:18:05 +01:00
2019-09-15 10:32:06 +01:00
2020-02-01 09:34:44 +00:00
2020-02-01 09:34:44 +00:00
2019-08-02 12:15:43 +01:00
2019-08-02 12:15:43 +01:00
2019-06-19 17:09:55 +02:00
2019-09-04 17:24:26 +01:00
2019-05-30 11:26:32 -07:00
2020-01-09 10:20:01 +01:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:32 -07:00
2019-08-28 14:10:41 +01:00
2020-02-24 08:36:28 +01:00
2020-02-24 08:36:54 +01:00
2020-01-12 12:21:13 +01:00
2019-05-30 11:26:32 -07:00
2019-09-04 17:18:25 +01:00
2019-12-31 16:43:16 +01:00
2019-12-31 16:44:46 +01:00
2019-03-15 17:06:34 +00:00
2019-05-30 11:26:41 -07:00
2019-05-21 10:50:45 +02:00
2019-08-02 12:15:43 +01:00
2019-07-31 14:13:13 -06:00
2019-05-30 11:26:37 -07:00
2019-09-04 17:18:35 +01:00
2019-04-08 14:06:51 +07:00
2019-09-04 17:18:55 +01:00
2019-09-04 17:19:14 +01:00
2019-05-30 11:26:32 -07:00
2019-06-05 17:37:16 +02:00
2019-05-30 11:26:32 -07:00
2019-09-13 10:41:10 +01:00
2019-09-04 17:19:34 +01:00
2019-03-20 17:20:29 +00:00
2019-09-04 17:19:54 +01:00
2019-09-05 18:19:45 +01:00
2019-09-04 17:20:03 +01:00
2020-01-12 12:21:34 +01:00
2019-09-04 17:20:33 +01:00
2019-05-30 11:26:37 -07:00
2019-05-30 11:26:37 -07:00
2019-06-19 17:09:55 +02:00
2019-09-04 17:20:52 +01:00
2019-08-02 12:15:43 +01:00
2019-05-30 11:26:37 -07:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-05-21 10:50:45 +02:00
2020-02-01 09:34:48 +00:00
2019-06-19 17:09:55 +02:00
2019-09-04 17:21:12 +01:00
2019-07-04 17:35:07 +01:00
2019-09-04 17:21:21 +01:00
2019-06-10 18:52:53 +01:00
2020-01-17 19:49:01 +01:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-09-04 17:21:31 +01:00
2018-05-17 13:27:08 +09:00
2019-05-30 11:26:37 -07:00
2019-02-08 13:04:19 +00:00
2019-08-07 14:24:47 +01:00
2019-06-19 17:09:55 +02:00
2019-08-02 12:15:43 +01:00
2019-12-31 16:44:34 +01:00
2019-09-04 17:22:00 +01:00
2019-08-02 12:15:43 +01:00
2018-10-03 16:23:10 +01:00
2019-12-31 16:44:25 +01:00
2020-01-17 19:49:00 +01:00
2019-12-31 16:45:37 +01:00
2019-12-13 08:43:13 +01:00
2019-05-02 10:38:41 +09:00
2019-09-04 17:22:29 +01:00
2019-09-04 17:22:49 +01:00
2019-08-02 12:15:43 +01:00
2019-09-04 17:22:58 +01:00
2019-12-31 16:45:33 +01:00
2019-06-10 18:52:53 +01:00
2019-05-30 11:26:37 -07:00
2020-01-12 12:21:25 +01:00
2019-06-19 17:09:55 +02:00
2019-06-05 17:36:37 +02:00
2020-01-09 10:20:04 +01:00
2019-05-30 11:25:18 -07:00
2019-06-19 17:09:55 +02:00
2019-09-04 17:23:28 +01:00
2019-06-19 17:09:55 +02:00
2019-09-04 17:24:07 +01:00
2019-09-04 17:23:48 +01:00
2019-12-13 08:43:15 +01:00
2020-03-12 13:00:22 +01:00