Skip to content

Commit

Permalink
staging: fbtft: Stop using BL_CORE_DRIVER1
Browse files Browse the repository at this point in the history
[ Upstream commit 9adfe5c ]

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.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
Daniel Vetter authored and Greg Kroah-Hartman committed Oct 17, 2019
1 parent 5a4a121 commit 0c7cf3e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/staging/fbtft/fbtft-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,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",
Expand Down Expand Up @@ -296,7 +296,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, &fbtft_bl_ops, &bl_props);
Expand Down
1 change: 1 addition & 0 deletions drivers/staging/fbtft/fbtft.h
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ struct fbtft_par {
ktime_t update_time;
bool bgr;
void *extra;
bool polarity;
};

#define NUMARGS(...) (sizeof((int[]){__VA_ARGS__})/sizeof(int))
Expand Down

0 comments on commit 0c7cf3e

Please sign in to comment.