backlight: l4f00242t03: 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-11-tzimmermann@suse.de
Signed-off-by: Lee Jones <lee@kernel.org>
This commit is contained in:
Thomas Zimmermann 2024-09-06 09:52:24 +02:00 committed by Lee Jones
parent 992f5c43fc
commit 4be0de90b7

View File

@ -112,40 +112,40 @@ static int l4f00242t03_lcd_power_set(struct lcd_device *ld, int power)
const u16 slpin = 0x10;
const u16 disoff = 0x28;
if (power <= FB_BLANK_NORMAL) {
if (priv->lcd_state <= FB_BLANK_NORMAL) {
if (power <= LCD_POWER_REDUCED) {
if (priv->lcd_state <= LCD_POWER_REDUCED) {
/* Do nothing, the LCD is running */
} else if (priv->lcd_state < FB_BLANK_POWERDOWN) {
} else if (priv->lcd_state < LCD_POWER_OFF) {
dev_dbg(&spi->dev, "Resuming LCD\n");
spi_write(spi, (const u8 *)&slpout, sizeof(u16));
msleep(60);
spi_write(spi, (const u8 *)&dison, sizeof(u16));
} else {
/* priv->lcd_state == FB_BLANK_POWERDOWN */
/* priv->lcd_state == LCD_POWER_OFF */
l4f00242t03_lcd_init(spi);
priv->lcd_state = FB_BLANK_VSYNC_SUSPEND;
priv->lcd_state = LCD_POWER_REDUCED_VSYNC_SUSPEND;
l4f00242t03_lcd_power_set(priv->ld, power);
}
} else if (power < FB_BLANK_POWERDOWN) {
if (priv->lcd_state <= FB_BLANK_NORMAL) {
} else if (power < LCD_POWER_OFF) {
if (priv->lcd_state <= LCD_POWER_REDUCED) {
/* Send the display in standby */
dev_dbg(&spi->dev, "Standby the LCD\n");
spi_write(spi, (const u8 *)&disoff, sizeof(u16));
msleep(60);
spi_write(spi, (const u8 *)&slpin, sizeof(u16));
} else if (priv->lcd_state < FB_BLANK_POWERDOWN) {
} else if (priv->lcd_state < LCD_POWER_OFF) {
/* Do nothing, the LCD is already in standby */
} else {
/* priv->lcd_state == FB_BLANK_POWERDOWN */
/* priv->lcd_state == LCD_POWER_OFF */
l4f00242t03_lcd_init(spi);
priv->lcd_state = FB_BLANK_UNBLANK;
priv->lcd_state = LCD_POWER_ON;
l4f00242t03_lcd_power_set(ld, power);
}
} else {
/* power == FB_BLANK_POWERDOWN */
if (priv->lcd_state != FB_BLANK_POWERDOWN) {
/* power == LCD_POWER_OFF */
if (priv->lcd_state != LCD_POWER_OFF) {
/* Clear the screen before shutting down */
spi_write(spi, (const u8 *)&disoff, sizeof(u16));
msleep(60);
@ -212,8 +212,8 @@ static int l4f00242t03_probe(struct spi_device *spi)
/* Init the LCD */
l4f00242t03_lcd_init(spi);
priv->lcd_state = FB_BLANK_VSYNC_SUSPEND;
l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_UNBLANK);
priv->lcd_state = LCD_POWER_REDUCED_VSYNC_SUSPEND;
l4f00242t03_lcd_power_set(priv->ld, LCD_POWER_ON);
dev_info(&spi->dev, "Epson l4f00242t03 lcd probed.\n");
@ -224,7 +224,7 @@ static void l4f00242t03_remove(struct spi_device *spi)
{
struct l4f00242t03_priv *priv = spi_get_drvdata(spi);
l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN);
l4f00242t03_lcd_power_set(priv->ld, LCD_POWER_OFF);
}
static void l4f00242t03_shutdown(struct spi_device *spi)
@ -232,7 +232,7 @@ static void l4f00242t03_shutdown(struct spi_device *spi)
struct l4f00242t03_priv *priv = spi_get_drvdata(spi);
if (priv)
l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN);
l4f00242t03_lcd_power_set(priv->ld, LCD_POWER_OFF);
}