msm: board-8930: add gpio-controlled backlight function
The function pointer is passed to driver to turn on/off backlight to avoid garbage display. (cherry picked from commit a07d78743024144158a7b2cc0c194ae75e9b6bea) CRs-fixed: 408728 Change-Id: Ibb218246bd3414b7004289e5afd0594a186374f1 Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
This commit is contained in:
committed by
Stephen Boyd
parent
f32dfe2ee0
commit
ca2b4a561c
@@ -124,6 +124,15 @@ static struct platform_device msm_fb_device = {
|
||||
};
|
||||
|
||||
static bool dsi_power_on;
|
||||
static struct mipi_dsi_panel_platform_data novatek_pdata;
|
||||
static void pm8917_gpio_set_backlight(int bl_level)
|
||||
{
|
||||
int gpio24 = PM8917_GPIO_PM_TO_SYS(24);
|
||||
if (bl_level > 0)
|
||||
gpio_set_value_cansleep(gpio24, 1);
|
||||
else
|
||||
gpio_set_value_cansleep(gpio24, 0);
|
||||
}
|
||||
|
||||
/*
|
||||
* TODO: When physical 8930/PM8038 hardware becomes
|
||||
@@ -206,9 +215,13 @@ static int mipi_dsi_cdp_panel_power(int on)
|
||||
rc);
|
||||
return -ENODEV;
|
||||
}
|
||||
gpio_set_value_cansleep(gpio24, 0);
|
||||
novatek_pdata.gpio_set_backlight =
|
||||
pm8917_gpio_set_backlight;
|
||||
}
|
||||
dsi_power_on = true;
|
||||
}
|
||||
|
||||
if (on) {
|
||||
rc = regulator_set_optimum_mode(reg_l8, 100000);
|
||||
if (rc < 0) {
|
||||
@@ -248,8 +261,6 @@ static int mipi_dsi_cdp_panel_power(int on)
|
||||
gpio_set_value(DISP_RST_GPIO, 1);
|
||||
gpio_set_value(DISP_3D_2D_MODE, 1);
|
||||
usleep(20);
|
||||
if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917)
|
||||
gpio_set_value_cansleep(gpio24, 1);
|
||||
} else {
|
||||
|
||||
gpio_set_value(DISP_RST_GPIO, 0);
|
||||
@@ -286,8 +297,6 @@ static int mipi_dsi_cdp_panel_power(int on)
|
||||
}
|
||||
gpio_set_value(DISP_3D_2D_MODE, 0);
|
||||
usleep(20);
|
||||
if (socinfo_get_pmic_model() == PMIC_MODEL_PM8917)
|
||||
gpio_set_value_cansleep(gpio24, 0);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -457,6 +457,7 @@ struct mipi_dsi_panel_platform_data {
|
||||
char dlane_swap;
|
||||
void (*dsi_pwm_cfg)(void);
|
||||
char enable_wled_bl_ctrl;
|
||||
void (*gpio_set_backlight)(int bl_level);
|
||||
};
|
||||
|
||||
struct lvds_panel_platform_data {
|
||||
|
||||
Reference in New Issue
Block a user