msm: Add gpio expander support for 8960

8960 has a camera gpio expander chip. Add support for it

Signed-off-by: Rohit Vaswani <rvaswani@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-msm8960.c b/arch/arm/mach-msm/board-msm8960.c
index 20156ee..c72af32 100644
--- a/arch/arm/mach-msm/board-msm8960.c
+++ b/arch/arm/mach-msm/board-msm8960.c
@@ -15,6 +15,7 @@
 #include <linux/io.h>
 #include <linux/irq.h>
 #include <linux/i2c.h>
+#include <linux/i2c/sx150x.h>
 #include <linux/gpio.h>
 #include <linux/msm_ssbi.h>
 #include <linux/regulator/gpio-regulator.h>
@@ -194,6 +195,24 @@
 #define PM8921_IRQ_BASE			(NR_MSM_IRQS + NR_GPIO_IRQS)
 #define PM8921_MPP_IRQ_BASE		(PM8921_IRQ_BASE + NR_GPIO_IRQS)
 
+#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
+enum {
+	GPIO_EXPANDER_IRQ_BASE = (PM8921_MPP_IRQ_BASE + PM8921_NR_MPPS),
+	GPIO_EXPANDER_GPIO_BASE = (PM8921_MPP_BASE + PM8921_NR_MPPS),
+	/* CAM Expander */
+	GPIO_CAM_EXPANDER_BASE = GPIO_EXPANDER_GPIO_BASE,
+	GPIO_CAM_GP_STROBE_READY = GPIO_CAM_EXPANDER_BASE,
+	GPIO_CAM_GP_AFBUSY,
+	GPIO_CAM_GP_STROBE_CE,
+	GPIO_CAM_GP_CAM1MP_XCLR,
+	GPIO_CAM_GP_CAMIF_RESET_N,
+	GPIO_CAM_GP_XMT_FLASH_INT,
+	GPIO_CAM_GP_LED_EN1,
+	GPIO_CAM_GP_LED_EN2,
+
+};
+#endif
+
 static struct gpiomux_setting gsbi1 = {
 	.func = GPIOMUX_FUNC_1,
 	.drv = GPIOMUX_DRV_8MA,
@@ -574,7 +593,6 @@
 	.pull = GPIOMUX_PULL_UP,
 };
 
-
 static struct msm_gpiomux_config msm8960_cyts_configs[] __initdata = {
 	{	/* TS INTERRUPT */
 		.gpio = 11,
@@ -599,6 +617,23 @@
 	},
 };
 
+#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
+enum {
+	SX150X_CAM,
+};
+
+static struct sx150x_platform_data sx150x_data[] __initdata = {
+	[SX150X_CAM] = {
+		.gpio_base         = GPIO_CAM_EXPANDER_BASE,
+		.oscio_is_gpo      = false,
+		.io_pullup_ena     = 0x0,
+		.io_pulldn_ena     = 0x0,
+		.io_open_drain_ena = 0x0,
+		.irq_summary       = -1,
+	},
+};
+#endif
+
 #define MSM_PMEM_KERNEL_EBI1_SIZE  0x110C000
 #define MSM_PMEM_ADSP_SIZE         0x3800000
 #define MSM_PMEM_AUDIO_SIZE        0x279000
@@ -3205,6 +3240,15 @@
 	int                    len;
 };
 
+#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
+static struct i2c_board_info cam_expander_i2c_info[] __initdata = {
+	{
+		I2C_BOARD_INFO("sx1508q", 0x22),
+		.platform_data = &sx150x_data[SX150X_CAM]
+	},
+};
+#endif
+
 #ifdef CONFIG_MSM_CAMERA
 static struct i2c_board_info msm_camera_boardinfo[] __initdata = {
 #ifdef CONFIG_IMX074
@@ -3255,7 +3299,15 @@
 		MSM_8960_GSBI3_QUP_I2C_BUS_ID,
 		cyttsp_info,
 		ARRAY_SIZE(cyttsp_info),
-	}
+	},
+#if defined(CONFIG_GPIO_SX150X) || defined(CONFIG_GPIO_SX150X_MODULE)
+	{
+		I2C_SURF | I2C_FFA,
+		MSM_8960_GSBI4_QUP_I2C_BUS_ID,
+		cam_expander_i2c_info,
+		ARRAY_SIZE(cam_expander_i2c_info),
+	},
+#endif
 };
 #endif /* CONFIG_I2C */