diff options
Diffstat (limited to 'arch/arm/mach-pxa/z2.c')
-rw-r--r-- | arch/arm/mach-pxa/z2.c | 118 |
1 files changed, 114 insertions, 4 deletions
diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c index d303c6929d32..f0d02288b4ca 100644 --- a/arch/arm/mach-pxa/z2.c +++ b/arch/arm/mach-pxa/z2.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/mtd/mtd.h> | 17 | #include <linux/mtd/mtd.h> |
18 | #include <linux/mtd/partitions.h> | 18 | #include <linux/mtd/partitions.h> |
19 | #include <linux/pwm_backlight.h> | 19 | #include <linux/pwm_backlight.h> |
20 | #include <linux/z2_battery.h> | ||
20 | #include <linux/dma-mapping.h> | 21 | #include <linux/dma-mapping.h> |
21 | #include <linux/spi/spi.h> | 22 | #include <linux/spi/spi.h> |
22 | #include <linux/spi/libertas_spi.h> | 23 | #include <linux/spi/libertas_spi.h> |
@@ -26,6 +27,7 @@ | |||
26 | #include <linux/gpio.h> | 27 | #include <linux/gpio.h> |
27 | #include <linux/gpio_keys.h> | 28 | #include <linux/gpio_keys.h> |
28 | #include <linux/delay.h> | 29 | #include <linux/delay.h> |
30 | #include <linux/regulator/machine.h> | ||
29 | 31 | ||
30 | #include <asm/mach-types.h> | 32 | #include <asm/mach-types.h> |
31 | #include <asm/mach/arch.h> | 33 | #include <asm/mach/arch.h> |
@@ -162,7 +164,7 @@ static struct mtd_partition z2_flash_parts[] = { | |||
162 | }, { | 164 | }, { |
163 | .name = "U-Boot Environment", | 165 | .name = "U-Boot Environment", |
164 | .offset = 0x40000, | 166 | .offset = 0x40000, |
165 | .size = 0x60000, | 167 | .size = 0x20000, |
166 | }, { | 168 | }, { |
167 | .name = "Flash", | 169 | .name = "Flash", |
168 | .offset = 0x60000, | 170 | .offset = 0x60000, |
@@ -452,6 +454,42 @@ static inline void z2_keys_init(void) {} | |||
452 | #endif | 454 | #endif |
453 | 455 | ||
454 | /****************************************************************************** | 456 | /****************************************************************************** |
457 | * Battery | ||
458 | ******************************************************************************/ | ||
459 | #if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE) | ||
460 | static struct z2_battery_info batt_chip_info = { | ||
461 | .batt_I2C_bus = 0, | ||
462 | .batt_I2C_addr = 0x55, | ||
463 | .batt_I2C_reg = 2, | ||
464 | .charge_gpio = GPIO0_ZIPITZ2_AC_DETECT, | ||
465 | .min_voltage = 2400000, | ||
466 | .max_voltage = 3700000, | ||
467 | .batt_div = 69, | ||
468 | .batt_mult = 1000000, | ||
469 | .batt_tech = POWER_SUPPLY_TECHNOLOGY_LION, | ||
470 | .batt_name = "Z2", | ||
471 | }; | ||
472 | |||
473 | static struct i2c_board_info __initdata z2_i2c_board_info[] = { | ||
474 | { | ||
475 | I2C_BOARD_INFO("aer915", 0x55), | ||
476 | .platform_data = &batt_chip_info, | ||
477 | }, { | ||
478 | I2C_BOARD_INFO("wm8750", 0x1b), | ||
479 | }, | ||
480 | |||
481 | }; | ||
482 | |||
483 | static void __init z2_i2c_init(void) | ||
484 | { | ||
485 | pxa_set_i2c_info(NULL); | ||
486 | i2c_register_board_info(0, ARRAY_AND_SIZE(z2_i2c_board_info)); | ||
487 | } | ||
488 | #else | ||
489 | static inline void z2_i2c_init(void) {} | ||
490 | #endif | ||
491 | |||
492 | /****************************************************************************** | ||
455 | * SSP Devices - WiFi and LCD control | 493 | * SSP Devices - WiFi and LCD control |
456 | ******************************************************************************/ | 494 | ******************************************************************************/ |
457 | #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE) | 495 | #if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE) |
@@ -573,23 +611,95 @@ static inline void z2_spi_init(void) {} | |||
573 | #endif | 611 | #endif |
574 | 612 | ||
575 | /****************************************************************************** | 613 | /****************************************************************************** |
614 | * Core power regulator | ||
615 | ******************************************************************************/ | ||
616 | #if defined(CONFIG_REGULATOR_TPS65023) || \ | ||
617 | defined(CONFIG_REGULATOR_TPS65023_MODULE) | ||
618 | static struct regulator_consumer_supply z2_tps65021_consumers[] = { | ||
619 | { | ||
620 | .supply = "vcc_core", | ||
621 | } | ||
622 | }; | ||
623 | |||
624 | static struct regulator_init_data z2_tps65021_info[] = { | ||
625 | { | ||
626 | .constraints = { | ||
627 | .name = "vcc_core range", | ||
628 | .min_uV = 800000, | ||
629 | .max_uV = 1600000, | ||
630 | .always_on = 1, | ||
631 | .valid_ops_mask = REGULATOR_CHANGE_VOLTAGE, | ||
632 | }, | ||
633 | .consumer_supplies = z2_tps65021_consumers, | ||
634 | .num_consumer_supplies = ARRAY_SIZE(z2_tps65021_consumers), | ||
635 | }, { | ||
636 | .constraints = { | ||
637 | .name = "DCDC2", | ||
638 | .min_uV = 3300000, | ||
639 | .max_uV = 3300000, | ||
640 | .always_on = 1, | ||
641 | }, | ||
642 | }, { | ||
643 | .constraints = { | ||
644 | .name = "DCDC3", | ||
645 | .min_uV = 1800000, | ||
646 | .max_uV = 1800000, | ||
647 | .always_on = 1, | ||
648 | }, | ||
649 | }, { | ||
650 | .constraints = { | ||
651 | .name = "LDO1", | ||
652 | .min_uV = 1000000, | ||
653 | .max_uV = 3150000, | ||
654 | .always_on = 1, | ||
655 | }, | ||
656 | }, { | ||
657 | .constraints = { | ||
658 | .name = "LDO2", | ||
659 | .min_uV = 1050000, | ||
660 | .max_uV = 3300000, | ||
661 | .always_on = 1, | ||
662 | }, | ||
663 | } | ||
664 | }; | ||
665 | |||
666 | static struct i2c_board_info __initdata z2_pi2c_board_info[] = { | ||
667 | { | ||
668 | I2C_BOARD_INFO("tps65021", 0x48), | ||
669 | .platform_data = &z2_tps65021_info, | ||
670 | }, | ||
671 | }; | ||
672 | |||
673 | static void __init z2_pmic_init(void) | ||
674 | { | ||
675 | pxa27x_set_i2c_power_info(NULL); | ||
676 | i2c_register_board_info(1, ARRAY_AND_SIZE(z2_pi2c_board_info)); | ||
677 | } | ||
678 | #else | ||
679 | static inline void z2_pmic_init(void) {} | ||
680 | #endif | ||
681 | |||
682 | /****************************************************************************** | ||
576 | * Machine init | 683 | * Machine init |
577 | ******************************************************************************/ | 684 | ******************************************************************************/ |
578 | static void __init z2_init(void) | 685 | static void __init z2_init(void) |
579 | { | 686 | { |
580 | pxa2xx_mfp_config(ARRAY_AND_SIZE(z2_pin_config)); | 687 | pxa2xx_mfp_config(ARRAY_AND_SIZE(z2_pin_config)); |
581 | 688 | ||
689 | pxa_set_ffuart_info(NULL); | ||
690 | pxa_set_btuart_info(NULL); | ||
691 | pxa_set_stuart_info(NULL); | ||
692 | |||
582 | z2_lcd_init(); | 693 | z2_lcd_init(); |
583 | z2_mmc_init(); | 694 | z2_mmc_init(); |
584 | z2_mkp_init(); | 695 | z2_mkp_init(); |
585 | 696 | z2_i2c_init(); | |
586 | pxa_set_i2c_info(NULL); | ||
587 | |||
588 | z2_spi_init(); | 697 | z2_spi_init(); |
589 | z2_nor_init(); | 698 | z2_nor_init(); |
590 | z2_pwm_init(); | 699 | z2_pwm_init(); |
591 | z2_leds_init(); | 700 | z2_leds_init(); |
592 | z2_keys_init(); | 701 | z2_keys_init(); |
702 | z2_pmic_init(); | ||
593 | } | 703 | } |
594 | 704 | ||
595 | MACHINE_START(ZIPIT2, "Zipit Z2") | 705 | MACHINE_START(ZIPIT2, "Zipit Z2") |