summaryrefslogtreecommitdiff
path: root/drivers/video/backlight/corgi_lcd.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/backlight/corgi_lcd.c')
-rw-r--r--drivers/video/backlight/corgi_lcd.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/video/backlight/corgi_lcd.c b/drivers/video/backlight/corgi_lcd.c
index dd765098ad98..69f49371ea35 100644
--- a/drivers/video/backlight/corgi_lcd.c
+++ b/drivers/video/backlight/corgi_lcd.c
@@ -17,14 +17,13 @@
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/gpio/consumer.h>
-#include <linux/fb.h>
#include <linux/lcd.h>
#include <linux/spi/spi.h>
#include <linux/spi/corgi_lcd.h>
#include <linux/slab.h>
#include <asm/mach/sharpsl_param.h>
-#define POWER_IS_ON(pwr) ((pwr) <= FB_BLANK_NORMAL)
+#define POWER_IS_ON(pwr) ((pwr) <= LCD_POWER_REDUCED)
/* Register Addresses */
#define RESCTL_ADRS 0x00
@@ -332,12 +331,12 @@ static void corgi_lcd_power_off(struct corgi_lcd *lcd)
POWER1_VW_OFF | POWER1_GVSS_OFF | POWER1_VDD_OFF);
}
-static int corgi_lcd_set_mode(struct lcd_device *ld, struct fb_videomode *m)
+static int corgi_lcd_set_mode(struct lcd_device *ld, u32 xres, u32 yres)
{
struct corgi_lcd *lcd = lcd_get_data(ld);
int mode = CORGI_LCD_MODE_QVGA;
- if (m->xres == 640 || m->xres == 480)
+ if (xres == 640 || xres == 480)
mode = CORGI_LCD_MODE_VGA;
if (lcd->mode == mode)
@@ -380,7 +379,7 @@ static int corgi_lcd_get_power(struct lcd_device *ld)
return lcd->power;
}
-static struct lcd_ops corgi_lcd_ops = {
+static const struct lcd_ops corgi_lcd_ops = {
.get_power = corgi_lcd_get_power,
.set_power = corgi_lcd_set_power,
.set_mode = corgi_lcd_set_mode,
@@ -455,7 +454,7 @@ static int corgi_lcd_suspend(struct device *dev)
corgibl_flags |= CORGIBL_SUSPENDED;
corgi_bl_set_intensity(lcd, 0);
- corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_POWERDOWN);
+ corgi_lcd_set_power(lcd->lcd_dev, LCD_POWER_OFF);
return 0;
}
@@ -464,7 +463,7 @@ static int corgi_lcd_resume(struct device *dev)
struct corgi_lcd *lcd = dev_get_drvdata(dev);
corgibl_flags &= ~CORGIBL_SUSPENDED;
- corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_UNBLANK);
+ corgi_lcd_set_power(lcd->lcd_dev, LCD_POWER_ON);
backlight_update_status(lcd->bl_dev);
return 0;
}
@@ -513,7 +512,7 @@ static int corgi_lcd_probe(struct spi_device *spi)
if (IS_ERR(lcd->lcd_dev))
return PTR_ERR(lcd->lcd_dev);
- lcd->power = FB_BLANK_POWERDOWN;
+ lcd->power = LCD_POWER_OFF;
lcd->mode = (pdata) ? pdata->init_mode : CORGI_LCD_MODE_VGA;
memset(&props, 0, sizeof(struct backlight_properties));
@@ -526,7 +525,7 @@ static int corgi_lcd_probe(struct spi_device *spi)
return PTR_ERR(lcd->bl_dev);
lcd->bl_dev->props.brightness = pdata->default_intensity;
- lcd->bl_dev->props.power = FB_BLANK_UNBLANK;
+ lcd->bl_dev->props.power = BACKLIGHT_POWER_ON;
ret = setup_gpio_backlight(lcd, pdata);
if (ret)
@@ -535,7 +534,7 @@ static int corgi_lcd_probe(struct spi_device *spi)
lcd->kick_battery = pdata->kick_battery;
spi_set_drvdata(spi, lcd);
- corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_UNBLANK);
+ corgi_lcd_set_power(lcd->lcd_dev, LCD_POWER_ON);
backlight_update_status(lcd->bl_dev);
lcd->limit_mask = pdata->limit_mask;
@@ -547,10 +546,10 @@ static void corgi_lcd_remove(struct spi_device *spi)
{
struct corgi_lcd *lcd = spi_get_drvdata(spi);
- lcd->bl_dev->props.power = FB_BLANK_UNBLANK;
+ lcd->bl_dev->props.power = BACKLIGHT_POWER_ON;
lcd->bl_dev->props.brightness = 0;
backlight_update_status(lcd->bl_dev);
- corgi_lcd_set_power(lcd->lcd_dev, FB_BLANK_POWERDOWN);
+ corgi_lcd_set_power(lcd->lcd_dev, LCD_POWER_OFF);
}
static struct spi_driver corgi_lcd_driver = {