aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-imx/mach-mx35_3ds.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-imx/mach-mx35_3ds.c')
-rw-r--r--arch/arm/mach-imx/mach-mx35_3ds.c193
1 files changed, 193 insertions, 0 deletions
diff --git a/arch/arm/mach-imx/mach-mx35_3ds.c b/arch/arm/mach-imx/mach-mx35_3ds.c
index c433187988a2..86284bba46d3 100644
--- a/arch/arm/mach-imx/mach-mx35_3ds.c
+++ b/arch/arm/mach-imx/mach-mx35_3ds.c
@@ -34,6 +34,8 @@
34#include <linux/usb/otg.h> 34#include <linux/usb/otg.h>
35 35
36#include <linux/mtd/physmap.h> 36#include <linux/mtd/physmap.h>
37#include <linux/mfd/mc13892.h>
38#include <linux/regulator/machine.h>
37 39
38#include <asm/mach-types.h> 40#include <asm/mach-types.h>
39#include <asm/mach/arch.h> 41#include <asm/mach/arch.h>
@@ -253,6 +255,8 @@ static iomux_v3_cfg_t mx35pdk_pads[] = {
253 MX35_PAD_CSI_MCLK__IPU_CSI_MCLK, 255 MX35_PAD_CSI_MCLK__IPU_CSI_MCLK,
254 MX35_PAD_CSI_PIXCLK__IPU_CSI_PIXCLK, 256 MX35_PAD_CSI_PIXCLK__IPU_CSI_PIXCLK,
255 MX35_PAD_CSI_VSYNC__IPU_CSI_VSYNC, 257 MX35_PAD_CSI_VSYNC__IPU_CSI_VSYNC,
258 /*PMIC IRQ*/
259 MX35_PAD_GPIO2_0__GPIO2_0,
256}; 260};
257 261
258/* 262/*
@@ -317,6 +321,193 @@ static struct platform_device mx35_3ds_ov2640 = {
317 }, 321 },
318}; 322};
319 323
324static struct regulator_consumer_supply sw1_consumers[] = {
325 {
326 .supply = "cpu_vcc",
327 }
328};
329
330static struct regulator_consumer_supply vcam_consumers[] = {
331 /* sgtl5000 */
332 REGULATOR_SUPPLY("VDDA", "0-000a"),
333};
334
335static struct regulator_consumer_supply vaudio_consumers[] = {
336 REGULATOR_SUPPLY("cmos_vio", "soc-camera-pdrv.0"),
337};
338
339static struct regulator_init_data sw1_init = {
340 .constraints = {
341 .name = "SW1",
342 .min_uV = 600000,
343 .max_uV = 1375000,
344 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
345 .valid_modes_mask = 0,
346 .always_on = 1,
347 .boot_on = 1,
348 },
349 .num_consumer_supplies = ARRAY_SIZE(sw1_consumers),
350 .consumer_supplies = sw1_consumers,
351};
352
353static struct regulator_init_data sw2_init = {
354 .constraints = {
355 .name = "SW2",
356 .always_on = 1,
357 .boot_on = 1,
358 }
359};
360
361static struct regulator_init_data sw3_init = {
362 .constraints = {
363 .name = "SW3",
364 .always_on = 1,
365 .boot_on = 1,
366 }
367};
368
369static struct regulator_init_data sw4_init = {
370 .constraints = {
371 .name = "SW4",
372 .always_on = 1,
373 .boot_on = 1,
374 }
375};
376
377static struct regulator_init_data viohi_init = {
378 .constraints = {
379 .name = "VIOHI",
380 .boot_on = 1,
381 }
382};
383
384static struct regulator_init_data vusb_init = {
385 .constraints = {
386 .name = "VUSB",
387 .boot_on = 1,
388 }
389};
390
391static struct regulator_init_data vdig_init = {
392 .constraints = {
393 .name = "VDIG",
394 .boot_on = 1,
395 }
396};
397
398static struct regulator_init_data vpll_init = {
399 .constraints = {
400 .name = "VPLL",
401 .boot_on = 1,
402 }
403};
404
405static struct regulator_init_data vusb2_init = {
406 .constraints = {
407 .name = "VUSB2",
408 .boot_on = 1,
409 }
410};
411
412static struct regulator_init_data vvideo_init = {
413 .constraints = {
414 .name = "VVIDEO",
415 .boot_on = 1
416 }
417};
418
419static struct regulator_init_data vaudio_init = {
420 .constraints = {
421 .name = "VAUDIO",
422 .min_uV = 2300000,
423 .max_uV = 3000000,
424 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE,
425 .boot_on = 1
426 },
427 .num_consumer_supplies = ARRAY_SIZE(vaudio_consumers),
428 .consumer_supplies = vaudio_consumers,
429};
430
431static struct regulator_init_data vcam_init = {
432 .constraints = {
433 .name = "VCAM",
434 .min_uV = 2500000,
435 .max_uV = 3000000,
436 .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE |
437 REGULATOR_CHANGE_MODE,
438 .valid_modes_mask = REGULATOR_MODE_FAST | REGULATOR_MODE_NORMAL,
439 .boot_on = 1
440 },
441 .num_consumer_supplies = ARRAY_SIZE(vcam_consumers),
442 .consumer_supplies = vcam_consumers,
443};
444
445static struct regulator_init_data vgen1_init = {
446 .constraints = {
447 .name = "VGEN1",
448 }
449};
450
451static struct regulator_init_data vgen2_init = {
452 .constraints = {
453 .name = "VGEN2",
454 .boot_on = 1,
455 }
456};
457
458static struct regulator_init_data vgen3_init = {
459 .constraints = {
460 .name = "VGEN3",
461 }
462};
463
464static struct mc13xxx_regulator_init_data mx35_3ds_regulators[] = {
465 { .id = MC13892_SW1, .init_data = &sw1_init },
466 { .id = MC13892_SW2, .init_data = &sw2_init },
467 { .id = MC13892_SW3, .init_data = &sw3_init },
468 { .id = MC13892_SW4, .init_data = &sw4_init },
469 { .id = MC13892_VIOHI, .init_data = &viohi_init },
470 { .id = MC13892_VPLL, .init_data = &vpll_init },
471 { .id = MC13892_VDIG, .init_data = &vdig_init },
472 { .id = MC13892_VUSB2, .init_data = &vusb2_init },
473 { .id = MC13892_VVIDEO, .init_data = &vvideo_init },
474 { .id = MC13892_VAUDIO, .init_data = &vaudio_init },
475 { .id = MC13892_VCAM, .init_data = &vcam_init },
476 { .id = MC13892_VGEN1, .init_data = &vgen1_init },
477 { .id = MC13892_VGEN2, .init_data = &vgen2_init },
478 { .id = MC13892_VGEN3, .init_data = &vgen3_init },
479 { .id = MC13892_VUSB, .init_data = &vusb_init },
480};
481
482static struct mc13xxx_platform_data mx35_3ds_mc13892_data = {
483 .flags = MC13XXX_USE_RTC | MC13XXX_USE_TOUCHSCREEN,
484 .regulators = {
485 .num_regulators = ARRAY_SIZE(mx35_3ds_regulators),
486 .regulators = mx35_3ds_regulators,
487 },
488};
489
490#define GPIO_PMIC_INT IMX_GPIO_NR(2, 0)
491
492static struct i2c_board_info mx35_3ds_i2c_mc13892 = {
493
494 I2C_BOARD_INFO("mc13892", 0x08),
495 .platform_data = &mx35_3ds_mc13892_data,
496 .irq = IMX_GPIO_TO_IRQ(GPIO_PMIC_INT),
497};
498
499static void __init imx35_3ds_init_mc13892(void)
500{
501 int ret = gpio_request_one(GPIO_PMIC_INT, GPIOF_DIR_IN, "pmic irq");
502
503 if (ret) {
504 pr_err("failed to get pmic irq: %d\n", ret);
505 return;
506 }
507
508 i2c_register_board_info(0, &mx35_3ds_i2c_mc13892, 1);
509}
510
320static int mx35_3ds_otg_init(struct platform_device *pdev) 511static int mx35_3ds_otg_init(struct platform_device *pdev)
321{ 512{
322 return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERNAL_PHY); 513 return mx35_initialize_usb_hw(pdev->id, MXC_EHCI_INTERNAL_PHY);
@@ -412,6 +603,8 @@ static void __init mx35_3ds_init(void)
412 imx35_fb_pdev = imx35_add_mx3_sdc_fb(&mx3fb_pdata); 603 imx35_fb_pdev = imx35_add_mx3_sdc_fb(&mx3fb_pdata);
413 mx35_3ds_lcd.dev.parent = &imx35_fb_pdev->dev; 604 mx35_3ds_lcd.dev.parent = &imx35_fb_pdev->dev;
414 platform_device_register(&mx35_3ds_lcd); 605 platform_device_register(&mx35_3ds_lcd);
606
607 imx35_3ds_init_mc13892();
415} 608}
416 609
417static void __init mx35pdk_timer_init(void) 610static void __init mx35pdk_timer_init(void)