summaryrefslogtreecommitdiff
path: root/drivers/video/backlight/ltv350qv.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/backlight/ltv350qv.c')
-rw-r--r--drivers/video/backlight/ltv350qv.c28
1 files changed, 11 insertions, 17 deletions
diff --git a/drivers/video/backlight/ltv350qv.c b/drivers/video/backlight/ltv350qv.c
index 885612cc1008..c919b0fe4cd9 100644
--- a/drivers/video/backlight/ltv350qv.c
+++ b/drivers/video/backlight/ltv350qv.c
@@ -1,15 +1,11 @@
+// SPDX-License-Identifier: GPL-2.0-only
/*
* Power control for Samsung LTV350QV Quarter VGA LCD Panel
*
* Copyright (C) 2006, 2007 Atmel Corporation
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
*/
#include <linux/delay.h>
#include <linux/err.h>
-#include <linux/fb.h>
#include <linux/init.h>
#include <linux/lcd.h>
#include <linux/module.h>
@@ -18,7 +14,7 @@
#include "ltv350qv.h"
-#define POWER_IS_ON(pwr) ((pwr) <= FB_BLANK_NORMAL)
+#define POWER_IS_ON(pwr) ((pwr) <= LCD_POWER_REDUCED)
struct ltv350qv {
struct spi_device *spi;
@@ -30,8 +26,7 @@ struct ltv350qv {
/*
* The power-on and power-off sequences are taken from the
* LTV350QV-F04 data sheet from Samsung. The register definitions are
- * taken from the S6F2002 command list also from Samsung. Both
- * documents are distributed with the AVR32 Linux BSP CD from Atmel.
+ * taken from the S6F2002 command list also from Samsung.
*
* There's still some voodoo going on here, but it's a lot better than
* in the first incarnation of the driver where all we had was the raw
@@ -221,7 +216,7 @@ static int ltv350qv_get_power(struct lcd_device *ld)
return lcd->power;
}
-static struct lcd_ops ltv_ops = {
+static const struct lcd_ops ltv_ops = {
.get_power = ltv350qv_get_power,
.set_power = ltv350qv_set_power,
};
@@ -237,7 +232,7 @@ static int ltv350qv_probe(struct spi_device *spi)
return -ENOMEM;
lcd->spi = spi;
- lcd->power = FB_BLANK_POWERDOWN;
+ lcd->power = LCD_POWER_OFF;
lcd->buffer = devm_kzalloc(&spi->dev, 8, GFP_KERNEL);
if (!lcd->buffer)
return -ENOMEM;
@@ -249,7 +244,7 @@ static int ltv350qv_probe(struct spi_device *spi)
lcd->ld = ld;
- ret = ltv350qv_power(lcd, FB_BLANK_UNBLANK);
+ ret = ltv350qv_power(lcd, LCD_POWER_ON);
if (ret)
return ret;
@@ -258,12 +253,11 @@ static int ltv350qv_probe(struct spi_device *spi)
return 0;
}
-static int ltv350qv_remove(struct spi_device *spi)
+static void ltv350qv_remove(struct spi_device *spi)
{
struct ltv350qv *lcd = spi_get_drvdata(spi);
- ltv350qv_power(lcd, FB_BLANK_POWERDOWN);
- return 0;
+ ltv350qv_power(lcd, LCD_POWER_OFF);
}
#ifdef CONFIG_PM_SLEEP
@@ -271,14 +265,14 @@ static int ltv350qv_suspend(struct device *dev)
{
struct ltv350qv *lcd = dev_get_drvdata(dev);
- return ltv350qv_power(lcd, FB_BLANK_POWERDOWN);
+ return ltv350qv_power(lcd, LCD_POWER_OFF);
}
static int ltv350qv_resume(struct device *dev)
{
struct ltv350qv *lcd = dev_get_drvdata(dev);
- return ltv350qv_power(lcd, FB_BLANK_UNBLANK);
+ return ltv350qv_power(lcd, LCD_POWER_ON);
}
#endif
@@ -289,7 +283,7 @@ static void ltv350qv_shutdown(struct spi_device *spi)
{
struct ltv350qv *lcd = spi_get_drvdata(spi);
- ltv350qv_power(lcd, FB_BLANK_POWERDOWN);
+ ltv350qv_power(lcd, LCD_POWER_OFF);
}
static struct spi_driver ltv350qv_driver = {