aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm63xx/patches-4.19/380-pcmcia-bcm63xx_pmcia-use-the-new-named-gpio.patch
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2019-09-14 09:39:52 +0200
committerJonas Gorski <jonas.gorski@gmail.com>2019-11-09 13:16:01 +0100
commitf586dd67ac58a908092fedaa550a7ef99ff84d22 (patch)
tree5b6f119b20c573f1e58fe1531ae412310d4938d1 /target/linux/brcm63xx/patches-4.19/380-pcmcia-bcm63xx_pmcia-use-the-new-named-gpio.patch
parent9673d5c7ab9b9018a6e87fa6a4b26624c7b1f96f (diff)
downloadupstream-f586dd67ac58a908092fedaa550a7ef99ff84d22.tar.gz
upstream-f586dd67ac58a908092fedaa550a7ef99ff84d22.tar.bz2
upstream-f586dd67ac58a908092fedaa550a7ef99ff84d22.zip
brcm63xx: add linux 4.19 support
Boot tested on Comtrend AR-5387un: https://gist.github.com/Noltari/57e5030455da8dc38e61f8c3a5922254 Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> [jonas.gorski: make 4.19 an optional testing version; add gcc 8.3 fix] Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Diffstat (limited to 'target/linux/brcm63xx/patches-4.19/380-pcmcia-bcm63xx_pmcia-use-the-new-named-gpio.patch')
-rw-r--r--target/linux/brcm63xx/patches-4.19/380-pcmcia-bcm63xx_pmcia-use-the-new-named-gpio.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/target/linux/brcm63xx/patches-4.19/380-pcmcia-bcm63xx_pmcia-use-the-new-named-gpio.patch b/target/linux/brcm63xx/patches-4.19/380-pcmcia-bcm63xx_pmcia-use-the-new-named-gpio.patch
new file mode 100644
index 0000000000..253417153c
--- /dev/null
+++ b/target/linux/brcm63xx/patches-4.19/380-pcmcia-bcm63xx_pmcia-use-the-new-named-gpio.patch
@@ -0,0 +1,59 @@
+From c4e04f1c54928a49b227a5420d38b18226838775 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jogo@openwrt.org>
+Date: Wed, 25 Mar 2015 13:54:56 +0100
+Subject: [PATCH 2/2] pcmcia: bcm63xx_pmcia: use the new named gpio
+
+Use the new named gpio instead of relying on the hardware gpio numbers
+matching the virtual gpio numbers.
+
+Signed-off-by: Jonas Gorski <jogo@openwrt.org>
+---
+ drivers/pcmcia/bcm63xx_pcmcia.c | 9 ++++++++-
+ drivers/pcmcia/bcm63xx_pcmcia.h | 4 ++++
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+--- a/drivers/pcmcia/bcm63xx_pcmcia.c
++++ b/drivers/pcmcia/bcm63xx_pcmcia.c
+@@ -237,7 +237,7 @@ static unsigned int __get_socket_status(
+ stat |= SS_XVCARD;
+ stat |= SS_POWERON;
+
+- if (gpio_get_value(skt->pd->ready_gpio))
++ if (gpiod_get_value(skt->ready_gpio))
+ stat |= SS_READY;
+
+ return stat;
+@@ -373,6 +373,13 @@ static int bcm63xx_drv_pcmcia_probe(stru
+ goto err;
+ }
+
++ /* get ready gpio */
++ skt->ready_gpio = devm_gpiod_get(&pdev->dev, "ready", GPIOD_IN);
++ if (IS_ERR(skt->ready_gpio)) {
++ ret = PTR_ERR(skt->ready_gpio);
++ goto err;
++ }
++
+ /* resources are static */
+ sock->resource_ops = &pccard_static_ops;
+ sock->ops = &bcm63xx_pcmcia_operations;
+--- a/drivers/pcmcia/bcm63xx_pcmcia.h
++++ b/drivers/pcmcia/bcm63xx_pcmcia.h
+@@ -4,6 +4,7 @@
+
+ #include <linux/types.h>
+ #include <linux/timer.h>
++#include <linux/gpio/consumer.h>
+ #include <pcmcia/ss.h>
+ #include <bcm63xx_dev_pcmcia.h>
+
+@@ -56,6 +57,9 @@ struct bcm63xx_pcmcia_socket {
+
+ /* base address of io memory */
+ void __iomem *io_base;
++
++ /* ready gpio */
++ struct gpio_desc *ready_gpio;
+ };
+
+ #endif /* BCM63XX_PCMCIA_H_ */