phy: sun4i-usb: support automatically switch PHY0 route to MUSB/HCI
commit3ecc25e12f0e210d56fcca110a8144e50db05905
authorIcenowy Zheng <icenowy@aosc.xyz>
Sat, 25 Mar 2017 14:50:11 +0000 (25 22:50 +0800)
committerKishon Vijay Abraham I <kishon@ti.com>
Mon, 10 Apr 2017 11:12:58 +0000 (10 16:42 +0530)
tree3c53fb45bf07f1025a88ac37daeb0c21f7ae1f35
parent864ebdf0bd4166e64c21e95b72d770eaa33122aa
phy: sun4i-usb: support automatically switch PHY0 route to MUSB/HCI

On newer Allwinner SoCs (H3 and after), the PHY0 node is routed to both
MUSB controller for peripheral and host support (the host support is
slightly broken), and a pair of EHCI/OHCI controllers, which provide a
better support for host mode.

Add support for automatically switch the route of PHY0 according to the
status of dr_mode and id det pin.

Only H3 have this function enabled in this patch, as further SoCs will
be tested later and then have it enabled.

As H5 is reusing the PHY driver of H3, this function is also enabled.

Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
Acked-by: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
drivers/phy/phy-sun4i-usb.c