Skip to content

Commit 8dc60f8

Browse files
pgwipeoutvinodkoul
authored andcommitted
phy: rockchip-inno-usb2: Sync initial otg state
The initial otg state for the phy defaults to device mode. The actual state isn't detected until an ID IRQ fires. Fix this by syncing the ID state during initialization. Fixes: 51a9b2c ("phy: rockchip-inno-usb2: Handle ID IRQ") Signed-off-by: Peter Geis <[email protected]> Reviewed-by: Samuel Holland <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 334fad1 commit 8dc60f8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/phy/rockchip/phy-rockchip-inno-usb2.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1162,6 +1162,12 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy,
11621162
EXTCON_USB_HOST, &rport->event_nb);
11631163
if (ret)
11641164
dev_err(rphy->dev, "register USB HOST notifier failed\n");
1165+
1166+
if (!of_property_read_bool(rphy->dev->of_node, "extcon")) {
1167+
/* do initial sync of usb state */
1168+
ret = property_enabled(rphy->grf, &rport->port_cfg->utmi_id);
1169+
extcon_set_state_sync(rphy->edev, EXTCON_USB_HOST, !ret);
1170+
}
11651171
}
11661172

11671173
out:

0 commit comments

Comments
 (0)