0102-pinctrl-bcm2835-bcm2835_gpio_direction_output-must-s.patch 960 B

12345678910111213141516171819202122232425262728
  1. From ce24753015125e11d87764dca9740fde33ccd455 Mon Sep 17 00:00:00 2001
  2. From: Phil Elwell <phil@raspberrypi.org>
  3. Date: Wed, 4 Feb 2015 10:02:24 +0000
  4. Subject: [PATCH 102/114] pinctrl-bcm2835: bcm2835_gpio_direction_output must
  5. set the value
  6. ---
  7. drivers/pinctrl/pinctrl-bcm2835.c | 9 ++++++++-
  8. 1 file changed, 8 insertions(+), 1 deletion(-)
  9. --- a/drivers/pinctrl/pinctrl-bcm2835.c
  10. +++ b/drivers/pinctrl/pinctrl-bcm2835.c
  11. @@ -355,7 +355,14 @@ static int bcm2835_gpio_get(struct gpio_
  12. static int bcm2835_gpio_direction_output(struct gpio_chip *chip,
  13. unsigned offset, int value)
  14. {
  15. - return pinctrl_gpio_direction_output(chip->base + offset);
  16. + struct bcm2835_pinctrl *pc = dev_get_drvdata(chip->dev);
  17. + int ret;
  18. +
  19. + ret = pinctrl_gpio_direction_output(chip->base + offset);
  20. + if (ret >= 0)
  21. + bcm2835_gpio_set_bit(pc, value ? GPSET0 : GPCLR0, offset);
  22. +
  23. + return ret;
  24. }
  25. static void bcm2835_gpio_set(struct gpio_chip *chip, unsigned offset, int value)