diff options
author | Marek Szyprowski <m.szyprowski@samsung.com> | 2011-03-03 20:19:52 -0500 |
---|---|---|
committer | Kukjin Kim <kgene.kim@samsung.com> | 2011-03-04 01:20:31 -0500 |
commit | 4d838ec03b2b0aea945a89b37abbf8c5550147fb (patch) | |
tree | 4564c6b6213f1599de94116915da55a57f91ae83 /arch/arm/mach-exynos4/mach-universal_c210.c | |
parent | caf8b1f234f876981bf1be0fa2651a4e97203754 (diff) |
ARM: EXYNOS4: Add support for i2c PMICs on Universal_C210 board
This patch adds basic definitions for MAX8952 & LP3974 (MAX8998
compatible) PMICs for UniversalC210 board. Power consumers for the
device drivers will be added later. These two PMICs occupy I2C5 bus.
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Kukjin Kim <kgene.kim@samsung.com>
Diffstat (limited to 'arch/arm/mach-exynos4/mach-universal_c210.c')
-rw-r--r-- | arch/arm/mach-exynos4/mach-universal_c210.c | 413 |
1 files changed, 413 insertions, 0 deletions
diff --git a/arch/arm/mach-exynos4/mach-universal_c210.c b/arch/arm/mach-exynos4/mach-universal_c210.c index b22b6ef2a94b..97d329fff2cf 100644 --- a/arch/arm/mach-exynos4/mach-universal_c210.c +++ b/arch/arm/mach-exynos4/mach-universal_c210.c | |||
@@ -13,8 +13,10 @@ | |||
13 | #include <linux/i2c.h> | 13 | #include <linux/i2c.h> |
14 | #include <linux/gpio_keys.h> | 14 | #include <linux/gpio_keys.h> |
15 | #include <linux/gpio.h> | 15 | #include <linux/gpio.h> |
16 | #include <linux/mfd/max8998.h> | ||
16 | #include <linux/regulator/machine.h> | 17 | #include <linux/regulator/machine.h> |
17 | #include <linux/regulator/fixed.h> | 18 | #include <linux/regulator/fixed.h> |
19 | #include <linux/regulator/max8952.h> | ||
18 | #include <linux/mmc/host.h> | 20 | #include <linux/mmc/host.h> |
19 | 21 | ||
20 | #include <asm/mach/arch.h> | 22 | #include <asm/mach/arch.h> |
@@ -24,6 +26,7 @@ | |||
24 | #include <plat/exynos4.h> | 26 | #include <plat/exynos4.h> |
25 | #include <plat/cpu.h> | 27 | #include <plat/cpu.h> |
26 | #include <plat/devs.h> | 28 | #include <plat/devs.h> |
29 | #include <plat/iic.h> | ||
27 | #include <plat/sdhci.h> | 30 | #include <plat/sdhci.h> |
28 | 31 | ||
29 | #include <mach/map.h> | 32 | #include <mach/map.h> |
@@ -69,6 +72,412 @@ static struct s3c2410_uartcfg universal_uartcfgs[] __initdata = { | |||
69 | }, | 72 | }, |
70 | }; | 73 | }; |
71 | 74 | ||
75 | static struct regulator_consumer_supply max8952_consumer = | ||
76 | REGULATOR_SUPPLY("vddarm", NULL); | ||
77 | |||
78 | static struct max8952_platform_data universal_max8952_pdata __initdata = { | ||
79 | .gpio_vid0 = EXYNOS4_GPX0(3), | ||
80 | .gpio_vid1 = EXYNOS4_GPX0(4), | ||
81 | .gpio_en = -1, /* Not controllable, set "Always High" */ | ||
82 | .default_mode = 0, /* vid0 = 0, vid1 = 0 */ | ||
83 | .dvs_mode = { 48, 32, 28, 18 }, /* 1.25, 1.20, 1.05, 0.95V */ | ||
84 | .sync_freq = 0, /* default: fastest */ | ||
85 | .ramp_speed = 0, /* default: fastest */ | ||
86 | |||
87 | .reg_data = { | ||
88 | .constraints = { | ||
89 | .name = "VARM_1.2V", | ||
90 | .min_uV = 770000, | ||
91 | .max_uV = 1400000, | ||
92 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | ||
93 | .always_on = 1, | ||
94 | .boot_on = 1, | ||
95 | }, | ||
96 | .num_consumer_supplies = 1, | ||
97 | .consumer_supplies = &max8952_consumer, | ||
98 | }, | ||
99 | }; | ||
100 | |||
101 | static struct regulator_consumer_supply lp3974_buck1_consumer = | ||
102 | REGULATOR_SUPPLY("vddint", NULL); | ||
103 | |||
104 | static struct regulator_consumer_supply lp3974_buck2_consumer = | ||
105 | REGULATOR_SUPPLY("vddg3d", NULL); | ||
106 | |||
107 | static struct regulator_init_data lp3974_buck1_data = { | ||
108 | .constraints = { | ||
109 | .name = "VINT_1.1V", | ||
110 | .min_uV = 750000, | ||
111 | .max_uV = 1500000, | ||
112 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | | ||
113 | REGULATOR_CHANGE_STATUS, | ||
114 | .boot_on = 1, | ||
115 | .state_mem = { | ||
116 | .disabled = 1, | ||
117 | }, | ||
118 | }, | ||
119 | .num_consumer_supplies = 1, | ||
120 | .consumer_supplies = &lp3974_buck1_consumer, | ||
121 | }; | ||
122 | |||
123 | static struct regulator_init_data lp3974_buck2_data = { | ||
124 | .constraints = { | ||
125 | .name = "VG3D_1.1V", | ||
126 | .min_uV = 750000, | ||
127 | .max_uV = 1500000, | ||
128 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE | | ||
129 | REGULATOR_CHANGE_STATUS, | ||
130 | .boot_on = 1, | ||
131 | .state_mem = { | ||
132 | .disabled = 1, | ||
133 | }, | ||
134 | }, | ||
135 | .num_consumer_supplies = 1, | ||
136 | .consumer_supplies = &lp3974_buck2_consumer, | ||
137 | }; | ||
138 | |||
139 | static struct regulator_init_data lp3974_buck3_data = { | ||
140 | .constraints = { | ||
141 | .name = "VCC_1.8V", | ||
142 | .min_uV = 1800000, | ||
143 | .max_uV = 1800000, | ||
144 | .apply_uV = 1, | ||
145 | .always_on = 1, | ||
146 | .state_mem = { | ||
147 | .enabled = 1, | ||
148 | }, | ||
149 | }, | ||
150 | }; | ||
151 | |||
152 | static struct regulator_init_data lp3974_buck4_data = { | ||
153 | .constraints = { | ||
154 | .name = "VMEM_1.2V", | ||
155 | .min_uV = 1200000, | ||
156 | .max_uV = 1200000, | ||
157 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
158 | .apply_uV = 1, | ||
159 | .state_mem = { | ||
160 | .disabled = 1, | ||
161 | }, | ||
162 | }, | ||
163 | }; | ||
164 | |||
165 | static struct regulator_init_data lp3974_ldo2_data = { | ||
166 | .constraints = { | ||
167 | .name = "VALIVE_1.2V", | ||
168 | .min_uV = 1200000, | ||
169 | .max_uV = 1200000, | ||
170 | .apply_uV = 1, | ||
171 | .always_on = 1, | ||
172 | .state_mem = { | ||
173 | .enabled = 1, | ||
174 | }, | ||
175 | }, | ||
176 | }; | ||
177 | |||
178 | static struct regulator_init_data lp3974_ldo3_data = { | ||
179 | .constraints = { | ||
180 | .name = "VUSB+MIPI_1.1V", | ||
181 | .min_uV = 1100000, | ||
182 | .max_uV = 1100000, | ||
183 | .apply_uV = 1, | ||
184 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
185 | .state_mem = { | ||
186 | .disabled = 1, | ||
187 | }, | ||
188 | }, | ||
189 | }; | ||
190 | |||
191 | static struct regulator_init_data lp3974_ldo4_data = { | ||
192 | .constraints = { | ||
193 | .name = "VADC_3.3V", | ||
194 | .min_uV = 3300000, | ||
195 | .max_uV = 3300000, | ||
196 | .apply_uV = 1, | ||
197 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
198 | .state_mem = { | ||
199 | .disabled = 1, | ||
200 | }, | ||
201 | }, | ||
202 | }; | ||
203 | |||
204 | static struct regulator_init_data lp3974_ldo5_data = { | ||
205 | .constraints = { | ||
206 | .name = "VTF_2.8V", | ||
207 | .min_uV = 2800000, | ||
208 | .max_uV = 2800000, | ||
209 | .apply_uV = 1, | ||
210 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
211 | .state_mem = { | ||
212 | .disabled = 1, | ||
213 | }, | ||
214 | }, | ||
215 | }; | ||
216 | |||
217 | static struct regulator_init_data lp3974_ldo6_data = { | ||
218 | .constraints = { | ||
219 | .name = "LDO6", | ||
220 | .min_uV = 2000000, | ||
221 | .max_uV = 2000000, | ||
222 | .apply_uV = 1, | ||
223 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
224 | .state_mem = { | ||
225 | .disabled = 1, | ||
226 | }, | ||
227 | }, | ||
228 | }; | ||
229 | |||
230 | static struct regulator_init_data lp3974_ldo7_data = { | ||
231 | .constraints = { | ||
232 | .name = "VLCD+VMIPI_1.8V", | ||
233 | .min_uV = 1800000, | ||
234 | .max_uV = 1800000, | ||
235 | .apply_uV = 1, | ||
236 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
237 | .state_mem = { | ||
238 | .disabled = 1, | ||
239 | }, | ||
240 | }, | ||
241 | }; | ||
242 | |||
243 | static struct regulator_init_data lp3974_ldo8_data = { | ||
244 | .constraints = { | ||
245 | .name = "VUSB+VDAC_3.3V", | ||
246 | .min_uV = 3300000, | ||
247 | .max_uV = 3300000, | ||
248 | .apply_uV = 1, | ||
249 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
250 | .state_mem = { | ||
251 | .disabled = 1, | ||
252 | }, | ||
253 | }, | ||
254 | }; | ||
255 | |||
256 | static struct regulator_init_data lp3974_ldo9_data = { | ||
257 | .constraints = { | ||
258 | .name = "VCC_2.8V", | ||
259 | .min_uV = 2800000, | ||
260 | .max_uV = 2800000, | ||
261 | .apply_uV = 1, | ||
262 | .always_on = 1, | ||
263 | .state_mem = { | ||
264 | .enabled = 1, | ||
265 | }, | ||
266 | }, | ||
267 | }; | ||
268 | |||
269 | static struct regulator_init_data lp3974_ldo10_data = { | ||
270 | .constraints = { | ||
271 | .name = "VPLL_1.1V", | ||
272 | .min_uV = 1100000, | ||
273 | .max_uV = 1100000, | ||
274 | .boot_on = 1, | ||
275 | .apply_uV = 1, | ||
276 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
277 | .state_mem = { | ||
278 | .disabled = 1, | ||
279 | }, | ||
280 | }, | ||
281 | }; | ||
282 | |||
283 | static struct regulator_init_data lp3974_ldo11_data = { | ||
284 | .constraints = { | ||
285 | .name = "CAM_AF_3.3V", | ||
286 | .min_uV = 3300000, | ||
287 | .max_uV = 3300000, | ||
288 | .apply_uV = 1, | ||
289 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
290 | .state_mem = { | ||
291 | .disabled = 1, | ||
292 | }, | ||
293 | }, | ||
294 | }; | ||
295 | |||
296 | static struct regulator_init_data lp3974_ldo12_data = { | ||
297 | .constraints = { | ||
298 | .name = "PS_2.8V", | ||
299 | .min_uV = 2800000, | ||
300 | .max_uV = 2800000, | ||
301 | .apply_uV = 1, | ||
302 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
303 | .state_mem = { | ||
304 | .disabled = 1, | ||
305 | }, | ||
306 | }, | ||
307 | }; | ||
308 | |||
309 | static struct regulator_init_data lp3974_ldo13_data = { | ||
310 | .constraints = { | ||
311 | .name = "VHIC_1.2V", | ||
312 | .min_uV = 1200000, | ||
313 | .max_uV = 1200000, | ||
314 | .apply_uV = 1, | ||
315 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
316 | .state_mem = { | ||
317 | .disabled = 1, | ||
318 | }, | ||
319 | }, | ||
320 | }; | ||
321 | |||
322 | static struct regulator_init_data lp3974_ldo14_data = { | ||
323 | .constraints = { | ||
324 | .name = "CAM_I_HOST_1.8V", | ||
325 | .min_uV = 1800000, | ||
326 | .max_uV = 1800000, | ||
327 | .apply_uV = 1, | ||
328 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
329 | .state_mem = { | ||
330 | .disabled = 1, | ||
331 | }, | ||
332 | }, | ||
333 | }; | ||
334 | |||
335 | static struct regulator_init_data lp3974_ldo15_data = { | ||
336 | .constraints = { | ||
337 | .name = "CAM_S_DIG+FM33_CORE_1.2V", | ||
338 | .min_uV = 1200000, | ||
339 | .max_uV = 1200000, | ||
340 | .apply_uV = 1, | ||
341 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
342 | .state_mem = { | ||
343 | .disabled = 1, | ||
344 | }, | ||
345 | }, | ||
346 | }; | ||
347 | |||
348 | static struct regulator_init_data lp3974_ldo16_data = { | ||
349 | .constraints = { | ||
350 | .name = "CAM_S_ANA_2.8V", | ||
351 | .min_uV = 2800000, | ||
352 | .max_uV = 2800000, | ||
353 | .apply_uV = 1, | ||
354 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
355 | .state_mem = { | ||
356 | .disabled = 1, | ||
357 | }, | ||
358 | }, | ||
359 | }; | ||
360 | |||
361 | static struct regulator_init_data lp3974_ldo17_data = { | ||
362 | .constraints = { | ||
363 | .name = "VCC_3.0V_LCD", | ||
364 | .min_uV = 3000000, | ||
365 | .max_uV = 3000000, | ||
366 | .apply_uV = 1, | ||
367 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
368 | .boot_on = 1, | ||
369 | .state_mem = { | ||
370 | .disabled = 1, | ||
371 | }, | ||
372 | }, | ||
373 | }; | ||
374 | |||
375 | static struct regulator_init_data lp3974_32khz_ap_data = { | ||
376 | .constraints = { | ||
377 | .name = "32KHz AP", | ||
378 | .always_on = 1, | ||
379 | .state_mem = { | ||
380 | .enabled = 1, | ||
381 | }, | ||
382 | }, | ||
383 | }; | ||
384 | |||
385 | static struct regulator_init_data lp3974_32khz_cp_data = { | ||
386 | .constraints = { | ||
387 | .name = "32KHz CP", | ||
388 | .state_mem = { | ||
389 | .disabled = 1, | ||
390 | }, | ||
391 | }, | ||
392 | }; | ||
393 | |||
394 | static struct regulator_init_data lp3974_vichg_data = { | ||
395 | .constraints = { | ||
396 | .name = "VICHG", | ||
397 | .state_mem = { | ||
398 | .disabled = 1, | ||
399 | }, | ||
400 | }, | ||
401 | }; | ||
402 | |||
403 | static struct regulator_init_data lp3974_esafeout1_data = { | ||
404 | .constraints = { | ||
405 | .name = "SAFEOUT1", | ||
406 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
407 | .state_mem = { | ||
408 | .enabled = 1, | ||
409 | }, | ||
410 | }, | ||
411 | }; | ||
412 | |||
413 | static struct regulator_init_data lp3974_esafeout2_data = { | ||
414 | .constraints = { | ||
415 | .name = "SAFEOUT2", | ||
416 | .boot_on = 1, | ||
417 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | ||
418 | .state_mem = { | ||
419 | .enabled = 1, | ||
420 | }, | ||
421 | }, | ||
422 | }; | ||
423 | |||
424 | static struct max8998_regulator_data lp3974_regulators[] = { | ||
425 | { MAX8998_LDO2, &lp3974_ldo2_data }, | ||
426 | { MAX8998_LDO3, &lp3974_ldo3_data }, | ||
427 | { MAX8998_LDO4, &lp3974_ldo4_data }, | ||
428 | { MAX8998_LDO5, &lp3974_ldo5_data }, | ||
429 | { MAX8998_LDO6, &lp3974_ldo6_data }, | ||
430 | { MAX8998_LDO7, &lp3974_ldo7_data }, | ||
431 | { MAX8998_LDO8, &lp3974_ldo8_data }, | ||
432 | { MAX8998_LDO9, &lp3974_ldo9_data }, | ||
433 | { MAX8998_LDO10, &lp3974_ldo10_data }, | ||
434 | { MAX8998_LDO11, &lp3974_ldo11_data }, | ||
435 | { MAX8998_LDO12, &lp3974_ldo12_data }, | ||
436 | { MAX8998_LDO13, &lp3974_ldo13_data }, | ||
437 | { MAX8998_LDO14, &lp3974_ldo14_data }, | ||
438 | { MAX8998_LDO15, &lp3974_ldo15_data }, | ||
439 | { MAX8998_LDO16, &lp3974_ldo16_data }, | ||
440 | { MAX8998_LDO17, &lp3974_ldo17_data }, | ||
441 | { MAX8998_BUCK1, &lp3974_buck1_data }, | ||
442 | { MAX8998_BUCK2, &lp3974_buck2_data }, | ||
443 | { MAX8998_BUCK3, &lp3974_buck3_data }, | ||
444 | { MAX8998_BUCK4, &lp3974_buck4_data }, | ||
445 | { MAX8998_EN32KHZ_AP, &lp3974_32khz_ap_data }, | ||
446 | { MAX8998_EN32KHZ_CP, &lp3974_32khz_cp_data }, | ||
447 | { MAX8998_ENVICHG, &lp3974_vichg_data }, | ||
448 | { MAX8998_ESAFEOUT1, &lp3974_esafeout1_data }, | ||
449 | { MAX8998_ESAFEOUT2, &lp3974_esafeout2_data }, | ||
450 | }; | ||
451 | |||
452 | static struct max8998_platform_data universal_lp3974_pdata = { | ||
453 | .num_regulators = ARRAY_SIZE(lp3974_regulators), | ||
454 | .regulators = lp3974_regulators, | ||
455 | .buck1_voltage1 = 1100000, /* INT */ | ||
456 | .buck1_voltage2 = 1000000, | ||
457 | .buck1_voltage3 = 1100000, | ||
458 | .buck1_voltage4 = 1000000, | ||
459 | .buck1_set1 = EXYNOS4_GPX0(5), | ||
460 | .buck1_set2 = EXYNOS4_GPX0(6), | ||
461 | .buck2_voltage1 = 1200000, /* G3D */ | ||
462 | .buck2_voltage2 = 1100000, | ||
463 | .buck1_default_idx = 0, | ||
464 | .buck2_set3 = EXYNOS4_GPE2(0), | ||
465 | .buck2_default_idx = 0, | ||
466 | .wakeup = true, | ||
467 | }; | ||
468 | |||
469 | /* GPIO I2C 5 (PMIC) */ | ||
470 | static struct i2c_board_info i2c5_devs[] __initdata = { | ||
471 | { | ||
472 | I2C_BOARD_INFO("max8952", 0xC0 >> 1), | ||
473 | .platform_data = &universal_max8952_pdata, | ||
474 | }, { | ||
475 | I2C_BOARD_INFO("lp3974", 0xCC >> 1), | ||
476 | .platform_data = &universal_lp3974_pdata, | ||
477 | }, | ||
478 | }; | ||
479 | |||
480 | /* GPIO KEYS */ | ||
72 | static struct gpio_keys_button universal_gpio_keys_tables[] = { | 481 | static struct gpio_keys_button universal_gpio_keys_tables[] = { |
73 | { | 482 | { |
74 | .code = KEY_VOLUMEUP, | 483 | .code = KEY_VOLUMEUP, |
@@ -203,6 +612,7 @@ static struct platform_device *universal_devices[] __initdata = { | |||
203 | &s3c_device_hsmmc0, | 612 | &s3c_device_hsmmc0, |
204 | &s3c_device_hsmmc2, | 613 | &s3c_device_hsmmc2, |
205 | &s3c_device_hsmmc3, | 614 | &s3c_device_hsmmc3, |
615 | &s3c_device_i2c5, | ||
206 | 616 | ||
207 | /* Universal Devices */ | 617 | /* Universal Devices */ |
208 | &universal_gpio_keys, | 618 | &universal_gpio_keys, |
@@ -223,6 +633,9 @@ static void __init universal_machine_init(void) | |||
223 | i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs)); | 633 | i2c_register_board_info(0, i2c0_devs, ARRAY_SIZE(i2c0_devs)); |
224 | i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); | 634 | i2c_register_board_info(1, i2c1_devs, ARRAY_SIZE(i2c1_devs)); |
225 | 635 | ||
636 | s3c_i2c5_set_platdata(NULL); | ||
637 | i2c_register_board_info(5, i2c5_devs, ARRAY_SIZE(i2c5_devs)); | ||
638 | |||
226 | /* Last */ | 639 | /* Last */ |
227 | platform_add_devices(universal_devices, ARRAY_SIZE(universal_devices)); | 640 | platform_add_devices(universal_devices, ARRAY_SIZE(universal_devices)); |
228 | } | 641 | } |