Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1362134
| From | Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] net: phy: at803x: don't depend on GPIOLIB |
| Date | 2016-03-21 21:20 +0100 |
| Message-ID | <rfesX-2eY-25@gated-at.bofh.it> (permalink) |
| References | <rdnTI-3JO-25@gated-at.bofh.it> |
| Organization | Cogent Embedded |
Hello.
On 03/16/2016 08:25 PM, Sebastian Frias wrote:
> Commit 687908c2b649 ("net: phy: at803x: simplify using
> devm_gpiod_get_optional and its 4th argument") introduced a dependency
> on GPIOLIB that was not there before.
>
> This commit removes such dependency by checking the return code and
> comparing it against ENOSYS which is returned when GPIOLIB is not
> selected.
>
> Fixes: 687908c2b649 ("net: phy: at803x: simplify using
> devm_gpiod_get_optional and its 4th argument")
>
> Signed-off-by: Sebastian Frias <sf84@laposte.net>
Do you have the PHY that requires the GPIO reset workaround?
Askinjg because I have the patch adding the "reset-gpios" prop handling to
phylib and your patch made me aware that I'll have to modify this driver in
order to do that...
> ---
> drivers/net/phy/at803x.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c
> index 2174ec9..88b7ff3 100644
> --- a/drivers/net/phy/at803x.c
> +++ b/drivers/net/phy/at803x.c
> @@ -252,7 +252,9 @@ static int at803x_probe(struct phy_device *phydev)
> return -ENOMEM;
>
> gpiod_reset = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH);
> - if (IS_ERR(gpiod_reset))
> + if (PTR_ERR(gpiod_reset) == -ENOSYS)
> + gpiod_reset = NULL;
> + else if (IS_ERR(gpiod_reset))
return PTR_ERR(gpiod_reset);
My patch basically gets rid of all this code. The thing that worries me is
that the driver assumes that the reset singal is active low, despite what the
GPIO specifier in the device tree has for the GPIO polarity. In fact, it will
only work correctly if the specified has GPIO_ACTIVE_HIGH -- which is wrong
because the reset signal is active low!
Can you point me to an actual device tree using this erratic PHY?
WBR, Sergei
Back to linux.kernel | Previous | Next — Next in thread | Find similar | Unroll thread
Re: [PATCH] net: phy: at803x: don't depend on GPIOLIB Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-03-21 21:20 +0100
Re: [PATCH] net: phy: at803x: don't depend on GPIOLIB Uwe Kleine-König <u.kleine-koenig@pengutronix.de> - 2016-03-21 21:50 +0100
Re: [PATCH] net: phy: at803x: don't depend on GPIOLIB Sergei Shtylyov <sergei.shtylyov@cogentembedded.com> - 2016-03-21 23:00 +0100
Re: [PATCH] net: phy: at803x: don't depend on GPIOLIB Sebastian Frias <sf84@laposte.net> - 2016-03-22 16:00 +0100
Re: [PATCH] net: phy: at803x: don't depend on GPIOLIB Sebastian Frias <sf84@laposte.net> - 2016-03-22 15:40 +0100
csiph-web