summaryrefslogtreecommitdiff
path: root/arch/arm/mach-tegra/board-ventana-power.c
diff options
context:
space:
mode:
authorPritesh Raithatha <praithatha@nvidia.com>2011-09-27 13:31:46 +0530
committerDan Willemsen <dwillemsen@nvidia.com>2011-11-30 21:49:10 -0800
commit1e1fa7f1f4ddc5b5021fae6e79157359b49189dd (patch)
tree84a7118606df26ce84a6521f486705db14420496 /arch/arm/mach-tegra/board-ventana-power.c
parentbc3638c9c538cd8cc27736f240f1a490bacc9279 (diff)
arm: tegra: ventana: add gpio charger support
-Separate ac detection from battery driver Bug 877456 Change-Id: I411ca707c58422075bdb27105bafc86a8de4e63e Signed-off-by: Pritesh Raithatha <praithatha@nvidia.com> Reviewed-on: http://git-master/r/54636 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Rebase-Id: R34bd7290f4c20c55bba8730b48fabe3fe0f566e1
Diffstat (limited to 'arch/arm/mach-tegra/board-ventana-power.c')
-rw-r--r--arch/arm/mach-tegra/board-ventana-power.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/arch/arm/mach-tegra/board-ventana-power.c b/arch/arm/mach-tegra/board-ventana-power.c
index c3e644d1aa1d..7f85b91cfb25 100644
--- a/arch/arm/mach-tegra/board-ventana-power.c
+++ b/arch/arm/mach-tegra/board-ventana-power.c
@@ -23,6 +23,7 @@
#include <linux/mfd/tps6586x.h>
#include <linux/gpio.h>
#include <linux/io.h>
+#include <linux/power/gpio-charger.h>
#include <mach/iomap.h>
#include <mach/irqs.h>
@@ -261,6 +262,33 @@ int __init ventana_regulator_init(void)
return 0;
}
+static char *ventana_battery[] = {
+ "battery",
+};
+
+static struct gpio_charger_platform_data ventana_charger_pdata = {
+ .name = "ac",
+ .type = POWER_SUPPLY_TYPE_MAINS,
+ .gpio = AC_PRESENT_GPIO,
+ .gpio_active_low = 1,
+ .supplied_to = ventana_battery,
+ .num_supplicants = ARRAY_SIZE(ventana_battery),
+};
+
+static struct platform_device ventana_charger_device = {
+ .name = "gpio-charger",
+ .dev = {
+ .platform_data = &ventana_charger_pdata,
+ },
+};
+
+int __init ventana_charger_init(void)
+{
+ tegra_gpio_enable(AC_PRESENT_GPIO);
+ platform_device_register(&ventana_charger_device);
+ return 0;
+}
+
static int __init ventana_pcie_init(void)
{
int ret;