diff options
author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-09-05 10:22:45 -0400 |
---|---|---|
committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2012-09-05 10:22:45 -0400 |
commit | 593d0a3e9f813db910dc50574532914db21d09ff (patch) | |
tree | 12d8413ee57b4383ca8c906996ffe02be6d377a5 /arch/arm/mach-exynos/setup-usb-phy.c | |
parent | 50e900417b8096939d12a46848f965e27a905e36 (diff) | |
parent | 4cb38750d49010ae72e718d46605ac9ba5a851b4 (diff) |
Merge commit '4cb38750d49010ae72e718d46605ac9ba5a851b4' into stable/for-linus-3.6
* commit '4cb38750d49010ae72e718d46605ac9ba5a851b4': (6849 commits)
bcma: fix invalid PMU chip control masks
[libata] pata_cmd64x: whitespace cleanup
libata-acpi: fix up for acpi_pm_device_sleep_state API
sata_dwc_460ex: device tree may specify dma_channel
ahci, trivial: fixed coding style issues related to braces
ahci_platform: add hibernation callbacks
libata-eh.c: local functions should not be exposed globally
libata-transport.c: local functions should not be exposed globally
sata_dwc_460ex: support hardreset
ata: use module_pci_driver
drivers/ata/pata_pcmcia.c: adjust suspicious bit operation
pata_imx: Convert to clk_prepare_enable/clk_disable_unprepare
ahci: Enable SB600 64bit DMA on MSI K9AGM2 (MS-7327) v2
[libata] Prevent interface errors with Seagate FreeAgent GoFlex
drivers/acpi/glue: revert accidental license-related 6b66d95895c bits
libata-acpi: add missing inlines in libata.h
i2c-omap: Add support for I2C_M_STOP message flag
i2c: Fall back to emulated SMBus if the operation isn't supported natively
i2c: Add SCCB support
i2c-tiny-usb: Add support for the Robofuzz OSIF USB/I2C converter
...
Diffstat (limited to 'arch/arm/mach-exynos/setup-usb-phy.c')
-rw-r--r-- | arch/arm/mach-exynos/setup-usb-phy.c | 60 |
1 files changed, 44 insertions, 16 deletions
diff --git a/arch/arm/mach-exynos/setup-usb-phy.c b/arch/arm/mach-exynos/setup-usb-phy.c index 1af0a7f44e00..b81cc569a8dd 100644 --- a/arch/arm/mach-exynos/setup-usb-phy.c +++ b/arch/arm/mach-exynos/setup-usb-phy.c | |||
@@ -31,27 +31,55 @@ static void exynos4210_usb_phy_clkset(struct platform_device *pdev) | |||
31 | struct clk *xusbxti_clk; | 31 | struct clk *xusbxti_clk; |
32 | u32 phyclk; | 32 | u32 phyclk; |
33 | 33 | ||
34 | /* set clock frequency for PLL */ | ||
35 | phyclk = readl(EXYNOS4_PHYCLK) & ~CLKSEL_MASK; | ||
36 | |||
37 | xusbxti_clk = clk_get(&pdev->dev, "xusbxti"); | 34 | xusbxti_clk = clk_get(&pdev->dev, "xusbxti"); |
38 | if (xusbxti_clk && !IS_ERR(xusbxti_clk)) { | 35 | if (xusbxti_clk && !IS_ERR(xusbxti_clk)) { |
39 | switch (clk_get_rate(xusbxti_clk)) { | 36 | if (soc_is_exynos4210()) { |
40 | case 12 * MHZ: | 37 | /* set clock frequency for PLL */ |
41 | phyclk |= CLKSEL_12M; | 38 | phyclk = readl(EXYNOS4_PHYCLK) & ~EXYNOS4210_CLKSEL_MASK; |
42 | break; | 39 | |
43 | case 24 * MHZ: | 40 | switch (clk_get_rate(xusbxti_clk)) { |
44 | phyclk |= CLKSEL_24M; | 41 | case 12 * MHZ: |
45 | break; | 42 | phyclk |= EXYNOS4210_CLKSEL_12M; |
46 | default: | 43 | break; |
47 | case 48 * MHZ: | 44 | case 48 * MHZ: |
48 | /* default reference clock */ | 45 | phyclk |= EXYNOS4210_CLKSEL_48M; |
49 | break; | 46 | break; |
47 | default: | ||
48 | case 24 * MHZ: | ||
49 | phyclk |= EXYNOS4210_CLKSEL_24M; | ||
50 | break; | ||
51 | } | ||
52 | writel(phyclk, EXYNOS4_PHYCLK); | ||
53 | } else if (soc_is_exynos4212() || soc_is_exynos4412()) { | ||
54 | /* set clock frequency for PLL */ | ||
55 | phyclk = readl(EXYNOS4_PHYCLK) & ~EXYNOS4X12_CLKSEL_MASK; | ||
56 | |||
57 | switch (clk_get_rate(xusbxti_clk)) { | ||
58 | case 9600 * KHZ: | ||
59 | phyclk |= EXYNOS4X12_CLKSEL_9600K; | ||
60 | break; | ||
61 | case 10 * MHZ: | ||
62 | phyclk |= EXYNOS4X12_CLKSEL_10M; | ||
63 | break; | ||
64 | case 12 * MHZ: | ||
65 | phyclk |= EXYNOS4X12_CLKSEL_12M; | ||
66 | break; | ||
67 | case 19200 * KHZ: | ||
68 | phyclk |= EXYNOS4X12_CLKSEL_19200K; | ||
69 | break; | ||
70 | case 20 * MHZ: | ||
71 | phyclk |= EXYNOS4X12_CLKSEL_20M; | ||
72 | break; | ||
73 | default: | ||
74 | case 24 * MHZ: | ||
75 | /* default reference clock */ | ||
76 | phyclk |= EXYNOS4X12_CLKSEL_24M; | ||
77 | break; | ||
78 | } | ||
79 | writel(phyclk, EXYNOS4_PHYCLK); | ||
50 | } | 80 | } |
51 | clk_put(xusbxti_clk); | 81 | clk_put(xusbxti_clk); |
52 | } | 82 | } |
53 | |||
54 | writel(phyclk, EXYNOS4_PHYCLK); | ||
55 | } | 83 | } |
56 | 84 | ||
57 | static int exynos4210_usb_phy0_init(struct platform_device *pdev) | 85 | static int exynos4210_usb_phy0_init(struct platform_device *pdev) |