RE: [PATCH v1] USB: OTG should be linked before Host

From: Neil Zhang
Date: Thu Nov 24 2011 - 02:19:58 EST


> -----Original Message-----
> From: Peter Chen [mailto:hzpeterchen@xxxxxxxxx]
> Sent: 2011å11æ24æ 14:06
> To: Greg KH
> Cc: Neil Zhang; balbi@xxxxxx; Haojian Zhuang; linux-usb@xxxxxxxxxxxxxxx
> Subject: Re: [PATCH v1] USB: OTG should be linked before Host
>
> On Thu, Nov 24, 2011 at 12:17 AM, Greg KH <gregkh@xxxxxxx> wrote:
> > On Wed, Nov 23, 2011 at 06:38:48PM +0800, Neil Zhang wrote:
> >> For OTG controller, the host driver will call function
> >> otg_get_transceiver to get the otg transceiver, so we need to init
> the
> >> OTG driver before HOST.
> >
> I agree with it, at freescale i.mx platform, we also need to init otg
> first, then the host
> if otg function is enabled.
>
> > How do you handle this if these drivers are built as modules?
> We require the user load module by order, and write it at UserGuide.
>
> I find at older kernel version, like 2.6.38, the otg was built firstly
> at usb module.

Actually, it was changed by the following patch.

commit 4661ffc91befc8c5ee080720120da1d53851060a
Author: Felipe Balbi <balbi@xxxxxx>
Date: Thu Apr 7 10:59:34 2011 +0300

usb: don't enter usb subdirectories directly

Instead, make we enter usb/ directory on all
needed cases and enter the subdirectories from
drivers/usb/Makefile.

Signed-off-by: Felipe Balbi <balbi@xxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxx>

Hi Balbi,
Do you have any concern to change it?

> >
> >> Signed-off-by: Neil Zhang <zhangwm@xxxxxxxxxxx>
> >> ---
> >> Âdrivers/usb/Makefile | Â Â3 ++-
> >> Â1 files changed, 2 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile
> >> index 75eca76..53a7bc0 100644
> >> --- a/drivers/usb/Makefile
> >> +++ b/drivers/usb/Makefile
> >> @@ -6,6 +6,8 @@
> >>
> >> Âobj-$(CONFIG_USB) Â Â Â Â Â Â+= core/
> >>
> >> +obj-$(CONFIG_USB_OTG_UTILS) Â+= otg/
> >> +
> >> Âobj-$(CONFIG_USB_DWC3) Â Â Â Â Â Â Â += dwc3/
> >>
> >> Âobj-$(CONFIG_USB_MON) Â Â Â Â Â Â Â Â+= mon/
> >> @@ -51,7 +53,6 @@ obj-$(CONFIG_USB_SPEEDTOUCH) Â Â Â Â+= atm/
> >>
> >> Âobj-$(CONFIG_USB_MUSB_HDRC) Â+= musb/
> >> Âobj-$(CONFIG_USB_RENESAS_USBHS) Â Â Â+= renesas_usbhs/
> >> -obj-$(CONFIG_USB_OTG_UTILS) Â+= otg/
> >> Âobj-$(CONFIG_USB_GADGET) Â Â += gadget/
> >>
> >> Âobj-$(CONFIG_USB_COMMON) Â Â += usb-common.o
> >
> > This is a big change that I would like to get some acks by other
> people
> > before making, are you sure you didn't just break any other hardware
> > that needs the host driver initialized first?
> >
> > greg k-h
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-usb"
> in
> > the body of a message to majordomo@xxxxxxxxxxxxxxx
> > More majordomo info at Âhttp://vger.kernel.org/majordomo-info.html
> >
>
>
>
> --
> BR,
> Peter Chen

Best Regards,
Neil Zhang
èº{.nÇ+‰·Ÿ®‰­†+%ŠËlzwm…ébëæìr¸›zX§»®w¥Š{ayºÊÚë,j­¢f£¢·hš‹àz¹®w¥¢¸ ¢·¦j:+v‰¨ŠwèjØm¶Ÿÿ¾«‘êçzZ+ƒùšŽŠÝj"ú!¶iO•æ¬z·švØ^¶m§ÿðà nÆàþY&—