Commit 66d653c3 authored by Stephen Kitt's avatar Stephen Kitt Committed by Greg Kroah-Hartman

staging: ftbft: Use backlight helper

backlight_properties.fb_blank is deprecated. The states it represents
are handled by other properties; but instead of accessing those
properties directly, drivers should use the helpers provided by
backlight.h.

Instead of manually checking the power state in struct
backlight_properties, use backlight_is_blank().

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: "Noralf Trønnes" <noralf@tronnes.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Javier Martinez Canillas <javierm@redhat.com>
Cc: Len Baker <len.baker@gmx.com>
Cc: dri-devel@lists.freedesktop.org
Cc: linux-fbdev@vger.kernel.org
Cc: linux-staging@lists.linux.dev
Reviewed-by: default avatarDaniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarStephen Kitt <steve@sk2.org>
Link: https://lore.kernel.org/r/20220607185516.1129900-1-steve@sk2.orgSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 455c5de9
...@@ -196,8 +196,7 @@ static int update_onboard_backlight(struct backlight_device *bd) ...@@ -196,8 +196,7 @@ static int update_onboard_backlight(struct backlight_device *bd)
"%s: power=%d, fb_blank=%d\n", "%s: power=%d, fb_blank=%d\n",
__func__, bd->props.power, bd->props.fb_blank); __func__, bd->props.power, bd->props.fb_blank);
on = (bd->props.power == FB_BLANK_UNBLANK) && on = !backlight_is_blank(bd);
(bd->props.fb_blank == FB_BLANK_UNBLANK);
/* Onboard backlight connected to GPIO0 on SSD1351, GPIO1 unused */ /* Onboard backlight connected to GPIO0 on SSD1351, GPIO1 unused */
write_reg(par, 0xB5, on ? 0x03 : 0x02); write_reg(par, 0xB5, on ? 0x03 : 0x02);
......
...@@ -137,8 +137,7 @@ static int fbtft_backlight_update_status(struct backlight_device *bd) ...@@ -137,8 +137,7 @@ static int fbtft_backlight_update_status(struct backlight_device *bd)
"%s: polarity=%d, power=%d, fb_blank=%d\n", "%s: polarity=%d, power=%d, fb_blank=%d\n",
__func__, polarity, bd->props.power, bd->props.fb_blank); __func__, polarity, bd->props.power, bd->props.fb_blank);
if ((bd->props.power == FB_BLANK_UNBLANK) && if (!backlight_is_blank(bd))
(bd->props.fb_blank == FB_BLANK_UNBLANK))
gpiod_set_value(par->gpio.led[0], polarity); gpiod_set_value(par->gpio.led[0], polarity);
else else
gpiod_set_value(par->gpio.led[0], !polarity); gpiod_set_value(par->gpio.led[0], !polarity);
......
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