Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 217013
b: refs/heads/master
c: a7c8875
h: refs/heads/master
i:
  217011: 8a15d52
v: v3
  • Loading branch information
Tony Lindgren committed Oct 8, 2010
1 parent 01ac553 commit 4dd3e0e
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4367260c0bc1773c00b2309a31b31657cabfda3f
refs/heads/master: a7c887510073b2f403e123f2befa40bf93554df9
69 changes: 63 additions & 6 deletions trunk/arch/arm/mach-omap2/board-omap4panda.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,9 @@
#include "hsmmc.h"
#include "control.h"

#define GPIO_HUB_POWER 1
#define GPIO_HUB_NRESET 62

static struct gpio_led gpio_leds[] = {
{
.name = "pandaboard::status1",
Expand Down Expand Up @@ -78,6 +81,56 @@ static void __init omap4_panda_init_irq(void)
omap_gpio_init();
}

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,
.phy_reset = false,
.reset_gpio_port[0] = -EINVAL,
.reset_gpio_port[1] = -EINVAL,
.reset_gpio_port[2] = -EINVAL
};

static void __init omap4_ehci_init(void)
{
int ret;


/* disable the power to the usb hub prior to init */
ret = gpio_request(GPIO_HUB_POWER, "hub_power");
if (ret) {
pr_err("Cannot request GPIO %d\n", GPIO_HUB_POWER);
goto error1;
}
gpio_export(GPIO_HUB_POWER, 0);
gpio_direction_output(GPIO_HUB_POWER, 0);
gpio_set_value(GPIO_HUB_POWER, 0);

/* reset phy+hub */
ret = gpio_request(GPIO_HUB_NRESET, "hub_nreset");
if (ret) {
pr_err("Cannot request GPIO %d\n", GPIO_HUB_NRESET);
goto error2;
}
gpio_export(GPIO_HUB_NRESET, 0);
gpio_direction_output(GPIO_HUB_NRESET, 0);
gpio_set_value(GPIO_HUB_NRESET, 0);
gpio_set_value(GPIO_HUB_NRESET, 1);

usb_ehci_init(&ehci_pdata);

/* enable power to hub */
gpio_set_value(GPIO_HUB_POWER, 1);
return;

error2:
gpio_free(GPIO_HUB_POWER);
error1:
pr_err("Unable to initialize EHCI power/reset\n");
return;

}

static struct omap_musb_board_data musb_board_data = {
.interface_type = MUSB_INTERFACE_UTMI,
.mode = MUSB_PERIPHERAL,
Expand All @@ -98,10 +151,6 @@ static struct regulator_consumer_supply omap4_panda_vmmc_supply[] = {
.supply = "vmmc",
.dev_name = "mmci-omap-hs.0",
},
{
.supply = "vmmc",
.dev_name = "mmci-omap-hs.1",
},
};

static int omap4_twl6030_hsmmc_late_init(struct device *dev)
Expand All @@ -120,7 +169,14 @@ static int omap4_twl6030_hsmmc_late_init(struct device *dev)

static __init void omap4_twl6030_hsmmc_set_late_init(struct device *dev)
{
struct omap_mmc_platform_data *pdata = dev->platform_data;
struct omap_mmc_platform_data *pdata;

/* dev can be null if CONFIG_MMC_OMAP_HS is not set */
if (!dev) {
pr_err("Failed omap4_twl6030_hsmmc_set_late_init\n");
return;
}
pdata = dev->platform_data;

pdata->init = omap4_twl6030_hsmmc_late_init;
}
Expand Down Expand Up @@ -187,7 +243,7 @@ static struct regulator_init_data omap4_panda_vmmc = {
| REGULATOR_CHANGE_MODE
| REGULATOR_CHANGE_STATUS,
},
.num_consumer_supplies = 2,
.num_consumer_supplies = 1,
.consumer_supplies = omap4_panda_vmmc_supply,
};

Expand Down Expand Up @@ -311,6 +367,7 @@ static void __init omap4_panda_init(void)
omap4_twl6030_hsmmc_init(mmc);
/* OMAP4 Panda uses internal transceiver so register nop transceiver */
usb_nop_xceiv_register();
omap4_ehci_init();
/* FIXME: allow multi-omap to boot until musb is updated for omap4 */
if (!cpu_is_omap44xx())
usb_musb_init(&musb_board_data);
Expand Down

0 comments on commit 4dd3e0e

Please sign in to comment.