aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-exynos
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-17 12:14:21 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2012-05-17 12:14:21 -0400
commit32535bd5637d3152f944f124bcc82d498892ba1b (patch)
tree99d33b58cfec44f4cf95fad5efa75aea0dd7d60b /arch/arm/mach-exynos
parent0b623f871d7c993fac8ad7aaaa8f5f3cdb8ed480 (diff)
parent3a36dd068f4308461661d28e8e14e11e426eba6b (diff)
Merge branch 'v3.5-for-usb' of git://git.kernel.org/pub/scm/linux/kernel/git/kgene/linux-samsung into usb-next
Diffstat (limited to 'arch/arm/mach-exynos')
-rw-r--r--arch/arm/mach-exynos/Kconfig6
-rw-r--r--arch/arm/mach-exynos/clock-exynos5.c2
-rw-r--r--arch/arm/mach-exynos/include/mach/irqs.h1
-rw-r--r--arch/arm/mach-exynos/include/mach/map.h4
-rw-r--r--arch/arm/mach-exynos/include/mach/regs-pmu.h3
-rw-r--r--arch/arm/mach-exynos/mach-nuri.c9
-rw-r--r--arch/arm/mach-exynos/mach-universal_c210.c14
-rw-r--r--arch/arm/mach-exynos/setup-usb-phy.c100
8 files changed, 108 insertions, 31 deletions
diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
index e81c35f936b5..a6a6a9417a01 100644
--- a/arch/arm/mach-exynos/Kconfig
+++ b/arch/arm/mach-exynos/Kconfig
@@ -232,6 +232,9 @@ config MACH_ARMLEX4210
232config MACH_UNIVERSAL_C210 232config MACH_UNIVERSAL_C210
233 bool "Mobile UNIVERSAL_C210 Board" 233 bool "Mobile UNIVERSAL_C210 Board"
234 select CPU_EXYNOS4210 234 select CPU_EXYNOS4210
235 select S5P_HRT
236 select CLKSRC_MMIO
237 select HAVE_SCHED_CLOCK
235 select S5P_GPIO_INT 238 select S5P_GPIO_INT
236 select S5P_DEV_FIMC0 239 select S5P_DEV_FIMC0
237 select S5P_DEV_FIMC1 240 select S5P_DEV_FIMC1
@@ -247,6 +250,7 @@ config MACH_UNIVERSAL_C210
247 select S3C_DEV_I2C1 250 select S3C_DEV_I2C1
248 select S3C_DEV_I2C3 251 select S3C_DEV_I2C3
249 select S3C_DEV_I2C5 252 select S3C_DEV_I2C5
253 select S3C_DEV_USB_HSOTG
250 select S5P_DEV_I2C_HDMIPHY 254 select S5P_DEV_I2C_HDMIPHY
251 select S5P_DEV_MFC 255 select S5P_DEV_MFC
252 select S5P_DEV_ONENAND 256 select S5P_DEV_ONENAND
@@ -259,6 +263,7 @@ config MACH_UNIVERSAL_C210
259 select EXYNOS4_SETUP_SDHCI 263 select EXYNOS4_SETUP_SDHCI
260 select EXYNOS4_SETUP_FIMC 264 select EXYNOS4_SETUP_FIMC
261 select S5P_SETUP_MIPIPHY 265 select S5P_SETUP_MIPIPHY
266 select EXYNOS4_SETUP_USB_PHY
262 help 267 help
263 Machine support for Samsung Mobile Universal S5PC210 Reference 268 Machine support for Samsung Mobile Universal S5PC210 Reference
264 Board. 269 Board.
@@ -277,6 +282,7 @@ config MACH_NURI
277 select S3C_DEV_I2C3 282 select S3C_DEV_I2C3
278 select S3C_DEV_I2C5 283 select S3C_DEV_I2C5
279 select S3C_DEV_I2C6 284 select S3C_DEV_I2C6
285 select S3C_DEV_USB_HSOTG
280 select S5P_DEV_CSIS0 286 select S5P_DEV_CSIS0
281 select S5P_DEV_JPEG 287 select S5P_DEV_JPEG
282 select S5P_DEV_FIMC0 288 select S5P_DEV_FIMC0
diff --git a/arch/arm/mach-exynos/clock-exynos5.c b/arch/arm/mach-exynos/clock-exynos5.c
index 5cd7a8b8868c..7ac6ff4c46bd 100644
--- a/arch/arm/mach-exynos/clock-exynos5.c
+++ b/arch/arm/mach-exynos/clock-exynos5.c
@@ -678,7 +678,7 @@ static struct clk exynos5_clk_pdma1 = {
678 .name = "dma", 678 .name = "dma",
679 .devname = "dma-pl330.1", 679 .devname = "dma-pl330.1",
680 .enable = exynos5_clk_ip_fsys_ctrl, 680 .enable = exynos5_clk_ip_fsys_ctrl,
681 .ctrlbit = (1 << 1), 681 .ctrlbit = (1 << 2),
682}; 682};
683 683
684static struct clk exynos5_clk_mdma1 = { 684static struct clk exynos5_clk_mdma1 = {
diff --git a/arch/arm/mach-exynos/include/mach/irqs.h b/arch/arm/mach-exynos/include/mach/irqs.h
index 591e78521a9f..c02dae7bf4a3 100644
--- a/arch/arm/mach-exynos/include/mach/irqs.h
+++ b/arch/arm/mach-exynos/include/mach/irqs.h
@@ -189,6 +189,7 @@
189#define IRQ_IIC7 EXYNOS4_IRQ_IIC7 189#define IRQ_IIC7 EXYNOS4_IRQ_IIC7
190 190
191#define IRQ_USB_HOST EXYNOS4_IRQ_USB_HOST 191#define IRQ_USB_HOST EXYNOS4_IRQ_USB_HOST
192#define IRQ_OTG EXYNOS4_IRQ_USB_HSOTG
192 193
193#define IRQ_HSMMC0 EXYNOS4_IRQ_HSMMC0 194#define IRQ_HSMMC0 EXYNOS4_IRQ_HSMMC0
194#define IRQ_HSMMC1 EXYNOS4_IRQ_HSMMC1 195#define IRQ_HSMMC1 EXYNOS4_IRQ_HSMMC1
diff --git a/arch/arm/mach-exynos/include/mach/map.h b/arch/arm/mach-exynos/include/mach/map.h
index 6e6d11ff352a..e009a66477f4 100644
--- a/arch/arm/mach-exynos/include/mach/map.h
+++ b/arch/arm/mach-exynos/include/mach/map.h
@@ -130,6 +130,9 @@
130#define EXYNOS4_PA_HSMMC(x) (0x12510000 + ((x) * 0x10000)) 130#define EXYNOS4_PA_HSMMC(x) (0x12510000 + ((x) * 0x10000))
131#define EXYNOS4_PA_DWMCI 0x12550000 131#define EXYNOS4_PA_DWMCI 0x12550000
132 132
133#define EXYNOS4_PA_HSOTG 0x12480000
134#define EXYNOS4_PA_USB_HSPHY 0x125B0000
135
133#define EXYNOS4_PA_SATA 0x12560000 136#define EXYNOS4_PA_SATA 0x12560000
134#define EXYNOS4_PA_SATAPHY 0x125D0000 137#define EXYNOS4_PA_SATAPHY 0x125D0000
135#define EXYNOS4_PA_SATAPHY_CTRL 0x126B0000 138#define EXYNOS4_PA_SATAPHY_CTRL 0x126B0000
@@ -186,6 +189,7 @@
186#define S3C_PA_SPI0 EXYNOS4_PA_SPI0 189#define S3C_PA_SPI0 EXYNOS4_PA_SPI0
187#define S3C_PA_SPI1 EXYNOS4_PA_SPI1 190#define S3C_PA_SPI1 EXYNOS4_PA_SPI1
188#define S3C_PA_SPI2 EXYNOS4_PA_SPI2 191#define S3C_PA_SPI2 EXYNOS4_PA_SPI2
192#define S3C_PA_USB_HSOTG EXYNOS4_PA_HSOTG
189 193
190#define S5P_PA_EHCI EXYNOS4_PA_EHCI 194#define S5P_PA_EHCI EXYNOS4_PA_EHCI
191#define S5P_PA_FIMC0 EXYNOS4_PA_FIMC0 195#define S5P_PA_FIMC0 EXYNOS4_PA_FIMC0
diff --git a/arch/arm/mach-exynos/include/mach/regs-pmu.h b/arch/arm/mach-exynos/include/mach/regs-pmu.h
index 4c53f38b5a9e..d457d052a420 100644
--- a/arch/arm/mach-exynos/include/mach/regs-pmu.h
+++ b/arch/arm/mach-exynos/include/mach/regs-pmu.h
@@ -163,6 +163,9 @@
163#define S5P_CHECK_SLEEP 0x00000BAD 163#define S5P_CHECK_SLEEP 0x00000BAD
164 164
165/* Only for EXYNOS4210 */ 165/* Only for EXYNOS4210 */
166#define S5P_USBDEVICE_PHY_CONTROL S5P_PMUREG(0x0704)
167#define S5P_USBDEVICE_PHY_ENABLE (1 << 0)
168
166#define S5P_USBHOST_PHY_CONTROL S5P_PMUREG(0x0708) 169#define S5P_USBHOST_PHY_CONTROL S5P_PMUREG(0x0708)
167#define S5P_USBHOST_PHY_ENABLE (1 << 0) 170#define S5P_USBHOST_PHY_ENABLE (1 << 0)
168 171
diff --git a/arch/arm/mach-exynos/mach-nuri.c b/arch/arm/mach-exynos/mach-nuri.c
index 2c6d701116bf..a60269d0a119 100644
--- a/arch/arm/mach-exynos/mach-nuri.c
+++ b/arch/arm/mach-exynos/mach-nuri.c
@@ -352,6 +352,7 @@ static struct regulator_consumer_supply __initdata max8997_ldo1_[] = {
352 REGULATOR_SUPPLY("vdd", "s5p-adc"), /* Used by CPU's ADC drv */ 352 REGULATOR_SUPPLY("vdd", "s5p-adc"), /* Used by CPU's ADC drv */
353}; 353};
354static struct regulator_consumer_supply __initdata max8997_ldo3_[] = { 354static struct regulator_consumer_supply __initdata max8997_ldo3_[] = {
355 REGULATOR_SUPPLY("vusb_d", "s3c-hsotg"), /* USB */
355 REGULATOR_SUPPLY("vdd11", "s5p-mipi-csis.0"), /* MIPI */ 356 REGULATOR_SUPPLY("vdd11", "s5p-mipi-csis.0"), /* MIPI */
356}; 357};
357static struct regulator_consumer_supply __initdata max8997_ldo4_[] = { 358static struct regulator_consumer_supply __initdata max8997_ldo4_[] = {
@@ -367,7 +368,7 @@ static struct regulator_consumer_supply __initdata max8997_ldo7_[] = {
367 REGULATOR_SUPPLY("dig_18", "0-001f"), /* HCD803 */ 368 REGULATOR_SUPPLY("dig_18", "0-001f"), /* HCD803 */
368}; 369};
369static struct regulator_consumer_supply __initdata max8997_ldo8_[] = { 370static struct regulator_consumer_supply __initdata max8997_ldo8_[] = {
370 REGULATOR_SUPPLY("vusb_d", NULL), /* Used by CPU */ 371 REGULATOR_SUPPLY("vusb_a", "s3c-hsotg"), /* USB */
371 REGULATOR_SUPPLY("vdac", NULL), /* Used by CPU */ 372 REGULATOR_SUPPLY("vdac", NULL), /* Used by CPU */
372}; 373};
373static struct regulator_consumer_supply __initdata max8997_ldo11_[] = { 374static struct regulator_consumer_supply __initdata max8997_ldo11_[] = {
@@ -823,6 +824,7 @@ static struct regulator_init_data __initdata max8997_esafeout1_data = {
823 .constraints = { 824 .constraints = {
824 .name = "SAFEOUT1", 825 .name = "SAFEOUT1",
825 .valid_ops_mask = REGULATOR_CHANGE_STATUS, 826 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
827 .always_on = 1,
826 .state_mem = { 828 .state_mem = {
827 .disabled = 1, 829 .disabled = 1,
828 }, 830 },
@@ -1080,6 +1082,9 @@ static void __init nuri_ehci_init(void)
1080 s5p_ehci_set_platdata(pdata); 1082 s5p_ehci_set_platdata(pdata);
1081} 1083}
1082 1084
1085/* USB OTG */
1086static struct s3c_hsotg_plat nuri_hsotg_pdata;
1087
1083/* CAMERA */ 1088/* CAMERA */
1084static struct regulator_consumer_supply cam_vt_cam15_supply = 1089static struct regulator_consumer_supply cam_vt_cam15_supply =
1085 REGULATOR_SUPPLY("vdd_core", "6-003c"); 1090 REGULATOR_SUPPLY("vdd_core", "6-003c");
@@ -1292,6 +1297,7 @@ static struct platform_device *nuri_devices[] __initdata = {
1292 &s5p_device_mfc_l, 1297 &s5p_device_mfc_l,
1293 &s5p_device_mfc_r, 1298 &s5p_device_mfc_r,
1294 &s5p_device_fimc_md, 1299 &s5p_device_fimc_md,
1300 &s3c_device_usb_hsotg,
1295 1301
1296 /* NURI Devices */ 1302 /* NURI Devices */
1297 &nuri_gpio_keys, 1303 &nuri_gpio_keys,
@@ -1340,6 +1346,7 @@ static void __init nuri_machine_init(void)
1340 nuri_camera_init(); 1346 nuri_camera_init();
1341 1347
1342 nuri_ehci_init(); 1348 nuri_ehci_init();
1349 s3c_hsotg_set_platdata(&nuri_hsotg_pdata);
1343 1350
1344 /* Last */ 1351 /* Last */
1345 platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices)); 1352 platform_add_devices(nuri_devices, ARRAY_SIZE(nuri_devices));
diff --git a/arch/arm/mach-exynos/mach-universal_c210.c b/arch/arm/mach-exynos/mach-universal_c210.c
index bc8bf3b4fe43..9be8a07d7d01 100644
--- a/arch/arm/mach-exynos/mach-universal_c210.c
+++ b/arch/arm/mach-exynos/mach-universal_c210.c
@@ -41,6 +41,7 @@
41#include <plat/pd.h> 41#include <plat/pd.h>
42#include <plat/regs-fb-v4.h> 42#include <plat/regs-fb-v4.h>
43#include <plat/fimc-core.h> 43#include <plat/fimc-core.h>
44#include <plat/s5p-time.h>
44#include <plat/camport.h> 45#include <plat/camport.h>
45#include <plat/mipi_csis.h> 46#include <plat/mipi_csis.h>
46 47
@@ -205,6 +206,7 @@ static struct regulator_init_data lp3974_ldo2_data = {
205}; 206};
206 207
207static struct regulator_consumer_supply lp3974_ldo3_consumer[] = { 208static struct regulator_consumer_supply lp3974_ldo3_consumer[] = {
209 REGULATOR_SUPPLY("vusb_a", "s3c-hsotg"),
208 REGULATOR_SUPPLY("vdd", "exynos4-hdmi"), 210 REGULATOR_SUPPLY("vdd", "exynos4-hdmi"),
209 REGULATOR_SUPPLY("vdd_pll", "exynos4-hdmi"), 211 REGULATOR_SUPPLY("vdd_pll", "exynos4-hdmi"),
210 REGULATOR_SUPPLY("vdd11", "s5p-mipi-csis.0"), 212 REGULATOR_SUPPLY("vdd11", "s5p-mipi-csis.0"),
@@ -290,6 +292,7 @@ static struct regulator_init_data lp3974_ldo7_data = {
290}; 292};
291 293
292static struct regulator_consumer_supply lp3974_ldo8_consumer[] = { 294static struct regulator_consumer_supply lp3974_ldo8_consumer[] = {
295 REGULATOR_SUPPLY("vusb_d", "s3c-hsotg"),
293 REGULATOR_SUPPLY("vdd33a_dac", "s5p-sdo"), 296 REGULATOR_SUPPLY("vdd33a_dac", "s5p-sdo"),
294}; 297};
295 298
@@ -486,7 +489,10 @@ static struct regulator_init_data lp3974_vichg_data = {
486static struct regulator_init_data lp3974_esafeout1_data = { 489static struct regulator_init_data lp3974_esafeout1_data = {
487 .constraints = { 490 .constraints = {
488 .name = "SAFEOUT1", 491 .name = "SAFEOUT1",
492 .min_uV = 4800000,
493 .max_uV = 4800000,
489 .valid_ops_mask = REGULATOR_CHANGE_STATUS, 494 .valid_ops_mask = REGULATOR_CHANGE_STATUS,
495 .always_on = 1,
490 .state_mem = { 496 .state_mem = {
491 .enabled = 1, 497 .enabled = 1,
492 }, 498 },
@@ -994,6 +1000,9 @@ static struct gpio universal_camera_gpios[] = {
994 { GPIO_CAM_VGA_NSTBY, GPIOF_OUT_INIT_LOW, "CAM_VGA_NSTBY" }, 1000 { GPIO_CAM_VGA_NSTBY, GPIOF_OUT_INIT_LOW, "CAM_VGA_NSTBY" },
995}; 1001};
996 1002
1003/* USB OTG */
1004static struct s3c_hsotg_plat universal_hsotg_pdata;
1005
997static void __init universal_camera_init(void) 1006static void __init universal_camera_init(void)
998{ 1007{
999 s3c_set_platdata(&mipi_csis_platdata, sizeof(mipi_csis_platdata), 1008 s3c_set_platdata(&mipi_csis_platdata, sizeof(mipi_csis_platdata),
@@ -1049,6 +1058,7 @@ static struct platform_device *universal_devices[] __initdata = {
1049 &s5p_device_onenand, 1058 &s5p_device_onenand,
1050 &s5p_device_fimd0, 1059 &s5p_device_fimd0,
1051 &s5p_device_jpeg, 1060 &s5p_device_jpeg,
1061 &s3c_device_usb_hsotg,
1052 &s5p_device_mfc, 1062 &s5p_device_mfc,
1053 &s5p_device_mfc_l, 1063 &s5p_device_mfc_l,
1054 &s5p_device_mfc_r, 1064 &s5p_device_mfc_r,
@@ -1064,6 +1074,7 @@ static void __init universal_map_io(void)
1064 exynos_init_io(NULL, 0); 1074 exynos_init_io(NULL, 0);
1065 s3c24xx_init_clocks(24000000); 1075 s3c24xx_init_clocks(24000000);
1066 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs)); 1076 s3c24xx_init_uarts(universal_uartcfgs, ARRAY_SIZE(universal_uartcfgs));
1077 s5p_set_timer_source(S5P_PWM2, S5P_PWM4);
1067} 1078}
1068 1079
1069static void s5p_tv_setup(void) 1080static void s5p_tv_setup(void)
@@ -1101,6 +1112,7 @@ static void __init universal_machine_init(void)
1101 i2c_register_board_info(I2C_GPIO_BUS_12, i2c_gpio12_devs, 1112 i2c_register_board_info(I2C_GPIO_BUS_12, i2c_gpio12_devs,
1102 ARRAY_SIZE(i2c_gpio12_devs)); 1113 ARRAY_SIZE(i2c_gpio12_devs));
1103 1114
1115 s3c_hsotg_set_platdata(&universal_hsotg_pdata);
1104 universal_camera_init(); 1116 universal_camera_init();
1105 1117
1106 /* Last */ 1118 /* Last */
@@ -1114,7 +1126,7 @@ MACHINE_START(UNIVERSAL_C210, "UNIVERSAL_C210")
1114 .map_io = universal_map_io, 1126 .map_io = universal_map_io,
1115 .handle_irq = gic_handle_irq, 1127 .handle_irq = gic_handle_irq,
1116 .init_machine = universal_machine_init, 1128 .init_machine = universal_machine_init,
1117 .timer = &exynos4_timer, 1129 .timer = &s5p_timer,
1118 .reserve = &universal_reserve, 1130 .reserve = &universal_reserve,
1119 .restart = exynos4_restart, 1131 .restart = exynos4_restart,
1120MACHINE_END 1132MACHINE_END
diff --git a/arch/arm/mach-exynos/setup-usb-phy.c b/arch/arm/mach-exynos/setup-usb-phy.c
index 41743d21e8c6..1af0a7f44e00 100644
--- a/arch/arm/mach-exynos/setup-usb-phy.c
+++ b/arch/arm/mach-exynos/setup-usb-phy.c
@@ -26,11 +26,71 @@ static int exynos4_usb_host_phy_is_on(void)
26 return (readl(EXYNOS4_PHYPWR) & PHY1_STD_ANALOG_POWERDOWN) ? 0 : 1; 26 return (readl(EXYNOS4_PHYPWR) & PHY1_STD_ANALOG_POWERDOWN) ? 0 : 1;
27} 27}
28 28
29static int exynos4_usb_phy1_init(struct platform_device *pdev) 29static void exynos4210_usb_phy_clkset(struct platform_device *pdev)
30{ 30{
31 struct clk *otg_clk;
32 struct clk *xusbxti_clk; 31 struct clk *xusbxti_clk;
33 u32 phyclk; 32 u32 phyclk;
33
34 /* set clock frequency for PLL */
35 phyclk = readl(EXYNOS4_PHYCLK) & ~CLKSEL_MASK;
36
37 xusbxti_clk = clk_get(&pdev->dev, "xusbxti");
38 if (xusbxti_clk && !IS_ERR(xusbxti_clk)) {
39 switch (clk_get_rate(xusbxti_clk)) {
40 case 12 * MHZ:
41 phyclk |= CLKSEL_12M;
42 break;
43 case 24 * MHZ:
44 phyclk |= CLKSEL_24M;
45 break;
46 default:
47 case 48 * MHZ:
48 /* default reference clock */
49 break;
50 }
51 clk_put(xusbxti_clk);
52 }
53
54 writel(phyclk, EXYNOS4_PHYCLK);
55}
56
57static int exynos4210_usb_phy0_init(struct platform_device *pdev)
58{
59 u32 rstcon;
60
61 writel(readl(S5P_USBDEVICE_PHY_CONTROL) | S5P_USBDEVICE_PHY_ENABLE,
62 S5P_USBDEVICE_PHY_CONTROL);
63
64 exynos4210_usb_phy_clkset(pdev);
65
66 /* set to normal PHY0 */
67 writel((readl(EXYNOS4_PHYPWR) & ~PHY0_NORMAL_MASK), EXYNOS4_PHYPWR);
68
69 /* reset PHY0 and Link */
70 rstcon = readl(EXYNOS4_RSTCON) | PHY0_SWRST_MASK;
71 writel(rstcon, EXYNOS4_RSTCON);
72 udelay(10);
73
74 rstcon &= ~PHY0_SWRST_MASK;
75 writel(rstcon, EXYNOS4_RSTCON);
76
77 return 0;
78}
79
80static int exynos4210_usb_phy0_exit(struct platform_device *pdev)
81{
82 writel((readl(EXYNOS4_PHYPWR) | PHY0_ANALOG_POWERDOWN |
83 PHY0_OTG_DISABLE), EXYNOS4_PHYPWR);
84
85 writel(readl(S5P_USBDEVICE_PHY_CONTROL) & ~S5P_USBDEVICE_PHY_ENABLE,
86 S5P_USBDEVICE_PHY_CONTROL);
87
88 return 0;
89}
90
91static int exynos4210_usb_phy1_init(struct platform_device *pdev)
92{
93 struct clk *otg_clk;
34 u32 rstcon; 94 u32 rstcon;
35 int err; 95 int err;
36 96
@@ -54,27 +114,7 @@ static int exynos4_usb_phy1_init(struct platform_device *pdev)
54 writel(readl(S5P_USBHOST_PHY_CONTROL) | S5P_USBHOST_PHY_ENABLE, 114 writel(readl(S5P_USBHOST_PHY_CONTROL) | S5P_USBHOST_PHY_ENABLE,
55 S5P_USBHOST_PHY_CONTROL); 115 S5P_USBHOST_PHY_CONTROL);
56 116
57 /* set clock frequency for PLL */ 117 exynos4210_usb_phy_clkset(pdev);
58 phyclk = readl(EXYNOS4_PHYCLK) & ~CLKSEL_MASK;
59
60 xusbxti_clk = clk_get(&pdev->dev, "xusbxti");
61 if (xusbxti_clk && !IS_ERR(xusbxti_clk)) {
62 switch (clk_get_rate(xusbxti_clk)) {
63 case 12 * MHZ:
64 phyclk |= CLKSEL_12M;
65 break;
66 case 24 * MHZ:
67 phyclk |= CLKSEL_24M;
68 break;
69 default:
70 case 48 * MHZ:
71 /* default reference clock */
72 break;
73 }
74 clk_put(xusbxti_clk);
75 }
76
77 writel(phyclk, EXYNOS4_PHYCLK);
78 118
79 /* floating prevention logic: disable */ 119 /* floating prevention logic: disable */
80 writel((readl(EXYNOS4_PHY1CON) | FPENABLEN), EXYNOS4_PHY1CON); 120 writel((readl(EXYNOS4_PHY1CON) | FPENABLEN), EXYNOS4_PHY1CON);
@@ -102,7 +142,7 @@ static int exynos4_usb_phy1_init(struct platform_device *pdev)
102 return 0; 142 return 0;
103} 143}
104 144
105static int exynos4_usb_phy1_exit(struct platform_device *pdev) 145static int exynos4210_usb_phy1_exit(struct platform_device *pdev)
106{ 146{
107 struct clk *otg_clk; 147 struct clk *otg_clk;
108 int err; 148 int err;
@@ -136,16 +176,20 @@ static int exynos4_usb_phy1_exit(struct platform_device *pdev)
136 176
137int s5p_usb_phy_init(struct platform_device *pdev, int type) 177int s5p_usb_phy_init(struct platform_device *pdev, int type)
138{ 178{
139 if (type == S5P_USB_PHY_HOST) 179 if (type == S5P_USB_PHY_DEVICE)
140 return exynos4_usb_phy1_init(pdev); 180 return exynos4210_usb_phy0_init(pdev);
181 else if (type == S5P_USB_PHY_HOST)
182 return exynos4210_usb_phy1_init(pdev);
141 183
142 return -EINVAL; 184 return -EINVAL;
143} 185}
144 186
145int s5p_usb_phy_exit(struct platform_device *pdev, int type) 187int s5p_usb_phy_exit(struct platform_device *pdev, int type)
146{ 188{
147 if (type == S5P_USB_PHY_HOST) 189 if (type == S5P_USB_PHY_DEVICE)
148 return exynos4_usb_phy1_exit(pdev); 190 return exynos4210_usb_phy0_exit(pdev);
191 else if (type == S5P_USB_PHY_HOST)
192 return exynos4210_usb_phy1_exit(pdev);
149 193
150 return -EINVAL; 194 return -EINVAL;
151} 195}