Skip to content

Commit

Permalink
omap: musb: introduce default board config
Browse files Browse the repository at this point in the history
Most boards use exactly the same configuration for musb initialization.
Create a default that can be shared amount different boards.

Signed-off-by: Mike Rapoport <mike@compulab.co.il>
Acked-by: Felipe Balbi <balbi@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
  • Loading branch information
Mike Rapoport authored and Tony Lindgren committed May 9, 2011
1 parent 9a3f39f commit 9e18630
Show file tree
Hide file tree
Showing 15 changed files with 27 additions and 98 deletions.
7 changes: 1 addition & 6 deletions arch/arm/mach-omap2/board-2430sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,6 @@ 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 struct omap_usb_config sdp2430_usb_config __initdata = {
.otg = 1,
#ifdef CONFIG_USB_GADGET_OMAP
Expand Down Expand Up @@ -246,7 +241,7 @@ static void __init omap_2430sdp_init(void)
omap2_usbfs_init(&sdp2430_usb_config);

omap_mux_init_signal("usb0hs_stp", OMAP_PULL_ENA | OMAP_PULL_UP);
usb_musb_init(&musb_board_data);
usb_musb_init(NULL);

board_smc91x_init();

Expand Down
8 changes: 1 addition & 7 deletions arch/arm/mach-omap2/board-3430sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -810,12 +810,6 @@ 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)
{
int gpio_pendown;
Expand All @@ -832,7 +826,7 @@ static void __init omap_3430sdp_init(void)
gpio_pendown = SDP3430_TS_GPIO_IRQ_SDPV1;
omap_ads7846_init(1, gpio_pendown, 310, NULL);
board_serial_init();
usb_musb_init(&musb_board_data);
usb_musb_init(NULL);
board_smc91x_init();
board_flash_init(sdp_flash_partitions, chip_sel_3430, 0);
sdp3430_display_init();
Expand Down
8 changes: 1 addition & 7 deletions arch/arm/mach-omap2/board-cm-t35.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,12 +653,6 @@ static struct omap_board_mux board_mux[] __initdata = {
};
#endif

static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
.mode = MUSB_OTG,
.power = 100,
};

static struct omap_board_config_kernel cm_t35_config[] __initdata = {
};

Expand All @@ -675,7 +669,7 @@ static void __init cm_t35_init(void)
cm_t35_init_led();
cm_t35_init_display();

usb_musb_init(&musb_board_data);
usb_musb_init(NULL);
usbhs_init(&usbhs_bdata);
}

Expand Down
8 changes: 1 addition & 7 deletions arch/arm/mach-omap2/board-devkit8000.c
Original file line number Diff line number Diff line change
Expand Up @@ -509,12 +509,6 @@ static struct platform_device *devkit8000_devices[] __initdata = {
&omap_dm9000_dev,
};

static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
.mode = MUSB_OTG,
.power = 100,
};

static const struct usbhs_omap_board_data usbhs_bdata __initconst = {

.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
Expand Down Expand Up @@ -698,7 +692,7 @@ static void __init devkit8000_init(void)

omap_ads7846_init(2, OMAP3_DEVKIT_TS_GPIO, 0, NULL);

usb_musb_init(&musb_board_data);
usb_musb_init(NULL);
usbhs_init(&usbhs_bdata);
omap_nand_flash_init(NAND_BUSWIDTH_16, devkit8000_nand_partitions,
ARRAY_SIZE(devkit8000_nand_partitions));
Expand Down
8 changes: 1 addition & 7 deletions arch/arm/mach-omap2/board-igep0020.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,12 +559,6 @@ static void __init igep2_i2c_init(void)
pr_warning("IGEP2: Could not register I2C3 bus (%d)\n", ret);
}

static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
.mode = MUSB_OTG,
.power = 100,
};

static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
.port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
Expand Down Expand Up @@ -637,7 +631,7 @@ static void __init igep2_init(void)
platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices));
omap_display_init(&igep2_dss_data);
omap_serial_init();
usb_musb_init(&musb_board_data);
usb_musb_init(NULL);
usbhs_init(&usbhs_bdata);

igep2_flash_init();
Expand Down
8 changes: 1 addition & 7 deletions arch/arm/mach-omap2/board-igep0030.c
Original file line number Diff line number Diff line change
Expand Up @@ -357,12 +357,6 @@ static int __init igep3_i2c_init(void)
return 0;
}

static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
.mode = MUSB_OTG,
.power = 100,
};

#if defined(CONFIG_LIBERTAS_SDIO) || defined(CONFIG_LIBERTAS_SDIO_MODULE)

static void __init igep3_wifi_bt_init(void)
Expand Down Expand Up @@ -424,7 +418,7 @@ static void __init igep3_init(void)
igep3_i2c_init();
platform_add_devices(igep3_devices, ARRAY_SIZE(igep3_devices));
omap_serial_init();
usb_musb_init(&musb_board_data);
usb_musb_init(NULL);
usbhs_init(&usbhs_bdata);

igep3_flash_init();
Expand Down
8 changes: 1 addition & 7 deletions arch/arm/mach-omap2/board-ldp.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,6 @@ static struct omap_board_mux board_mux[] __initdata = {
};
#endif

static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
.mode = MUSB_OTG,
.power = 100,
};

static struct mtd_partition ldp_nand_partitions[] = {
/* All the partition sizes are listed in terms of NAND block size */
{
Expand Down Expand Up @@ -342,7 +336,7 @@ static void __init omap_ldp_init(void)
platform_add_devices(ldp_devices, ARRAY_SIZE(ldp_devices));
omap_ads7846_init(1, 54, 310, NULL);
omap_serial_init();
usb_musb_init(&musb_board_data);
usb_musb_init(NULL);
board_nand_init(ldp_nand_partitions,
ARRAY_SIZE(ldp_nand_partitions), ZOOM_NAND_CS, 0);

Expand Down
8 changes: 1 addition & 7 deletions arch/arm/mach-omap2/board-omap3beagle.c
Original file line number Diff line number Diff line change
Expand Up @@ -551,12 +551,6 @@ static struct omap_board_mux board_mux[] __initdata = {
};
#endif

static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
.mode = MUSB_OTG,
.power = 100,
};

static void __init beagle_opp_init(void)
{
int r = 0;
Expand Down Expand Up @@ -618,7 +612,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(&musb_board_data);
usb_musb_init(NULL);
usbhs_init(&usbhs_bdata);
omap_nand_flash_init(NAND_BUSWIDTH_16, omap3beagle_nand_partitions,
ARRAY_SIZE(omap3beagle_nand_partitions));
Expand Down
8 changes: 1 addition & 7 deletions arch/arm/mach-omap2/board-omap3pandora.c
Original file line number Diff line number Diff line change
Expand Up @@ -633,12 +633,6 @@ static struct omap_board_mux board_mux[] __initdata = {
};
#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);
Expand All @@ -652,7 +646,7 @@ static void __init omap3pandora_init(void)
ARRAY_SIZE(omap3pandora_spi_board_info));
omap_ads7846_init(1, OMAP3_PANDORA_TS_GPIO, 0, NULL);
usbhs_init(&usbhs_bdata);
usb_musb_init(&musb_board_data);
usb_musb_init(NULL);
gpmc_nand_init(&pandora_nand_data);

/* Ensure SDRC pins are mux'd for self-refresh */
Expand Down
8 changes: 1 addition & 7 deletions arch/arm/mach-omap2/board-omap3stalker.c
Original file line number Diff line number Diff line change
Expand Up @@ -526,12 +526,6 @@ static struct omap_board_mux board_mux[] __initdata = {
};
#endif

static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
.mode = MUSB_OTG,
.power = 100,
};

static void __init omap3_stalker_init(void)
{
omap3_mux_init(board_mux, OMAP_PACKAGE_CUS);
Expand All @@ -546,7 +540,7 @@ static void __init omap3_stalker_init(void)
omap_display_init(&omap3_stalker_dss_data);

omap_serial_init();
usb_musb_init(&musb_board_data);
usb_musb_init(NULL);
usbhs_init(&usbhs_bdata);
omap_ads7846_init(1, OMAP3_STALKER_TS_GPIO, 310, NULL);

Expand Down
8 changes: 1 addition & 7 deletions arch/arm/mach-omap2/board-omap3touchbook.c
Original file line number Diff line number Diff line change
Expand Up @@ -421,12 +421,6 @@ static int __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)
{
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
Expand All @@ -447,7 +441,7 @@ static void __init omap3_touchbook_init(void)

/* Touchscreen and accelerometer */
omap_ads7846_init(4, OMAP3_TS_GPIO, 310, &ads7846_pdata);
usb_musb_init(&musb_board_data);
usb_musb_init(NULL);
usbhs_init(&usbhs_bdata);
omap_nand_flash_init(NAND_BUSWIDTH_16, omap3touchbook_nand_partitions,
ARRAY_SIZE(omap3touchbook_nand_partitions));
Expand Down
8 changes: 1 addition & 7 deletions arch/arm/mach-omap2/board-overo.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,12 +553,6 @@ static struct omap_board_mux board_mux[] __initdata = {
};
#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);
Expand All @@ -567,7 +561,7 @@ static void __init overo_init(void)
omap_serial_init();
omap_nand_flash_init(0, overo_nand_partitions,
ARRAY_SIZE(overo_nand_partitions));
usb_musb_init(&musb_board_data);
usb_musb_init(NULL);
usbhs_init(&usbhs_bdata);
overo_spi_init();
overo_ads7846_init();
Expand Down
8 changes: 1 addition & 7 deletions arch/arm/mach-omap2/board-rm680.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,17 +144,11 @@ static struct omap_board_mux board_mux[] __initdata = {
};
#endif

static struct omap_musb_board_data rm680_musb_data = {
.interface_type = MUSB_INTERFACE_ULPI,
.mode = MUSB_PERIPHERAL,
.power = 100,
};

static void __init rm680_init(void)
{
omap3_mux_init(board_mux, OMAP_PACKAGE_CBB);
omap_serial_init();
usb_musb_init(&rm680_musb_data);
usb_musb_init(NULL);
rm680_peripherals_init();
}

Expand Down
8 changes: 1 addition & 7 deletions arch/arm/mach-omap2/board-zoom-peripherals.c
Original file line number Diff line number Diff line change
Expand Up @@ -363,12 +363,6 @@ 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) */
Expand All @@ -383,7 +377,7 @@ void __init zoom_peripherals_init(void)

omap_i2c_init();
platform_device_register(&omap_vwlan_device);
usb_musb_init(&musb_board_data);
usb_musb_init(NULL);
enable_board_wakeup_source();
omap_serial_init();
}
14 changes: 13 additions & 1 deletion arch/arm/mach-omap2/usb-musb.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,26 @@ static void usb_musb_mux_init(struct omap_musb_board_data *board_data)
}
}

void __init usb_musb_init(struct omap_musb_board_data *board_data)
static struct omap_musb_board_data musb_default_board_data = {
.interface_type = MUSB_INTERFACE_ULPI,
.mode = MUSB_OTG,
.power = 100,
};

void __init usb_musb_init(struct omap_musb_board_data *musb_board_data)
{
struct omap_hwmod *oh;
struct omap_device *od;
struct platform_device *pdev;
struct device *dev;
int bus_id = -1;
const char *oh_name, *name;
struct omap_musb_board_data *board_data;

if (musb_board_data)
board_data = musb_board_data;
else
board_data = &musb_default_board_data;

if (cpu_is_omap3517() || cpu_is_omap3505()) {
} else if (cpu_is_omap44xx()) {
Expand Down

0 comments on commit 9e18630

Please sign in to comment.