]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
omap: musb: Pass board specific data from board file
authorMaulik Mankad <x0082077@ti.com>
Wed, 17 Feb 2010 22:09:30 +0000 (14:09 -0800)
committerTony Lindgren <tony@atomide.com>
Fri, 19 Feb 2010 23:22:17 +0000 (15:22 -0800)
Pass board specific data for MUSB (like interface_type,
mode etc) from board file by defining board
specific structure.

Each board file can define this structure based on
its requirement and pass this information to the
driver.

Signed-off-by: Maulik Mankad <x0082077@ti.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Cc: David Brownell <david-b@pacbell.net>
Cc: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Gupta Ajay Kumar <ajay.gupta@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
16 files changed:
arch/arm/mach-omap2/board-2430sdp.c
arch/arm/mach-omap2/board-3430sdp.c
arch/arm/mach-omap2/board-cm-t35.c
arch/arm/mach-omap2/board-devkit8000.c
arch/arm/mach-omap2/board-igep0020.c
arch/arm/mach-omap2/board-ldp.c
arch/arm/mach-omap2/board-omap3beagle.c
arch/arm/mach-omap2/board-omap3evm.c
arch/arm/mach-omap2/board-omap3pandora.c
arch/arm/mach-omap2/board-omap3touchbook.c
arch/arm/mach-omap2/board-overo.c
arch/arm/mach-omap2/board-rx51.c
arch/arm/mach-omap2/board-zoom-peripherals.c
arch/arm/mach-omap2/usb-musb.c
arch/arm/plat-omap/include/plat/usb.h
include/linux/usb/musb.h

index d6f55ef9059d411666304a1229932b18f638c5b2..01d113ff9fcf366aff724f23d53811a890aa3090 100644 (file)
@@ -193,6 +193,12 @@ static struct omap2_hsmmc_info mmc[] __initdata = {
        {}      /* Terminator */
 };
 
+static struct omap_musb_board_data musb_board_data = {
+       .interface_type         = MUSB_INTERFACE_ULPI,
+       .mode                   = MUSB_OTG,
+       .power                  = 100,
+};
+
 static void __init omap_2430sdp_init(void)
 {
        int ret;
@@ -202,7 +208,7 @@ static void __init omap_2430sdp_init(void)
        platform_add_devices(sdp2430_devices, ARRAY_SIZE(sdp2430_devices));
        omap_serial_init();
        omap2_hsmmc_init(mmc);
-       usb_musb_init();
+       usb_musb_init(&musb_board_data);
        board_smc91x_init();
 
        /* Turn off secondary LCD backlight */
index 5adef517a2b35f99fa5ca1470e3caca2776ac15b..a10e96f48aeaf88d7d6b449f0df4b7139c0192d6 100644 (file)
@@ -760,6 +760,12 @@ static struct flash_partitions sdp_flash_partitions[] = {
        },
 };
 
+static struct omap_musb_board_data musb_board_data = {
+       .interface_type         = MUSB_INTERFACE_ULPI,
+       .mode                   = MUSB_OTG,
+       .power                  = 100,
+};
+
 static void __init omap_3430sdp_init(void)
 {
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -774,7 +780,7 @@ static void __init omap_3430sdp_init(void)
                                ARRAY_SIZE(sdp3430_spi_board_info));
        ads7846_dev_init();
        omap_serial_init();
-       usb_musb_init();
+       usb_musb_init(&musb_board_data);
        board_smc91x_init();
        sdp_flash_init(sdp_flash_partitions);
        sdp3430_display_init();
index 8659c3e2ef6e80ddc940d023c96d78be4a301f9f..afa77caaff4dece9cc58bc3b469735f4651aba39 100644 (file)
@@ -811,6 +811,12 @@ static struct omap_board_mux board_mux[] __initdata = {
        { .reg_offset = OMAP_MUX_TERMINATOR },
 };
 
+static struct omap_musb_board_data musb_board_data = {
+       .interface_type         = MUSB_INTERFACE_ULPI,
+       .mode                   = MUSB_OTG,
+       .power                  = 100,
+};
+
 static void __init cm_t35_init(void)
 {
        omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
@@ -822,7 +828,7 @@ static void __init cm_t35_init(void)
        cm_t35_init_led();
        cm_t35_init_display();
 
-       usb_musb_init();
+       usb_musb_init(&musb_board_data);
 }
 
 MACHINE_START(CM_T35, "Compulab CM-T35")
index 89a55f1d07e3f436faebf1aa8ca0b7aeb7870191..371019054b494c713f19de50310e7b521cc3459d 100644 (file)
@@ -630,6 +630,12 @@ static void __init devkit8000_flash_init(void)
        }
 }
 
+static struct omap_musb_board_data musb_board_data = {
+       .interface_type         = MUSB_INTERFACE_ULPI,
+       .mode                   = MUSB_OTG,
+       .power                  = 100,
+};
+
 static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
 
        .port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
@@ -665,7 +671,7 @@ static void __init devkit8000_init(void)
        /* REVISIT leave DVI powered down until it's needed ... */
        gpio_direction_output(170, true);
 
-       usb_musb_init();
+       usb_musb_init(&musb_board_data);
        usb_ehci_init(&ehci_pdata);
        devkit8000_flash_init();
 
index 748f418ba442505589c282766341dc57418880de..9958987a3d0a8456761825c9577ddf0953355eb8 100644 (file)
@@ -436,6 +436,12 @@ static int __init igep2_i2c_init(void)
        return 0;
 }
 
+static struct omap_musb_board_data musb_board_data = {
+       .interface_type         = MUSB_INTERFACE_ULPI,
+       .mode                   = MUSB_OTG,
+       .power                  = 100,
+};
+
 static struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
        .port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN,
        .port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
@@ -461,7 +467,7 @@ static void __init igep2_init(void)
        igep2_i2c_init();
        platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices));
        omap_serial_init();
-       usb_musb_init();
+       usb_musb_init(&musb_board_data);
        usb_ehci_init(&ehci_pdata);
 
        igep2_flash_init();
index 095adcb642b8a56a3f7a186b18e75086500760aa..5fcb52e71298a8846f29734f3f96951546ff2d90 100644 (file)
@@ -383,6 +383,12 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux      NULL
 #endif
 
+static struct omap_musb_board_data musb_board_data = {
+       .interface_type         = MUSB_INTERFACE_ULPI,
+       .mode                   = MUSB_OTG,
+       .power                  = 100,
+};
+
 static void __init omap_ldp_init(void)
 {
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -394,7 +400,7 @@ static void __init omap_ldp_init(void)
                                ARRAY_SIZE(ldp_spi_board_info));
        ads7846_dev_init();
        omap_serial_init();
-       usb_musb_init();
+       usb_musb_init(&musb_board_data);
 
        omap2_hsmmc_init(mmc);
        /* link regulators to MMC adapters */
index 1bae699133762b74f168f4fe7a9a34b8992e50a5..6eb77e1f7c828b04c27f4742aff108f2f4c74eee 100644 (file)
@@ -430,6 +430,12 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux      NULL
 #endif
 
+static struct omap_musb_board_data musb_board_data = {
+       .interface_type         = MUSB_INTERFACE_ULPI,
+       .mode                   = MUSB_OTG,
+       .power                  = 100,
+};
+
 static void __init omap3_beagle_init(void)
 {
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -443,7 +449,7 @@ static void __init omap3_beagle_init(void)
        /* REVISIT leave DVI powered down until it's needed ... */
        gpio_direction_output(170, true);
 
-       usb_musb_init();
+       usb_musb_init(&musb_board_data);
        usb_ehci_init(&ehci_pdata);
        omap3beagle_flash_init();
 
index 57506da4e43395fa05fcebb350fe1c01ee350ca9..d6bc88c426b560bace561b402e28d7817f7d457f 100644 (file)
@@ -662,6 +662,12 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux      NULL
 #endif
 
+static struct omap_musb_board_data musb_board_data = {
+       .interface_type         = MUSB_INTERFACE_ULPI,
+       .mode                   = MUSB_OTG,
+       .power                  = 100,
+};
+
 static void __init omap3_evm_init(void)
 {
        omap3_evm_get_revision();
@@ -701,7 +707,7 @@ static void __init omap3_evm_init(void)
                omap_mux_init_gpio(135, OMAP_PIN_OUTPUT);
                ehci_pdata.reset_gpio_port[1] = 135;
        }
-       usb_musb_init();
+       usb_musb_init(&musb_board_data);
        usb_ehci_init(&ehci_pdata);
        ads7846_dev_init();
        omap3evm_init_smsc911x();
index a0acf8d1e806e01c0e45304f2da7c677302baaa0..4827f4658df391ab3023c25e28d7ca7901628417 100644 (file)
@@ -557,6 +557,12 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux      NULL
 #endif
 
+static struct omap_musb_board_data musb_board_data = {
+       .interface_type         = MUSB_INTERFACE_ULPI,
+       .mode                   = MUSB_OTG,
+       .power                  = 100,
+};
+
 static void __init omap3pandora_init(void)
 {
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -569,7 +575,7 @@ static void __init omap3pandora_init(void)
        omap3pandora_ads7846_init();
        usb_ehci_init(&ehci_pdata);
        pandora_keys_gpio_init();
-       usb_musb_init();
+       usb_musb_init(&musb_board_data);
 
        /* Ensure SDRC pins are mux'd for self-refresh */
        omap_mux_init_signal("sdrc_cke0", OMAP_PIN_OUTPUT);
index 8252ba49a664546d4c762e40c78719d189ad6494..3943d0f8322c68dd2ae95db6981b6a8c31a3a4f2 100644 (file)
@@ -527,6 +527,12 @@ static void __init early_touchbook_revision(char **p)
 }
 __early_param("tbr=", early_touchbook_revision);
 
+static struct omap_musb_board_data musb_board_data = {
+       .interface_type         = MUSB_INTERFACE_ULPI,
+       .mode                   = MUSB_OTG,
+       .power                  = 100,
+};
+
 static void __init omap3_touchbook_init(void)
 {
        pm_power_off = omap3_touchbook_poweroff;
@@ -545,7 +551,7 @@ static void __init omap3_touchbook_init(void)
        spi_register_board_info(omap3_ads7846_spi_board_info,
                                ARRAY_SIZE(omap3_ads7846_spi_board_info));
        omap3_ads7846_init();
-       usb_musb_init();
+       usb_musb_init(&musb_board_data);
        usb_ehci_init(&ehci_pdata);
        omap3touchbook_flash_init();
 
index 7e6aa8292746a683c8ca50757e228f828119541a..50872a42bec74c3dbafe6c686a8ad0c5ce2d9bbf 100644 (file)
@@ -413,6 +413,12 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux      NULL
 #endif
 
+static struct omap_musb_board_data musb_board_data = {
+       .interface_type         = MUSB_INTERFACE_ULPI,
+       .mode                   = MUSB_OTG,
+       .power                  = 100,
+};
+
 static void __init overo_init(void)
 {
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
@@ -420,7 +426,7 @@ static void __init overo_init(void)
        platform_add_devices(overo_devices, ARRAY_SIZE(overo_devices));
        omap_serial_init();
        overo_flash_init();
-       usb_musb_init();
+       usb_musb_init(&musb_board_data);
        usb_ehci_init(&ehci_pdata);
        overo_ads7846_init();
        overo_init_smsc911x();
index 6a49f916103da9d0dc23741293334ebfc8a5df76..0ccb8b46d15752068255cb067894e8f852a99f4b 100644 (file)
@@ -78,11 +78,17 @@ static struct omap_board_mux board_mux[] __initdata = {
 #define board_mux      NULL
 #endif
 
+static struct omap_musb_board_data musb_board_data = {
+       .interface_type         = MUSB_INTERFACE_ULPI,
+       .mode                   = MUSB_PERIPHERAL,
+       .power                  = 0,
+};
+
 static void __init rx51_init(void)
 {
        omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
        omap_serial_init();
-       usb_musb_init();
+       usb_musb_init(&musb_board_data);
        rx51_peripherals_init();
 
        /* Ensure SDRC pins are mux'd for self-refresh */
index 9a0821fb7ea03d716ffddf78627c15894d3c20d4..ca95d8d64136d903036ef069785b61810a82c54e 100755 (executable)
@@ -264,6 +264,12 @@ static int __init omap_i2c_init(void)
        return 0;
 }
 
+static struct omap_musb_board_data musb_board_data = {
+       .interface_type         = MUSB_INTERFACE_ULPI,
+       .mode                   = MUSB_OTG,
+       .power                  = 100,
+};
+
 static void enable_board_wakeup_source(void)
 {
        /* T2 interrupt line (keypad) */
@@ -275,6 +281,6 @@ void __init zoom_peripherals_init(void)
 {
        omap_i2c_init();
        omap_serial_init();
-       usb_musb_init();
+       usb_musb_init(&musb_board_data);
        enable_board_wakeup_source();
 }
index ba71f762db71f18c1508b01a2db7682b631ffaea..2ddc316d9394e5941a8a450046a30c1c9dff6a11 100644 (file)
@@ -146,7 +146,7 @@ static struct platform_device musb_device = {
        .resource       = musb_resources,
 };
 
-void __init usb_musb_init(void)
+void __init usb_musb_init(struct omap_musb_board_data *board_data)
 {
        if (cpu_is_omap243x())
                musb_resources[0].start = OMAP243X_HS_BASE;
@@ -159,6 +159,9 @@ void __init usb_musb_init(void)
         * musb_core.c have been converted to use use clkdev.
         */
        musb_plat.clock = "ick";
+       musb_plat.board_data = board_data;
+       musb_plat.power = board_data->power >> 1;
+       musb_plat.mode = board_data->mode;
 
        if (platform_device_register(&musb_device) < 0) {
                printk(KERN_ERR "Unable to register HS-USB (MUSB) device\n");
@@ -167,7 +170,7 @@ void __init usb_musb_init(void)
 }
 
 #else
-void __init usb_musb_init(void)
+void __init usb_musb_init(struct omap_musb_board_data *board_data)
 {
 }
 #endif /* CONFIG_USB_MUSB_SOC */
index 33a500eb2f93d9f0653eda20604983df24b663ca..288e29e1c06f52f6c187b8681e75ef0586a82306 100644 (file)
@@ -3,6 +3,7 @@
 #ifndef        __ASM_ARCH_OMAP_USB_H
 #define        __ASM_ARCH_OMAP_USB_H
 
+#include <linux/usb/musb.h>
 #include <plat/board.h>
 
 #define OMAP3_HS_USB_PORTS     3
@@ -42,7 +43,15 @@ struct ehci_hcd_omap_platform_data {
 #define UDC_BASE                       OMAP2_UDC_BASE
 #define OMAP_OHCI_BASE                 OMAP2_OHCI_BASE
 
-extern void usb_musb_init(void);
+struct omap_musb_board_data {
+       u8      interface_type;
+       u8      mode;
+       u8      power;
+};
+
+enum musb_interface    {MUSB_INTERFACE_ULPI, MUSB_INTERFACE_UTMI};
+
+extern void usb_musb_init(struct omap_musb_board_data *board_data);
 
 extern void usb_ehci_init(struct ehci_hcd_omap_platform_data *pdata);
 
index d43755669261a6a1406af177d01b2c13ddf2ab77..5dc2f227a0f1591bc5a8dd1165a3218da2901a62 100644 (file)
@@ -84,6 +84,9 @@ struct musb_hdrc_platform_data {
 
        /* MUSB configuration-specific details */
        struct musb_hdrc_config *config;
+
+       /* Architecture specific board data     */
+       void            *board_data;
 };