Samsung SCH-I545 (Verizon) source updates
/arch/arm/mach-msm/board-8064-display.c
blob:88cbfb99fa673efa01e3277b52a388d2a15aa59e -> blob:ee4f774ac0cc24d6942ae9b6c7de8faff925effc
--- arch/arm/mach-msm/board-8064-display.c
+++ arch/arm/mach-msm/board-8064-display.c
@@ -423,7 +423,7 @@ static int gpio27; /* LED_DRIVER */
static int gpio33;
#endif
static struct regulator *reg_L15;
-#if defined(CONFIG_MACH_JACTIVE_EUR) || defined(CONFIG_MACH_JACTIVE)
+#if defined(CONFIG_MACH_JACTIVE_EUR)
static struct regulator *reg_LVS1;
#endif
#else
@@ -462,44 +462,6 @@ static struct pm8xxx_mpp_config_data MLC
.control = PM8XXX_MPP_DOUT_CTRL_LOW,
};
-static int mipi_dsi_power(int enable)
-{
- int rc = 0;
-
- if (enable) {
-
- pr_info("[lcd] DSI ON\n");
- rc = regulator_set_optimum_mode(reg_l2, 100000);
- if (rc < 0) {
- pr_err("set_optimum_mode L2 failed, rc=%d\n", rc);
- return -EINVAL;
- }
-
- rc = regulator_enable(reg_l2);
- if (rc) {
- pr_err("enable L2 failed, rc=%d\n", rc);
- return -ENODEV;
- }
- } else {
-
- pr_info("[lcd] DSI OFF\n");
- rc = regulator_set_optimum_mode(reg_l2, 100);
- if (rc < 0) {
- pr_err("set_optimum_mode L2 failed, rc=%d\n", rc);
- return -EINVAL;
- }
-
- rc = regulator_disable(reg_l2);
- if (rc) {
- pr_err("disable reg_L2 failed, rc=%d\n", rc);
- return -ENODEV;
- }
- }
-
- return rc;
-
-}
-
#if defined(CONFIG_SUPPORT_DISPLAY_OCTA_TFT)
static int mipi_dsi_power_tft_request(void)
{
@@ -608,11 +570,10 @@ static int mipi_dsi_power_tft_request(vo
return rc;
}
-static int mipi_panel_power_tft(int enable)
+static int mipi_dsi_power_tft(int enable)
{
int rc = 0;
- pr_info("%s %d", __func__, enable);
if (enable) {
#if defined(CONFIG_MACH_JACTIVE_EUR)
rc = regulator_set_optimum_mode(reg_LVS1, 100000); /*IOVDD */
@@ -625,19 +586,6 @@ static int mipi_panel_power_tft(int enab
pr_err("enable LVS1 failed, rc=%d\n", rc);
return -ENODEV;
}
-#elif defined(CONFIG_MACH_JACTIVE)
- if (system_rev >= 11) {
- rc = regulator_set_optimum_mode(reg_LVS1, 100000); /*IOVDD */
- if (rc < 0) {
- pr_err("set_optimum_mode LVS1 failed, rc=%d\n", rc);
- return -EINVAL;
- }
- rc = regulator_enable(reg_LVS1);
- if (rc) {
- pr_err("enable LVS1 failed, rc=%d\n", rc);
- return -ENODEV;
- }
- }
#endif
rc = regulator_set_optimum_mode(reg_L15, 100000); /*IOVDD */
@@ -651,6 +599,20 @@ static int mipi_panel_power_tft(int enab
return -ENODEV;
}
+ rc = regulator_set_optimum_mode(reg_l2, 100000);
+ if (rc < 0) {
+ pr_err("set_optimum_mode L2 failed, rc=%d\n", rc);
+ return -EINVAL;
+ }
+
+ rc = regulator_enable(reg_l2);
+ if (rc) {
+ pr_err("enable L2 failed, rc=%d\n", rc);
+ return -ENODEV;
+ }
+
+
+ msleep(20);
#if defined(CONFIG_MACH_JACTIVE_ATT)
if(system_rev < 10)
gpio_direction_output(gpio33, 1);
@@ -659,6 +621,7 @@ static int mipi_panel_power_tft(int enab
#else
gpio_direction_output(LCD_22V_EN, 1);
#endif
+ msleep(20);
/*active_reset_ldi(gpio43);*/
if (system_rev == 0)
@@ -679,6 +642,20 @@ static int mipi_panel_power_tft(int enab
PM8921_MPP_PM_TO_SYS(MLCD_RST_MPP2),
&MLCD_RESET_LOW_CONFIG);
+ msleep(200);
+
+ rc = regulator_set_optimum_mode(reg_l2, 100);
+ if (rc < 0) {
+ pr_err("set_optimum_mode L2 failed, rc=%d\n", rc);
+ return -EINVAL;
+ }
+
+ rc = regulator_disable(reg_l2);
+ if (rc) {
+ pr_err("disable reg_L2 failed, rc=%d\n", rc);
+ return -ENODEV;
+ }
+
rc = regulator_set_optimum_mode(reg_L15, 100);
if (rc < 0) {
pr_err("set_optimum_mode L15 failed, rc=%d\n", rc);
@@ -691,6 +668,8 @@ static int mipi_panel_power_tft(int enab
return -ENODEV;
}
+ msleep(20);
+
gpio_direction_output(gpio27, 0);/*LED_DRIVER(gpio27);*/
#if defined(CONFIG_MACH_JACTIVE_ATT)
if(system_rev < 10)
@@ -712,21 +691,8 @@ static int mipi_panel_power_tft(int enab
pr_err("disable reg_LVS1 failed, rc=%d\n", rc);
return -ENODEV;
}
-#elif defined(CONFIG_MACH_JACTIVE)
- if (system_rev >= 11) {
- rc = regulator_set_optimum_mode(reg_LVS1, 100);
- if (rc < 0) {
- pr_err("set_optimum_mode LVS1 failed, rc=%d\n", rc);
- return -EINVAL;
- }
- rc = regulator_disable(reg_LVS1);
- if (rc) {
- pr_err("disable reg_LVS1 failed, rc=%d\n", rc);
- return -ENODEV;
- }
- }
-#endif
msleep(20);
+#endif
}
return rc;
@@ -758,6 +724,44 @@ static int mipi_dsi_power_octa_request(v
return rc;
}
+static int mipi_dsi_power_oled(int enable)
+{
+ int rc = 0;
+
+ if (enable) {
+
+ pr_info("[lcd] DSI ON\n");
+ rc = regulator_set_optimum_mode(reg_l2, 100000);
+ if (rc < 0) {
+ pr_err("set_optimum_mode L2 failed, rc=%d\n", rc);
+ return -EINVAL;
+ }
+
+ rc = regulator_enable(reg_l2);
+ if (rc) {
+ pr_err("enable L2 failed, rc=%d\n", rc);
+ return -ENODEV;
+ }
+ } else {
+
+ pr_info("[lcd] DSI OFF\n");
+ rc = regulator_set_optimum_mode(reg_l2, 100);
+ if (rc < 0) {
+ pr_err("set_optimum_mode L2 failed, rc=%d\n", rc);
+ return -EINVAL;
+ }
+
+ rc = regulator_disable(reg_l2);
+ if (rc) {
+ pr_err("disable reg_L2 failed, rc=%d\n", rc);
+ return -ENODEV;
+ }
+ }
+
+ return rc;
+
+}
+
static int mipi_panel_power_oled(int enable)
{
int rc = 0;
@@ -910,15 +914,6 @@ static int mipi_oled_power_set(void)
PTR_ERR(reg_LVS1));
return -ENODEV;
}
-#elif defined(CONFIG_MACH_JACTIVE)
- if (system_rev >=11) {
- reg_LVS1 = regulator_get(NULL, "8921_lvs1");
- if (IS_ERR_OR_NULL(reg_LVS1)) {
- pr_err("could not get 8917_LVS1, rc = %ld\n",
- PTR_ERR(reg_LVS1));
- return -ENODEV;
- }
- }
#endif
#endif
@@ -953,35 +948,41 @@ static int mipi_power_samsung_common(voi
return 0;
}
-static int mipi_dsi_power_samsung(int on)
+static int mipi_dsi_power_samsung_oled(int on)
{
- if (on)
- mipi_dsi_power(1);
- else
- mipi_dsi_power(0);
+ if (on) {
+#if defined(CONFIG_SUPPORT_DISPLAY_OCTA_TFT)
+ mipi_dsi_power_tft(1);
+#else
+ mipi_dsi_power_oled(1);
+#endif
+ } else {
+#if defined(CONFIG_SUPPORT_DISPLAY_OCTA_TFT)
+ mipi_dsi_power_tft(0);
+#else
+ mipi_dsi_power_oled(0);
+#endif
+ }
return 0;
}
#if defined(CONFIG_SUPPORT_SECOND_POWER)
-static int mipi_panel_power_samsung(int on)
+static int mipi_panel_power_samsung_oled(int on)
{
int rc;
rc = 0;
#ifdef CONFIG_SUPPORT_DISPLAY_OCTA_TFT
- if (on)
- rc = mipi_panel_power_tft(1);
- else
- rc = mipi_panel_power_tft(0);
+ return rc;
#else
- if (on)
- rc = mipi_panel_power_oled(1);
- else
- rc = mipi_panel_power_oled(0);
-
-#endif
+ if (on) {
+ mipi_panel_power_oled(1);
+ } else {
+ mipi_panel_power_oled(0);
+ }
return rc;
+#endif
}
#endif
@@ -989,9 +990,9 @@ static char mipi_dsi_splash_is_enabled(v
static struct mipi_dsi_platform_data mipi_dsi_pdata = {
.power_common = mipi_power_samsung_common,
- .dsi_power_save = mipi_dsi_power_samsung,
+ .dsi_power_save = mipi_dsi_power_samsung_oled,
#if defined(CONFIG_SUPPORT_SECOND_POWER)
- .panel_power_save = mipi_panel_power_samsung,
+ .panel_power_save = mipi_panel_power_samsung_oled,
#endif
.splash_is_enabled = mipi_dsi_splash_is_enabled,
.active_reset = active_reset,