diff options
author | Inderpal Singh <inderpal.singh@linaro.org> | 2011-10-02 19:51:20 -0400 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-10-03 23:57:09 -0400 |
commit | 6e01280f34be02e5e7635debb045aab3705bb5bf (patch) | |
tree | b64f44101859ba9562f0482e51da7306eb37d5fb /arch/arm/mach-exynos4/mach-origen.c | |
parent | 6ca3f8bdf8253504426935c97cabb44bdc6f5888 (diff) |
ARM: EXYNOS4: Configure MAX8997 PMIC for ORIGEN
Configure MAX8997 PMIC and provide platform specific
data for ORIGEN board.
Signed-off-by: Inderpal Singh <inderpal.singh@linaro.org>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-exynos4/mach-origen.c')
-rw-r--r-- | arch/arm/mach-exynos4/mach-origen.c | 396 |
1 files changed, 392 insertions, 4 deletions
diff --git a/arch/arm/mach-exynos4/mach-origen.c b/arch/arm/mach-exynos4/mach-origen.c index c8121fcf198d..3da77766961e 100644 --- a/arch/arm/mach-exynos4/mach-origen.c +++ b/arch/arm/mach-exynos4/mach-origen.c | |||
@@ -16,6 +16,9 @@ | |||
16 | #include <linux/input.h> | 16 | #include <linux/input.h> |
17 | #include <linux/pwm_backlight.h> | 17 | #include <linux/pwm_backlight.h> |
18 | #include <linux/gpio_keys.h> | 18 | #include <linux/gpio_keys.h> |
19 | #include <linux/i2c.h> | ||
20 | #include <linux/regulator/machine.h> | ||
21 | #include <linux/mfd/max8997.h> | ||
19 | 22 | ||
20 | #include <asm/mach/arch.h> | 23 | #include <asm/mach/arch.h> |
21 | #include <asm/mach-types.h> | 24 | #include <asm/mach-types.h> |
@@ -78,6 +81,378 @@ static struct s3c2410_uartcfg origen_uartcfgs[] __initdata = { | |||
78 | }, | 81 | }, |
79 | }; | 82 | }; |
80 | 83 | ||
84 | static struct regulator_consumer_supply __initdata ldo3_consumer[] = { | ||
85 | REGULATOR_SUPPLY("vdd11", "s5p-mipi-csis.0"), /* MIPI */ | ||
86 | }; | ||
87 | static struct regulator_consumer_supply __initdata ldo6_consumer[] = { | ||
88 | REGULATOR_SUPPLY("vdd18", "s5p-mipi-csis.0"), /* MIPI */ | ||
89 | }; | ||
90 | static struct regulator_consumer_supply __initdata ldo7_consumer[] = { | ||
91 | REGULATOR_SUPPLY("avdd", "alc5625"), /* Realtek ALC5625 */ | ||
92 | }; | ||
93 | static struct regulator_consumer_supply __initdata ldo8_consumer[] = { | ||
94 | REGULATOR_SUPPLY("vdd", "s5p-adc"), /* ADC */ | ||
95 | }; | ||
96 | static struct regulator_consumer_supply __initdata ldo9_consumer[] = { | ||
97 | REGULATOR_SUPPLY("dvdd", "swb-a31"), /* AR6003 WLAN & CSR 8810 BT */ | ||
98 | }; | ||
99 | static struct regulator_consumer_supply __initdata ldo11_consumer[] = { | ||
100 | REGULATOR_SUPPLY("dvdd", "alc5625"), /* Realtek ALC5625 */ | ||
101 | }; | ||
102 | static struct regulator_consumer_supply __initdata ldo14_consumer[] = { | ||
103 | REGULATOR_SUPPLY("avdd18", "swb-a31"), /* AR6003 WLAN & CSR 8810 BT */ | ||
104 | }; | ||
105 | static struct regulator_consumer_supply __initdata ldo17_consumer[] = { | ||
106 | REGULATOR_SUPPLY("vdd33", "swb-a31"), /* AR6003 WLAN & CSR 8810 BT */ | ||
107 | }; | ||
108 | static struct regulator_consumer_supply __initdata buck1_consumer[] = { | ||
109 | REGULATOR_SUPPLY("vdd_arm", NULL), /* CPUFREQ */ | ||
110 | }; | ||
111 | static struct regulator_consumer_supply __initdata buck2_consumer[] = { | ||
112 | REGULATOR_SUPPLY("vdd_int", NULL), /* CPUFREQ */ | ||
113 | }; | ||
114 | static struct regulator_consumer_supply __initdata buck3_consumer[] = { | ||
115 | REGULATOR_SUPPLY("vdd_g3d", "mali_drm"), /* G3D */ | ||
116 | }; | ||
117 | static struct regulator_consumer_supply __initdata buck7_consumer[] = { | ||
118 | REGULATOR_SUPPLY("vcc", "platform-lcd"), /* LCD */ | ||
119 | }; | ||
120 | |||
121 | static struct regulator_init_data __initdata max8997_ldo1_data = { | ||
122 | .constraints = { | ||
123 | .name = "VDD_ABB_3.3V", | ||
124 | .min_uV = 3300000, | ||
125 | .max_uV = 3300000, | ||
126 | .apply_uV = 1, | ||
127 | .state_mem = { | ||
128 | .disabled = 1, | ||
129 | }, | ||
130 | }, | ||
131 | }; | ||
132 | |||
133 | static struct regulator_init_data __initdata max8997_ldo2_data = { | ||
134 | .constraints = { | ||
135 | .name = "VDD_ALIVE_1.1V", | ||
136 | .min_uV = 1100000, | ||
137 | .max_uV = 1100000, | ||
138 | .apply_uV = 1, | ||
139 | .always_on = 1, | ||
140 | .state_mem = { | ||
141 | .enabled = 1, | ||
142 | }, | ||
143 | }, | ||
144 | }; | ||
145 | |||
146 | static struct regulator_init_data __initdata max8997_ldo3_data = { | ||
147 | .constraints = { | ||
148 | .name = "VMIPI_1.1V", | ||
149 | .min_uV = 1100000, | ||
150 | .max_uV = 1100000, | ||
151 | .apply_uV = 1, | ||
152 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
153 | .state_mem = { | ||
154 | .disabled = 1, | ||
155 | }, | ||
156 | }, | ||
157 | .num_consumer_supplies = ARRAY_SIZE(ldo3_consumer), | ||
158 | .consumer_supplies = ldo3_consumer, | ||
159 | }; | ||
160 | |||
161 | static struct regulator_init_data __initdata max8997_ldo4_data = { | ||
162 | .constraints = { | ||
163 | .name = "VDD_RTC_1.8V", | ||
164 | .min_uV = 1800000, | ||
165 | .max_uV = 1800000, | ||
166 | .apply_uV = 1, | ||
167 | .always_on = 1, | ||
168 | .state_mem = { | ||
169 | .disabled = 1, | ||
170 | }, | ||
171 | }, | ||
172 | }; | ||
173 | |||
174 | static struct regulator_init_data __initdata max8997_ldo6_data = { | ||
175 | .constraints = { | ||
176 | .name = "VMIPI_1.8V", | ||
177 | .min_uV = 1800000, | ||
178 | .max_uV = 1800000, | ||
179 | .apply_uV = 1, | ||
180 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
181 | .state_mem = { | ||
182 | .disabled = 1, | ||
183 | }, | ||
184 | }, | ||
185 | .num_consumer_supplies = ARRAY_SIZE(ldo6_consumer), | ||
186 | .consumer_supplies = ldo6_consumer, | ||
187 | }; | ||
188 | |||
189 | static struct regulator_init_data __initdata max8997_ldo7_data = { | ||
190 | .constraints = { | ||
191 | .name = "VDD_AUD_1.8V", | ||
192 | .min_uV = 1800000, | ||
193 | .max_uV = 1800000, | ||
194 | .apply_uV = 1, | ||
195 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
196 | .state_mem = { | ||
197 | .disabled = 1, | ||
198 | }, | ||
199 | }, | ||
200 | .num_consumer_supplies = ARRAY_SIZE(ldo7_consumer), | ||
201 | .consumer_supplies = ldo7_consumer, | ||
202 | }; | ||
203 | |||
204 | static struct regulator_init_data __initdata max8997_ldo8_data = { | ||
205 | .constraints = { | ||
206 | .name = "VADC_3.3V", | ||
207 | .min_uV = 3300000, | ||
208 | .max_uV = 3300000, | ||
209 | .apply_uV = 1, | ||
210 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
211 | .state_mem = { | ||
212 | .disabled = 1, | ||
213 | }, | ||
214 | }, | ||
215 | .num_consumer_supplies = ARRAY_SIZE(ldo8_consumer), | ||
216 | .consumer_supplies = ldo8_consumer, | ||
217 | }; | ||
218 | |||
219 | static struct regulator_init_data __initdata max8997_ldo9_data = { | ||
220 | .constraints = { | ||
221 | .name = "DVDD_SWB_2.8V", | ||
222 | .min_uV = 2800000, | ||
223 | .max_uV = 2800000, | ||
224 | .apply_uV = 1, | ||
225 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
226 | .state_mem = { | ||
227 | .disabled = 1, | ||
228 | }, | ||
229 | }, | ||
230 | .num_consumer_supplies = ARRAY_SIZE(ldo9_consumer), | ||
231 | .consumer_supplies = ldo9_consumer, | ||
232 | }; | ||
233 | |||
234 | static struct regulator_init_data __initdata max8997_ldo10_data = { | ||
235 | .constraints = { | ||
236 | .name = "VDD_PLL_1.1V", | ||
237 | .min_uV = 1100000, | ||
238 | .max_uV = 1100000, | ||
239 | .apply_uV = 1, | ||
240 | .always_on = 1, | ||
241 | .state_mem = { | ||
242 | .disabled = 1, | ||
243 | }, | ||
244 | }, | ||
245 | }; | ||
246 | |||
247 | static struct regulator_init_data __initdata max8997_ldo11_data = { | ||
248 | .constraints = { | ||
249 | .name = "VDD_AUD_3V", | ||
250 | .min_uV = 3000000, | ||
251 | .max_uV = 3000000, | ||
252 | .apply_uV = 1, | ||
253 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
254 | .state_mem = { | ||
255 | .disabled = 1, | ||
256 | }, | ||
257 | }, | ||
258 | .num_consumer_supplies = ARRAY_SIZE(ldo11_consumer), | ||
259 | .consumer_supplies = ldo11_consumer, | ||
260 | }; | ||
261 | |||
262 | static struct regulator_init_data __initdata max8997_ldo14_data = { | ||
263 | .constraints = { | ||
264 | .name = "AVDD18_SWB_1.8V", | ||
265 | .min_uV = 1800000, | ||
266 | .max_uV = 1800000, | ||
267 | .apply_uV = 1, | ||
268 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
269 | .state_mem = { | ||
270 | .disabled = 1, | ||
271 | }, | ||
272 | }, | ||
273 | .num_consumer_supplies = ARRAY_SIZE(ldo14_consumer), | ||
274 | .consumer_supplies = ldo14_consumer, | ||
275 | }; | ||
276 | |||
277 | static struct regulator_init_data __initdata max8997_ldo17_data = { | ||
278 | .constraints = { | ||
279 | .name = "VDD_SWB_3.3V", | ||
280 | .min_uV = 3300000, | ||
281 | .max_uV = 3300000, | ||
282 | .apply_uV = 1, | ||
283 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
284 | .state_mem = { | ||
285 | .disabled = 1, | ||
286 | }, | ||
287 | }, | ||
288 | .num_consumer_supplies = ARRAY_SIZE(ldo17_consumer), | ||
289 | .consumer_supplies = ldo17_consumer, | ||
290 | }; | ||
291 | |||
292 | static struct regulator_init_data __initdata max8997_ldo21_data = { | ||
293 | .constraints = { | ||
294 | .name = "VDD_MIF_1.2V", | ||
295 | .min_uV = 1200000, | ||
296 | .max_uV = 1200000, | ||
297 | .apply_uV = 1, | ||
298 | .always_on = 1, | ||
299 | .state_mem = { | ||
300 | .disabled = 1, | ||
301 | }, | ||
302 | }, | ||
303 | }; | ||
304 | |||
305 | static struct regulator_init_data __initdata max8997_buck1_data = { | ||
306 | .constraints = { | ||
307 | .name = "VDD_ARM_1.2V", | ||
308 | .min_uV = 950000, | ||
309 | .max_uV = 1350000, | ||
310 | .always_on = 1, | ||
311 | .boot_on = 1, | ||
312 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | ||
313 | .state_mem = { | ||
314 | .disabled = 1, | ||
315 | }, | ||
316 | }, | ||
317 | .num_consumer_supplies = ARRAY_SIZE(buck1_consumer), | ||
318 | .consumer_supplies = buck1_consumer, | ||
319 | }; | ||
320 | |||
321 | static struct regulator_init_data __initdata max8997_buck2_data = { | ||
322 | .constraints = { | ||
323 | .name = "VDD_INT_1.1V", | ||
324 | .min_uV = 900000, | ||
325 | .max_uV = 1100000, | ||
326 | .always_on = 1, | ||
327 | .boot_on = 1, | ||
328 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | ||
329 | .state_mem = { | ||
330 | .disabled = 1, | ||
331 | }, | ||
332 | }, | ||
333 | .num_consumer_supplies = ARRAY_SIZE(buck2_consumer), | ||
334 | .consumer_supplies = buck2_consumer, | ||
335 | }; | ||
336 | |||
337 | static struct regulator_init_data __initdata max8997_buck3_data = { | ||
338 | .constraints = { | ||
339 | .name = "VDD_G3D_1.1V", | ||
340 | .min_uV = 900000, | ||
341 | .max_uV = 1100000, | ||
342 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | | ||
343 | REGULATOR_CHANGE_STATUS, | ||
344 | .state_mem = { | ||
345 | .disabled = 1, | ||
346 | }, | ||
347 | }, | ||
348 | .num_consumer_supplies = ARRAY_SIZE(buck3_consumer), | ||
349 | .consumer_supplies = buck3_consumer, | ||
350 | }; | ||
351 | |||
352 | static struct regulator_init_data __initdata max8997_buck5_data = { | ||
353 | .constraints = { | ||
354 | .name = "VDDQ_M1M2_1.2V", | ||
355 | .min_uV = 1200000, | ||
356 | .max_uV = 1200000, | ||
357 | .apply_uV = 1, | ||
358 | .always_on = 1, | ||
359 | .state_mem = { | ||
360 | .disabled = 1, | ||
361 | }, | ||
362 | }, | ||
363 | }; | ||
364 | |||
365 | static struct regulator_init_data __initdata max8997_buck7_data = { | ||
366 | .constraints = { | ||
367 | .name = "VDD_LCD_3.3V", | ||
368 | .min_uV = 3300000, | ||
369 | .max_uV = 3300000, | ||
370 | .boot_on = 1, | ||
371 | .apply_uV = 1, | ||
372 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
373 | .state_mem = { | ||
374 | .disabled = 1 | ||
375 | }, | ||
376 | }, | ||
377 | .num_consumer_supplies = ARRAY_SIZE(buck7_consumer), | ||
378 | .consumer_supplies = buck7_consumer, | ||
379 | }; | ||
380 | |||
381 | static struct max8997_regulator_data __initdata origen_max8997_regulators[] = { | ||
382 | { MAX8997_LDO1, &max8997_ldo1_data }, | ||
383 | { MAX8997_LDO2, &max8997_ldo2_data }, | ||
384 | { MAX8997_LDO3, &max8997_ldo3_data }, | ||
385 | { MAX8997_LDO4, &max8997_ldo4_data }, | ||
386 | { MAX8997_LDO6, &max8997_ldo6_data }, | ||
387 | { MAX8997_LDO7, &max8997_ldo7_data }, | ||
388 | { MAX8997_LDO8, &max8997_ldo8_data }, | ||
389 | { MAX8997_LDO9, &max8997_ldo9_data }, | ||
390 | { MAX8997_LDO10, &max8997_ldo10_data }, | ||
391 | { MAX8997_LDO11, &max8997_ldo11_data }, | ||
392 | { MAX8997_LDO14, &max8997_ldo14_data }, | ||
393 | { MAX8997_LDO17, &max8997_ldo17_data }, | ||
394 | { MAX8997_LDO21, &max8997_ldo21_data }, | ||
395 | { MAX8997_BUCK1, &max8997_buck1_data }, | ||
396 | { MAX8997_BUCK2, &max8997_buck2_data }, | ||
397 | { MAX8997_BUCK3, &max8997_buck3_data }, | ||
398 | { MAX8997_BUCK5, &max8997_buck5_data }, | ||
399 | { MAX8997_BUCK7, &max8997_buck7_data }, | ||
400 | }; | ||
401 | |||
402 | struct max8997_platform_data __initdata origen_max8997_pdata = { | ||
403 | .num_regulators = ARRAY_SIZE(origen_max8997_regulators), | ||
404 | .regulators = origen_max8997_regulators, | ||
405 | |||
406 | .wakeup = true, | ||
407 | .buck1_gpiodvs = false, | ||
408 | .buck2_gpiodvs = false, | ||
409 | .buck5_gpiodvs = false, | ||
410 | .irq_base = IRQ_GPIO_END + 1, | ||
411 | |||
412 | .ignore_gpiodvs_side_effect = true, | ||
413 | .buck125_default_idx = 0x0, | ||
414 | |||
415 | .buck125_gpios[0] = EXYNOS4_GPX0(0), | ||
416 | .buck125_gpios[1] = EXYNOS4_GPX0(1), | ||
417 | .buck125_gpios[2] = EXYNOS4_GPX0(2), | ||
418 | |||
419 | .buck1_voltage[0] = 1350000, | ||
420 | .buck1_voltage[1] = 1300000, | ||
421 | .buck1_voltage[2] = 1250000, | ||
422 | .buck1_voltage[3] = 1200000, | ||
423 | .buck1_voltage[4] = 1150000, | ||
424 | .buck1_voltage[5] = 1100000, | ||
425 | .buck1_voltage[6] = 1000000, | ||
426 | .buck1_voltage[7] = 950000, | ||
427 | |||
428 | .buck2_voltage[0] = 1100000, | ||
429 | .buck2_voltage[1] = 1100000, | ||
430 | .buck2_voltage[2] = 1100000, | ||
431 | .buck2_voltage[3] = 1100000, | ||
432 | .buck2_voltage[4] = 1000000, | ||
433 | .buck2_voltage[5] = 1000000, | ||
434 | .buck2_voltage[6] = 1000000, | ||
435 | .buck2_voltage[7] = 1000000, | ||
436 | |||
437 | .buck5_voltage[0] = 1200000, | ||
438 | .buck5_voltage[1] = 1200000, | ||
439 | .buck5_voltage[2] = 1200000, | ||
440 | .buck5_voltage[3] = 1200000, | ||
441 | .buck5_voltage[4] = 1200000, | ||
442 | .buck5_voltage[5] = 1200000, | ||
443 | .buck5_voltage[6] = 1200000, | ||
444 | .buck5_voltage[7] = 1200000, | ||
445 | }; | ||
446 | |||
447 | /* I2C0 */ | ||
448 | static struct i2c_board_info i2c0_devs[] __initdata = { | ||
449 | { | ||
450 | I2C_BOARD_INFO("max8997", (0xCC >> 1)), | ||
451 | .platform_data = &origen_max8997_pdata, | ||
452 | .irq = IRQ_EINT(4), | ||
453 | }, | ||
454 | }; | ||
455 | |||
81 | static struct s3c_sdhci_platdata origen_hsmmc0_pdata __initdata = { | 456 | static struct s3c_sdhci_platdata origen_hsmmc0_pdata __initdata = { |
82 | .cd_type = S3C_SDHCI_CD_INTERNAL, | 457 | .cd_type = S3C_SDHCI_CD_INTERNAL, |
83 | .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, | 458 | .clk_type = S3C_SDHCI_CLK_DIV_EXTERNAL, |
@@ -155,6 +530,7 @@ static struct platform_device origen_device_gpiokeys = { | |||
155 | }; | 530 | }; |
156 | 531 | ||
157 | static struct platform_device *origen_devices[] __initdata = { | 532 | static struct platform_device *origen_devices[] __initdata = { |
533 | &s3c_device_i2c0, | ||
158 | &s3c_device_hsmmc2, | 534 | &s3c_device_hsmmc2, |
159 | &s3c_device_hsmmc0, | 535 | &s3c_device_hsmmc0, |
160 | &s3c_device_rtc, | 536 | &s3c_device_rtc, |
@@ -172,13 +548,13 @@ static struct platform_device *origen_devices[] __initdata = { | |||
172 | 548 | ||
173 | /* LCD Backlight data */ | 549 | /* LCD Backlight data */ |
174 | static struct samsung_bl_gpio_info origen_bl_gpio_info = { | 550 | static struct samsung_bl_gpio_info origen_bl_gpio_info = { |
175 | .no = EXYNOS4_GPD0(0), | 551 | .no = EXYNOS4_GPD0(0), |
176 | .func = S3C_GPIO_SFN(2), | 552 | .func = S3C_GPIO_SFN(2), |
177 | }; | 553 | }; |
178 | 554 | ||
179 | static struct platform_pwm_backlight_data origen_bl_data = { | 555 | static struct platform_pwm_backlight_data origen_bl_data = { |
180 | .pwm_id = 0, | 556 | .pwm_id = 0, |
181 | .pwm_period_ns = 1000, | 557 | .pwm_period_ns = 1000, |
182 | }; | 558 | }; |
183 | 559 | ||
184 | static void __init origen_map_io(void) | 560 | static void __init origen_map_io(void) |
@@ -188,8 +564,20 @@ static void __init origen_map_io(void) | |||
188 | s3c24xx_init_uarts(origen_uartcfgs, ARRAY_SIZE(origen_uartcfgs)); | 564 | s3c24xx_init_uarts(origen_uartcfgs, ARRAY_SIZE(origen_uartcfgs)); |
189 | } | 565 | } |
190 | 566 | ||
567 | static void __init origen_power_init(void) | ||
568 | { | ||
569 | gpio_request(EXYNOS4_GPX0(4), "PMIC_IRQ"); | ||
570 | s3c_gpio_cfgpin(EXYNOS4_GPX0(4), S3C_GPIO_SFN(0xf)); | ||
571 | s3c_gpio_setpull(EXYNOS4_GPX0(4), S3C_GPIO_PULL_NONE); | ||
572 | } | ||
573 | |||
191 | static void __init origen_machine_init(void) | 574 | static void __init origen_machine_init(void) |
192 | { | 575 | { |
576 | origen_power_init(); | ||
577 | |||
578 | s3c_i2c0_set_platdata(NULL); | ||
579 | i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs)); | ||
580 | |||
193 | /* | 581 | /* |
194 | * Since sdhci instance 2 can contain a bootable media, | 582 | * Since sdhci instance 2 can contain a bootable media, |
195 | * sdhci instance 0 is registered after instance 2. | 583 | * sdhci instance 0 is registered after instance 2. |