Commit d593bfdb authored by Meghana Madhyastha's avatar Meghana Madhyastha Committed by Sean Paul

drm/panel: Use backlight_enable/disable helpers

Use backlight_enable/disable helpers instead of changing
the property and calling backlight_update_status for cleaner
and simpler code and also to avoid repetitions.
Reviewed-by: default avatarNoralf Trønnes <noralf@tronnes.org>
Reviewed-by: default avatarSean Paul <seanpaul@chromium.org>
Acked-by: default avatarThierry Reding <treding@nvidia.com>
Signed-off-by: default avatarMeghana Madhyastha <meghana.madhyastha@gmail.com>
Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/bc80cdb5cf1a6638dce9fb9f8da674e361e3b749.1516810725.git.meghana.madhyastha@gmail.com
parent 27f6640c
...@@ -45,8 +45,7 @@ static int innolux_panel_disable(struct drm_panel *panel) ...@@ -45,8 +45,7 @@ static int innolux_panel_disable(struct drm_panel *panel)
if (!innolux->enabled) if (!innolux->enabled)
return 0; return 0;
innolux->backlight->props.power = FB_BLANK_POWERDOWN; backlight_disable(innolux->backlight);
backlight_update_status(innolux->backlight);
err = mipi_dsi_dcs_set_display_off(innolux->link); err = mipi_dsi_dcs_set_display_off(innolux->link);
if (err < 0) if (err < 0)
...@@ -151,8 +150,7 @@ static int innolux_panel_enable(struct drm_panel *panel) ...@@ -151,8 +150,7 @@ static int innolux_panel_enable(struct drm_panel *panel)
if (innolux->enabled) if (innolux->enabled)
return 0; return 0;
innolux->backlight->props.power = FB_BLANK_UNBLANK; ret = backlight_enable(innolux->backlight);
ret = backlight_update_status(innolux->backlight);
if (ret) { if (ret) {
DRM_DEV_ERROR(panel->drm->dev, DRM_DEV_ERROR(panel->drm->dev,
"Failed to enable backlight %d\n", ret); "Failed to enable backlight %d\n", ret);
......
...@@ -192,8 +192,7 @@ static int jdi_panel_disable(struct drm_panel *panel) ...@@ -192,8 +192,7 @@ static int jdi_panel_disable(struct drm_panel *panel)
if (!jdi->enabled) if (!jdi->enabled)
return 0; return 0;
jdi->backlight->props.power = FB_BLANK_POWERDOWN; backlight_disable(jdi->backlight);
backlight_update_status(jdi->backlight);
jdi->enabled = false; jdi->enabled = false;
...@@ -289,8 +288,7 @@ static int jdi_panel_enable(struct drm_panel *panel) ...@@ -289,8 +288,7 @@ static int jdi_panel_enable(struct drm_panel *panel)
if (jdi->enabled) if (jdi->enabled)
return 0; return 0;
jdi->backlight->props.power = FB_BLANK_UNBLANK; backlight_enable(jdi->backlight);
backlight_update_status(jdi->backlight);
jdi->enabled = true; jdi->enabled = true;
......
...@@ -96,10 +96,7 @@ static int sharp_panel_disable(struct drm_panel *panel) ...@@ -96,10 +96,7 @@ static int sharp_panel_disable(struct drm_panel *panel)
if (!sharp->enabled) if (!sharp->enabled)
return 0; return 0;
if (sharp->backlight) { backlight_disable(sharp->backlight);
sharp->backlight->props.power = FB_BLANK_POWERDOWN;
backlight_update_status(sharp->backlight);
}
sharp->enabled = false; sharp->enabled = false;
...@@ -263,10 +260,7 @@ static int sharp_panel_enable(struct drm_panel *panel) ...@@ -263,10 +260,7 @@ static int sharp_panel_enable(struct drm_panel *panel)
if (sharp->enabled) if (sharp->enabled)
return 0; return 0;
if (sharp->backlight) { backlight_enable(sharp->backlight);
sharp->backlight->props.power = FB_BLANK_UNBLANK;
backlight_update_status(sharp->backlight);
}
sharp->enabled = true; sharp->enabled = true;
......
...@@ -117,10 +117,7 @@ static int sharp_nt_panel_disable(struct drm_panel *panel) ...@@ -117,10 +117,7 @@ static int sharp_nt_panel_disable(struct drm_panel *panel)
if (!sharp_nt->enabled) if (!sharp_nt->enabled)
return 0; return 0;
if (sharp_nt->backlight) { backlight_disable(sharp_nt->backlight);
sharp_nt->backlight->props.power = FB_BLANK_POWERDOWN;
backlight_update_status(sharp_nt->backlight);
}
sharp_nt->enabled = false; sharp_nt->enabled = false;
...@@ -203,10 +200,7 @@ static int sharp_nt_panel_enable(struct drm_panel *panel) ...@@ -203,10 +200,7 @@ static int sharp_nt_panel_enable(struct drm_panel *panel)
if (sharp_nt->enabled) if (sharp_nt->enabled)
return 0; return 0;
if (sharp_nt->backlight) { backlight_enable(sharp_nt->backlight);
sharp_nt->backlight->props.power = FB_BLANK_UNBLANK;
backlight_update_status(sharp_nt->backlight);
}
sharp_nt->enabled = true; sharp_nt->enabled = true;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment