USB: musb: blackfin: push clkin value to platform resources
authorBob Liu <lliubbo@gmail.com>
Sat, 23 Oct 2010 10:12:01 +0000 (05:12 -0500)
committerFelipe Balbi <balbi@ti.com>
Fri, 5 Nov 2010 12:13:32 +0000 (14:13 +0200)
In order to not touch the driver file for different xtal usage,
push the clkin value to board file and calculate the register
value instead of hardcoding it.

Signed-off-by: Bob Liu <lliubbo@gmail.com>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Felipe Balbi <balbi@ti.com>
drivers/usb/musb/blackfin.c
include/linux/usb/musb.h

index ade45a219c47f222de6a5570d6739e4d7161e5df..fcb5206a65bdfd84eca43a39ce974f20489e2c80 100644 (file)
@@ -337,7 +337,8 @@ static void musb_platform_reg_init(struct musb *musb)
        }
 
        /* Configure PLL oscillator register */
-       bfin_write_USB_PLLOSC_CTRL(0x30a8);
+       bfin_write_USB_PLLOSC_CTRL(0x3080 |
+                       ((480/musb->config->clkin) << 1));
        SSYNC();
 
        bfin_write_USB_SRP_CLKDIV((get_sclk()/1000) / 32 - 1);
index ee2dd1d506ed575cd795963dc8cad50c7aefa419..2387f9fc81381dd517c7d3008de21aeb5790c0da 100644 (file)
@@ -89,6 +89,8 @@ struct musb_hdrc_config {
        /* A GPIO controlling VRSEL in Blackfin */
        unsigned int    gpio_vrsel;
        unsigned int    gpio_vrsel_active;
+       /* musb CLKIN in Blackfin in MHZ */
+       unsigned char   clkin;
 #endif
 
 };