[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <5da210ec-8a9d-4cf5-61c6-54b4c56d99de@linaro.org>
Date: Wed, 17 Jan 2018 16:50:49 +0000
From: Daniel Thompson <daniel.thompson@...aro.org>
To: Daniel Vetter <daniel.vetter@...ll.ch>,
DRI Development <dri-devel@...ts.freedesktop.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Lee Jones <lee.jones@...aro.org>,
Jingoo Han <jingoohan1@...il.com>,
Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
Daniel Vetter <daniel.vetter@...el.com>
Subject: Re: [PATCH 4/6] staging/fbtft: Stop using BL_CORE_DRIVER1
On 17/01/18 14:01, Daniel Vetter wrote:
> Leaking driver internal tracking into the already massively confusing
> backlight power tracking is really confusing.
>
> Luckily we have already a drvdata structure, so fixing this is really
> easy.
>
> Cc: Lee Jones <lee.jones@...aro.org>
> Cc: Daniel Thompson <daniel.thompson@...aro.org>
> Cc: Jingoo Han <jingoohan1@...il.com>
> Cc: Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@...el.com>
Acked-by: Daniel Thompson <daniel.thompson@...aro.org>
> ---
> drivers/staging/fbtft/fbtft-core.c | 4 ++--
> drivers/staging/fbtft/fbtft.h | 1 +
> 2 files changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/staging/fbtft/fbtft-core.c b/drivers/staging/fbtft/fbtft-core.c
> index 6d0363deba61..448929cc7ba1 100644
> --- a/drivers/staging/fbtft/fbtft-core.c
> +++ b/drivers/staging/fbtft/fbtft-core.c
> @@ -255,7 +255,7 @@ static int fbtft_request_gpios_dt(struct fbtft_par *par)
> static int fbtft_backlight_update_status(struct backlight_device *bd)
> {
> struct fbtft_par *par = bl_get_data(bd);
> - bool polarity = !!(bd->props.state & BL_CORE_DRIVER1);
> + bool polarity = par->polarity;
>
> fbtft_par_dbg(DEBUG_BACKLIGHT, par,
> "%s: polarity=%d, power=%d, fb_blank=%d\n",
> @@ -305,7 +305,7 @@ void fbtft_register_backlight(struct fbtft_par *par)
> /* Assume backlight is off, get polarity from current state of pin */
> bl_props.power = FB_BLANK_POWERDOWN;
> if (!gpio_get_value(par->gpio.led[0]))
> - bl_props.state |= BL_CORE_DRIVER1;
> + par->polarity = true;
>
> bd = backlight_device_register(dev_driver_string(par->info->device),
> par->info->device, par,
> diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
> index 488ab788138e..54de7cdfdff7 100644
> --- a/drivers/staging/fbtft/fbtft.h
> +++ b/drivers/staging/fbtft/fbtft.h
> @@ -240,6 +240,7 @@ struct fbtft_par {
> ktime_t update_time;
> bool bgr;
> void *extra;
> + bool polarity;
> };
>
> #define NUMARGS(...) (sizeof((int[]){__VA_ARGS__})/sizeof(int))
>
Powered by blists - more mailing lists