aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/z2.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/z2.c')
-rw-r--r--arch/arm/mach-pxa/z2.c142
1 files changed, 123 insertions, 19 deletions
diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c
index f5d1ae3db3a..f0d02288b4c 100644
--- a/arch/arm/mach-pxa/z2.c
+++ b/arch/arm/mach-pxa/z2.c
@@ -3,8 +3,9 @@
3 * 3 *
4 * Support for the Zipit Z2 Handheld device. 4 * Support for the Zipit Z2 Handheld device.
5 * 5 *
6 * Author: Ken McGuire 6 * Copyright (C) 2009-2010 Marek Vasut <marek.vasut@gmail.com>
7 * Created: Jan 25, 2009 7 *
8 * Based on research and code by: Ken McGuire
8 * Based on mainstone.c as modified for the Zipit Z2. 9 * Based on mainstone.c as modified for the Zipit Z2.
9 * 10 *
10 * This program is free software; you can redistribute it and/or modify 11 * This program is free software; you can redistribute it and/or modify
@@ -16,6 +17,7 @@
16#include <linux/mtd/mtd.h> 17#include <linux/mtd/mtd.h>
17#include <linux/mtd/partitions.h> 18#include <linux/mtd/partitions.h>
18#include <linux/pwm_backlight.h> 19#include <linux/pwm_backlight.h>
20#include <linux/z2_battery.h>
19#include <linux/dma-mapping.h> 21#include <linux/dma-mapping.h>
20#include <linux/spi/spi.h> 22#include <linux/spi/spi.h>
21#include <linux/spi/libertas_spi.h> 23#include <linux/spi/libertas_spi.h>
@@ -25,6 +27,7 @@
25#include <linux/gpio.h> 27#include <linux/gpio.h>
26#include <linux/gpio_keys.h> 28#include <linux/gpio_keys.h>
27#include <linux/delay.h> 29#include <linux/delay.h>
30#include <linux/regulator/machine.h>
28 31
29#include <asm/mach-types.h> 32#include <asm/mach-types.h>
30#include <asm/mach/arch.h> 33#include <asm/mach/arch.h>
@@ -157,21 +160,14 @@ static struct mtd_partition z2_flash_parts[] = {
157 { 160 {
158 .name = "U-Boot Bootloader", 161 .name = "U-Boot Bootloader",
159 .offset = 0x0, 162 .offset = 0x0,
160 .size = 0x20000, 163 .size = 0x40000,
161 }, 164 }, {
162 {
163 .name = "Linux Kernel",
164 .offset = 0x20000,
165 .size = 0x220000,
166 },
167 {
168 .name = "Filesystem",
169 .offset = 0x240000,
170 .size = 0x5b0000,
171 },
172 {
173 .name = "U-Boot Environment", 165 .name = "U-Boot Environment",
174 .offset = 0x7f0000, 166 .offset = 0x40000,
167 .size = 0x20000,
168 }, {
169 .name = "Flash",
170 .offset = 0x60000,
175 .size = MTDPART_SIZ_FULL, 171 .size = MTDPART_SIZ_FULL,
176 }, 172 },
177}; 173};
@@ -458,6 +454,42 @@ static inline void z2_keys_init(void) {}
458#endif 454#endif
459 455
460/****************************************************************************** 456/******************************************************************************
457 * Battery
458 ******************************************************************************/
459#if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE)
460static 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
473static 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
483static 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
489static inline void z2_i2c_init(void) {}
490#endif
491
492/******************************************************************************
461 * SSP Devices - WiFi and LCD control 493 * SSP Devices - WiFi and LCD control
462 ******************************************************************************/ 494 ******************************************************************************/
463#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE) 495#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
@@ -579,23 +611,95 @@ static inline void z2_spi_init(void) {}
579#endif 611#endif
580 612
581/****************************************************************************** 613/******************************************************************************
614 * Core power regulator
615 ******************************************************************************/
616#if defined(CONFIG_REGULATOR_TPS65023) || \
617 defined(CONFIG_REGULATOR_TPS65023_MODULE)
618static struct regulator_consumer_supply z2_tps65021_consumers[] = {
619 {
620 .supply = "vcc_core",
621 }
622};
623
624static 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
666static 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
673static 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
679static inline void z2_pmic_init(void) {}
680#endif
681
682/******************************************************************************
582 * Machine init 683 * Machine init
583 ******************************************************************************/ 684 ******************************************************************************/
584static void __init z2_init(void) 685static void __init z2_init(void)
585{ 686{
586 pxa2xx_mfp_config(ARRAY_AND_SIZE(z2_pin_config)); 687 pxa2xx_mfp_config(ARRAY_AND_SIZE(z2_pin_config));
587 688
689 pxa_set_ffuart_info(NULL);
690 pxa_set_btuart_info(NULL);
691 pxa_set_stuart_info(NULL);
692
588 z2_lcd_init(); 693 z2_lcd_init();
589 z2_mmc_init(); 694 z2_mmc_init();
590 z2_mkp_init(); 695 z2_mkp_init();
591 696 z2_i2c_init();
592 pxa_set_i2c_info(NULL);
593
594 z2_spi_init(); 697 z2_spi_init();
595 z2_nor_init(); 698 z2_nor_init();
596 z2_pwm_init(); 699 z2_pwm_init();
597 z2_leds_init(); 700 z2_leds_init();
598 z2_keys_init(); 701 z2_keys_init();
702 z2_pmic_init();
599} 703}
600 704
601MACHINE_START(ZIPIT2, "Zipit Z2") 705MACHINE_START(ZIPIT2, "Zipit Z2")