diff mbox

[LEDE-DEV,2/3] brcm47xx: resolve GPIO conflict for WRT54GSv1

Message ID 1495136944-8880-3-git-send-email-mirko.parthey@web.de
State Superseded
Delegated to: Hauke Mehrtens
Headers show

Commit Message

Mirko Parthey May 18, 2017, 7:49 p.m. UTC
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@web.de>
---
 target/linux/generic/files/drivers/net/phy/adm6996.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Hauke Mehrtens June 23, 2017, 8:24 p.m. UTC | #1
On 05/18/2017 09:49 PM, Mirko Parthey wrote:
> 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@web.de>
> ---
>  target/linux/generic/files/drivers/net/phy/adm6996.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/target/linux/generic/files/drivers/net/phy/adm6996.c b/target/linux/generic/files/drivers/net/phy/adm6996.c
> index 25776b836651..0a1b303ab1c0 100644
> --- a/target/linux/generic/files/drivers/net/phy/adm6996.c
> +++ b/target/linux/generic/files/drivers/net/phy/adm6996.c
> @@ -1154,12 +1154,13 @@ 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;

Could you also remove the references of eerc from the other places of
the code.

>  	ret = devm_gpio_request(&pdev->dev, priv->eesk, "adm_eesk");
>  	if (ret)
>  		return ret;
> +	/*
> +	 * We do not request the "adm_rc" GPIO here. The driver does not use it,

Do you mean adm_eerc instead of adm_rc?

> +	 * and it conflicts with the Reset button GPIO on the Linksys WRT54GSv1.
> +	 */
>  
>  	ret = adm6996_switch_init(priv, dev_name(&pdev->dev), NULL);
>  	if (ret < 0)
>
Mirko Parthey June 26, 2017, 4:22 p.m. UTC | #2
On Fri, Jun 23, 2017 at 10:24:50PM +0200, Hauke Mehrtens wrote:
> Could you also remove the references of eerc from the other places of
> the code.

OK.

> >  	ret = devm_gpio_request(&pdev->dev, priv->eesk, "adm_eesk");
> >  	if (ret)
> >  		return ret;
> > +	/*
> > +	 * We do not request the "adm_rc" GPIO here. The driver does not use it,
> 
> Do you mean adm_eerc instead of adm_rc?

No, I meant adm_rc as stored in nvram.  I'll move the comment to clarify this.

Thanks,
Mirko
diff mbox

Patch

diff --git a/target/linux/generic/files/drivers/net/phy/adm6996.c b/target/linux/generic/files/drivers/net/phy/adm6996.c
index 25776b836651..0a1b303ab1c0 100644
--- a/target/linux/generic/files/drivers/net/phy/adm6996.c
+++ b/target/linux/generic/files/drivers/net/phy/adm6996.c
@@ -1154,12 +1154,13 @@  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;
+	/*
+	 * We do not request the "adm_rc" GPIO here. The driver does not use it,
+	 * and it conflicts with the Reset button GPIO on the Linksys WRT54GSv1.
+	 */
 
 	ret = adm6996_switch_init(priv, dev_name(&pdev->dev), NULL);
 	if (ret < 0)