From 7c4667f203624e1a56d6982d367c151b7955addf Mon Sep 17 00:00:00 2001 From: wlf Date: Thu, 17 Apr 2014 17:58:59 +0800 Subject: [PATCH] USB: set usbphy_480m clk rate 480MHz. --- arch/arm/boot/dts/rk3288.dtsi | 6 ++++-- drivers/usb/dwc_otg_310/dwc_otg_driver.c | 1 + drivers/usb/dwc_otg_310/usbdev_rk.h | 1 + drivers/usb/dwc_otg_310/usbdev_rk32.c | 9 ++++++++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi index 680af0815de1..dfd935e35df0 100755 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -1049,8 +1049,10 @@ compatible = "rockchip,rk3288_usb20_host"; reg = <0xff540000 0x40000>; interrupts = ; - clocks = <&clk_gates13 6>, <&clk_gates7 7>; - clock-names = "clk_usbphy1", "hclk_usb1"; + clocks = <&clk_gates13 6>, <&clk_gates7 7>, + <&usbphy_480m>; + clock-names = "clk_usbphy1", "hclk_usb1", + "usbphy_480m"; }; usb2: usb@ff500000 { diff --git a/drivers/usb/dwc_otg_310/dwc_otg_driver.c b/drivers/usb/dwc_otg_310/dwc_otg_driver.c index 47c2f48cfc62..93d1d2ea401b 100755 --- a/drivers/usb/dwc_otg_310/dwc_otg_driver.c +++ b/drivers/usb/dwc_otg_310/dwc_otg_driver.c @@ -1141,6 +1141,7 @@ static int host20_driver_probe(struct platform_device *_dev) goto fail; } + clk_set_rate(pldata->phyclk_480m, 480000000); /* * Enable the global interrupt after all the interrupt * handlers are installed if there is no ADP support else diff --git a/drivers/usb/dwc_otg_310/usbdev_rk.h b/drivers/usb/dwc_otg_310/usbdev_rk.h index 8f49ced01bd7..16d447be9305 100755 --- a/drivers/usb/dwc_otg_310/usbdev_rk.h +++ b/drivers/usb/dwc_otg_310/usbdev_rk.h @@ -57,6 +57,7 @@ struct dwc_otg_platform_data { struct clk* phyclk; struct clk* ahbclk; struct clk* busclk; + struct clk* phyclk_480m; int phy_status; void (*hw_init)(void); void (*phy_suspend)(void* pdata, int suspend); diff --git a/drivers/usb/dwc_otg_310/usbdev_rk32.c b/drivers/usb/dwc_otg_310/usbdev_rk32.c index 278d1c49c2d5..3298a478f5e1 100755 --- a/drivers/usb/dwc_otg_310/usbdev_rk32.c +++ b/drivers/usb/dwc_otg_310/usbdev_rk32.c @@ -215,7 +215,7 @@ static void usb20host_soft_reset(void) static void usb20host_clock_init(void* pdata) { struct dwc_otg_platform_data *usbpdata=pdata; - struct clk* ahbclk,*phyclk; + struct clk* ahbclk, *phyclk, *phyclk_480m; ahbclk = devm_clk_get(usbpdata->dev, "hclk_usb1"); if (IS_ERR(ahbclk)) { @@ -229,8 +229,15 @@ static void usb20host_clock_init(void* pdata) return; } + phyclk_480m = devm_clk_get(usbpdata->dev, "usbphy_480m"); + if (IS_ERR(phyclk_480m)) { + dev_err(usbpdata->dev, "Failed to get usbphy_480m\n"); + return; + } + usbpdata->phyclk = phyclk; usbpdata->ahbclk = ahbclk; + usbpdata->phyclk_480m = phyclk_480m; } static void usb20host_clock_enable(void* pdata, int enable) -- 2.34.1