On Wed, Dec 15, 2010 at 04:44:14PM +0530, Pavankumar Kondeti wrote:
> Some USB controllers have common resources (IRQ, register address
> space) for Host, Peripheral and OTG.  So HCD is added only before
> entering into Host mode.  Root hub initialization is done in
> different steps to decrease boot up time.  But this makes B-device
> difficult to meet HNP timings.  Hence eliminate delays involved in
> root hub initialization for B-host.
> 
> This patch also marks hnp_supported flag TURE for B-host while
> registering the bus.
> 
> Signed-off-by: Pavankumar Kondeti <[email protected]>
> ---
>  drivers/usb/core/hcd.c |    4 ++++
>  drivers/usb/core/hub.c |   13 +++++++++++++
>  2 files changed, 17 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
> index 6bffd50..a180a0f 100644
> --- a/drivers/usb/core/hcd.c
> +++ b/drivers/usb/core/hcd.c
> @@ -902,6 +902,10 @@ static int usb_register_bus(struct usb_bus *bus)
>       list_add (&bus->bus_list, &usb_bus_list);
>       mutex_unlock(&usb_bus_list_lock);
>  
> +#ifdef CONFIG_USB_OTG
> +     if (bus->is_b_host)
> +             bus->hnp_support = 1;
> +#endif
>       usb_notify_add_bus(bus);
>  
>       dev_info (bus->controller, "new USB bus registered, assigned bus "
> diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
> index 60705a1..48fb83d 100644
> --- a/drivers/usb/core/hub.c
> +++ b/drivers/usb/core/hub.c
> @@ -706,6 +706,10 @@ static void hub_activate(struct usb_hub *hub, enum 
> hub_activation_type type)
>                */
>               if (type == HUB_INIT) {
>                       delay = hub_power_on(hub, false);
> +#ifdef CONFIG_USB_OTG
> +                     if (hdev->bus->is_b_host)
> +                             goto init2;
> +#endif

Never have #ifdefs in .c code, that is totally unacceptable and
unworkable for stuff like this.

Come on, you know better than this...

thanks,

greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to