]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
USB: Build USB init code based on config entry, clean-up Makefile
authorTony Lindgren <tony@atomide.com>
Thu, 12 Feb 2009 19:52:57 +0000 (11:52 -0800)
committerTony Lindgren <tony@atomide.com>
Thu, 12 Feb 2009 21:32:44 +0000 (13:32 -0800)
Build USB init code based on config entry, clean-up Makefile

Cc: Felipe Balbi <felipe.balbi@nokia.com>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/mach-omap2/Makefile
arch/arm/mach-omap2/usb-ehci.c
arch/arm/mach-omap2/usb-musb.c
arch/arm/plat-omap/include/mach/usb.h

index 631166d44cb481f6099a3582f67ca1dacb7221a1..b44bb788cd29cd03a1a4abf5b9ec807a245bf259 100644 (file)
@@ -43,28 +43,21 @@ obj-$(CONFIG_MACH_OMAP_GENERIC)             += board-generic.o
 obj-$(CONFIG_MACH_OMAP_H4)             += board-h4.o board-h4-mmc.o
 obj-$(CONFIG_MACH_OMAP_2430SDP)                += board-2430sdp.o \
                                           board-2430sdp-flash.o \
-                                          mmc-twl4030.o \
-                                          usb-musb.o \
-                                          usb-ehci.o
+                                          mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP2EVM)            += board-omap2evm.o \
                                           mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_3430SDP)                += board-3430sdp.o \
                                           mmc-twl4030.o \
-                                          usb-musb.o \
-                                          usb-ehci.o \
                                           board-3430sdp-flash.o
 obj-$(CONFIG_MACH_OMAP3EVM)            += board-omap3evm.o \
                                           mmc-twl4030.o \
-                                          usb-musb.o usb-ehci.o \
                                           board-omap3evm-flash.o \
                                           twl4030-generic-scripts.o
 obj-$(CONFIG_MACH_OMAP3_BEAGLE)                += board-omap3beagle.o \
-                                          usb-musb.o usb-ehci.o \
                                           mmc-twl4030.o \
                                           twl4030-generic-scripts.o
 obj-$(CONFIG_MACH_OMAP_LDP)            += board-ldp.o \
-                                          mmc-twl4030.o \
-                                          usb-musb.o
+                                          mmc-twl4030.o
 obj-$(CONFIG_MACH_OMAP_APOLLON)                += board-apollon.o \
                                           board-apollon-mmc.o  \
                                           board-apollon-keys.o
@@ -80,19 +73,20 @@ obj-$(CONFIG_MACH_NOKIA_RX51)               += board-rx51.o \
                                           board-rx51-sdram.o \
                                           board-rx51-video.o \
                                           board-rx51-peripherals.o \
-                                          mmc-twl4030.o \
-                                          usb-musb.o
+                                          mmc-twl4030.o
 
 obj-$(CONFIG_MACH_OVERO)               += board-overo.o \
                                           mmc-twl4030.o \
-                                          usb-musb.o \
-                                          usb-ehci.o \
                                           twl4030-generic-scripts.o
 obj-$(CONFIG_MACH_OMAP3_PANDORA)       += board-omap3pandora.o \
-                                          mmc-twl4030.o \
-                                          usb-musb.o \
-                                          usb-ehci.o
+                                          mmc-twl4030.o
 
-# TUSB 6010 chips
+# Platform specific device init code
+obj-$(CONFIG_USB_MUSB_SOC)             += usb-musb.o
 obj-$(CONFIG_MACH_OMAP2_TUSB6010)      += usb-tusb6010.o
 
+ifneq ($(CONFIG_USB_EHCI_HCD),)
+       obj-y                           += usb-ehci.o
+endif
+
+
index d6333c528f34c2da3149b2f9436452469ff233df..23fe8578d2a84f4f5c30af164d1673b4d1274426 100644 (file)
@@ -28,7 +28,6 @@
 #include <mach/pm.h>
 #include <mach/usb.h>
 
-#if    defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE)
 static struct resource ehci_resources[] = {
        [0] = {
                .start   = OMAP34XX_HSUSB_HOST_BASE + 0x800,
@@ -54,7 +53,6 @@ static struct platform_device ehci_device = {
        .resource       = ehci_resources,
 };
 
-
 /* MUX settings for EHCI pins */
 /*
  * setup_ehci_io_mux - initialize IO pad mux for USBHOST
@@ -147,11 +145,8 @@ static void setup_ehci_io_mux(void)
        return;
 }
 
-#endif /* EHCI specific data */
-
 void __init usb_ehci_init(void)
 {
-#if     defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE)
        /* Setup Pin IO MUX for EHCI */
        if (cpu_is_omap34xx())
                setup_ehci_io_mux();
@@ -160,6 +155,6 @@ void __init usb_ehci_init(void)
                printk(KERN_ERR "Unable to register HS-USB (EHCI) device\n");
                return;
        }
-#endif
 }
 
+
index 897c07d43c6ee0bfad0cea1476c41f25195b831f..327af7d494fecad537946ef31deccdcf2d42a5e1 100644 (file)
@@ -33,7 +33,6 @@
 #include <mach/mux.h>
 #include <mach/usb.h>
 
-#ifdef CONFIG_USB_MUSB_SOC
 static struct resource musb_resources[] = {
        [0] = { /* start and end set dynamically */
                .flags  = IORESOURCE_MEM,
@@ -146,13 +145,9 @@ static struct platform_device musb_device = {
        .num_resources  = ARRAY_SIZE(musb_resources),
        .resource       = musb_resources,
 };
-#endif
-
 
 void __init usb_musb_init(void)
 {
-#ifdef CONFIG_USB_MUSB_SOC
-
        if (cpu_is_omap243x()) {
                musb_resources[0].start = OMAP243X_HS_BASE;
                musb_plat.clock = "usbhs_ick";
@@ -167,6 +162,4 @@ void __init usb_musb_init(void)
                printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
                return;
        }
-#endif
 }
-
index 7d7b2b056e71f42ac8a577229cd26fec925ffa03..47aba6b1e80cef6d749e6e21f5338a6c35f2cd06 100644 (file)
 #define UDC_BASE                       OMAP2_UDC_BASE
 #define OMAP_OHCI_BASE                 OMAP2_OHCI_BASE
 
+#ifdef CONFIG_USB_MUSB_SOC
 extern void usb_musb_init(void);
+#else
+static inline void usb_musb_init(void)
+{
+}
+#endif
+
+#if defined(CONFIG_USB_EHCI_HCD) || defined(CONFIG_USB_EHCI_HCD_MODULE)
 extern void usb_ehci_init(void);
+#else
+static inline void usb_ehci_init(void)
+{
+}
+#endif
 
 #endif