380-pcmcia-bcm63xx_pmcia-use-the-new-named-gpio.patch 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. From c4e04f1c54928a49b227a5420d38b18226838775 Mon Sep 17 00:00:00 2001
  2. From: Jonas Gorski <jogo@openwrt.org>
  3. Date: Wed, 25 Mar 2015 13:54:56 +0100
  4. Subject: [PATCH 2/2] pcmcia: bcm63xx_pmcia: use the new named gpio
  5. Use the new named gpio instead of relying on the hardware gpio numbers
  6. matching the virtual gpio numbers.
  7. Signed-off-by: Jonas Gorski <jogo@openwrt.org>
  8. ---
  9. drivers/pcmcia/bcm63xx_pcmcia.c | 9 ++++++++-
  10. drivers/pcmcia/bcm63xx_pcmcia.h | 4 ++++
  11. 2 files changed, 12 insertions(+), 1 deletion(-)
  12. --- a/drivers/pcmcia/bcm63xx_pcmcia.c
  13. +++ b/drivers/pcmcia/bcm63xx_pcmcia.c
  14. @@ -237,7 +237,7 @@ static unsigned int __get_socket_status(
  15. stat |= SS_XVCARD;
  16. stat |= SS_POWERON;
  17. - if (gpio_get_value(skt->pd->ready_gpio))
  18. + if (gpiod_get_value(skt->ready_gpio))
  19. stat |= SS_READY;
  20. return stat;
  21. @@ -373,6 +373,13 @@ static int bcm63xx_drv_pcmcia_probe(stru
  22. goto err;
  23. }
  24. + /* get ready gpio */
  25. + skt->ready_gpio = devm_gpiod_get(&pdev->dev, "ready", GPIOD_IN);
  26. + if (IS_ERR(skt->ready_gpio)) {
  27. + ret = PTR_ERR(skt->ready_gpio);
  28. + goto err;
  29. + }
  30. +
  31. /* resources are static */
  32. sock->resource_ops = &pccard_static_ops;
  33. sock->ops = &bcm63xx_pcmcia_operations;
  34. --- a/drivers/pcmcia/bcm63xx_pcmcia.h
  35. +++ b/drivers/pcmcia/bcm63xx_pcmcia.h
  36. @@ -3,6 +3,7 @@
  37. #include <linux/types.h>
  38. #include <linux/timer.h>
  39. +#include <linux/gpio/consumer.h>
  40. #include <pcmcia/ss.h>
  41. #include <bcm63xx_dev_pcmcia.h>
  42. @@ -55,6 +56,9 @@ struct bcm63xx_pcmcia_socket {
  43. /* base address of io memory */
  44. void __iomem *io_base;
  45. +
  46. + /* ready gpio */
  47. + struct gpio_desc *ready_gpio;
  48. };
  49. #endif /* BCM63XX_PCMCIA_H_ */