summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaxman Dewangan <ldewangan@nvidia.com>2011-07-14 18:38:07 +0530
committerVarun Colbert <vcolbert@nvidia.com>2011-07-15 16:50:16 -0700
commit7391b685365f8b1dc8c1477c6b3507007567991c (patch)
tree536da26068cbabe79d2363262412aea1be06ef64
parent844983ef04e9521595451829757fdcdc020273b2 (diff)
mfd: tps6591x: Reorganise GPIO definition
Adding the TPS6591x gpio definition in tps6591x core header files. bug 849976 Change-Id: I1f7a7cc38e220c091ccf44db5af6e43c34daa1cd Reviewed-on: http://git-master/r/41040 Reviewed-by: Varun Colbert <vcolbert@nvidia.com> Tested-by: Varun Colbert <vcolbert@nvidia.com>
-rw-r--r--arch/arm/mach-tegra/board-cardhu-power.c14
-rw-r--r--arch/arm/mach-tegra/board-cardhu.h22
-rw-r--r--drivers/mfd/tps6591x.c2
-rw-r--r--include/linux/mfd/tps6591x.h16
4 files changed, 35 insertions, 19 deletions
diff --git a/arch/arm/mach-tegra/board-cardhu-power.c b/arch/arm/mach-tegra/board-cardhu-power.c
index f2dc18c4e82a..11a33200dca3 100644
--- a/arch/arm/mach-tegra/board-cardhu-power.c
+++ b/arch/arm/mach-tegra/board-cardhu-power.c
@@ -658,10 +658,10 @@ static int disable_load_switch_rail(
}
/* common to most of boards*/
-GREG_INIT(0, en_5v_cp, en_5v_cp, NULL, 1, 0, TPS6591X_GPIO_GP0, false, 1, 0, 0, 0);
-GREG_INIT(1, en_5v0, en_5v0, NULL, 0, 0, TPS6591X_GPIO_GP2, false, 0, 0, 0, 0);
-GREG_INIT(2, en_ddr, en_ddr, NULL, 0, 0, TPS6591X_GPIO_GP6, false, 0, 0, 0, 0);
-GREG_INIT(3, en_3v3_sys, en_3v3_sys, NULL, 0, 0, TPS6591X_GPIO_GP7, false, 0, 0, 0, 0);
+GREG_INIT(0, en_5v_cp, en_5v_cp, NULL, 1, 0, TPS6591X_GPIO_0, false, 1, 0, 0, 0);
+GREG_INIT(1, en_5v0, en_5v0, NULL, 0, 0, TPS6591X_GPIO_2, false, 0, 0, 0, 0);
+GREG_INIT(2, en_ddr, en_ddr, NULL, 0, 0, TPS6591X_GPIO_6, false, 0, 0, 0, 0);
+GREG_INIT(3, en_3v3_sys, en_3v3_sys, NULL, 0, 0, TPS6591X_GPIO_7, false, 0, 0, 0, 0);
GREG_INIT(4, en_vdd_bl, en_vdd_bl, NULL, 0, 0, TEGRA_GPIO_PK3, false, 1, 0, 0, 0);
GREG_INIT(5, en_3v3_modem, en_3v3_modem, NULL, 1, 0, TEGRA_GPIO_PD6, false, 1, 0, 0, 0);
GREG_INIT(6, en_vdd_pnl1, en_vdd_pnl1, "vdd_3v3_devices", 0, 0, TEGRA_GPIO_PL4, false, 1, 0, 0, 0);
@@ -674,9 +674,9 @@ GREG_INIT(12, en_3v3_pex_hvdd, en_3v3_pex_hvdd, "vdd_3v3_devices", 0, 0,
GREG_INIT(13, en_1v8_cam, en_1v8_cam, "vdd_gen1v8", 0, 0, TEGRA_GPIO_PBB4, false, 0, 0, 0, 0);
/* E1291-A04 specific */
-GREG_INIT(1, en_5v0_a04, en_5v0, NULL, 0, 0, TPS6591X_GPIO_GP8, false, 0, 0, 0, 0);
-GREG_INIT(2, en_ddr_a04, en_ddr, NULL, 0, 0, TPS6591X_GPIO_GP7, false, 0, 0, 0, 0);
-GREG_INIT(3, en_3v3_sys_a04, en_3v3_sys, NULL, 0, 0, TPS6591X_GPIO_GP6, false, 0, 0, 0, 0);
+GREG_INIT(1, en_5v0_a04, en_5v0, NULL, 0, 0, TPS6591X_GPIO_8, false, 0, 0, 0, 0);
+GREG_INIT(2, en_ddr_a04, en_ddr, NULL, 0, 0, TPS6591X_GPIO_7, false, 0, 0, 0, 0);
+GREG_INIT(3, en_3v3_sys_a04, en_3v3_sys, NULL, 0, 0, TPS6591X_GPIO_6, false, 0, 0, 0, 0);
/*Specific to pm269*/
diff --git a/arch/arm/mach-tegra/board-cardhu.h b/arch/arm/mach-tegra/board-cardhu.h
index 77a47b3e5120..d5c2b803a3d2 100644
--- a/arch/arm/mach-tegra/board-cardhu.h
+++ b/arch/arm/mach-tegra/board-cardhu.h
@@ -57,16 +57,16 @@
/* External peripheral act as gpio */
/* TPS6591x GPIOs */
#define TPS6591X_GPIO_BASE TEGRA_NR_GPIOS
-#define TPS6591X_GPIO_GP0 (TPS6591X_GPIO_BASE + 0)
-#define TPS6591X_GPIO_GP1 (TPS6591X_GPIO_BASE + 1)
-#define TPS6591X_GPIO_GP2 (TPS6591X_GPIO_BASE + 2)
-#define TPS6591X_GPIO_GP3 (TPS6591X_GPIO_BASE + 3)
-#define TPS6591X_GPIO_GP4 (TPS6591X_GPIO_BASE + 4)
-#define TPS6591X_GPIO_GP5 (TPS6591X_GPIO_BASE + 5)
-#define TPS6591X_GPIO_GP6 (TPS6591X_GPIO_BASE + 6)
-#define TPS6591X_GPIO_GP7 (TPS6591X_GPIO_BASE + 7)
-#define TPS6591X_GPIO_GP8 (TPS6591X_GPIO_BASE + 8)
-#define TPS6591X_GPIO_END (TPS6591X_GPIO_GP8 + 1)
+#define TPS6591X_GPIO_0 (TPS6591X_GPIO_BASE + TPS6591X_GPIO_GP0)
+#define TPS6591X_GPIO_1 (TPS6591X_GPIO_BASE + TPS6591X_GPIO_GP1)
+#define TPS6591X_GPIO_2 (TPS6591X_GPIO_BASE + TPS6591X_GPIO_GP2)
+#define TPS6591X_GPIO_3 (TPS6591X_GPIO_BASE + TPS6591X_GPIO_GP3)
+#define TPS6591X_GPIO_4 (TPS6591X_GPIO_BASE + TPS6591X_GPIO_GP4)
+#define TPS6591X_GPIO_5 (TPS6591X_GPIO_BASE + TPS6591X_GPIO_GP5)
+#define TPS6591X_GPIO_6 (TPS6591X_GPIO_BASE + TPS6591X_GPIO_GP6)
+#define TPS6591X_GPIO_7 (TPS6591X_GPIO_BASE + TPS6591X_GPIO_GP7)
+#define TPS6591X_GPIO_8 (TPS6591X_GPIO_BASE + TPS6591X_GPIO_GP8)
+#define TPS6591X_GPIO_END (TPS6591X_GPIO_BASE + TPS6591X_GPIO_NR)
/* PMU_TCA6416 GPIOs */
#define PMU_TCA6416_GPIO_BASE (TPS6591X_GPIO_END)
@@ -144,7 +144,7 @@
#define PCA954x_I2C_BUS2 (PCA954x_I2C_BUS_BASE + 2)
#define PCA954x_I2C_BUS3 (PCA954x_I2C_BUS_BASE + 3)
-#define AC_PRESENT_GPIO TPS6591X_GPIO_GP4
+#define AC_PRESENT_GPIO TPS6591X_GPIO_4
/*****************Interrupt tables ******************/
/* External peripheral act as interrupt controller */
diff --git a/drivers/mfd/tps6591x.c b/drivers/mfd/tps6591x.c
index f63a01a2166a..fba43df03e83 100644
--- a/drivers/mfd/tps6591x.c
+++ b/drivers/mfd/tps6591x.c
@@ -410,7 +410,7 @@ static void tps6591x_gpio_init(struct tps6591x *tps6591x,
tps6591x->gpio.label = tps6591x->client->name;
tps6591x->gpio.dev = tps6591x->dev;
tps6591x->gpio.base = gpio_base;
- tps6591x->gpio.ngpio = 9;
+ tps6591x->gpio.ngpio = TPS6591X_GPIO_NR;
tps6591x->gpio.can_sleep = 1;
tps6591x->gpio.direction_input = tps6591x_gpio_input;
diff --git a/include/linux/mfd/tps6591x.h b/include/linux/mfd/tps6591x.h
index 8470c371e877..525a8616c44b 100644
--- a/include/linux/mfd/tps6591x.h
+++ b/include/linux/mfd/tps6591x.h
@@ -49,6 +49,22 @@ enum {
TPS6591X_INT_NR,
};
+/* Gpio definitions */
+enum {
+ TPS6591X_GPIO_GP0 = 0,
+ TPS6591X_GPIO_GP1 = 1,
+ TPS6591X_GPIO_GP2 = 2,
+ TPS6591X_GPIO_GP3 = 3,
+ TPS6591X_GPIO_GP4 = 4,
+ TPS6591X_GPIO_GP5 = 5,
+ TPS6591X_GPIO_GP6 = 6,
+ TPS6591X_GPIO_GP7 = 7,
+ TPS6591X_GPIO_GP8 = 8,
+
+ /* Last entry */
+ TPS6591X_GPIO_NR,
+};
+
struct tps6591x_subdev_info {
int id;
const char *name;