Commit 9adfe5c8 authored by Daniel Vetter's avatar Daniel Vetter Committed by Lee Jones

staging: fbtft: Stop using BL_CORE_DRIVER1

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: default avatarDaniel Vetter <daniel.vetter@intel.com>
Acked-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarLee Jones <lee.jones@linaro.org>
parent 832ae8e0
...@@ -246,7 +246,7 @@ static int fbtft_request_gpios_dt(struct fbtft_par *par) ...@@ -246,7 +246,7 @@ static int fbtft_request_gpios_dt(struct fbtft_par *par)
static int fbtft_backlight_update_status(struct backlight_device *bd) static int fbtft_backlight_update_status(struct backlight_device *bd)
{ {
struct fbtft_par *par = bl_get_data(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, fbtft_par_dbg(DEBUG_BACKLIGHT, par,
"%s: polarity=%d, power=%d, fb_blank=%d\n", "%s: polarity=%d, power=%d, fb_blank=%d\n",
...@@ -296,7 +296,7 @@ void fbtft_register_backlight(struct fbtft_par *par) ...@@ -296,7 +296,7 @@ void fbtft_register_backlight(struct fbtft_par *par)
/* Assume backlight is off, get polarity from current state of pin */ /* Assume backlight is off, get polarity from current state of pin */
bl_props.power = FB_BLANK_POWERDOWN; bl_props.power = FB_BLANK_POWERDOWN;
if (!gpio_get_value(par->gpio.led[0])) 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), bd = backlight_device_register(dev_driver_string(par->info->device),
par->info->device, par, par->info->device, par,
......
...@@ -229,6 +229,7 @@ struct fbtft_par { ...@@ -229,6 +229,7 @@ struct fbtft_par {
ktime_t update_time; ktime_t update_time;
bool bgr; bool bgr;
void *extra; void *extra;
bool polarity;
}; };
#define NUMARGS(...) (sizeof((int[]){__VA_ARGS__})/sizeof(int)) #define NUMARGS(...) (sizeof((int[]){__VA_ARGS__})/sizeof(int))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment