aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/z2.c
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut@gmail.com>2010-05-31 10:51:50 -0400
committerEric Miao <eric.y.miao@gmail.com>2010-06-18 03:07:35 -0400
commitd198290d8250e6318cc31c15e7d017ef4441a438 (patch)
tree219b0055a1d5d9696e23d3bb1adc78e94594d0df /arch/arm/mach-pxa/z2.c
parent9ceb4c99f3f117dba16487d7c06790f0238726f8 (diff)
[ARM] pxa/z2: Add battery support into Zipit Z2
This patch adds support for the AER915 battery chip into Zipit Z2 platform file. Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa/z2.c')
-rw-r--r--arch/arm/mach-pxa/z2.c42
1 files changed, 39 insertions, 3 deletions
diff --git a/arch/arm/mach-pxa/z2.c b/arch/arm/mach-pxa/z2.c
index d303c6929d32..1452c71805c1 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>
@@ -452,6 +453,39 @@ static inline void z2_keys_init(void) {}
452#endif 453#endif
453 454
454/****************************************************************************** 455/******************************************************************************
456 * Battery
457 ******************************************************************************/
458#if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE)
459static struct z2_battery_info batt_chip_info = {
460 .batt_I2C_bus = 0,
461 .batt_I2C_addr = 0x55,
462 .batt_I2C_reg = 2,
463 .charge_gpio = GPIO0_ZIPITZ2_AC_DETECT,
464 .min_voltage = 2400000,
465 .max_voltage = 3700000,
466 .batt_div = 69,
467 .batt_mult = 1000000,
468 .batt_tech = POWER_SUPPLY_TECHNOLOGY_LION,
469 .batt_name = "Z2",
470};
471
472static struct i2c_board_info __initdata z2_i2c_board_info[] = {
473 {
474 I2C_BOARD_INFO("aer915", 0x55),
475 .platform_data = &batt_chip_info,
476 }
477};
478
479static void __init z2_i2c_init(void)
480{
481 pxa_set_i2c_info(NULL);
482 i2c_register_board_info(0, ARRAY_AND_SIZE(z2_i2c_board_info));
483}
484#else
485static inline void z2_i2c_init(void) {}
486#endif
487
488/******************************************************************************
455 * SSP Devices - WiFi and LCD control 489 * SSP Devices - WiFi and LCD control
456 ******************************************************************************/ 490 ******************************************************************************/
457#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE) 491#if defined(CONFIG_SPI_PXA2XX) || defined(CONFIG_SPI_PXA2XX_MODULE)
@@ -579,12 +613,14 @@ static void __init z2_init(void)
579{ 613{
580 pxa2xx_mfp_config(ARRAY_AND_SIZE(z2_pin_config)); 614 pxa2xx_mfp_config(ARRAY_AND_SIZE(z2_pin_config));
581 615
616 pxa_set_ffuart_info(NULL);
617 pxa_set_btuart_info(NULL);
618 pxa_set_stuart_info(NULL);
619
582 z2_lcd_init(); 620 z2_lcd_init();
583 z2_mmc_init(); 621 z2_mmc_init();
584 z2_mkp_init(); 622 z2_mkp_init();
585 623 z2_i2c_init();
586 pxa_set_i2c_info(NULL);
587
588 z2_spi_init(); 624 z2_spi_init();
589 z2_nor_init(); 625 z2_nor_init();
590 z2_pwm_init(); 626 z2_pwm_init();