msm: 9615: Add platform data for LTC4088 charger

Change-Id: I104817c6c9799efba508421c1d8f251f2c12a9d8
Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-9615.c b/arch/arm/mach-msm/board-9615.c
index 0a2e102..5efafae 100644
--- a/arch/arm/mach-msm/board-9615.c
+++ b/arch/arm/mach-msm/board-9615.c
@@ -34,6 +34,7 @@
 #include "cpuidle.h"
 #include "pm.h"
 #include "acpuclock.h"
+#include <linux/power/ltc4088-charger.h>
 
 static struct pm8xxx_adc_amux pm8018_adc_channels_data[] = {
 	{"vcoin", CHANNEL_VCOIN, CHAN_PATH_SCALING2, AMUX_RSV1,
@@ -133,6 +134,14 @@
 		.num_configs = ARRAY_SIZE(pm8018_led_configs),
 };
 
+#ifdef CONFIG_LTC4088_CHARGER
+static struct ltc4088_charger_platform_data ltc4088_chg_pdata = {
+		.gpio_mode_select_d0 = 7,
+		.gpio_mode_select_d1 = 6,
+		.gpio_mode_select_d2 = 4,
+};
+#endif
+
 static struct pm8018_platform_data pm8018_platform_data __devinitdata = {
 	.irq_pdata		= &pm8xxx_irq_pdata,
 	.gpio_pdata		= &pm8xxx_gpio_pdata,
@@ -200,6 +209,14 @@
 	.pull = GPIOMUX_PULL_NONE,
 };
 
+#ifdef CONFIG_LTC4088_CHARGER
+static struct gpiomux_setting ltc4088_chg_cfg = {
+	.func = GPIOMUX_FUNC_GPIO,
+	.drv = GPIOMUX_DRV_8MA,
+	.pull = GPIOMUX_PULL_NONE,
+};
+#endif
+
 struct msm_gpiomux_config msm9615_ps_hold_config[] __initdata = {
 	{
 		.gpio = 83,
@@ -209,6 +226,30 @@
 	},
 };
 
+#ifdef CONFIG_LTC4088_CHARGER
+static struct msm_gpiomux_config
+	msm9615_ltc4088_charger_config[] __initdata = {
+	{
+		.gpio = 4,
+		.settings = {
+			[GPIOMUX_SUSPENDED] = &ltc4088_chg_cfg,
+		},
+	},
+	{
+		.gpio = 6,
+		.settings = {
+			[GPIOMUX_SUSPENDED] = &ltc4088_chg_cfg,
+		},
+	},
+	{
+		.gpio = 7,
+		.settings = {
+			[GPIOMUX_SUSPENDED] = &ltc4088_chg_cfg,
+		},
+	},
+};
+#endif
+
 struct msm_gpiomux_config msm9615_gsbi_configs[] __initdata = {
 	{
 		.gpio      = 8,		/* GSBI3 QUP SPI_CLK */
@@ -600,6 +641,10 @@
 
 	msm_gpiomux_install(msm9615_ps_hold_config,
 			ARRAY_SIZE(msm9615_ps_hold_config));
+#ifdef CONFIG_LTC4088_CHARGER
+	msm_gpiomux_install(msm9615_ltc4088_charger_config,
+			ARRAY_SIZE(msm9615_ltc4088_charger_config));
+#endif
 	return 0;
 }
 
@@ -717,9 +762,22 @@
 	return platform_device_register(&msm_wlan_ar6000_pm_device);
 }
 
+#ifdef CONFIG_LTC4088_CHARGER
+static struct platform_device msm_device_charger = {
+	.name	= LTC4088_CHARGER_DEV_NAME,
+	.id	= -1,
+	.dev	= {
+		.platform_data = &ltc4088_chg_pdata,
+	},
+};
+#endif
+
 static struct platform_device *common_devices[] = {
 	&msm9615_device_dmov,
 	&msm_device_smd,
+#ifdef CONFIG_LTC4088_CHARGER
+	&msm_device_charger,
+#endif
 	&msm_device_otg,
 	&msm_device_gadget_peripheral,
 	&msm_device_hsusb_host,