drm/panel: Use backlight_enable/disable helpers
authorMeghana Madhyastha <meghana.madhyastha@gmail.com>
Wed, 24 Jan 2018 16:39:27 +0000 (16:39 +0000)
committerSean Paul <seanpaul@chromium.org>
Tue, 20 Feb 2018 16:07:22 +0000 (11:07 -0500)
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: Noralf Trønnes <noralf@tronnes.org>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Meghana Madhyastha <meghana.madhyastha@gmail.com>
Signed-off-by: Sean Paul <seanpaul@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/bc80cdb5cf1a6638dce9fb9f8da674e361e3b749.1516810725.git.meghana.madhyastha@gmail.com
drivers/gpu/drm/panel/panel-innolux-p079zca.c
drivers/gpu/drm/panel/panel-jdi-lt070me05000.c
drivers/gpu/drm/panel/panel-sharp-lq101r1sx01.c
drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c

index 6ba93449fcfbd5c74a25949880e5bc82d80ff10a..4c1b29eec2a5e34fd6f2c66ec39bb1999f6d8966 100644 (file)
@@ -45,8 +45,7 @@ static int innolux_panel_disable(struct drm_panel *panel)
        if (!innolux->enabled)
                return 0;
 
-       innolux->backlight->props.power = FB_BLANK_POWERDOWN;
-       backlight_update_status(innolux->backlight);
+       backlight_disable(innolux->backlight);
 
        err = mipi_dsi_dcs_set_display_off(innolux->link);
        if (err < 0)
@@ -151,8 +150,7 @@ static int innolux_panel_enable(struct drm_panel *panel)
        if (innolux->enabled)
                return 0;
 
-       innolux->backlight->props.power = FB_BLANK_UNBLANK;
-       ret = backlight_update_status(innolux->backlight);
+       ret = backlight_enable(innolux->backlight);
        if (ret) {
                DRM_DEV_ERROR(panel->drm->dev,
                              "Failed to enable backlight %d\n", ret);
index 5b2340ef74ed0cf069ef46aa9c973542bfbb3755..0a94ab79a6c0f768227a3c273751913ef5bc512e 100644 (file)
@@ -192,8 +192,7 @@ static int jdi_panel_disable(struct drm_panel *panel)
        if (!jdi->enabled)
                return 0;
 
-       jdi->backlight->props.power = FB_BLANK_POWERDOWN;
-       backlight_update_status(jdi->backlight);
+       backlight_disable(jdi->backlight);
 
        jdi->enabled = false;
 
@@ -289,8 +288,7 @@ static int jdi_panel_enable(struct drm_panel *panel)
        if (jdi->enabled)
                return 0;
 
-       jdi->backlight->props.power = FB_BLANK_UNBLANK;
-       backlight_update_status(jdi->backlight);
+       backlight_enable(jdi->backlight);
 
        jdi->enabled = true;
 
index 3cce3ca19601ed5999c045df23fc47ff40462c28..072c0fc794d6f8e3aed390ac1b0b798e9dbfd5ac 100644 (file)
@@ -96,10 +96,7 @@ static int sharp_panel_disable(struct drm_panel *panel)
        if (!sharp->enabled)
                return 0;
 
-       if (sharp->backlight) {
-               sharp->backlight->props.power = FB_BLANK_POWERDOWN;
-               backlight_update_status(sharp->backlight);
-       }
+       backlight_disable(sharp->backlight);
 
        sharp->enabled = false;
 
@@ -263,10 +260,7 @@ static int sharp_panel_enable(struct drm_panel *panel)
        if (sharp->enabled)
                return 0;
 
-       if (sharp->backlight) {
-               sharp->backlight->props.power = FB_BLANK_UNBLANK;
-               backlight_update_status(sharp->backlight);
-       }
+       backlight_enable(sharp->backlight);
 
        sharp->enabled = true;
 
index 3aeb0bda4947fd7c11d6d363a17d85fdfcfce8f2..8a5137963c7d91d01e314a35ecc8ebe5bf1adc9f 100644 (file)
@@ -117,10 +117,7 @@ static int sharp_nt_panel_disable(struct drm_panel *panel)
        if (!sharp_nt->enabled)
                return 0;
 
-       if (sharp_nt->backlight) {
-               sharp_nt->backlight->props.power = FB_BLANK_POWERDOWN;
-               backlight_update_status(sharp_nt->backlight);
-       }
+       backlight_disable(sharp_nt->backlight);
 
        sharp_nt->enabled = false;
 
@@ -203,10 +200,7 @@ static int sharp_nt_panel_enable(struct drm_panel *panel)
        if (sharp_nt->enabled)
                return 0;
 
-       if (sharp_nt->backlight) {
-               sharp_nt->backlight->props.power = FB_BLANK_UNBLANK;
-               backlight_update_status(sharp_nt->backlight);
-       }
+       backlight_enable(sharp_nt->backlight);
 
        sharp_nt->enabled = true;