usb: max3420: add the gadget driver
PATCH v2 1/1 usb: max3420: add the gadget driver
From: Jassi Brar <[email protected]>
MAX3420 implements FullSpeed USB Device over SPI. Another version MAX3421, also implements USB Host mode. This driver should be good for the device mode of max3421 as well.
Signed-off-by Jassi Brar <[email protected]>
--- drivers/usb/gadget/Kconfig | 6 + drivers/usb/gadget/Makefile | 1 + drivers/usb/gadget/gadget_chips.h | 8 + drivers/usb/gadget/max3420_udc.c | 877 ++++++++++++++++++++++++++++++ 4 files changed, 892 insertions(+) create mode 100644 drivers/usb/gadget/max3420_udc.c
drivers/usb/gadget/Kconfig +6 -0
@@ -105,6 +105,12 @@ config CI_UDC Say Y here to enable device controller functionality of the ChipIdea driver. +config USB_GADGET_MAX3420 + bool "MAX3420 USB Over SPI" + depends on DM_SPI + help + MAX3420, from MAXIM, implements USB-over-SPI Full-Speed device controller. + config USB_GADGET_VBUS_DRAW int "Maximum VBUS Power usage (2-500 mA)" range 2 500
drivers/usb/gadget/Makefile +1 -0
@@ -20,6 +20,7 @@ obj-$(CONFIG_USB_GADGET_BCM_UDC_OTG_PHY) += bcm_udc_otg_phy.o obj-$(CONFIG_USB_GADGET_DWC2_OTG) += dwc2_udc_otg.o obj-$(CONFIG_USB_GADGET_DWC2_OTG_PHY) += dwc2_udc_otg_phy.o obj-$(CONFIG_USB_GADGET_FOTG210) += fotg210.o +obj-$(CONFIG_USB_GADGET_MAX3420) += max3420_udc.o obj-$(CONFIG_CI_UDC) += ci_udc.o ifndef CONFIG_SPL_BUILD obj-$(CONFIG_USB_GADGET_DOWNLOAD) += g_dnl.o
drivers/usb/gadget/gadget_chips.h +8 -0
@@ -155,6 +155,12 @@#define gadget_is_cdns3 (g) 0#endif +#ifdef CONFIG_USB_GADGET_MAX3420 +#define gadget_is_max3420 (g) (!strcmp("max3420-udc", (g)->name)) +#else +#define gadget_is_max3420 (g) 0 +#endif +/** * usb_gadget_controller_number - support bcdDevice id convention * @gadget: the controller being driven
@@ -216,5 +222,7 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget)return 0x23 ; else if (gadget_is_cdns3(gadget)) return 0x24; + else if (gadget_is_max3420(gadget)) + return 0x25;return -ENOENT ; }
drivers/usb/gadget/max3420_udc.c new file +877 -0
877 lines not on this page · raw message
Signature · 1 line
2.25.1