[PATCH v1 2/3] drm/panel: update backlight handling for samsung-s6e63j0x03

Emil Velikov emil.l.velikov at gmail.com
Thu Apr 9 14:13:28 UTC 2020


On Thu, 9 Apr 2020 at 12:53, Sam Ravnborg <sam at ravnborg.org> wrote:
>
> The samsung-s6e63j0x03 had a local way to handle backlight.
>
> Update the driver to use a devm_ based register function
> and utilize drm_panel backlight support. The changes results
> in a simpler driver with the same functionality.
>
> Signed-off-by: Sam Ravnborg <sam at ravnborg.org>
> Cc: Joonas Kylmälä <joonas.kylmala at iki.fi>
> Cc: Andrzej Hajda <a.hajda at samsung.com>
> Cc: Thierry Reding <thierry.reding at gmail.com>
> Cc: Inki Dae <inki.dae at samsung.com>
> Cc: Hyungwon Hwang <human.hwang at samsung.com>
> Cc: Hoegeun Kwon <hoegeun.kwon at samsung.com>
> ---
>  .../gpu/drm/panel/panel-samsung-s6e63j0x03.c  | 55 ++++++++++---------
>  1 file changed, 29 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c b/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c
> index a3570e0a90a8..2c035f87e3f0 100644
> --- a/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c
> +++ b/drivers/gpu/drm/panel/panel-samsung-s6e63j0x03.c
> @@ -36,7 +36,6 @@
>  struct s6e63j0x03 {
>         struct device *dev;
>         struct drm_panel panel;
> -       struct backlight_device *bl_dev;
>
>         struct regulator_bulk_data supplies[2];
>         struct gpio_desc *reset_gpio;
> @@ -184,7 +183,7 @@ static unsigned int s6e63j0x03_get_brightness_index(unsigned int brightness)
>  static int s6e63j0x03_update_gamma(struct s6e63j0x03 *ctx,
>                                         unsigned int brightness)
>  {
> -       struct backlight_device *bl_dev = ctx->bl_dev;
> +       struct backlight_device *bl_dev = ctx->panel.backlight;
>         unsigned int index = s6e63j0x03_get_brightness_index(brightness);
>         int ret;
>
> @@ -217,6 +216,30 @@ static const struct backlight_ops s6e63j0x03_bl_ops = {
>         .update_status = s6e63j0x03_set_brightness,
>  };
>
> +static int s6e63j0x03_backlight_register(struct s6e63j0x03 *ctx)
> +{
> +       struct backlight_properties props = {
Pretty sure we can (should really) make the props const.

Quick grep through drm, shows that there're other offenders, so might
as well do that in separate series.
Seems like other panels could follow suite, with later series of course.

Back on topic, it's not immediately obvious why the FB_BLANK_*
handling is safe to remove. Please add small mention in the commit log
mentioning why.

-Emil


More information about the dri-devel mailing list