summaryrefslogtreecommitdiff
path: root/target/linux/brcm63xx/patches-4.4/376-net-bcm63xx_enet-use-named-gpio-for-ephy-reset-gpio.patch
diff options
context:
space:
mode:
authorJonas Gorski <jogo@openwrt.org>2015-12-02 22:24:46 +0000
committerJonas Gorski <jogo@openwrt.org>2015-12-02 22:24:46 +0000
commite395433178224ff1e2a6053105d12936b46c7576 (patch)
tree6fd6e2bb8019d78d1b8a57d63516ebbe3cff47f6 /target/linux/brcm63xx/patches-4.4/376-net-bcm63xx_enet-use-named-gpio-for-ephy-reset-gpio.patch
parent621677154f39f2e0b698a558b8b795db84a8e014 (diff)
downloadmtk-20170518-e395433178224ff1e2a6053105d12936b46c7576.zip
mtk-20170518-e395433178224ff1e2a6053105d12936b46c7576.tar.gz
mtk-20170518-e395433178224ff1e2a6053105d12936b46c7576.tar.bz2
brcm63xx: add linux 4.4 support
Only netboot tested. Flash at your own risk. Signed-off-by: Jonas Gorski <jogo@openwrt.org> SVN-Revision: 47702
Diffstat (limited to 'target/linux/brcm63xx/patches-4.4/376-net-bcm63xx_enet-use-named-gpio-for-ephy-reset-gpio.patch')
-rw-r--r--target/linux/brcm63xx/patches-4.4/376-net-bcm63xx_enet-use-named-gpio-for-ephy-reset-gpio.patch46
1 files changed, 46 insertions, 0 deletions
diff --git a/target/linux/brcm63xx/patches-4.4/376-net-bcm63xx_enet-use-named-gpio-for-ephy-reset-gpio.patch b/target/linux/brcm63xx/patches-4.4/376-net-bcm63xx_enet-use-named-gpio-for-ephy-reset-gpio.patch
new file mode 100644
index 0000000..db3fc5b
--- /dev/null
+++ b/target/linux/brcm63xx/patches-4.4/376-net-bcm63xx_enet-use-named-gpio-for-ephy-reset-gpio.patch
@@ -0,0 +1,46 @@
+From ec905f2ea78ec40602a685ede31c5e4f9893d196 Mon Sep 17 00:00:00 2001
+From: Jonas Gorski <jogo@openwrt.org>
+Date: Sat, 21 Feb 2015 16:35:07 +0100
+Subject: [PATCH 3/6] net: bcm63xx_enet: use named gpio for ephy reset gpio
+
+Allow using a named optional gpio for ephy reset gpio registration.
+---
+ drivers/net/ethernet/broadcom/bcm63xx_enet.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+--- a/drivers/net/ethernet/broadcom/bcm63xx_enet.c
++++ b/drivers/net/ethernet/broadcom/bcm63xx_enet.c
+@@ -30,6 +30,7 @@
+ #include <linux/dma-mapping.h>
+ #include <linux/platform_device.h>
+ #include <linux/if_vlan.h>
++#include <linux/gpio/consumer.h>
+
+ #include <bcm63xx_dev_enet.h>
+ #include "bcm63xx_enet.h"
+@@ -2851,10 +2852,15 @@ static int bcm_enet_shared_probe(struct
+ {
+ struct resource *res;
+ void __iomem *p[3];
++ struct gpio_desc *ephy_reset;
+ unsigned int i;
+
+ memset(bcm_enet_shared_base, 0, sizeof(bcm_enet_shared_base));
+
++ ephy_reset = devm_gpiod_get_optional(&pdev->dev, "ephy-reset", GPIOD_ASIS);
++ if (IS_ERR(ephy_reset))
++ return PTR_ERR(ephy_reset);
++
+ for (i = 0; i < 3; i++) {
+ res = platform_get_resource(pdev, IORESOURCE_MEM, i);
+ p[i] = devm_ioremap_resource(&pdev->dev, res);
+@@ -2864,6 +2870,9 @@ static int bcm_enet_shared_probe(struct
+
+ memcpy(bcm_enet_shared_base, p, sizeof(bcm_enet_shared_base));
+
++ if (ephy_reset)
++ gpiod_direction_output(ephy_reset, 0);
++
+ return 0;
+ }
+