Re: [PATCH 02/28] usb: musb: export some symbols for glue driver access

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

 



2010/12/13 Felipe Balbi <balbi@xxxxxx>:
> On Mon, Dec 13, 2010 at 10:10:39AM +0200, Felipe Balbi wrote:
>>
>> On Mon, Dec 13, 2010 at 01:01:36AM +0800, tom.leiming@xxxxxxxxx wrote:
>>>
>>> From: Ming Lei <tom.leiming@xxxxxxxxx>
>>>
>>> Export this functions so that glue drivers can see them if glue drivers
>>> are built as modules.
>>>
>>> Signed-off-by: Ming Lei <tom.leiming@xxxxxxxxx>
>>> ---
>>> drivers/usb/musb/musb_core.c |    7 ++++++-
>>> 1 files changed, 6 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
>>> index 2bbf911..070725f 100644
>>> --- a/drivers/usb/musb/musb_core.c
>>> +++ b/drivers/usb/musb/musb_core.c
>>> @@ -116,6 +116,7 @@
>>>
>>>
>>> unsigned musb_debug;
>>> +EXPORT_SYMBOL(musb_debug);
>>
>> change all these to EXPORT_SYMBOL_GPL() is glue layer isn't GPL we don't
>> want it.
>
> BTW, changing all DBG() to dev_dbg() on hw glue layer already kills most
> of the complaints. I think it's better to say musb-omap2430 than
> musb-hdrc on debug messages comming for omap2430.c as it's a better hint
> of where the problem is.
>
> otg_state_string() will be generalized soon with a patchset that's been
> sent already, so most of the problems are killed.
>
> I'm also not sure we want to build glue layer as module, it's just a
> glue layer anyway, and instead of users just modprobe musb_hdrc they'll
> have to modprobe musb-omap2430 && modprobe musb_hdrc, on that order
> otherwise it doesn't work. So keep glue layer as bool, and the same

No, only modprobe musb-omap2430 is enough, which has been OK now in
my beagle with this patch set.

If we want to run one single binary to support multiple machines and
if glue driver can't be built as module, we have to load all glue driver into
ram, which is sure very ugly.

If glue driver can depend on musb_hdrc,  we can make musb_hdrc
more generic to export this kind of generic functions, which may be
used by many glue drivers.

> "behavior" is kept. That means a simple change to drivers/Makefile would
> be enough. Something like:
>
> diff --git a/drivers/Makefile b/drivers/Makefile
> index 14cf907..9c66677 100644
> --- a/drivers/Makefile
> +++ b/drivers/Makefile
> @@ -65,7 +65,7 @@ obj-$(CONFIG_TC)              += tc/
>  obj-$(CONFIG_UWB)              += uwb/
>  obj-$(CONFIG_USB_OTG_UTILS)    += usb/otg/
>  obj-$(CONFIG_USB)              += usb/
> -obj-$(CONFIG_USB_MUSB_HDRC)    += usb/musb/
> +obj-$(CONFIG_USB_MUSB)         += usb/musb/
>  obj-$(CONFIG_PCI)              += usb/
>  obj-$(CONFIG_USB_GADGET)       += usb/gadget/
>  obj-$(CONFIG_SERIO)            += input/serio/
> diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig
> index 4cbb7e4..98c0dc9 100644
> --- a/drivers/usb/musb/Kconfig
> +++ b/drivers/usb/musb/Kconfig
> @@ -6,6 +6,9 @@
>  comment "Enable Host or Gadget support to see Inventra options"
>        depends on !USB && USB_GADGET=n
>  +config USB_MUSB
> +       bool
> +
>  # (M)HDRC = (Multipoint) Highspeed Dual-Role Controller
>  config USB_MUSB_HDRC
>        depends on (USB || USB_GADGET)
> @@ -14,6 +17,7 @@ config USB_MUSB_HDRC
>        select TWL4030_USB if MACH_OMAP_3430SDP
>        select TWL6030_USB if MACH_OMAP_4430SDP || MACH_OMAP4_PANDA
>        select USB_OTG_UTILS
> +       select USB_MUSB
>        tristate 'Inventra Highspeed Dual Role Controller (TI, ADI, ...)'
>        help
>          Say Y here if your system has a dual role high speed USB
>
> of course, this also needs the changes to exported symbols. But also a
> bit trivial.
>
> --
> balbi
>



-- 
Lei Ming
--
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


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

  Powered by Linux