USB: EHCI: use otg_start_hnp() to intiate HNP in ehci-hub.c

EHCI core intiates HNP by calling otg_start_hnp() API when OTG port
is put into suspend to notify OTG driver which will take care of
HNP by suspending host and kicking gadget.

Change-Id: I2982b9f49140c2dcf2a32691e74f177e8d5d08cb
Signed-off-by: Vijayavardhan Vennapusa <vvreddy@codeaurora.org>
This commit is contained in:
Vijayavardhan Vennapusa
2012-03-05 16:09:40 +05:30
parent d450cb04b0
commit a36dc2ca7d
3 changed files with 4 additions and 19 deletions

View File

@@ -1203,10 +1203,9 @@ static int ehci_hub_control (
ehci_writel(ehci, temp | PORT_SUSPEND, status_reg);
#ifdef CONFIG_USB_OTG
if (hcd->self.otg_port == (wIndex + 1) &&
hcd->self.b_hnp_enable &&
ehci->start_hnp) {
hcd->self.b_hnp_enable) {
set_bit(wIndex, &ehci->suspended_ports);
ehci->start_hnp(ehci);
otg_start_hnp(ehci->transceiver);
break;
}
#endif

View File

@@ -605,19 +605,6 @@ static int msm_xusb_rpc_close(struct msmusb_hcd *mhcd)
return retval;
}
#ifdef CONFIG_USB_OTG
static void ehci_msm_start_hnp(struct ehci_hcd *ehci)
{
struct usb_hcd *hcd = ehci_to_hcd(ehci);
struct msmusb_hcd *mhcd = hcd_to_mhcd(hcd);
/* OTG driver handles HNP */
otg_start_hnp(mhcd->xceiv);
}
#else
#define ehci_msm_start_hnp NULL
#endif
static int msm_xusb_init_host(struct platform_device *pdev,
struct msmusb_hcd *mhcd)
{
@@ -645,9 +632,9 @@ static int msm_xusb_init_host(struct platform_device *pdev,
otg = container_of(mhcd->xceiv, struct msm_otg, otg);
hcd->regs = otg->regs;
otg->start_host = msm_hsusb_start_host;
ehci->start_hnp = ehci_msm_start_hnp;
ret = otg_set_host(mhcd->xceiv, &hcd->self);
ehci->transceiver = mhcd->xceiv;
break;
case USB_PHY_SERIAL_PMIC:
hcd->regs = ioremap(hcd->rsrc_start, hcd->rsrc_len);
@@ -753,6 +740,7 @@ static void msm_xusb_uninit_host(struct msmusb_hcd *mhcd)
case USB_PHY_INTEGRATED:
if (pdata->vbus_init)
pdata->vbus_init(0);
hcd_to_ehci(hcd)->transceiver = NULL;
otg_set_host(mhcd->xceiv, NULL);
otg_put_transceiver(mhcd->xceiv);
cancel_work_sync(&mhcd->otg_work);

View File

@@ -124,8 +124,6 @@ struct ehci_hcd { /* one per controller */
ktime_t last_periodic_enable;
u32 command;
void (*start_hnp)(struct ehci_hcd *ehci);
/* SILICON QUIRKS */
unsigned no_selective_suspend:1;
unsigned has_fsl_port_bug:1; /* FreeScale */