Skip to content

Commit

Permalink
USB: gadget driver for LPC32xx
Browse files Browse the repository at this point in the history
This patch adds a USB gadget driver for the LPC32xx ARM SoC.

Signed-off-by: Roland Stigge <[email protected]>
Acked-by: Arnd Bergmann <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
  • Loading branch information
stigge authored and gregkh committed May 1, 2012
1 parent 8b7c3b6 commit 24a28e4
Show file tree
Hide file tree
Showing 5 changed files with 3,581 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Documentation/devicetree/bindings/usb/lpc32xx-udc.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
* NXP LPC32xx SoC USB Device Controller (UDC)

Required properties:
- compatible: Must be "nxp,lpc3220-udc"
- reg: Physical base address of the controller and length of memory mapped
region.
- interrupts: The USB interrupts:
* USB Device Low Priority Interrupt
* USB Device High Priority Interrupt
* USB Device DMA Interrupt
* External USB Transceiver Interrupt (OTG ATX)
- transceiver: phandle of the associated ISP1301 device - this is necessary for
the UDC controller for connecting to the USB physical layer

Example:

isp1301: usb-transceiver@2c {
compatible = "nxp,isp1301";
reg = <0x2c>;
};

usbd@31020000 {
compatible = "nxp,lpc3220-udc";
reg = <0x31020000 0x300>;
interrupt-parent = <&mic>;
interrupts = <0x3d 0>, <0x3e 0>, <0x3c 0>, <0x3a 0>;
transceiver = <&isp1301>;
};
11 changes: 11 additions & 0 deletions drivers/usb/gadget/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,17 @@ config USB_AT91
dynamically linked module called "at91_udc" and force all
gadget drivers to also be dynamically linked.

config USB_LPC32XX
tristate "LPC32XX USB Peripheral Controller"
depends on ARCH_LPC32XX
select USB_ISP1301
help
This option selects the USB device controller in the LPC32xx SoC.

Say "y" to link the driver statically, or "m" to build a
dynamically linked module called "lpc32xx_udc" and force all
gadget drivers to also be dynamically linked.

config USB_ATMEL_USBA
tristate "Atmel USBA"
select USB_GADGET_DUALSPEED
Expand Down
1 change: 1 addition & 0 deletions drivers/usb/gadget/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ obj-$(CONFIG_USB_CI13XXX_PCI) += ci13xxx_pci.o
obj-$(CONFIG_USB_S3C_HSOTG) += s3c-hsotg.o
obj-$(CONFIG_USB_S3C_HSUDC) += s3c-hsudc.o
obj-$(CONFIG_USB_LANGWELL) += langwell_udc.o
obj-$(CONFIG_USB_LPC32XX) += lpc32xx_udc.o
obj-$(CONFIG_USB_EG20T) += pch_udc.o
obj-$(CONFIG_USB_MV_UDC) += mv_udc.o
mv_udc-y := mv_udc_core.o
Expand Down
3 changes: 3 additions & 0 deletions drivers/usb/gadget/gadget_chips.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
#define gadget_is_goku(g) (!strcmp("goku_udc", (g)->name))
#define gadget_is_imx(g) (!strcmp("imx_udc", (g)->name))
#define gadget_is_langwell(g) (!strcmp("langwell_udc", (g)->name))
#define gadget_is_lpc32xx(g) (!strcmp("lpc32xx_udc", (g)->name))
#define gadget_is_m66592(g) (!strcmp("m66592_udc", (g)->name))
#define gadget_is_musbhdrc(g) (!strcmp("musb-hdrc", (g)->name))
#define gadget_is_net2272(g) (!strcmp("net2272", (g)->name))
Expand Down Expand Up @@ -118,6 +119,8 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget)
return 0x31;
else if (gadget_is_dwc3(gadget))
return 0x32;
else if (gadget_is_lpc32xx(gadget))
return 0x33;

return -ENOENT;
}
Expand Down
Loading

0 comments on commit 24a28e4

Please sign in to comment.