Re: [RFC] GADGET : allow to build multi udc

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

 



On Thu, 02 Sep 2010 15:09:17 +0200, Matthieu CASTET <matthieu.castet@xxxxxxxxxx> wrote:
even if the usb gadget framework is limited to work with one driver, it
could be useful to have a kernel build with more than driver.
This allow to make generic kernel that work with similar platform (but
different udc controller).

After looking at the current code, the only blocker to do that is
usb_gadget_register_driver/usb_gadget_unregister_driver function that
are declared in each driver.

For avoiding that I propose to do a redirection for these functions.
At probe time the driver register them (usb_gadget_register_udc), and
usb_gadget_register_driver/usb_gadget_unregister_driver call these callback.

Only one probing should succeed, so only one call to
usb_gadget_register_udc is done. It not, only the first one will succeed.

I've noticed that you've added priv.  I would also add some kind of name or
(name, id) pair.  Both of those could be a way to allow several UDCs to work.
usb_gadget_register() (or usb_gadget_probe() in next) would take the first
available UDC but usb_gadget_probe_named() could be added which would allow
to specify UDC by name.

Just my two cents.

--
Best regards,                                        _     _
| Humble Liege of Serenely Enlightened Majesty of  o' \,=./ `o
| Computer Science,  Michał "mina86" Nazarewicz       (o o)
+----[mina86*mina86.com]---[mina86*jabber.org]----ooO--(_)--Ooo--

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