generic: ar8xxx: add optional gpio reset support
authorPetr Štetiar <ynezz@true.cz>
Mon, 20 May 2019 22:18:29 +0000 (00:18 +0200)
committerPetr Štetiar <ynezz@true.cz>
Fri, 31 May 2019 07:12:33 +0000 (09:12 +0200)
commitaa54ce390a42e5ce1e076d339a3cc94b53943ffa
tree00cb113c700a79be9b2d4d04f1882a748090ac06
parentcf463159df1bee537362d8faee8b1ac51e5bbfef
generic: ar8xxx: 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 optional reset GPIO which helps fixing this
problem.

Tested-by: Your Real Name <424778940z@gmail.com>
Reported-by: Your Real Name <424778940z@gmail.com>
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>
target/linux/generic/files/drivers/net/phy/ar8216.c