Commit 84337b63 authored by Roger Quadros's avatar Roger Quadros Committed by Tony Lindgren

ARM: OMAP2+: omap4panda: Adapt to ehci-omap changes

Use usbhs_init_phys() to register the PHY's VCC and RESET
regulators and the NOP PHY device.

Get rid of managing the PHY clock as it will be done by the PHY driver.
For that to work we create a clock alias that links the PHY clock name
to the PHY device name.
Signed-off-by: default avatarRoger Quadros <rogerq@ti.com>
Signed-off-by: default avatarTony Lindgren <tony@atomide.com>
parent 5ecd52e5
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#include <linux/ti_wilink_st.h> #include <linux/ti_wilink_st.h>
#include <linux/usb/musb.h> #include <linux/usb/musb.h>
#include <linux/usb/phy.h> #include <linux/usb/phy.h>
#include <linux/usb/nop-usb-xceiv.h>
#include <linux/wl12xx.h> #include <linux/wl12xx.h>
#include <linux/irqchip/arm-gic.h> #include <linux/irqchip/arm-gic.h>
#include <linux/platform_data/omap-abe-twl6040.h> #include <linux/platform_data/omap-abe-twl6040.h>
...@@ -132,6 +133,22 @@ static struct platform_device btwilink_device = { ...@@ -132,6 +133,22 @@ static struct platform_device btwilink_device = {
.id = -1, .id = -1,
}; };
/* PHY device on HS USB Port 1 i.e. nop_usb_xceiv.1 */
static struct nop_usb_xceiv_platform_data hsusb1_phy_data = {
/* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */
.clk_rate = 19200000,
};
static struct usbhs_phy_data phy_data[] __initdata = {
{
.port = 1,
.reset_gpio = GPIO_HUB_NRESET,
.vcc_gpio = GPIO_HUB_POWER,
.vcc_polarity = 1,
.platform_data = &hsusb1_phy_data,
},
};
static struct platform_device *panda_devices[] __initdata = { static struct platform_device *panda_devices[] __initdata = {
&leds_gpio, &leds_gpio,
&wl1271_device, &wl1271_device,
...@@ -142,49 +159,19 @@ static struct platform_device *panda_devices[] __initdata = { ...@@ -142,49 +159,19 @@ static struct platform_device *panda_devices[] __initdata = {
static struct usbhs_omap_platform_data usbhs_bdata __initdata = { static struct usbhs_omap_platform_data usbhs_bdata __initdata = {
.port_mode[0] = OMAP_EHCI_PORT_MODE_PHY, .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,
.reset_gpio_port[2] = -EINVAL
};
static struct gpio panda_ehci_gpios[] __initdata = {
{ GPIO_HUB_POWER, GPIOF_OUT_INIT_LOW, "hub_power" },
{ GPIO_HUB_NRESET, GPIOF_OUT_INIT_LOW, "hub_nreset" },
}; };
static void __init omap4_ehci_init(void) static void __init omap4_ehci_init(void)
{ {
int ret; int ret;
struct clk *phy_ref_clk;
/* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */ /* FREF_CLK3 provides the 19.2 MHz reference clock to the PHY */
phy_ref_clk = clk_get(NULL, "auxclk3_ck"); ret = clk_add_alias("main_clk", "nop_usb_xceiv.1", "auxclk3_ck", NULL);
if (IS_ERR(phy_ref_clk)) { if (ret)
pr_err("Cannot request auxclk3\n"); pr_err("Failed to add main_clk alias to auxclk3_ck\n");
return;
}
clk_set_rate(phy_ref_clk, 19200000);
clk_prepare_enable(phy_ref_clk);
/* disable the power to the usb hub prior to init and reset phy+hub */
ret = gpio_request_array(panda_ehci_gpios,
ARRAY_SIZE(panda_ehci_gpios));
if (ret) {
pr_err("Unable to initialize EHCI power/reset\n");
return;
}
gpio_export(GPIO_HUB_POWER, 0);
gpio_export(GPIO_HUB_NRESET, 0);
gpio_set_value(GPIO_HUB_NRESET, 1);
usbhs_init_phys(phy_data, ARRAY_SIZE(phy_data));
usbhs_init(&usbhs_bdata); usbhs_init(&usbhs_bdata);
/* enable power to hub */
gpio_set_value(GPIO_HUB_POWER, 1);
} }
static struct omap_musb_board_data musb_board_data = { static struct omap_musb_board_data musb_board_data = {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment