Skip to content

Commit b9c9fd4

Browse files
Nagarjuna Kristamthierryreding
authored andcommitted
usb: gadget: tegra-xudc: Use phy_set_mode() to set/unset device mode
When device mode is set/unset, VBUS override activity is done via exported functions from padctl driver. Use phy_set_mode() instead. Signed-off-by: Nagarjuna Kristam <[email protected]> Acked-by: Felipe Balbi <[email protected]> Signed-off-by: Thierry Reding <[email protected]>
1 parent b77f2ff commit b9c9fd4

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

drivers/usb/gadget/udc/tegra-xudc.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ static void tegra_xudc_device_mode_on(struct tegra_xudc *xudc)
612612

613613
dev_dbg(xudc->dev, "device mode on\n");
614614

615-
tegra_xusb_padctl_set_vbus_override(xudc->padctl, true);
615+
phy_set_mode_ext(xudc->utmi_phy, PHY_MODE_USB_OTG, USB_ROLE_DEVICE);
616616
}
617617

618618
static void tegra_xudc_device_mode_off(struct tegra_xudc *xudc)
@@ -627,7 +627,7 @@ static void tegra_xudc_device_mode_off(struct tegra_xudc *xudc)
627627

628628
reinit_completion(&xudc->disconnect_complete);
629629

630-
tegra_xusb_padctl_set_vbus_override(xudc->padctl, false);
630+
phy_set_mode_ext(xudc->utmi_phy, PHY_MODE_USB_OTG, USB_ROLE_NONE);
631631

632632
pls = (xudc_readl(xudc, PORTSC) & PORTSC_PLS_MASK) >>
633633
PORTSC_PLS_SHIFT;
@@ -714,9 +714,11 @@ static void tegra_xudc_plc_reset_work(struct work_struct *work)
714714

715715
if (pls == PORTSC_PLS_INACTIVE) {
716716
dev_info(xudc->dev, "PLS = Inactive. Toggle VBUS\n");
717-
tegra_xusb_padctl_set_vbus_override(xudc->padctl,
718-
false);
719-
tegra_xusb_padctl_set_vbus_override(xudc->padctl, true);
717+
phy_set_mode_ext(xudc->utmi_phy, PHY_MODE_USB_OTG,
718+
USB_ROLE_NONE);
719+
phy_set_mode_ext(xudc->utmi_phy, PHY_MODE_USB_OTG,
720+
USB_ROLE_DEVICE);
721+
720722
xudc->wait_csc = false;
721723
}
722724
}

0 commit comments

Comments
 (0)