[source] brcm47xx: resolve GPIO conflict for WRT54GSv1

LEDE Commits lede-commits at lists.infradead.org
Sun Jul 2 14:12:48 PDT 2017


hauke pushed a commit to source.git, branch master:
https://git.lede-project.org/1dace8cbe0ba32a4876cede2c9ee226462955dcd

commit 1dace8cbe0ba32a4876cede2c9ee226462955dcd
Author: Mirko Parthey <mirko.parthey at web.de>
AuthorDate: Mon Jun 26 18:25:46 2017 +0200

    brcm47xx: resolve GPIO conflict for WRT54GSv1
    
    On the Linksys WRT54GSv1, the adm6996 switch driver and the
    gpio_button_hotplug module both claim GPIO 6, which is connected to the
    Reset button.  When the switch driver's request wins, the Reset button
    cannot work. This makes it impossible to enter failsafe mode without a
    serial console.
    
    Stop requesting the "adm_rc" GPIO in the switch driver, since it is not
    used anywhere.
    
    Fixes FS#792.
    
    Signed-off-by: Mirko Parthey <mirko.parthey at web.de>
---
 .../patches-4.4/209-b44-register-adm-switch.patch         | 15 +++++++--------
 target/linux/generic/files/drivers/net/phy/adm6996.c      |  5 -----
 .../files/include/linux/platform_data/adm6996-gpio.h      |  1 -
 3 files changed, 7 insertions(+), 14 deletions(-)

diff --git a/target/linux/brcm47xx/patches-4.4/209-b44-register-adm-switch.patch b/target/linux/brcm47xx/patches-4.4/209-b44-register-adm-switch.patch
index 115b6ae..7e3d1d6 100644
--- a/target/linux/brcm47xx/patches-4.4/209-b44-register-adm-switch.patch
+++ b/target/linux/brcm47xx/patches-4.4/209-b44-register-adm-switch.patch
@@ -19,7 +19,7 @@ Subject: [PATCH 210/210] b44: register adm switch
  
  #include <asm/uaccess.h>
  #include <asm/io.h>
-@@ -2240,6 +2242,70 @@ static void b44_adjust_link(struct net_d
+@@ -2240,6 +2242,69 @@ static void b44_adjust_link(struct net_d
  	}
  }
  
@@ -50,11 +50,10 @@ Subject: [PATCH 210/210] b44: register adm switch
 +	else
 +		adm_data.eedi = 4;
 +
-+	gpio = bcm47xx_nvram_gpio_pin("adm_rc");
-+	if (gpio >= 0)
-+		adm_data.eerc = gpio;
-+	else
-+		adm_data.eerc = 5;
++	/*
++	 * We ignore the "adm_rc" GPIO here. The driver does not use it,
++	 * and it conflicts with the Reset button GPIO on the Linksys WRT54GSv1.
++	 */
 +
 +	info.parent = bp->sdev->dev;
 +	info.name = "adm6996_gpio";
@@ -90,7 +89,7 @@ Subject: [PATCH 210/210] b44: register adm switch
  static int b44_register_phy_one(struct b44 *bp)
  {
  	struct mii_bus *mii_bus;
-@@ -2283,6 +2349,9 @@ static int b44_register_phy_one(struct b
+@@ -2283,6 +2348,9 @@ static int b44_register_phy_one(struct b
  	if (!bp->mii_bus->phy_map[bp->phy_addr] &&
  	    (sprom->boardflags_lo & (B44_BOARDFLAG_ROBO | B44_BOARDFLAG_ADM))) {
  
@@ -100,7 +99,7 @@ Subject: [PATCH 210/210] b44: register adm switch
  		dev_info(sdev->dev,
  			 "could not find PHY at %i, use fixed one\n",
  			 bp->phy_addr);
-@@ -2479,6 +2548,7 @@ static void b44_remove_one(struct ssb_de
+@@ -2479,6 +2547,7 @@ static void b44_remove_one(struct ssb_de
  	unregister_netdev(dev);
  	if (bp->flags & B44_FLAG_EXTERNAL_PHY)
  		b44_unregister_phy_one(bp);
diff --git a/target/linux/generic/files/drivers/net/phy/adm6996.c b/target/linux/generic/files/drivers/net/phy/adm6996.c
index 25776b8..d9ea828 100644
--- a/target/linux/generic/files/drivers/net/phy/adm6996.c
+++ b/target/linux/generic/files/drivers/net/phy/adm6996.c
@@ -67,7 +67,6 @@ struct adm6996_priv {
 	u8 eecs;
 	u8 eesk;
 	u8 eedi;
-	u8 eerc;
 
 	enum adm6996_model model;
 
@@ -1141,7 +1140,6 @@ static int adm6996_gpio_probe(struct platform_device *pdev)
 
 	priv->eecs = pdata->eecs;
 	priv->eedi = pdata->eedi;
-	priv->eerc = pdata->eerc;
 	priv->eesk = pdata->eesk;
 
 	priv->model = pdata->model;
@@ -1154,9 +1152,6 @@ static int adm6996_gpio_probe(struct platform_device *pdev)
 	ret = devm_gpio_request(&pdev->dev, priv->eedi, "adm_eedi");
 	if (ret)
 		return ret;
-	ret = devm_gpio_request(&pdev->dev, priv->eerc, "adm_eerc");
-	if (ret)
-		return ret;
 	ret = devm_gpio_request(&pdev->dev, priv->eesk, "adm_eesk");
 	if (ret)
 		return ret;
diff --git a/target/linux/generic/files/include/linux/platform_data/adm6996-gpio.h b/target/linux/generic/files/include/linux/platform_data/adm6996-gpio.h
index e4fcfaf..d5af9bb 100644
--- a/target/linux/generic/files/include/linux/platform_data/adm6996-gpio.h
+++ b/target/linux/generic/files/include/linux/platform_data/adm6996-gpio.h
@@ -23,7 +23,6 @@ struct adm6996_gpio_platform_data {
 	u8 eecs;
 	u8 eesk;
 	u8 eedi;
-	u8 eerc;
 	enum adm6996_model model;
 };
 



More information about the lede-commits mailing list