msm: board: lpm gpio support to mipi driver

lpm gpio support is added to mipi toshiba driver. it will provide
pwm signal to mipi panel driver to control the back light.

Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
diff --git a/arch/arm/mach-msm/board-msm8960.c b/arch/arm/mach-msm/board-msm8960.c
index fe10c97..386e3b1 100644
--- a/arch/arm/mach-msm/board-msm8960.c
+++ b/arch/arm/mach-msm/board-msm8960.c
@@ -145,7 +145,7 @@
 	PM8XXX_GPIO_DISABLE(7),				 /* Disable NFC */
 	PM8XXX_GPIO_INPUT(16,	    PM_GPIO_PULL_UP_30), /* SD_CARD_WP */
 	PM8XXX_GPIO_DISABLE(22),			 /* Disable NFC */
-	PM8XXX_GPIO_OUTPUT_FUNC(24, 0, PM_GPIO_FUNC_1),	 /* Bl: Off, PWM mode */
+	PM8XXX_GPIO_OUTPUT_FUNC(24, 0, PM_GPIO_FUNC_2),	 /* Bl: Off, PWM mode */
 	PM8XXX_GPIO_INPUT(26,	    PM_GPIO_PULL_UP_30), /* SD_CARD_DET_N */
 	PM8XXX_GPIO_OUTPUT(43,	    0),			 /* DISP_RESET_N */
 };
@@ -1026,7 +1026,7 @@
 static int mipi_dsi_panel_power(int on)
 {
 	static struct regulator *reg_l8, *reg_l23, *reg_l2;
-	static int gpio24, gpio43;
+	static int gpio43;
 	int rc;
 
 	struct pm_gpio gpio43_param = {
@@ -1041,18 +1041,6 @@
 		.disable_pin = 0,
 	};
 
-	struct pm_gpio gpio24_param = {
-		.direction = PM_GPIO_DIR_OUT,
-		.output_buffer = PM_GPIO_OUT_BUF_CMOS,
-		.output_value = 1,
-		.pull = PM_GPIO_PULL_NO,
-		.vin_sel = 2,
-		.out_strength = PM_GPIO_STRENGTH_HIGH,
-		.function = PM_GPIO_FUNC_NORMAL,
-		.inv_int_pol = 0,
-		.disable_pin = 0,
-	};
-
 	pr_info("%s: state : %d\n", __func__, on);
 
 	if (!dsi_power_on) {
@@ -1104,12 +1092,6 @@
 			return -ENODEV;
 		}
 
-		gpio24 = PM8921_GPIO_PM_TO_SYS(24);
-		rc = gpio_request(gpio24, "disp_backlight");
-		if (rc) {
-			pr_err("request gpio 24 failed, rc=%d\n", rc);
-			return -EINVAL;
-		}
 		dsi_power_on = true;
 	}
 
@@ -1169,13 +1151,6 @@
 			pr_err("gpio_config 43 failed (4), rc=%d\n", rc);
 			return -EINVAL;
 		}
-
-		rc = pm8xxx_gpio_config(gpio24, &gpio24_param);
-		if (rc) {
-			pr_err("gpio_config 24 failed, rc=%d\n", rc);
-			return -EINVAL;
-		}
-
 		gpio_set_value_cansleep(gpio43, 1);
 	} else {
 		rc = regulator_set_optimum_mode(reg_l8, 100);
@@ -1317,9 +1292,19 @@
 	.id = 0,
 };
 
+#define LPM_CHANNEL0 0
+static int toshiba_gpio[] = {LPM_CHANNEL0};
+
+static struct mipi_dsi_panel_platform_data toshiba_pdata = {
+	.gpio = toshiba_gpio,
+};
+
 static struct platform_device mipi_dsi_toshiba_panel_device = {
 	.name = "mipi_toshiba",
 	.id = 0,
+	.dev = {
+		.platform_data = &toshiba_pdata,
+	}
 };
 
 #ifdef CONFIG_FB_MSM_HDMI_MSM_PANEL
diff --git a/arch/arm/mach-msm/board-msm8x60.c b/arch/arm/mach-msm/board-msm8x60.c
index c3a60d0..3c50a6c 100644
--- a/arch/arm/mach-msm/board-msm8x60.c
+++ b/arch/arm/mach-msm/board-msm8x60.c
@@ -2927,7 +2927,7 @@
 
 #define FPGA_3D_GPIO_CONFIG_ADDR	0x1D00017A
 
-static struct mipi_dsi_novatek_platform_data novatek_pdata = {
+static struct mipi_dsi_panel_platform_data novatek_pdata = {
 	.fpga_3d_config_addr  = FPGA_3D_GPIO_CONFIG_ADDR,
 };
 
diff --git a/arch/arm/mach-msm/include/mach/board.h b/arch/arm/mach-msm/include/mach/board.h
index 133a987..dccdde9 100644
--- a/arch/arm/mach-msm/include/mach/board.h
+++ b/arch/arm/mach-msm/include/mach/board.h
@@ -303,8 +303,9 @@
 	int target_type;
 };
 
-struct mipi_dsi_novatek_platform_data {
+struct mipi_dsi_panel_platform_data {
 	int fpga_3d_config_addr;
+	int *gpio;
 };
 
 struct msm_fb_platform_data {