ARM: tegra: cardhu: pass ac present interrupt and gpio to bq27x00
Pritesh Raithatha [Sat, 4 Jun 2011 13:33:16 +0000 (18:33 +0530)]
-Define AC_PRESENT_INT
-Assign AC_PRESENT_INT to .irq of battery driver bq27x00
-Pass AC_PRESENT_GPIO to bq27x00 throught plarform data

Original-Change-Id: Ic493cc4be5ef38a75f026cfd7082315563a07214
Reviewed-on: http://git-master/r/32620
Reviewed-by: Pritesh Raithatha <praithatha@nvidia.com>
Tested-by: Pritesh Raithatha <praithatha@nvidia.com>
Reviewed-by: Bharat Nihalani <bnihalani@nvidia.com>

Rebase-Id: Rbfe05a3a86c1c54e0c0dadf3640a1814b4b782f0

arch/arm/mach-tegra/board-cardhu-sensors.c
arch/arm/mach-tegra/board-cardhu.h

index d352158..d00fe90 100644 (file)
@@ -46,7 +46,7 @@
 #include "board.h"
 #include <linux/mpu.h>
 #include <media/sh532u.h>
-
+#include <linux/bq27x00.h>
 #include <mach/gpio.h>
 #include <mach/edp.h>
 
@@ -455,10 +455,15 @@ static struct nct1008_platform_data cardhu_nct1008_pdata = {
        .alarm_fn = tegra_throttling_enable,
 };
 
+static struct bq27x00_platform_data cardhu_bq27510_pdata = {
+       .ac_persent_gpio = AC_PRESENT_GPIO,
+};
+
 static struct i2c_board_info cardhu_i2c4_bq27510_board_info[] = {
        {
                I2C_BOARD_INFO("bq27510", 0x55),
-               .irq = AC_PRESENT_GPIO,
+               .irq = AC_PRESENT_INT,
+               .platform_data = &cardhu_bq27510_pdata,
        },
 };
 
index 8e68e12..3275078 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <mach/gpio.h>
 #include <mach/irqs.h>
+#include <linux/mfd/tps6591x.h>
 
 #define BOARD_E1187   0x0B57
 #define BOARD_E1186   0x0B56
 /* External peripheral act as interrupt controller */
 /* TPS6591x IRQs */
 #define TPS6591X_IRQ_BASE      TEGRA_NR_IRQS
-#define TPS6591X_IRQ_END       (TPS6591X_IRQ_BASE + 24)
+#define TPS6591X_IRQ_END       (TPS6591X_IRQ_BASE + 18)
+
+#define AC_PRESENT_INT         (TPS6591X_INT_GPIO4 + TPS6591X_IRQ_BASE)
 
 int cardhu_charge_init(void);
 int cardhu_regulator_init(void);