#include <linux/backlight.h>
#include <linux/delay.h>
-#include <linux/fb.h>
#include <linux/lcd.h>
#include <linux/module.h>
#include <linux/spi/spi.h>
static int ams369fg06_power_is_on(int power)
{
- return power <= FB_BLANK_NORMAL;
+ return power <= BACKLIGHT_POWER_REDUCED;
}
static int ams369fg06_power_on(struct ams369fg06 *lcd)
{
struct ams369fg06 *lcd = lcd_get_data(ld);
- if (power != FB_BLANK_UNBLANK && power != FB_BLANK_POWERDOWN &&
- power != FB_BLANK_NORMAL) {
+ if (power != BACKLIGHT_POWER_ON && power != BACKLIGHT_POWER_OFF &&
+ power != BACKLIGHT_POWER_REDUCED) {
dev_err(lcd->dev, "power value should be 0, 1 or 4.\n");
return -EINVAL;
}
* current lcd status is powerdown and then
* it enables lcd panel.
*/
- lcd->power = FB_BLANK_POWERDOWN;
+ lcd->power = BACKLIGHT_POWER_OFF;
- ams369fg06_power(lcd, FB_BLANK_UNBLANK);
+ ams369fg06_power(lcd, BACKLIGHT_POWER_ON);
} else {
- lcd->power = FB_BLANK_UNBLANK;
+ lcd->power = BACKLIGHT_POWER_ON;
}
spi_set_drvdata(spi, lcd);
{
struct ams369fg06 *lcd = spi_get_drvdata(spi);
- ams369fg06_power(lcd, FB_BLANK_POWERDOWN);
+ ams369fg06_power(lcd, BACKLIGHT_POWER_OFF);
}
#ifdef CONFIG_PM_SLEEP
* when lcd panel is suspend, lcd panel becomes off
* regardless of status.
*/
- return ams369fg06_power(lcd, FB_BLANK_POWERDOWN);
+ return ams369fg06_power(lcd, BACKLIGHT_POWER_OFF);
}
static int ams369fg06_resume(struct device *dev)
{
struct ams369fg06 *lcd = dev_get_drvdata(dev);
- lcd->power = FB_BLANK_POWERDOWN;
+ lcd->power = BACKLIGHT_POWER_OFF;
- return ams369fg06_power(lcd, FB_BLANK_UNBLANK);
+ return ams369fg06_power(lcd, BACKLIGHT_POWER_ON);
}
#endif
{
struct ams369fg06 *lcd = spi_get_drvdata(spi);
- ams369fg06_power(lcd, FB_BLANK_POWERDOWN);
+ ams369fg06_power(lcd, BACKLIGHT_POWER_OFF);
}
static struct spi_driver ams369fg06_driver = {