Skip to content

Commit

Permalink
phy: rockchip-inno-usb2: Sync initial otg state
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
pgwipeout authored and vinodkoul committed Jul 5, 2022
1 parent 334fad1 commit 8dc60f8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/phy/rockchip/phy-rockchip-inno-usb2.c
Original file line number Diff line number Diff line change
Expand Up @@ -1162,6 +1162,12 @@ static int rockchip_usb2phy_otg_port_init(struct rockchip_usb2phy *rphy,
EXTCON_USB_HOST, &rport->event_nb);
if (ret)
dev_err(rphy->dev, "register USB HOST notifier failed\n");

if (!of_property_read_bool(rphy->dev->of_node, "extcon")) {
/* do initial sync of usb state */
ret = property_enabled(rphy->grf, &rport->port_cfg->utmi_id);
extcon_set_state_sync(rphy->edev, EXTCON_USB_HOST, !ret);
}
}

out:
Expand Down

0 comments on commit 8dc60f8

Please sign in to comment.