Re: [PATCH] usb, davinci: remove USB_MUSB_* defines in davinci usb setup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Nov 24, 2011 at 04:27:55PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 24-11-2011 14:16, Felipe Balbi wrote:
> 
> >>>>>>>commit 622859634a663c5e55d0e2a2cdbb55ac058d97b3
> >>>>>>>Author: Felipe Balbi<balbi@xxxxxx>
> >>>>>>>Date:   Wed Jun 22 17:28:09 2011 +0300
> >>>>>>>     usb: musb: drop a gigantic amount of ifdeferry
> >>>>>>>dropped a lot of ifdefs, also the USB_MUSB_HOST, USB_MUSB_PERIPHERAL
> >>>>>>>and USB_MUSB_OTG defines, which are used in arch/arm/mach-davinci/usb.c
> >>>>>>>Drop them in arch/arm/mach-davinci/usb.c and set otg as mode.
> >>>>>>>Signed-off-by: Heiko Schocher<hs@xxxxxxx>
> >>>>>>>Cc: Felipe Balbi<balbi@xxxxxx>
> >>>>>>>Cc: Sergei Shtylyov<sshtylyov@xxxxxxxxxxxxx>
> >>>>>>>Cc: linux-usb@xxxxxxxxxxxxxxx
> >>>>>>>Cc: Wolfgang Denk<wd@xxxxxxx>
> >>>>>>>---
> >>>>>>>patch checked with checkpatch, no errors/warnigs
> >>>>[...]
> 
> >>>>>>>diff --git a/arch/arm/mach-davinci/usb.c b/arch/arm/mach-davinci/usb.c
> >>>>>>>index 23d2b6d..6f72b6a 100644
> >>>>>>>--- a/arch/arm/mach-davinci/usb.c
> >>>>>>>+++ b/arch/arm/mach-davinci/usb.c
> >>>>>>>@@ -42,14 +42,7 @@ static struct musb_hdrc_config musb_config = {
> >>>>>>>  };
> >>>>>>>
> >>>>>>>  static struct musb_hdrc_platform_data usb_data = {
> >>>>>>>-#if defined(CONFIG_USB_MUSB_OTG)
> >>>>>>>-	/* OTG requires a Mini-AB connector */
> >>>>>>>  	.mode           = MUSB_OTG,
> >>>>>>>-#elif defined(CONFIG_USB_MUSB_PERIPHERAL)
> >>>>>>>-	.mode           = MUSB_PERIPHERAL,
> >>>>>>>-#elif defined(CONFIG_USB_MUSB_HOST)
> >>>>>>>-	.mode           = MUSB_HOST,
> >>>>>>>-#endif
> >>>>>>>  	.clock		= "usb",
> >>>>>>>  	.config		=&musb_config,
> >>>>>>>  };
> 
> >>>>>>    This is not a correct patch. DM644x EVM board for example doesn't
> >>>>>>have OTG connector, only host, so we need more subtle logic here.
> >>>>>>Maybe I'll come up with something when I'm back from vacations next
> >>>>>>week...
> 
> >>>>>it doesn't have the connector, but the underlying HW is OTG-capable. We
> >>>>>could hack a host cable to unground ID-pin
> 
> >>>>    The ID pin is just not the part of the connector I think -- it's
> >>>>normal 4-signal A-type receptacle, not mini- or micro- one.
> 
> >>>>>and have peripheral side working for instance.
> 
> >>>>    Then what's the point of the '.mode' field at all -- if we could
> >>>>hack the hardware anyway?
> 
> >>>no point whatsoever, do you want to send a patch removing that ?
> 
>    I don't feel comfortable doing this as yet, see below (and have no
> time anyway).
> 
> >>It is used in drivers/usb/musb/musb_core.c musb_init_controller(), so
> >>we could not remove it ... we need to setup up it with the right value,
> >>as my patch http://permalink.gmane.org/gmane.linux.usb.general/54512
> >>did ...
> 
>    Except this patch didn't always setup the right value.
> 
> >>BTW: I am trying to get a solution for my problem, mentioned here:
> 
> >>http://permalink.gmane.org/gmane.linux.usb.general/54505
> >>(timing issue in da8xx_musb_interrupt())
> 
> >>but I still have no real idea ...
> 
>    Sorry, Heiko, have no ideas anymore, and lack the time as usual...
> 
> >it can be removed from there too.
> 
>    How about
> is_host_enabled()/is_peripheral_enabled()/is_otg_enabled() macros
> which also use 'musb->board_mode'? They are used thoughout
> musb_core.c and in the glue layers too...
> 
> >If we're always building the driver as
> >OTG, what's the point in having that ? If the controller is always
> >OTG-capable, what's the point in having that ?
> 
>    Then remove this stuff please. I feel that it's a decision that
> should be made by you, same way as dropping the #ifdefery. :-)

sure, I can do that... no problem.

-- 
balbi

Attachment: signature.asc
Description: Digital signature


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux