]> www.infradead.org Git - users/dwmw2/linux.git/commit
phy: renesas: rcar-gen3-usb2: Disable clearing VBUS in over-current
authorYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Tue, 6 Aug 2019 08:51:19 +0000 (17:51 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 21 Sep 2019 05:18:00 +0000 (07:18 +0200)
commit32e50e282ea7f5dd008a4149be3fd7f42ccb9e07
treeffca9f681894c84e7a1e1db5f2bdb429419dae01
parent262c7b193cbbde8ed6315d94ebb2b9ae1f4b2a8e
phy: renesas: rcar-gen3-usb2: Disable clearing VBUS in over-current

commit e6839c31a608e79f2057fab987dd814f5d3477e6 upstream.

The hardware manual should be revised, but the initial value of
VBCTRL.OCCLREN is set to 1 actually. If the bit is set, the hardware
clears VBCTRL.VBOUT and ADPCTRL.DRVVBUS registers automatically
when the hardware detects over-current signal from a USB power switch.
However, since the hardware doesn't have any registers which
indicates over-current, the driver cannot handle it at all. So, if
"is_otg_channel" hardware detects over-current, since ADPCTRL.DRVVBUS
register is cleared automatically, the channel cannot be used after
that.

To resolve this behavior, this patch sets the VBCTRL.OCCLREN to 0
to keep ADPCTRL.DRVVBUS even if the "is_otg_channel" hardware
detects over-current. (We assume a USB power switch itself protects
over-current and turns the VBUS off.)

This patch is inspired by a BSP patch from Kazuya Mizuguchi.

Fixes: 1114e2d31731 ("phy: rcar-gen3-usb2: change the mode to OTG on the combined channel")
Cc: <stable@vger.kernel.org> # v4.5+
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/phy/renesas/phy-rcar-gen3-usb2.c