generic: ar8327: add optional gpio reset support
authorPetr Štetiar <ynezz@true.cz>
Mon, 20 May 2019 22:18:29 +0000 (00:18 +0200)
committerChristian Marangi <ansuelsmth@gmail.com>
Fri, 11 Nov 2022 18:58:57 +0000 (19:58 +0100)
commita4e06c3c7a9bbc2eff59a57cd3b395b2754ebec2
tree9357d19b57a713507f98e26258376e3b37eb2a17
parentce296b1aeb18b386bd99d25794f26b0233fe2101
generic: ar8327: add optional gpio reset support

Some devices like Linksys EA8500 use designated GPIO to reset the switch
and if the switch isn't reset properly before first access, it can lead
to unusable switch after soft reboot of the device:

 libphy: GPIO Bitbanged MDIO: probed
 mdio_bus gpio-0: MDIO device at address 0 is missing.
 mdio_bus gpio-0: MDIO device at address 4 is missing.

Working case:

 libphy: GPIO Bitbanged MDIO: probed
 switch0: Atheros AR8337 rev. 2 switch registered on gpio-0

So this patch introduces reset GPIO, along with duration and active
high/low properties which fixes the problem.

Ref: https://github.com/openwrt/openwrt/pull/2047
Ref: https://bugs.openwrt.org/index.php?do=details&task_id=2168
Signed-off-by: Petr Štetiar <ynezz@true.cz>
[ remove invalid tested-by and reported-by ]
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
target/linux/generic/files/drivers/net/phy/ar8327.c