Re: [PATCH] OMAP2: add USB platform data and initialization forNokia N800 and N810

From: Tony Lindgren
Date: Tue Dec 29 2009 - 14:24:17 EST


Hi,

* Luke-Jr <luke@xxxxxxxxxx> [091228 23:51]:
> Add platform data and initialization for USB on Nokia N800 and N810 devices
> via the TUSB6010 chipset.
>
> Tested on Nokia N810 in Linux-OMAP tree. Mainline is not bootable yet.
>
> Signed-off-by: Luke Dashjr <luke_linuxkern@xxxxxxxxxx>
> ---
> arch/arm/mach-omap2/Kconfig | 5 +
> arch/arm/mach-omap2/Makefile | 1 +
> arch/arm/mach-omap2/board-n8x0-usb.c | 173 ++++++++++++++++++++++++++++++++++
> arch/arm/mach-omap2/board-n8x0.c | 8 ++
> 4 files changed, 187 insertions(+), 0 deletions(-)
> create mode 100644 arch/arm/mach-omap2/board-n8x0-usb.c
>

<snip>

> diff --git a/arch/arm/mach-omap2/board-n8x0-usb.c b/arch/arm/mach-omap2/board-n8x0-usb.c
> new file mode 100644
> index 0000000..2254ebd
> --- /dev/null
> +++ b/arch/arm/mach-omap2/board-n8x0-usb.c

<snip>

> +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;
> +}

Great. The comment from Russell earlier was that we should be now using
clkdev to do things like this and get rid of the _set_clock functions.
In musb_core.c are already using the clk directly if set_clock is NULL.

Can you try the patch below? If it works, just merge it into your
patch.

Regards,

Tony