]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
staging: fbtft: Stop using BL_CORE_DRIVER1
authorDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 25 Apr 2018 17:42:51 +0000 (19:42 +0200)
committerLee Jones <lee.jones@linaro.org>
Mon, 30 Apr 2018 12:25:14 +0000 (13:25 +0100)
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>
drivers/staging/fbtft/fbtft-core.c
drivers/staging/fbtft/fbtft.h

index 0e36b66ae5f75d58a9216569d7f86a3da991fbbf..731e47149af8072318045e18efee2379aa6de540 100644 (file)
@@ -246,7 +246,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",
@@ -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,
index e19e64e0d094c26078c45b1ff7df924a62962a3c..c7cb4a7896f478f1765f9b5d2b6442ec27f342ba 100644 (file)
@@ -229,6 +229,7 @@ struct fbtft_par {
        ktime_t update_time;
        bool bgr;
        void *extra;
+       bool polarity;
 };
 
 #define NUMARGS(...)  (sizeof((int[]){__VA_ARGS__})/sizeof(int))