提交 1c05ad44 编写于 作者: D David Brownell 提交者: Greg Kroah-Hartman

[PATCH] recognize three more usb peripheral controllers

This adds declarations for three USB peripheral controllers:

  - Two high speed USB cores that can be licensed from Mentor Graphics
    to be integrated into silicon:

      * "musbhsfc" is for peripherals only, as found in for example the
        IBM/AMCC 44EP processors.

      * "musbhdrc" is OTG-capable (dual role), and is found in various
        products including OMAP 2430 and the new DaVinci SOCs.

    The "musbh" standing for "Mentor USB Highspeed", the rest standing
    for "Function Controller" or "Dual Role Controller" (OTG-capable).

  - The full speed controller on the FreeScale MPC8272.

Adding these definitions just allows gadget driver code to handle any
controller-specific logic; controller drivers are quite separate.
Signed-off-by: NDavid Brownell <david-b@pacbell.net>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 7802ac5c
...@@ -253,6 +253,14 @@ MODULE_PARM_DESC(host_addr, "Host Ethernet Address"); ...@@ -253,6 +253,14 @@ MODULE_PARM_DESC(host_addr, "Host Ethernet Address");
#define DEV_CONFIG_CDC #define DEV_CONFIG_CDC
#endif #endif
#ifdef CONFIG_USB_GADGET_MUSBHSFC
#define DEV_CONFIG_CDC
#endif
#ifdef CONFIG_USB_GADGET_MUSBHDRC
#define DEV_CONFIG_CDC
#endif
/* For CDC-incapable hardware, choose the simple cdc subset. /* For CDC-incapable hardware, choose the simple cdc subset.
* Anything that talks bulk (without notable bugs) can do this. * Anything that talks bulk (without notable bugs) can do this.
......
...@@ -3,9 +3,9 @@ ...@@ -3,9 +3,9 @@
* gadget drivers or other code that needs to deal with them, and which * gadget drivers or other code that needs to deal with them, and which
* autoconfigures instead of using early binding to the hardware. * autoconfigures instead of using early binding to the hardware.
* *
* This could eventually work like the ARM mach_is_*() stuff, driven by * This SHOULD eventually work like the ARM mach_is_*() stuff, driven by
* some config file that gets updated as new hardware is supported. * some config file that gets updated as new hardware is supported.
* (And avoiding the runtime comparisons in typical one-choice cases.) * (And avoiding all runtime comparisons in typical one-choice configs!)
* *
* NOTE: some of these controller drivers may not be available yet. * NOTE: some of these controller drivers may not be available yet.
*/ */
...@@ -93,6 +93,26 @@ ...@@ -93,6 +93,26 @@
#define gadget_is_imx(g) 0 #define gadget_is_imx(g) 0
#endif #endif
/* Mentor high speed function controller */
#ifdef CONFIG_USB_GADGET_MUSBHSFC
#define gadget_is_musbhsfc(g) !strcmp("musbhsfc_udc", (g)->name)
#else
#define gadget_is_musbhsfc(g) 0
#endif
/* Mentor high speed "dual role" controller, peripheral mode */
#ifdef CONFIG_USB_GADGET_MUSBHDRC
#define gadget_is_musbhdrc(g) !strcmp("musbhdrc_udc", (g)->name)
#else
#define gadget_is_musbhdrc(g) 0
#endif
#ifdef CONFIG_USB_GADGET_MPC8272
#define gadget_is_mpc8272(g) !strcmp("mpc8272_udc", (g)->name)
#else
#define gadget_is_mpc8272(g) 0
#endif
// CONFIG_USB_GADGET_SX2 // CONFIG_USB_GADGET_SX2
// CONFIG_USB_GADGET_AU1X00 // CONFIG_USB_GADGET_AU1X00
// ... // ...
...@@ -143,5 +163,11 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget) ...@@ -143,5 +163,11 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget)
return 0x13; return 0x13;
else if (gadget_is_imx(gadget)) else if (gadget_is_imx(gadget))
return 0x14; return 0x14;
else if (gadget_is_musbhsfc(gadget))
return 0x15;
else if (gadget_is_musbhdrc(gadget))
return 0x16;
else if (gadget_is_mpc8272(gadget))
return 0x17;
return -ENOENT; return -ENOENT;
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册