0419-spi-bcm2835-Disable-forced-software-CS.patch 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. From ca5ffeeb576e6392ed1331f01fb2ac5be4524d24 Mon Sep 17 00:00:00 2001
  2. From: Phil Elwell <phil@raspberrypi.org>
  3. Date: Fri, 1 Jul 2016 22:09:24 +0100
  4. Subject: [PATCH] spi-bcm2835: Disable forced software CS
  5. Select software CS in bcm2708_common.dtsi, and disable the automatic
  6. conversion in the driver to allow hardware CS to be re-enabled with an
  7. overlay.
  8. See: https://github.com/raspberrypi/linux/issues/1547
  9. Signed-off-by: Phil Elwell <phil@raspberrypi.org>
  10. ---
  11. arch/arm/boot/dts/bcm2708_common.dtsi | 2 +-
  12. drivers/spi/spi-bcm2835.c | 2 ++
  13. 2 files changed, 3 insertions(+), 1 deletion(-)
  14. --- a/arch/arm/boot/dts/bcm2708_common.dtsi
  15. +++ b/arch/arm/boot/dts/bcm2708_common.dtsi
  16. @@ -183,7 +183,7 @@
  17. * add more gpios if necessary as <&gpio 6 1>
  18. * (but do not forget to make them output!)
  19. */
  20. - cs-gpios = <0>, <0>;
  21. + cs-gpios = <&gpio 8 1>, <&gpio 7 1>;
  22. };
  23. i2c0: i2c@7e205000 {
  24. --- a/drivers/spi/spi-bcm2835.c
  25. +++ b/drivers/spi/spi-bcm2835.c
  26. @@ -706,6 +706,7 @@ static int bcm2835_spi_setup(struct spi_
  27. return -EINVAL;
  28. }
  29. +#if 0
  30. /* now translate native cs to GPIO */
  31. /* first look for chip select pins in the devices pin groups */
  32. for (pingroup_index = 0;
  33. @@ -760,6 +761,7 @@ static int bcm2835_spi_setup(struct spi_
  34. * so we are setting it here explicitly
  35. */
  36. gpio_set_value(spi->cs_gpio, (spi->mode & SPI_CS_HIGH) ? 0 : 1);
  37. +#endif
  38. return 0;
  39. }