From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wolverine01.qualcomm.com ([199.106.114.254]:30867 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755210Ab0LPLJR (ORCPT ); Thu, 16 Dec 2010 06:09:17 -0500 From: Pavankumar Kondeti Subject: [RFC v2 3/4] USB: EHCI: Notify HCD about HNP enabled port suspend Date: Thu, 16 Dec 2010 16:39:01 +0530 Message-Id: <1292497742-2618-4-git-send-email-pkondeti@codeaurora.org> In-Reply-To: <1292497742-2618-1-git-send-email-pkondeti@codeaurora.org> References: <1292497742-2618-1-git-send-email-pkondeti@codeaurora.org> Sender: linux-arm-msm-owner@vger.kernel.org List-ID: To: linux-usb@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, Pavankumar Kondeti Introduce start_hnp callback function for HCD to receive notification from EHCI core that HNP enabled port is suspended. HCD may initiate HNP or notify the same to OTG via otg_start_hnp(). This patch is inspired by "USB: Hook start_hnp into ohci struct" (e8b24450). Signed-off-by: Pavankumar Kondeti --- drivers/usb/host/ehci-hub.c | 11 +++++++++++ drivers/usb/host/ehci.h | 2 ++ 2 files changed, 13 insertions(+), 0 deletions(-) diff --git a/drivers/usb/host/ehci-hub.c b/drivers/usb/host/ehci-hub.c index 796ea0c..65bf104 100644 --- a/drivers/usb/host/ehci-hub.c +++ b/drivers/usb/host/ehci-hub.c @@ -1018,6 +1018,17 @@ static int ehci_hub_control ( || (temp & PORT_RESET) != 0) goto error; +#ifdef CONFIG_USB_OTG + if (hcd->self.otg_port == (wIndex + 1) && + hcd->self.b_hnp_enable && + ehci->start_hnp) { + ehci_writel(ehci, temp | PORT_SUSPEND, + status_reg); + set_bit(wIndex, &ehci->suspended_ports); + ehci->start_hnp(ehci); + break; + } +#endif /* After above check the port must be connected. * Set appropriate bit thus could put phy into low power * mode if we have hostpc feature diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index fd1c53d..a4989f2 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h @@ -122,6 +122,8 @@ 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 */ -- 1.7.1 -- Sent by a consultant of the Qualcomm Innovation Center, Inc. The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum.