[PATCH v9 06/20] usb: move ci13xxx and related code to drivers/usb/chipidea

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

 



Since chipidea is a dual role controller, it makes sense to move it
to its own directory, where we can also have host, otg and platform
code related to this controller. It also makes sense to break out
the driver into several compilation units like udc, host, debugging
code, etc.

Firstly, let's move the udc and platform code to drivers/usb/chipidea.

Signed-off-by: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
---
 drivers/usb/Kconfig                            |    2 ++
 drivers/usb/Makefile                           |    1 +
 drivers/usb/chipidea/Kconfig                   |   10 ++++++
 drivers/usb/chipidea/Makefile                  |   11 +++++++
 drivers/usb/{gadget => chipidea}/ci13xxx_msm.c |    0
 drivers/usb/{gadget => chipidea}/ci13xxx_pci.c |    0
 drivers/usb/{gadget => chipidea}/ci13xxx_udc.c |    0
 drivers/usb/{gadget => chipidea}/ci13xxx_udc.h |    0
 drivers/usb/gadget/Kconfig                     |   41 ------------------------
 drivers/usb/gadget/Makefile                    |    3 --
 10 files changed, 24 insertions(+), 44 deletions(-)
 create mode 100644 drivers/usb/chipidea/Kconfig
 create mode 100644 drivers/usb/chipidea/Makefile
 rename drivers/usb/{gadget => chipidea}/ci13xxx_msm.c (100%)
 rename drivers/usb/{gadget => chipidea}/ci13xxx_pci.c (100%)
 rename drivers/usb/{gadget => chipidea}/ci13xxx_udc.c (100%)
 rename drivers/usb/{gadget => chipidea}/ci13xxx_udc.h (100%)

diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig
index 4473ae5..a7773a3 100644
--- a/drivers/usb/Kconfig
+++ b/drivers/usb/Kconfig
@@ -133,6 +133,8 @@ source "drivers/usb/host/Kconfig"
 
 source "drivers/usb/musb/Kconfig"
 
+source "drivers/usb/chipidea/Kconfig"
+
 source "drivers/usb/renesas_usbhs/Kconfig"
 
 source "drivers/usb/class/Kconfig"
diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile
index 77c835a..c691eea 100644
--- a/drivers/usb/Makefile
+++ b/drivers/usb/Makefile
@@ -53,6 +53,7 @@ obj-$(CONFIG_USB_ATM)		+= atm/
 obj-$(CONFIG_USB_SPEEDTOUCH)	+= atm/
 
 obj-$(CONFIG_USB_MUSB_HDRC)	+= musb/
+obj-$(CONFIG_USB_CHIPIDEA)	+= chipidea/
 obj-$(CONFIG_USB_RENESAS_USBHS)	+= renesas_usbhs/
 obj-$(CONFIG_USB_GADGET)	+= gadget/
 
diff --git a/drivers/usb/chipidea/Kconfig b/drivers/usb/chipidea/Kconfig
new file mode 100644
index 0000000..71725dd
--- /dev/null
+++ b/drivers/usb/chipidea/Kconfig
@@ -0,0 +1,10 @@
+config USB_CHIPIDEA
+	tristate "ChipIdea Highspeed Dual Role Controller"
+	depends on USB && USB_GADGET
+	select USB_GADGET_DUALSPEED
+	help
+          Say Y here if your system has a dual role high speed USB
+          controller based on ChipIdea silicon IP. Currently, only the
+	  peripheral mode is supported.
+
+	  When compiled dynamically, the module will be called ci-hdrc.ko.
diff --git a/drivers/usb/chipidea/Makefile b/drivers/usb/chipidea/Makefile
new file mode 100644
index 0000000..e56bedb
--- /dev/null
+++ b/drivers/usb/chipidea/Makefile
@@ -0,0 +1,11 @@
+obj-$(CONFIG_USB_CHIPIDEA)		+= ci_hdrc.o
+
+ci_hdrc-y				:= ci13xxx_udc.o
+
+ifneq ($(CONFIG_PCI),)
+	obj-$(CONFIG_USB_CHIPIDEA)	+= ci13xxx_pci.o
+endif
+
+ifneq ($(CONFIG_ARCH_MSM),)
+	obj-$(CONFIG_USB_CHIPIDEA)	+= ci13xxx_msm.o
+endif
diff --git a/drivers/usb/gadget/ci13xxx_msm.c b/drivers/usb/chipidea/ci13xxx_msm.c
similarity index 100%
rename from drivers/usb/gadget/ci13xxx_msm.c
rename to drivers/usb/chipidea/ci13xxx_msm.c
diff --git a/drivers/usb/gadget/ci13xxx_pci.c b/drivers/usb/chipidea/ci13xxx_pci.c
similarity index 100%
rename from drivers/usb/gadget/ci13xxx_pci.c
rename to drivers/usb/chipidea/ci13xxx_pci.c
diff --git a/drivers/usb/gadget/ci13xxx_udc.c b/drivers/usb/chipidea/ci13xxx_udc.c
similarity index 100%
rename from drivers/usb/gadget/ci13xxx_udc.c
rename to drivers/usb/chipidea/ci13xxx_udc.c
diff --git a/drivers/usb/gadget/ci13xxx_udc.h b/drivers/usb/chipidea/ci13xxx_udc.h
similarity index 100%
rename from drivers/usb/gadget/ci13xxx_udc.h
rename to drivers/usb/chipidea/ci13xxx_udc.h
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig
index 47e086a..1d7405c 100644
--- a/drivers/usb/gadget/Kconfig
+++ b/drivers/usb/gadget/Kconfig
@@ -378,30 +378,6 @@ config USB_FSL_QE
 	   Set CONFIG_USB_GADGET to "m" to build this driver as a
 	   dynamically linked module called "fsl_qe_udc".
 
-config USB_CHIPIDEA_UDC
-	tristate "ChipIdea UDC driver"
-	select USB_GADGET_DUALSPEED
-	help
-	  This module contains the ChipIdea USB device controller driver;
-	  you will also need platform driver like ci13xxx_pci or ci13xxx_msm
-	  to use it.
-
-	  Say "y" to link the driver statically, or "m" to build a
-	  dynamically linked module called "ci13xxx_udc", which will serve
-	  as a driver for ChipIdea udc on different platforms.
-
-config USB_CI13XXX_PCI
-	tristate "MIPS USB CI13xxx PCI UDC"
-	depends on PCI && USB_CHIPIDEA_UDC
-	select USB_GADGET_DUALSPEED
-	help
-	  MIPS USB IP core family device controller
-	  Currently it only supports IP part number CI13412
-
-	  Say "y" to link the driver statically, or "m" to build a
-	  dynamically linked module called "ci13xxx_pci" and force all
-	  gadget drivers to also be dynamically linked.
-
 config USB_NET2272
 	tristate "PLX NET2272"
 	select USB_GADGET_DUALSPEED
@@ -494,23 +470,6 @@ config USB_EG20T
 	  ML7213/ML7831 is companion chip for Intel Atom E6xx series.
 	  ML7213/ML7831 is completely compatible for Intel EG20T PCH.
 
-config USB_CI13XXX_MSM
-	tristate "MIPS USB CI13xxx for MSM"
-	depends on ARCH_MSM && USB_CHIPIDEA_UDC
-	select USB_GADGET_DUALSPEED
-	select USB_MSM_OTG
-	help
-	  MSM SoC has chipidea USB controller.  This driver uses
-	  ci13xxx_udc core.
-	  This driver depends on OTG driver for PHY initialization,
-	  clock management, powering up VBUS, and power management.
-	  This driver is not supported on boards like trout which
-	  has an external PHY.
-
-	  Say "y" to link the driver statically, or "m" to build a
-	  dynamically linked module called "ci13xxx_msm" and force all
-	  gadget drivers to also be dynamically linked.
-
 #
 # LAST -- dummy/emulated controller
 #
diff --git a/drivers/usb/gadget/Makefile b/drivers/usb/gadget/Makefile
index 3786c7c..6ddfd26 100644
--- a/drivers/usb/gadget/Makefile
+++ b/drivers/usb/gadget/Makefile
@@ -22,8 +22,6 @@ fsl_usb2_udc-$(CONFIG_ARCH_MXC)	+= fsl_mxc_udc.o
 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_CHIPIDEA_UDC)	+= ci13xxx_udc.o
-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
@@ -31,7 +29,6 @@ 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
-obj-$(CONFIG_USB_CI13XXX_MSM)	+= ci13xxx_msm.o
 obj-$(CONFIG_USB_FUSB300)	+= fusb300_udc.o
 
 #
-- 
1.7.10

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