Skip to content

Commit 4be0de9

Browse files
tdzlag-linaro
authored andcommitted
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 <[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 992f5c4 commit 4be0de9

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

drivers/video/backlight/l4f00242t03.c

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -112,40 +112,40 @@ static int l4f00242t03_lcd_power_set(struct lcd_device *ld, int power)
112112
const u16 slpin = 0x10;
113113
const u16 disoff = 0x28;
114114

115-
if (power <= FB_BLANK_NORMAL) {
116-
if (priv->lcd_state <= FB_BLANK_NORMAL) {
115+
if (power <= LCD_POWER_REDUCED) {
116+
if (priv->lcd_state <= LCD_POWER_REDUCED) {
117117
/* Do nothing, the LCD is running */
118-
} else if (priv->lcd_state < FB_BLANK_POWERDOWN) {
118+
} else if (priv->lcd_state < LCD_POWER_OFF) {
119119
dev_dbg(&spi->dev, "Resuming LCD\n");
120120

121121
spi_write(spi, (const u8 *)&slpout, sizeof(u16));
122122
msleep(60);
123123
spi_write(spi, (const u8 *)&dison, sizeof(u16));
124124
} else {
125-
/* priv->lcd_state == FB_BLANK_POWERDOWN */
125+
/* priv->lcd_state == LCD_POWER_OFF */
126126
l4f00242t03_lcd_init(spi);
127-
priv->lcd_state = FB_BLANK_VSYNC_SUSPEND;
127+
priv->lcd_state = LCD_POWER_REDUCED_VSYNC_SUSPEND;
128128
l4f00242t03_lcd_power_set(priv->ld, power);
129129
}
130-
} else if (power < FB_BLANK_POWERDOWN) {
131-
if (priv->lcd_state <= FB_BLANK_NORMAL) {
130+
} else if (power < LCD_POWER_OFF) {
131+
if (priv->lcd_state <= LCD_POWER_REDUCED) {
132132
/* Send the display in standby */
133133
dev_dbg(&spi->dev, "Standby the LCD\n");
134134

135135
spi_write(spi, (const u8 *)&disoff, sizeof(u16));
136136
msleep(60);
137137
spi_write(spi, (const u8 *)&slpin, sizeof(u16));
138-
} else if (priv->lcd_state < FB_BLANK_POWERDOWN) {
138+
} else if (priv->lcd_state < LCD_POWER_OFF) {
139139
/* Do nothing, the LCD is already in standby */
140140
} else {
141-
/* priv->lcd_state == FB_BLANK_POWERDOWN */
141+
/* priv->lcd_state == LCD_POWER_OFF */
142142
l4f00242t03_lcd_init(spi);
143-
priv->lcd_state = FB_BLANK_UNBLANK;
143+
priv->lcd_state = LCD_POWER_ON;
144144
l4f00242t03_lcd_power_set(ld, power);
145145
}
146146
} else {
147-
/* power == FB_BLANK_POWERDOWN */
148-
if (priv->lcd_state != FB_BLANK_POWERDOWN) {
147+
/* power == LCD_POWER_OFF */
148+
if (priv->lcd_state != LCD_POWER_OFF) {
149149
/* Clear the screen before shutting down */
150150
spi_write(spi, (const u8 *)&disoff, sizeof(u16));
151151
msleep(60);
@@ -212,8 +212,8 @@ static int l4f00242t03_probe(struct spi_device *spi)
212212

213213
/* Init the LCD */
214214
l4f00242t03_lcd_init(spi);
215-
priv->lcd_state = FB_BLANK_VSYNC_SUSPEND;
216-
l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_UNBLANK);
215+
priv->lcd_state = LCD_POWER_REDUCED_VSYNC_SUSPEND;
216+
l4f00242t03_lcd_power_set(priv->ld, LCD_POWER_ON);
217217

218218
dev_info(&spi->dev, "Epson l4f00242t03 lcd probed.\n");
219219

@@ -224,15 +224,15 @@ static void l4f00242t03_remove(struct spi_device *spi)
224224
{
225225
struct l4f00242t03_priv *priv = spi_get_drvdata(spi);
226226

227-
l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN);
227+
l4f00242t03_lcd_power_set(priv->ld, LCD_POWER_OFF);
228228
}
229229

230230
static void l4f00242t03_shutdown(struct spi_device *spi)
231231
{
232232
struct l4f00242t03_priv *priv = spi_get_drvdata(spi);
233233

234234
if (priv)
235-
l4f00242t03_lcd_power_set(priv->ld, FB_BLANK_POWERDOWN);
235+
l4f00242t03_lcd_power_set(priv->ld, LCD_POWER_OFF);
236236

237237
}
238238

0 commit comments

Comments
 (0)