Skip to content

Commit 1adf982

Browse files
Thomas Zimmermannlag-linaro
authored andcommitted
backlight: ams369fb06: Use backlight power constants
Replace FB_BLANK_ constants with their counterparts from the backlight subsystem. The values are identical, so there's no change in functionality. Signed-off-by: Thomas Zimmermann <[email protected]> Reviewed-by: Daniel Thompson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Lee Jones <[email protected]>
1 parent 26dcf62 commit 1adf982

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

drivers/video/backlight/ams369fg06.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
#include <linux/backlight.h>
1212
#include <linux/delay.h>
13-
#include <linux/fb.h>
1413
#include <linux/lcd.h>
1514
#include <linux/module.h>
1615
#include <linux/spi/spi.h>
@@ -300,7 +299,7 @@ static int ams369fg06_ldi_disable(struct ams369fg06 *lcd)
300299

301300
static int ams369fg06_power_is_on(int power)
302301
{
303-
return power <= FB_BLANK_NORMAL;
302+
return power <= BACKLIGHT_POWER_REDUCED;
304303
}
305304

306305
static int ams369fg06_power_on(struct ams369fg06 *lcd)
@@ -396,8 +395,8 @@ static int ams369fg06_set_power(struct lcd_device *ld, int power)
396395
{
397396
struct ams369fg06 *lcd = lcd_get_data(ld);
398397

399-
if (power != FB_BLANK_UNBLANK && power != FB_BLANK_POWERDOWN &&
400-
power != FB_BLANK_NORMAL) {
398+
if (power != BACKLIGHT_POWER_ON && power != BACKLIGHT_POWER_OFF &&
399+
power != BACKLIGHT_POWER_REDUCED) {
401400
dev_err(lcd->dev, "power value should be 0, 1 or 4.\n");
402401
return -EINVAL;
403402
}
@@ -492,11 +491,11 @@ static int ams369fg06_probe(struct spi_device *spi)
492491
* current lcd status is powerdown and then
493492
* it enables lcd panel.
494493
*/
495-
lcd->power = FB_BLANK_POWERDOWN;
494+
lcd->power = BACKLIGHT_POWER_OFF;
496495

497-
ams369fg06_power(lcd, FB_BLANK_UNBLANK);
496+
ams369fg06_power(lcd, BACKLIGHT_POWER_ON);
498497
} else {
499-
lcd->power = FB_BLANK_UNBLANK;
498+
lcd->power = BACKLIGHT_POWER_ON;
500499
}
501500

502501
spi_set_drvdata(spi, lcd);
@@ -510,7 +509,7 @@ static void ams369fg06_remove(struct spi_device *spi)
510509
{
511510
struct ams369fg06 *lcd = spi_get_drvdata(spi);
512511

513-
ams369fg06_power(lcd, FB_BLANK_POWERDOWN);
512+
ams369fg06_power(lcd, BACKLIGHT_POWER_OFF);
514513
}
515514

516515
#ifdef CONFIG_PM_SLEEP
@@ -524,16 +523,16 @@ static int ams369fg06_suspend(struct device *dev)
524523
* when lcd panel is suspend, lcd panel becomes off
525524
* regardless of status.
526525
*/
527-
return ams369fg06_power(lcd, FB_BLANK_POWERDOWN);
526+
return ams369fg06_power(lcd, BACKLIGHT_POWER_OFF);
528527
}
529528

530529
static int ams369fg06_resume(struct device *dev)
531530
{
532531
struct ams369fg06 *lcd = dev_get_drvdata(dev);
533532

534-
lcd->power = FB_BLANK_POWERDOWN;
533+
lcd->power = BACKLIGHT_POWER_OFF;
535534

536-
return ams369fg06_power(lcd, FB_BLANK_UNBLANK);
535+
return ams369fg06_power(lcd, BACKLIGHT_POWER_ON);
537536
}
538537
#endif
539538

@@ -544,7 +543,7 @@ static void ams369fg06_shutdown(struct spi_device *spi)
544543
{
545544
struct ams369fg06 *lcd = spi_get_drvdata(spi);
546545

547-
ams369fg06_power(lcd, FB_BLANK_POWERDOWN);
546+
ams369fg06_power(lcd, BACKLIGHT_POWER_OFF);
548547
}
549548

550549
static struct spi_driver ams369fg06_driver = {

0 commit comments

Comments
 (0)