display: JDI: fix no backlight in recovery mode
1. add set recovery backlight done flag to ignore redundant power on/off from userspace -> to fix no backlight in recovery mode 2. set recovery backlight to 100/255 to be consistent with bootloader Change-Id: Ic3bf1b54544b47dfd62d45c57db01ab1075c1bd8 Signed-off-by: yetta_wu <yetta_wu@asus.com>
This commit is contained in:
committed by
Android Partner Code Review
parent
cc3656f67a
commit
d266fbf6d0
@@ -367,6 +367,24 @@ static struct platform_device wfd_device = {
|
||||
#define HDMI_DDC_DATA_GPIO 71
|
||||
#define HDMI_HPD_GPIO 72
|
||||
|
||||
#define LPM_CHANNEL 2
|
||||
|
||||
static int mipi_JDI_gpio[] = {LPM_CHANNEL};
|
||||
|
||||
static struct mipi_dsi_panel_platform_data mipi_JDI_pdata = {
|
||||
.gpio = mipi_JDI_gpio,
|
||||
.recovery_backlight = 100, /* 1~255 */
|
||||
.set_recovery_bl_done = 0,
|
||||
};
|
||||
|
||||
static struct platform_device mipi_JDI_panel_device = {
|
||||
.name = "mipi_JDI",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = &mipi_JDI_pdata,
|
||||
}
|
||||
};
|
||||
|
||||
static uint32_t gpio_SR2[] = {
|
||||
/* LCM_XRES */
|
||||
GPIO_CFG(gpio_LCM_XRES_SR2, 0, GPIO_CFG_OUTPUT,
|
||||
@@ -383,6 +401,11 @@ static int mipi_dsi_panel_power(int on)
|
||||
|
||||
printk("%s+, on=%d\n", __func__, on);
|
||||
|
||||
if (mipi_JDI_pdata.set_recovery_bl_done) {
|
||||
pr_info("%s-, set_recovery_bl_done, do nothing\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (!dsi_power_on) {
|
||||
reg_lvs7 = regulator_get(&msm_mipi_dsi1_device.dev,
|
||||
"dsi1_vddio");
|
||||
@@ -741,8 +764,6 @@ static struct platform_device lvds_chimei_panel_device = {
|
||||
};
|
||||
#endif
|
||||
|
||||
#define LPM_CHANNEL 2
|
||||
|
||||
static int mipi_novatek_gpio[] = {LPM_CHANNEL};
|
||||
|
||||
static struct mipi_dsi_panel_platform_data mipi_novatek_pdata = {
|
||||
@@ -771,20 +792,6 @@ static struct platform_device mipi_lg_panel_device = {
|
||||
}
|
||||
};
|
||||
|
||||
static int mipi_JDI_gpio[] = {LPM_CHANNEL};
|
||||
|
||||
static struct mipi_dsi_panel_platform_data mipi_JDI_pdata = {
|
||||
.gpio = mipi_JDI_gpio,
|
||||
.recovery_backlight = 40, /* 1~255 */
|
||||
};
|
||||
|
||||
static struct platform_device mipi_JDI_panel_device = {
|
||||
.name = "mipi_JDI",
|
||||
.id = 0,
|
||||
.dev = {
|
||||
.platform_data = &mipi_JDI_pdata,
|
||||
}
|
||||
};
|
||||
#if 0
|
||||
#define FRC_GPIO_UPDATE (SX150X_EXP4_GPIO_BASE + 8)
|
||||
#define FRC_GPIO_RESET (SX150X_EXP4_GPIO_BASE + 9)
|
||||
|
||||
@@ -475,6 +475,7 @@ struct mipi_dsi_panel_platform_data {
|
||||
int fpga_3d_config_addr;
|
||||
int *gpio;
|
||||
int recovery_backlight;
|
||||
int set_recovery_bl_done;
|
||||
struct mipi_dsi_phy_ctrl *phy_ctrl_settings;
|
||||
char dlane_swap;
|
||||
void (*dsi_pwm_cfg)(void);
|
||||
|
||||
@@ -180,6 +180,11 @@ static int mipi_JDI_lcd_on(struct platform_device *pdev)
|
||||
if (mfd->key != MFD_KEY)
|
||||
return -EINVAL;
|
||||
|
||||
if (mipi_JDI_pdata->set_recovery_bl_done) {
|
||||
pr_info("%s-, set_recovery_bl_done, do nothing\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (first_cmd) {/* change first in setbacklight */
|
||||
first_cmd = false;
|
||||
pr_info("%s-, booting\n", __func__);
|
||||
@@ -220,6 +225,11 @@ static int mipi_JDI_lcd_off(struct platform_device *pdev)
|
||||
if (mfd->key != MFD_KEY)
|
||||
return -EINVAL;
|
||||
|
||||
if (mipi_JDI_pdata->set_recovery_bl_done) {
|
||||
pr_info("%s-, set_recovery_bl_done, do nothing\n", __func__);
|
||||
return 0;
|
||||
}
|
||||
|
||||
pr_info("%s, JDI display off command+\n", __func__);
|
||||
cmdreq_JDI.cmds = JDI_display_off_cmds;
|
||||
cmdreq_JDI.cmds_cnt = ARRAY_SIZE(JDI_display_off_cmds);
|
||||
@@ -305,9 +315,8 @@ static void mipi_JDI_set_recovery_backlight(struct msm_fb_data_type *mfd)
|
||||
{
|
||||
int ret;
|
||||
int recovery_backlight = 100;
|
||||
static int set_recovery_bl_done;
|
||||
|
||||
if (!set_recovery_bl_done) {
|
||||
if (!mipi_JDI_pdata->set_recovery_bl_done) {
|
||||
if (mipi_JDI_pdata->recovery_backlight)
|
||||
recovery_backlight = mipi_JDI_pdata->recovery_backlight;
|
||||
|
||||
@@ -332,7 +341,7 @@ static void mipi_JDI_set_recovery_backlight(struct msm_fb_data_type *mfd)
|
||||
msleep_interruptible(10);
|
||||
gpio_set_value_cansleep(gpio_LCD_BL_EN, 1);
|
||||
}
|
||||
set_recovery_bl_done = 1;
|
||||
mipi_JDI_pdata->set_recovery_bl_done = 1;
|
||||
}
|
||||
}
|
||||
static void mipi_JDI_lcd_shutdown(void)
|
||||
|
||||
Reference in New Issue
Block a user