From: Pavan Kondeti <pkondeti@codeaurora.org>
To: balbi@ti.com
Cc: linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org
Subject: Re: [RFC 2/5] USB: core: OTG Supplement Revision 2.0 updates
Date: Thu, 16 Dec 2010 14:24:05 +0530 [thread overview]
Message-ID: <4D09D3AD.5080602@codeaurora.org> (raw)
In-Reply-To: <20101215121616.GO2997@legolas.emea.dhcp.ti.com>
On 12/15/2010 5:46 PM, Felipe Balbi wrote:
> Hi,
>
> On Wed, Dec 15, 2010 at 04:44:11PM +0530, Pavankumar Kondeti wrote:
>> OTG supplement revision 2.0 spec introduces Attach Detection Protocol
>> (ADP) for detecting peripheral connection without applying power on
>> VBUS. ADP is optional and is included in the OTG descriptor along with
>> SRP and HNP.
>>
>> HNP polling is introduced for peripheral to notify its wish to become
>> host. Host polls (GET_STATUS on DEVICE) peripheral for host_request
>> and suspend the bus when peripheral returns host_request TRUE. The spec
>> insists the polling frequency to be in 1-2 sec range and bus should be
>> suspended with in 2 sec from host_request is set.
>
> within ?
>
yeah. will fix it in V2.
>> diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c
>> index b9278a1..38885b6 100644
>> --- a/drivers/usb/core/driver.c
>> +++ b/drivers/usb/core/driver.c
>> @@ -1207,6 +1207,19 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
>> * and flush any outstanding URBs.
>> */
>> } else {
>> +#ifdef CONFIG_USB_OTG
>> + /* According to OTG supplement Rev 2.0 section 6.3
>> + * Unless an A-device enables b_hnp_enable before entering
>> + * suspend it shall also continue polling while the bus is
>> + * suspended.
>> + *
>> + * We don't have to perform HNP polling, as we are going to
>> + * enable b_hnp_enable before suspending.
>> + */
>> + if (udev->bus->hnp_support &&
>> + udev->portnum == udev->bus->otg_port)
>> + cancel_delayed_work(&udev->bus->hnp_polling);
>> +#endif
>> udev->can_submit = 0;
>> for (i = 0; i < 16; ++i) {
>> usb_hcd_flush_endpoint(udev, udev->ep_out[i]);
>> @@ -1270,6 +1283,43 @@ static int usb_resume_both(struct usb_device *udev, pm_message_t msg)
>> return status;
>> }
>>
>> +#ifdef CONFIG_USB_OTG
>> +void usb_hnp_polling_work(struct work_struct *work)
>
> do you really need this to be exported ??
>
The work struct is per USB bus. The bus is initialized in core/hcd.c. I
kept the work function here as it it belongs to usb core (I mean not HCD
specific) like other USB auto suspend functions.
Thanks,
Pavan
--
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 8:54 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-15 11:14 [RFC 0/5] USB core changes for supporting OTG on MSM SoC Pavankumar Kondeti
2010-12-15 11:14 ` [RFC 1/5] USB: core: Add input prompt and help text for USB_OTG config Pavankumar Kondeti
2010-12-15 12:35 ` Sergei Shtylyov
2010-12-15 21:52 ` Greg KH
2010-12-16 8:53 ` Pavan Kondeti
2010-12-15 11:14 ` [RFC 2/5] USB: core: OTG Supplement Revision 2.0 updates Pavankumar Kondeti
2010-12-15 12:16 ` Felipe Balbi
2010-12-15 21:39 ` Alan Stern
2010-12-16 8:10 ` Felipe Balbi
2010-12-16 8:54 ` Pavan Kondeti [this message]
2010-12-16 9:11 ` Felipe Balbi
2010-12-15 21:29 ` Alan Stern
2010-12-16 8:54 ` Pavan Kondeti
2010-12-15 21:53 ` Greg KH
2010-12-16 8:54 ` Pavan Kondeti
2010-12-15 11:14 ` [RFC 3/5] USB: gadget: OTG supplement revision " Pavankumar Kondeti
2010-12-15 12:18 ` Felipe Balbi
2010-12-16 8:54 ` Pavan Kondeti
2010-12-15 11:14 ` [RFC 4/5] USB: EHCI: Notify HCD about HNP enabled port suspend Pavankumar Kondeti
2010-12-15 12:19 ` Felipe Balbi
2010-12-16 8:54 ` Pavan Kondeti
2010-12-15 11:14 ` [RFC 5/5] USB: Eliminate delays involved in root hub initialization during HNP Pavankumar Kondeti
2010-12-15 12:21 ` Felipe Balbi
2010-12-16 11:26 ` Pavan Kondeti
2010-12-16 12:15 ` Felipe Balbi
2010-12-16 12:53 ` Pavan Kondeti
2010-12-15 21:52 ` Greg KH
2010-12-15 21:38 ` [RFC 0/5] USB core changes for supporting OTG on MSM SoC Alan Stern
2010-12-16 8:55 ` Pavan Kondeti
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=4D09D3AD.5080602@codeaurora.org \
--to=pkondeti@codeaurora.org \
--cc=balbi@ti.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.