From: Pavankumar Kondeti <pkondeti@codeaurora.org>
To: linux-usb@vger.kernel.org
Cc: linux-arm-msm@vger.kernel.org,
Pavankumar Kondeti <pkondeti@codeaurora.org>
Subject: [RFC v2 3/4] USB: EHCI: Notify HCD about HNP enabled port suspend
Date: Thu, 16 Dec 2010 16:39:01 +0530 [thread overview]
Message-ID: <1292497742-2618-4-git-send-email-pkondeti@codeaurora.org> (raw)
In-Reply-To: <1292497742-2618-1-git-send-email-pkondeti@codeaurora.org>
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 <pkondeti@codeaurora.org>
---
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.
next prev parent reply other threads:[~2010-12-16 11:09 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-16 11:08 [RFC v2 0/4] USB core changes for supporting OTG on MSM SoC Pavankumar Kondeti
2010-12-16 11:08 ` [RFC v2 1/4] USB: core: OTG Supplement Revision 2.0 updates Pavankumar Kondeti
2010-12-16 15:34 ` Alan Stern
2010-12-16 15:53 ` Pavan Kondeti
2010-12-16 11:09 ` [RFC v2 2/4] USB: gadget: OTG supplement revision " Pavankumar Kondeti
2010-12-16 11:09 ` Pavankumar Kondeti [this message]
2010-12-16 11:09 ` [RFC v2 4/4] USB: Eliminate delays involved in root hub initialization during HNP Pavankumar Kondeti
2010-12-16 12:39 ` Sergei Shtylyov
2010-12-16 13:07 ` Felipe Balbi
2010-12-16 13:13 ` Pavan Kondeti
2010-12-16 13:17 ` Sergei Shtylyov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1292497742-2618-4-git-send-email-pkondeti@codeaurora.org \
--to=pkondeti@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).