Because chg_work is used for charge detection, so if OTG works in
Host mode, we don't need to initialize chg_work, and aslo we don't
need to cancel it when phy exit.
Change-Id: I19cbede5aeb4c1f7f8faa32f195fffb0fc71eca9
Signed-off-by: Wu Liang feng <wulf@rock-chips.com>
{
struct rockchip_usb2phy_port *rport = phy_get_drvdata(phy);
- if (rport->port_id == USB2PHY_PORT_OTG) {
+ if (rport->port_id == USB2PHY_PORT_OTG &&
+ rport->mode != USB_DR_MODE_HOST)
cancel_delayed_work_sync(&rport->chg_work);
- } else if (rport->port_id == USB2PHY_PORT_HOST)
+ else if (rport->port_id == USB2PHY_PORT_HOST)
cancel_delayed_work_sync(&rport->sm_work);
return 0;