mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 16:16:15 -04:00
kernel: dsi: add new backlight device to avoid conflict
New added backlight wled driver uses ko, it is not be loaded at recovery mode. If new added backlight driver uses same backlight type as panel0-backlight, system will call panel0-backlight when ko is not loaded, but panel0-backlight is a logical device, cause system dead. Change-Id: I0c03905c116aae2f42e5ca11edd89035b0cadf33 Signed-off-by: wangyq13 <wangyq13@lenovo.com> Reviewed-on: https://gerrit.mot.com/1653756 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Jing Hu <hujing3@lenovo.com> Reviewed-by: Huosheng Liao <liaohs@motorola.com> Submit-Approved: Jira Key Signed-off-by: tanhua1 <tanhua1@lenovo.com> Reviewed-on: https://gerrit.mot.com/1949836 Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com> Reviewed-on: https://gerrit.mot.com/2046088 Reviewed-by: Zhihong Kang <kangzh@motorola.com>
This commit is contained in:
parent
83a97f26b2
commit
4222fb1b3d
2 changed files with 8 additions and 6 deletions
|
|
@ -857,10 +857,10 @@ int dsi_panel_set_backlight(struct dsi_panel *panel, u32 bl_lvl)
|
|||
rc = dsi_panel_update_pwm_backlight(panel, bl_lvl);
|
||||
break;
|
||||
case DSI_BACKLIGHT_I2C:
|
||||
if (!(bl->raw_bd))
|
||||
bl->raw_bd = backlight_device_get_by_type(BACKLIGHT_RAW);
|
||||
if (!(bl->i2c_bd))
|
||||
bl->i2c_bd = backlight_device_get_by_type(BACKLIGHT_PLATFORM);
|
||||
else
|
||||
rc = backlight_device_set_brightness(bl->raw_bd, bl_lvl);
|
||||
rc = backlight_device_set_brightness(bl->i2c_bd, bl_lvl);
|
||||
break;
|
||||
default:
|
||||
DSI_ERR("Backlight type(%d) not supported\n", bl->type);
|
||||
|
|
@ -874,6 +874,7 @@ static u32 dsi_panel_get_brightness(struct dsi_backlight_config *bl)
|
|||
{
|
||||
u32 cur_bl_level;
|
||||
struct backlight_device *bd = bl->raw_bd;
|
||||
struct backlight_device *i2c_bd = bl->i2c_bd;
|
||||
|
||||
/* default the brightness level to 50% */
|
||||
cur_bl_level = bl->bl_max_level >> 1;
|
||||
|
|
@ -885,8 +886,8 @@ static u32 dsi_panel_get_brightness(struct dsi_backlight_config *bl)
|
|||
cur_bl_level = bd->ops->get_brightness(bd);
|
||||
break;
|
||||
case DSI_BACKLIGHT_I2C:
|
||||
if (bd && bd->ops && bd->ops->get_brightness)
|
||||
cur_bl_level = bd->ops->get_brightness(bd);
|
||||
if (i2c_bd && i2c_bd->ops && i2c_bd->ops->get_brightness)
|
||||
cur_bl_level = i2c_bd->ops->get_brightness(i2c_bd);
|
||||
break;
|
||||
case DSI_BACKLIGHT_DCS:
|
||||
case DSI_BACKLIGHT_EXTERNAL:
|
||||
|
|
|
|||
|
|
@ -172,7 +172,8 @@ struct dsi_backlight_config {
|
|||
/* WLED params */
|
||||
struct led_trigger *wled;
|
||||
struct backlight_device *raw_bd;
|
||||
|
||||
struct backlight_device *i2c_bd;
|
||||
|
||||
/* DCS params */
|
||||
bool lp_mode;
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in a new issue