Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c4144247 authored by Yoshihiro Shimoda's avatar Yoshihiro Shimoda Committed by Paul Mundt
Browse files

usb: gadget: R8A66597 peripheral controller support.



While in-tree support for the R8A66597 host side has been supported for
some time, the peripheral side has so far been unsupported. This adds a
new USB gadget driver which bridges the gap and finally wires up the
peripheral side as well.

Signed-off-by: default avatarYoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
Tested-by: default avatarMagnus Damm <damm@igel.co.jp>
Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
parent 24d76195
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
@@ -251,6 +251,24 @@ config USB_PXA25X_SMALL
	default y if USB_ETH
	default y if USB_G_SERIAL

config USB_GADGET_R8A66597
	boolean "Renesas R8A66597 USB Peripheral Controller"
	select USB_GADGET_DUALSPEED
	help
	   R8A66597 is a discrete USB host and peripheral controller chip that
	   supports both full and high speed USB 2.0 data transfers.
	   It has nine configurable endpoints, and endpoint zero.

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

config USB_R8A66597
	tristate
	depends on USB_GADGET_R8A66597
	default USB_GADGET
	select USB_GADGET_SELECTED

config USB_GADGET_PXA27X
	boolean "PXA 27x"
	depends on ARCH_PXA && (PXA27x || PXA3xx)
+1 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ ifeq ($(CONFIG_ARCH_MXC),y)
fsl_usb2_udc-objs		+= fsl_mx3_udc.o
endif
obj-$(CONFIG_USB_M66592)	+= m66592-udc.o
obj-$(CONFIG_USB_R8A66597)	+= r8a66597-udc.o
obj-$(CONFIG_USB_FSL_QE)	+= fsl_qe_udc.o
obj-$(CONFIG_USB_CI13XXX)	+= ci13xxx_udc.o
obj-$(CONFIG_USB_S3C_HSOTG)	+= s3c-hsotg.o
+8 −0
Original line number Diff line number Diff line
@@ -173,6 +173,12 @@
// CONFIG_USB_GADGET_AU1X00
// ...

#ifdef CONFIG_USB_GADGET_R8A66597
#define	gadget_is_r8a66597(g)	!strcmp("r8a66597_udc", (g)->name)
#else
#define	gadget_is_r8a66597(g)	0
#endif


/**
 * usb_gadget_controller_number - support bcdDevice id convention
@@ -239,6 +245,8 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget)
		return 0x23;
	else if (gadget_is_langwell(gadget))
		return 0x24;
	else if (gadget_is_r8a66597(gadget))
		return 0x25;
	return -ENOENT;
}