diff options
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/gadget/s3c-hsotg.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/drivers/usb/gadget/s3c-hsotg.c b/drivers/usb/gadget/s3c-hsotg.c index 825b6ca62941..a4e0b0fa0191 100644 --- a/drivers/usb/gadget/s3c-hsotg.c +++ b/drivers/usb/gadget/s3c-hsotg.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/delay.h> | 25 | #include <linux/delay.h> |
26 | #include <linux/io.h> | 26 | #include <linux/io.h> |
27 | #include <linux/slab.h> | 27 | #include <linux/slab.h> |
28 | #include <linux/clk.h> | ||
28 | 29 | ||
29 | #include <linux/usb/ch9.h> | 30 | #include <linux/usb/ch9.h> |
30 | #include <linux/usb/gadget.h> | 31 | #include <linux/usb/gadget.h> |
@@ -2798,6 +2799,7 @@ static void __devinit s3c_hsotg_initep(struct s3c_hsotg *hsotg, | |||
2798 | */ | 2799 | */ |
2799 | static void s3c_hsotg_otgreset(struct s3c_hsotg *hsotg) | 2800 | static void s3c_hsotg_otgreset(struct s3c_hsotg *hsotg) |
2800 | { | 2801 | { |
2802 | struct clk *xusbxti; | ||
2801 | u32 osc; | 2803 | u32 osc; |
2802 | 2804 | ||
2803 | writel(0, S3C_PHYPWR); | 2805 | writel(0, S3C_PHYPWR); |
@@ -2805,6 +2807,23 @@ static void s3c_hsotg_otgreset(struct s3c_hsotg *hsotg) | |||
2805 | 2807 | ||
2806 | osc = hsotg->plat->is_osc ? S3C_PHYCLK_EXT_OSC : 0; | 2808 | osc = hsotg->plat->is_osc ? S3C_PHYCLK_EXT_OSC : 0; |
2807 | 2809 | ||
2810 | xusbxti = clk_get(hsotg->dev, "xusbxti"); | ||
2811 | if (xusbxti && !IS_ERR(xusbxti)) { | ||
2812 | switch (clk_get_rate(xusbxti)) { | ||
2813 | case 12*MHZ: | ||
2814 | osc |= S3C_PHYCLK_CLKSEL_12M; | ||
2815 | break; | ||
2816 | case 24*MHZ: | ||
2817 | osc |= S3C_PHYCLK_CLKSEL_24M; | ||
2818 | break; | ||
2819 | default: | ||
2820 | case 48*MHZ: | ||
2821 | /* default reference clock */ | ||
2822 | break; | ||
2823 | } | ||
2824 | clk_put(xusbxti); | ||
2825 | } | ||
2826 | |||
2808 | writel(osc | 0x10, S3C_PHYCLK); | 2827 | writel(osc | 0x10, S3C_PHYCLK); |
2809 | 2828 | ||
2810 | /* issue a full set of resets to the otg and core */ | 2829 | /* issue a full set of resets to the otg and core */ |