usb: gadget: allow multiple gadgets to be built
now that we have the udc class, we can allow
multiple gadget controller drivers to be
compiled as modules. This will allow for
distro-like kernels for embedded devices.
With this patch, I managed to build an x86
kernel with support for many of the controllers
enabled:
CONFIG_USB_FUSB300=m
CONFIG_USB_R8A66597=m
CONFIG_USB_M66592=m
CONFIG_USB_AMD5536UDC=m
CONFIG_USB_CI13XXX_PCI=m
CONFIG_USB_NET2272=m
CONFIG_USB_NET2280=m
CONFIG_USB_GOKU=m
CONFIG_USB_LANGWELL=m
CONFIG_USB_EG20T=m
Also an ARM kernel with support for many controllers:
CONFIG_USB_FUSB300=m
CONFIG_USB_OMAP=m
CONFIG_USB_R8A66597=m
CONFIG_USB_GADGET_MUSB_HDRC=m
CONFIG_USB_M66592=m
CONFIG_USB_NET2272=m
CONFIG_USB_DUMMY_HCD=m
The next step would be to get rid of the
direct access to arch/ and mach/ directories
on some gadget controllers so that we can
build all of them without depending on their
respective ARCH_* symbols.
Signed-off-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
[esalman@codeaurora.org:
Fix defconfig files to set the correct configuration, since
_GADGET_ is removed from the gadget config names in this patch
rpc_hsusb.c - Remove _GADGET_ from config name
board-9615.c - Remove _GADGET_ from config name
board-msm8x60.c - Remove _GADGET_ from config name
musb/Kconfig - align the define]
Signed-off-by: Lena Salman <esalman@codeaurora.org>
Change-Id: I26758627e49940d14655e2724099283c5e0541e2
diff --git a/arch/arm/mach-msm/board-9615.c b/arch/arm/mach-msm/board-9615.c
index a1a0dc7..a557764 100644
--- a/arch/arm/mach-msm/board-9615.c
+++ b/arch/arm/mach-msm/board-9615.c
@@ -280,7 +280,7 @@
#define HSIC_BAM_PHY_BASE 0x12542000
#define A2_BAM_PHY_BASE 0x124C2000
static struct usb_bam_pipe_connect msm_usb_bam_connections[4][2] = {
-#ifndef CONFIG_USB_GADGET_CI13XXX_MSM_HSIC
+#ifndef CONFIG_USB_CI13XXX_MSM_HSIC
[0][USB_TO_PEER_PERIPHERAL] = {
.src_phy_addr = USB_BAM_PHY_BASE,
.src_pipe_index = 11,
@@ -407,7 +407,7 @@
static struct msm_usb_bam_platform_data msm_usb_bam_pdata = {
.connections = &msm_usb_bam_connections[0][0],
-#ifndef CONFIG_USB_GADGET_CI13XXX_MSM_HSIC
+#ifndef CONFIG_USB_CI13XXX_MSM_HSIC
.usb_active_bam = HSUSB_BAM,
.usb_bam_num_pipes = 16,
#else
@@ -514,7 +514,7 @@
#ifdef CONFIG_LTC4088_CHARGER
&msm_device_charger,
#endif
-#ifndef CONFIG_USB_GADGET_CI13XXX_MSM_HSIC
+#ifndef CONFIG_USB_CI13XXX_MSM_HSIC
&msm_device_otg,
#endif
&msm_device_hsic_peripheral,
diff --git a/arch/arm/mach-msm/board-msm8x60.c b/arch/arm/mach-msm/board-msm8x60.c
index 9b5e1e2..e8e4a56 100644
--- a/arch/arm/mach-msm/board-msm8x60.c
+++ b/arch/arm/mach-msm/board-msm8x60.c
@@ -1023,7 +1023,7 @@
};
#endif
-#if defined(CONFIG_USB_GADGET_MSM_72K) || defined(CONFIG_USB_EHCI_MSM_72K)
+#if defined(CONFIG_USB_MSM_72K) || defined(CONFIG_USB_EHCI_MSM_72K)
static struct msm_otg_platform_data msm_otg_pdata;
static struct regulator *ldo6_3p3;
static struct regulator *ldo7_1p8;
@@ -1455,7 +1455,7 @@
}
#endif
-#if defined(CONFIG_USB_GADGET_MSM_72K) || defined(CONFIG_USB_EHCI_MSM_72K)
+#if defined(CONFIG_USB_MSM_72K) || defined(CONFIG_USB_EHCI_MSM_72K)
static struct msm_otg_platform_data msm_otg_pdata = {
/* if usb link is in sps there is no need for
* usb pclk as dayatona fabric clock will be
@@ -1485,7 +1485,7 @@
};
#endif
-#ifdef CONFIG_USB_GADGET_MSM_72K
+#ifdef CONFIG_USB_MSM_72K
static struct msm_hsusb_gadget_platform_data msm_gadget_pdata = {
.is_phy_status_timer_on = 1,
};
@@ -5159,10 +5159,10 @@
&asoc_mvs_dai1,
#endif
-#if defined(CONFIG_USB_GADGET_MSM_72K) || defined(CONFIG_USB_EHCI_HCD)
+#if defined(CONFIG_USB_MSM_72K) || defined(CONFIG_USB_EHCI_HCD)
&msm_device_otg,
#endif
-#ifdef CONFIG_USB_GADGET_MSM_72K
+#ifdef CONFIG_USB_MSM_72K
&msm_device_gadget_peripheral,
#endif
#ifdef CONFIG_USB_G_ANDROID
@@ -7421,7 +7421,7 @@
#endif
}
-#if defined(CONFIG_USB_GADGET_MSM_72K) || defined(CONFIG_USB_EHCI_HCD)
+#if defined(CONFIG_USB_MSM_72K) || defined(CONFIG_USB_EHCI_HCD)
/*
* We can not put USB regulators (8058_l6 and 8058_l7) in LPM
* when we depend on USB PHY for VBUS/ID notifications. VBUS
@@ -7436,7 +7436,7 @@
msm_device_otg.dev.platform_data = &msm_otg_pdata;
#endif
-#ifdef CONFIG_USB_GADGET_MSM_72K
+#ifdef CONFIG_USB_MSM_72K
msm_device_gadget_peripheral.dev.platform_data = &msm_gadget_pdata;
#endif
diff --git a/arch/arm/mach-msm/include/mach/rpc_hsusb.h b/arch/arm/mach-msm/include/mach/rpc_hsusb.h
index 2255237..88d7650 100644
--- a/arch/arm/mach-msm/include/mach/rpc_hsusb.h
+++ b/arch/arm/mach-msm/include/mach/rpc_hsusb.h
@@ -1,6 +1,6 @@
/* linux/include/mach/rpc_hsusb.h
*
- * Copyright (c) 2008-2010, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2008-2010, 2012 Code Aurora Forum. All rights reserved.
*
* All source code in this file is licensed under the following license except
* where indicated.
@@ -42,7 +42,7 @@
int msm_chg_usb_charger_disconnected(void);
int msm_chg_rpc_close(void);
-#ifdef CONFIG_USB_GADGET_MSM_72K
+#ifdef CONFIG_USB_MSM_72K
int hsusb_chg_init(int connect);
void hsusb_chg_vbus_draw(unsigned mA);
void hsusb_chg_connected(enum chg_type chgtype);
@@ -78,7 +78,7 @@
static inline int msm_chg_usb_charger_disconnected(void) { return 0; }
static inline int msm_chg_rpc_close(void) { return 0; }
-#ifdef CONFIG_USB_GADGET_MSM_72K
+#ifdef CONFIG_USB_MSM_72K
static inline int hsusb_chg_init(int connect) { return 0; }
static inline void hsusb_chg_vbus_draw(unsigned mA) { }
static inline void hsusb_chg_connected(enum chg_type chgtype) { }
diff --git a/arch/arm/mach-msm/rpc_hsusb.c b/arch/arm/mach-msm/rpc_hsusb.c
index 635ef31..52a1001 100644
--- a/arch/arm/mach-msm/rpc_hsusb.c
+++ b/arch/arm/mach-msm/rpc_hsusb.c
@@ -1,6 +1,6 @@
/* linux/arch/arm/mach-msm/rpc_hsusb.c
*
- * Copyright (c) 2008-2011, Code Aurora Forum. All rights reserved.
+ * Copyright (c) 2008-2012, Code Aurora Forum. All rights reserved.
*
* All source code in this file is licensed under the following license except
* where indicated.
@@ -621,7 +621,7 @@
}
-#ifdef CONFIG_USB_GADGET_MSM_72K
+#ifdef CONFIG_USB_MSM_72K
/* charger api wrappers */
int hsusb_chg_init(int connect)
{