Skip to content

Commit

Permalink
arm: omap: usb: create common enums and structures for ehci and ohci
Browse files Browse the repository at this point in the history
Create the ehci and ohci specific platform data structures.
The port enum values are made common for both ehci and ohci.

Signed-off-by: Keshava Munegowda <keshava_mgowda@ti.com>
Signed-off-by: Felipe Balbi <balbi@ti.com>
  • Loading branch information
Keshava Munegowda authored and Felipe Balbi committed Mar 1, 2011
1 parent a8480ea commit 181b250
Show file tree
Hide file tree
Showing 22 changed files with 184 additions and 168 deletions.
10 changes: 5 additions & 5 deletions arch/arm/mach-omap2/board-3430sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,11 +653,11 @@ static void enable_board_wakeup_source(void)
OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
}

static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
static const struct usbhs_omap_board_data usbhs_bdata __initconst = {

.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,

.phy_reset = true,
.reset_gpio_port[0] = 57,
Expand Down Expand Up @@ -816,7 +816,7 @@ static void __init omap_3430sdp_init(void)
board_flash_init(sdp_flash_partitions, chip_sel_3430);
sdp3430_display_init();
enable_board_wakeup_source();
usb_ehci_init(&ehci_pdata);
usb_ehci_init(&usbhs_bdata);
}

MACHINE_START(OMAP_3430SDP, "OMAP3430 3430SDP board")
Expand Down
10 changes: 5 additions & 5 deletions arch/arm/mach-omap2/board-3630sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ static void enable_board_wakeup_source(void)
OMAP_WAKEUP_EN | OMAP_PIN_INPUT_PULLUP);
}

static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
static const struct usbhs_omap_board_data usbhs_bdata __initconst = {

.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,

.phy_reset = true,
.reset_gpio_port[0] = 126,
Expand Down Expand Up @@ -211,7 +211,7 @@ static void __init omap_sdp_init(void)
board_smc91x_init();
board_flash_init(sdp_flash_partitions, chip_sel_sdp);
enable_board_wakeup_source();
usb_ehci_init(&ehci_pdata);
usb_ehci_init(&usbhs_bdata);
}

MACHINE_START(OMAP_3630SDP, "OMAP 3630SDP board")
Expand Down
10 changes: 5 additions & 5 deletions arch/arm/mach-omap2/board-4430sdp.c
Original file line number Diff line number Diff line change
Expand Up @@ -251,10 +251,10 @@ static void __init omap_4430sdp_init_irq(void)
gic_init_irq();
}

static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
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,
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
.phy_reset = false,
.reset_gpio_port[0] = -EINVAL,
.reset_gpio_port[1] = -EINVAL,
Expand Down Expand Up @@ -584,7 +584,7 @@ static void __init omap_4430sdp_init(void)
else
gpio_direction_output(OMAP4SDP_MDM_PWR_EN_GPIO, 1);

usb_ehci_init(&ehci_pdata);
usb_ehci_init(&usbhs_bdata);
usb_musb_init(&musb_board_data);

status = omap_ethernet_init();
Expand Down
10 changes: 5 additions & 5 deletions arch/arm/mach-omap2/board-am3517crane.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ static void __init am3517_crane_init_irq(void)
omap_init_irq();
}

static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {
.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
static struct usbhs_omap_board_data usbhs_bdata __initdata = {
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
.port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,

.phy_reset = true,
.reset_gpio_port[0] = GPIO_USB_NRESET,
Expand Down Expand Up @@ -103,7 +103,7 @@ static void __init am3517_crane_init(void)
return;
}

usb_ehci_init(&ehci_pdata);
usb_ehci_init(&usbhs_bdata);
}

MACHINE_START(CRANEBOARD, "AM3517/05 CRANEBOARD")
Expand Down
12 changes: 6 additions & 6 deletions arch/arm/mach-omap2/board-am3517evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,15 +430,15 @@ static __init void am3517_evm_musb_init(void)
usb_musb_init(&musb_board_data);
}

static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
#if defined(CONFIG_PANEL_SHARP_LQ043T1DG01) || \
defined(CONFIG_PANEL_SHARP_LQ043T1DG01_MODULE)
.port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
.port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
#else
.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
#endif
.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,

.phy_reset = true,
.reset_gpio_port[0] = 57,
Expand Down Expand Up @@ -502,7 +502,7 @@ static void __init am3517_evm_init(void)

/* Configure GPIO for EHCI port */
omap_mux_init_gpio(57, OMAP_PIN_OUTPUT);
usb_ehci_init(&ehci_pdata);
usb_ehci_init(&usbhs_bdata);
am3517_evm_hecc_init(&am3517_evm_hecc_pdata);
/* DSS */
am3517_evm_display_init();
Expand Down
10 changes: 5 additions & 5 deletions arch/arm/mach-omap2/board-cm-t35.c
Original file line number Diff line number Diff line change
Expand Up @@ -605,10 +605,10 @@ static struct omap2_hsmmc_info mmc[] = {
{} /* Terminator */
};

static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {
.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
static struct usbhs_omap_board_data usbhs_bdata __initdata = {
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,

.phy_reset = true,
.reset_gpio_port[0] = OMAP_MAX_GPIO_LINES + 6,
Expand Down Expand Up @@ -810,7 +810,7 @@ static void __init cm_t35_init(void)
cm_t35_init_display();

usb_musb_init(&musb_board_data);
usb_ehci_init(&ehci_pdata);
usb_ehci_init(&usbhs_bdata);
}

MACHINE_START(CM_T35, "Compulab CM-T35")
Expand Down
8 changes: 4 additions & 4 deletions arch/arm/mach-omap2/board-cm-t3517.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ static inline void cm_t3517_init_rtc(void) {}
#define HSUSB2_RESET_GPIO (147)
#define USB_HUB_RESET_GPIO (152)

static struct ehci_hcd_omap_platform_data cm_t3517_ehci_pdata __initdata = {
.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
static struct usbhs_omap_board_data cm_t3517_ehci_pdata __initdata = {
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,

.phy_reset = true,
.reset_gpio_port[0] = HSUSB1_RESET_GPIO,
Expand Down
10 changes: 5 additions & 5 deletions arch/arm/mach-omap2/board-devkit8000.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,11 +620,11 @@ static struct omap_musb_board_data musb_board_data = {
.power = 100,
};

static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
static const struct usbhs_omap_board_data usbhs_bdata __initconst = {

.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
.port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,

.phy_reset = true,
.reset_gpio_port[0] = -EINVAL,
Expand Down Expand Up @@ -803,7 +803,7 @@ static void __init devkit8000_init(void)
devkit8000_ads7846_init();

usb_musb_init(&musb_board_data);
usb_ehci_init(&ehci_pdata);
usb_ehci_init(&usbhs_bdata);
devkit8000_flash_init();

/* Ensure SDRC pins are mux'd for self-refresh */
Expand Down
10 changes: 5 additions & 5 deletions arch/arm/mach-omap2/board-igep0020.c
Original file line number Diff line number Diff line change
Expand Up @@ -627,10 +627,10 @@ static struct omap_musb_board_data musb_board_data = {
.power = 100,
};

static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
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,
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,

.phy_reset = true,
.reset_gpio_port[0] = IGEP2_GPIO_USBH_NRESET,
Expand Down Expand Up @@ -699,7 +699,7 @@ static void __init igep2_init(void)
platform_add_devices(igep2_devices, ARRAY_SIZE(igep2_devices));
omap_serial_init();
usb_musb_init(&musb_board_data);
usb_ehci_init(&ehci_pdata);
usb_ehci_init(&usbhs_bdata);

igep2_flash_init();
igep2_leds_init();
Expand Down
10 changes: 5 additions & 5 deletions arch/arm/mach-omap2/board-igep0030.c
Original file line number Diff line number Diff line change
Expand Up @@ -408,10 +408,10 @@ static void __init igep3_wifi_bt_init(void)
void __init igep3_wifi_bt_init(void) {}
#endif

static const 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,
.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
static const struct usbhs_omap_board_data usbhs_bdata __initconst = {
.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,

.phy_reset = true,
.reset_gpio_port[0] = -EINVAL,
Expand All @@ -435,7 +435,7 @@ static void __init igep3_init(void)
platform_add_devices(igep3_devices, ARRAY_SIZE(igep3_devices));
omap_serial_init();
usb_musb_init(&musb_board_data);
usb_ehci_init(&ehci_pdata);
usb_ehci_init(&usbhs_bdata);

igep3_flash_init();
igep3_leds_init();
Expand Down
10 changes: 5 additions & 5 deletions arch/arm/mach-omap2/board-omap3beagle.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,11 +586,11 @@ static void __init omap3beagle_flash_init(void)
}
}

static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
static const struct usbhs_omap_board_data usbhs_bdata __initconst = {

.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,

.phy_reset = true,
.reset_gpio_port[0] = -EINVAL,
Expand Down Expand Up @@ -625,7 +625,7 @@ static void __init omap3_beagle_init(void)
gpio_direction_output(170, true);

usb_musb_init(&musb_board_data);
usb_ehci_init(&ehci_pdata);
usb_ehci_init(&usbhs_bdata);
omap3beagle_flash_init();

/* Ensure SDRC pins are mux'd for self-refresh */
Expand Down
14 changes: 7 additions & 7 deletions arch/arm/mach-omap2/board-omap3evm.c
Original file line number Diff line number Diff line change
Expand Up @@ -638,11 +638,11 @@ static struct platform_device *omap3_evm_devices[] __initdata = {
&omap3_evm_dss_device,
};

static struct ehci_hcd_omap_platform_data ehci_pdata __initdata = {
static struct usbhs_omap_board_data usbhs_bdata __initdata = {

.port_mode[0] = EHCI_HCD_OMAP_MODE_UNKNOWN,
.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,

.phy_reset = true,
/* PHY reset GPIO will be runtime programmed based on EVM version */
Expand Down Expand Up @@ -700,18 +700,18 @@ static void __init omap3_evm_init(void)

/* setup EHCI phy reset config */
omap_mux_init_gpio(21, OMAP_PIN_INPUT_PULLUP);
ehci_pdata.reset_gpio_port[1] = 21;
usbhs_bdata.reset_gpio_port[1] = 21;

/* EVM REV >= E can supply 500mA with EXTVBUS programming */
musb_board_data.power = 500;
musb_board_data.extvbus = 1;
} else {
/* setup EHCI phy reset on MDC */
omap_mux_init_gpio(135, OMAP_PIN_OUTPUT);
ehci_pdata.reset_gpio_port[1] = 135;
usbhs_bdata.reset_gpio_port[1] = 135;
}
usb_musb_init(&musb_board_data);
usb_ehci_init(&ehci_pdata);
usb_ehci_init(&usbhs_bdata);
ads7846_dev_init();
omap3evm_init_smsc911x();
omap3_evm_display_init();
Expand Down
10 changes: 5 additions & 5 deletions arch/arm/mach-omap2/board-omap3pandora.c
Original file line number Diff line number Diff line change
Expand Up @@ -681,11 +681,11 @@ static struct platform_device *omap3pandora_devices[] __initdata = {
&pandora_vwlan_device,
};

static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
static const struct usbhs_omap_board_data usbhs_bdata __initconst = {

.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[1] = EHCI_HCD_OMAP_MODE_UNKNOWN,
.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
.port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,

.phy_reset = true,
.reset_gpio_port[0] = 16,
Expand Down Expand Up @@ -716,7 +716,7 @@ static void __init omap3pandora_init(void)
spi_register_board_info(omap3pandora_spi_board_info,
ARRAY_SIZE(omap3pandora_spi_board_info));
omap3pandora_ads7846_init();
usb_ehci_init(&ehci_pdata);
usb_ehci_init(&usbhs_bdata);
usb_musb_init(&musb_board_data);
gpmc_nand_init(&pandora_nand_data);

Expand Down
10 changes: 5 additions & 5 deletions arch/arm/mach-omap2/board-omap3stalker.c
Original file line number Diff line number Diff line change
Expand Up @@ -608,10 +608,10 @@ static struct platform_device *omap3_stalker_devices[] __initdata = {
&keys_gpio,
};

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,
.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
static struct usbhs_omap_board_data usbhs_bdata __initconst = {
.port_mode[0] = OMAP_USBHS_PORT_MODE_UNUSED,
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,

.phy_reset = true,
.reset_gpio_port[0] = -EINVAL,
Expand Down Expand Up @@ -649,7 +649,7 @@ static void __init omap3_stalker_init(void)

omap_serial_init();
usb_musb_init(&musb_board_data);
usb_ehci_init(&ehci_pdata);
usb_ehci_init(&usbhs_bdata);
ads7846_dev_init();

omap_mux_init_gpio(21, OMAP_PIN_OUTPUT);
Expand Down
10 changes: 5 additions & 5 deletions arch/arm/mach-omap2/board-omap3touchbook.c
Original file line number Diff line number Diff line change
Expand Up @@ -468,11 +468,11 @@ static void __init omap3touchbook_flash_init(void)
}
}

static const struct ehci_hcd_omap_platform_data ehci_pdata __initconst = {
static const struct usbhs_omap_board_data usbhs_bdata __initconst = {

.port_mode[0] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[1] = EHCI_HCD_OMAP_MODE_PHY,
.port_mode[2] = EHCI_HCD_OMAP_MODE_UNKNOWN,
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
.port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
.port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,

.phy_reset = true,
.reset_gpio_port[0] = -EINVAL,
Expand Down Expand Up @@ -527,7 +527,7 @@ static void __init omap3_touchbook_init(void)
ARRAY_SIZE(omap3_ads7846_spi_board_info));
omap3_ads7846_init();
usb_musb_init(&musb_board_data);
usb_ehci_init(&ehci_pdata);
usb_ehci_init(&usbhs_bdata);
omap3touchbook_flash_init();

/* Ensure SDRC pins are mux'd for self-refresh */
Expand Down
Loading

0 comments on commit 181b250

Please sign in to comment.