[PATCH] tusb6010: Use clkdev to initialize the clock

From: Tony Lindgren
Date: Tue Dec 29 2009 - 14:04:58 EST


Note that in this case the clock is fck, not ick
like for musb.

Signed-off-by: Tony Lindgren <tony@xxxxxxxxxxx>

diff --git a/arch/arm/mach-omap2/board-n8x0-usb.c b/arch/arm/mach-omap2/board-n8x0-usb.c
index 2254ebd..e67eabf 100644
--- a/arch/arm/mach-omap2/board-n8x0-usb.c
+++ b/arch/arm/mach-omap2/board-n8x0-usb.c
@@ -25,7 +25,6 @@
#define GPIO_TUSB_ENABLE 0

static int tusb_set_power(int state);
-static int tusb_set_clock(struct clk *osc_ck, int state);

#if defined(CONFIG_USB_MUSB_OTG)
# define BOARD_MODE MUSB_OTG
@@ -82,10 +81,8 @@ static struct musb_hdrc_config musb_config = {
static struct musb_hdrc_platform_data tusb_data = {
.mode = BOARD_MODE,
.set_power = tusb_set_power,
- .set_clock = tusb_set_clock,
.min_power = 25, /* x2 = 50 mA drawn from VBUS as peripheral */
.power = 100, /* Max 100 mA VBUS for host mode */
- .clock = "osc_ck",
.config = &musb_config,
};

@@ -121,27 +118,6 @@ static int tusb_set_power(int state)
return retval;
}

-static int osc_ck_on;
-
-static int tusb_set_clock(struct clk *osc_ck, int state)
-{
- if (state) {
- if (osc_ck_on > 0)
- return -ENODEV;
-
- clk_enable(osc_ck);
- osc_ck_on = 1;
- } else {
- if (osc_ck_on == 0)
- return -ENODEV;
-
- clk_disable(osc_ck);
- osc_ck_on = 0;
- }
-
- return 0;
-}
-
void __init n8x0_usb_init(void)
{
int ret = 0;
@@ -156,6 +132,12 @@ void __init n8x0_usb_init(void)
}
gpio_direction_output(GPIO_TUSB_ENABLE, 0);

+ /*
+ * REVISIT: This line can be removed once all the platforms using
+ * musb_core.c have been converted to use use clkdev.
+ */
+ tusb_data.clock = "fck";
+
tusb_set_power(0);

ret = tusb6010_setup_interface(&tusb_data, TUSB6010_REFCLK_19, 2,
diff --git a/arch/arm/mach-omap2/clock2xxx_data.c b/arch/arm/mach-omap2/clock2xxx_data.c
index 97dc7cf..e9c8f09 100644
--- a/arch/arm/mach-omap2/clock2xxx_data.c
+++ b/arch/arm/mach-omap2/clock2xxx_data.c
@@ -2222,6 +2222,7 @@ static struct omap_clk omap24xx_clks[] = {
CLK(NULL, "aes_ick", &aes_ick, CK_243X | CK_242X),
CLK(NULL, "pka_ick", &pka_ick, CK_243X | CK_242X),
CLK(NULL, "usb_fck", &usb_fck, CK_243X | CK_242X),
+ CLK("musb_hdrc", "fck", &osc_ck, CK_242X),
CLK("musb_hdrc", "ick", &usbhs_ick, CK_243X),
CLK("mmci-omap-hs.0", "ick", &mmchs1_ick, CK_243X),
CLK("mmci-omap-hs.0", "fck", &mmchs1_fck, CK_243X),

--1UWUbFP1cBYEclgG--
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/