Skip to content

Commit 7c323fb

Browse files
tdzlag-linaro
authored andcommitted
backlight: lms501kf03: Use lcd power constants
Replace FB_BLANK_ constants with their counterparts from the lcd 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 2576e64 commit 7c323fb

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

drivers/video/backlight/lms501kf03.c

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88

99
#include <linux/delay.h>
10-
#include <linux/fb.h>
1110
#include <linux/lcd.h>
1211
#include <linux/module.h>
1312
#include <linux/spi/spi.h>
@@ -205,7 +204,7 @@ static int lms501kf03_ldi_disable(struct lms501kf03 *lcd)
205204

206205
static int lms501kf03_power_is_on(int power)
207206
{
208-
return (power) <= FB_BLANK_NORMAL;
207+
return (power) <= LCD_POWER_REDUCED;
209208
}
210209

211210
static int lms501kf03_power_on(struct lms501kf03 *lcd)
@@ -294,8 +293,8 @@ static int lms501kf03_set_power(struct lcd_device *ld, int power)
294293
{
295294
struct lms501kf03 *lcd = lcd_get_data(ld);
296295

297-
if (power != FB_BLANK_UNBLANK && power != FB_BLANK_POWERDOWN &&
298-
power != FB_BLANK_NORMAL) {
296+
if (power != LCD_POWER_ON && power != LCD_POWER_OFF &&
297+
power != LCD_POWER_REDUCED) {
299298
dev_err(lcd->dev, "power value should be 0, 1 or 4.\n");
300299
return -EINVAL;
301300
}
@@ -349,11 +348,11 @@ static int lms501kf03_probe(struct spi_device *spi)
349348
* current lcd status is powerdown and then
350349
* it enables lcd panel.
351350
*/
352-
lcd->power = FB_BLANK_POWERDOWN;
351+
lcd->power = LCD_POWER_OFF;
353352

354-
lms501kf03_power(lcd, FB_BLANK_UNBLANK);
353+
lms501kf03_power(lcd, LCD_POWER_ON);
355354
} else {
356-
lcd->power = FB_BLANK_UNBLANK;
355+
lcd->power = LCD_POWER_ON;
357356
}
358357

359358
spi_set_drvdata(spi, lcd);
@@ -367,7 +366,7 @@ static void lms501kf03_remove(struct spi_device *spi)
367366
{
368367
struct lms501kf03 *lcd = spi_get_drvdata(spi);
369368

370-
lms501kf03_power(lcd, FB_BLANK_POWERDOWN);
369+
lms501kf03_power(lcd, LCD_POWER_OFF);
371370
}
372371

373372
#ifdef CONFIG_PM_SLEEP
@@ -381,16 +380,16 @@ static int lms501kf03_suspend(struct device *dev)
381380
* when lcd panel is suspend, lcd panel becomes off
382381
* regardless of status.
383382
*/
384-
return lms501kf03_power(lcd, FB_BLANK_POWERDOWN);
383+
return lms501kf03_power(lcd, LCD_POWER_OFF);
385384
}
386385

387386
static int lms501kf03_resume(struct device *dev)
388387
{
389388
struct lms501kf03 *lcd = dev_get_drvdata(dev);
390389

391-
lcd->power = FB_BLANK_POWERDOWN;
390+
lcd->power = LCD_POWER_OFF;
392391

393-
return lms501kf03_power(lcd, FB_BLANK_UNBLANK);
392+
return lms501kf03_power(lcd, LCD_POWER_ON);
394393
}
395394
#endif
396395

@@ -401,7 +400,7 @@ static void lms501kf03_shutdown(struct spi_device *spi)
401400
{
402401
struct lms501kf03 *lcd = spi_get_drvdata(spi);
403402

404-
lms501kf03_power(lcd, FB_BLANK_POWERDOWN);
403+
lms501kf03_power(lcd, LCD_POWER_OFF);
405404
}
406405

407406
static struct spi_driver lms501kf03_driver = {

0 commit comments

Comments
 (0)