MLK-18358: drm/panel: rm67191: Fix initial brightness level
authorRobert Chiras <robert.chiras@nxp.com>
Mon, 21 May 2018 12:15:37 +0000 (15:15 +0300)
committerLeonard Crestez <leonard.crestez@nxp.com>
Wed, 17 Apr 2019 23:51:34 +0000 (02:51 +0300)
When enabling the panel, the initial brightness level was hard-coded to
0x20. This way, during a suspend/resume cycle, after resume, this
hard-coded brightness was used, instead of the one before suspend.
Removing the hard-coded level and using the one stored in backlight
device.

Signed-off-by: Robert Chiras <robert.chiras@nxp.com>
drivers/gpu/drm/panel/panel-raydium-rm67191.c

index 3be2412..7cd1bf5 100644 (file)
@@ -284,6 +284,7 @@ static int rad_panel_enable(struct drm_panel *panel)
        struct mipi_dsi_device *dsi = rad->dsi;
        struct device *dev = &dsi->dev;
        int color_format = color_format_from_dsi_format(dsi->format);
+       u16 brightness;
        int ret;
 
        if (rad->enabled)
@@ -343,7 +344,8 @@ static int rad_panel_enable(struct drm_panel *panel)
                goto fail;
        }
        /* Set display brightness */
-       ret = mipi_dsi_dcs_set_display_brightness(dsi, 0x20);
+       brightness = rad->backlight->props.brightness;
+       ret = mipi_dsi_dcs_set_display_brightness(dsi, brightness);
        if (ret < 0) {
                DRM_DEV_ERROR(dev, "Failed to set display brightness (%d)\n",
                              ret);