backlight: tdo24m: 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 <tzimmermann@suse.de>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Link: https://lore.kernel.org/r/20240906075439.98476-20-tzimmermann@suse.de
Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
Thomas Zimmermann 2024-09-06 09:52:33 +02:00 committed by Lee Jones
parent 86c0826a7e
commit e5dfbbd39e

View File

@ -16,7 +16,7 @@
#include <linux/lcd.h>
#include <linux/slab.h>
#define POWER_IS_ON(pwr) ((pwr) <= FB_BLANK_NORMAL)
#define POWER_IS_ON(pwr) ((pwr) <= LCD_POWER_REDUCED)
#define TDO24M_SPI_BUFF_SIZE (4)
#define MODE_QVGA 0
@ -354,7 +354,7 @@ static int tdo24m_probe(struct spi_device *spi)
return -ENOMEM;
lcd->spi_dev = spi;
lcd->power = FB_BLANK_POWERDOWN;
lcd->power = LCD_POWER_OFF;
lcd->mode = MODE_VGA; /* default to VGA */
lcd->buf = devm_kzalloc(&spi->dev, TDO24M_SPI_BUFF_SIZE, GFP_KERNEL);
@ -390,7 +390,7 @@ static int tdo24m_probe(struct spi_device *spi)
return PTR_ERR(lcd->lcd_dev);
spi_set_drvdata(spi, lcd);
err = tdo24m_power(lcd, FB_BLANK_UNBLANK);
err = tdo24m_power(lcd, LCD_POWER_ON);
if (err)
return err;
@ -401,7 +401,7 @@ static void tdo24m_remove(struct spi_device *spi)
{
struct tdo24m *lcd = spi_get_drvdata(spi);
tdo24m_power(lcd, FB_BLANK_POWERDOWN);
tdo24m_power(lcd, LCD_POWER_OFF);
}
#ifdef CONFIG_PM_SLEEP
@ -409,14 +409,14 @@ static int tdo24m_suspend(struct device *dev)
{
struct tdo24m *lcd = dev_get_drvdata(dev);
return tdo24m_power(lcd, FB_BLANK_POWERDOWN);
return tdo24m_power(lcd, LCD_POWER_OFF);
}
static int tdo24m_resume(struct device *dev)
{
struct tdo24m *lcd = dev_get_drvdata(dev);
return tdo24m_power(lcd, FB_BLANK_UNBLANK);
return tdo24m_power(lcd, LCD_POWER_ON);
}
#endif
@ -427,7 +427,7 @@ static void tdo24m_shutdown(struct spi_device *spi)
{
struct tdo24m *lcd = spi_get_drvdata(spi);
tdo24m_power(lcd, FB_BLANK_POWERDOWN);
tdo24m_power(lcd, LCD_POWER_OFF);
}
static struct spi_driver tdo24m_driver = {