1717#include <linux/init.h>
1818#include <linux/delay.h>
1919#include <linux/gpio/consumer.h>
20- #include <linux/fb.h>
2120#include <linux/lcd.h>
2221#include <linux/spi/spi.h>
2322#include <linux/spi/corgi_lcd.h>
2423#include <linux/slab.h>
2524#include <asm/mach/sharpsl_param.h>
2625
27- #define POWER_IS_ON (pwr ) ((pwr) <= FB_BLANK_NORMAL )
26+ #define POWER_IS_ON (pwr ) ((pwr) <= LCD_POWER_REDUCED )
2827
2928/* Register Addresses */
3029#define RESCTL_ADRS 0x00
@@ -332,12 +331,12 @@ static void corgi_lcd_power_off(struct corgi_lcd *lcd)
332331 POWER1_VW_OFF | POWER1_GVSS_OFF | POWER1_VDD_OFF );
333332}
334333
335- static int corgi_lcd_set_mode (struct lcd_device * ld , struct fb_videomode * m )
334+ static int corgi_lcd_set_mode (struct lcd_device * ld , u32 xres , u32 yres )
336335{
337336 struct corgi_lcd * lcd = lcd_get_data (ld );
338337 int mode = CORGI_LCD_MODE_QVGA ;
339338
340- if (m -> xres == 640 || m -> xres == 480 )
339+ if (xres == 640 || xres == 480 )
341340 mode = CORGI_LCD_MODE_VGA ;
342341
343342 if (lcd -> mode == mode )
@@ -455,7 +454,7 @@ static int corgi_lcd_suspend(struct device *dev)
455454
456455 corgibl_flags |= CORGIBL_SUSPENDED ;
457456 corgi_bl_set_intensity (lcd , 0 );
458- corgi_lcd_set_power (lcd -> lcd_dev , FB_BLANK_POWERDOWN );
457+ corgi_lcd_set_power (lcd -> lcd_dev , LCD_POWER_OFF );
459458 return 0 ;
460459}
461460
@@ -464,7 +463,7 @@ static int corgi_lcd_resume(struct device *dev)
464463 struct corgi_lcd * lcd = dev_get_drvdata (dev );
465464
466465 corgibl_flags &= ~CORGIBL_SUSPENDED ;
467- corgi_lcd_set_power (lcd -> lcd_dev , FB_BLANK_UNBLANK );
466+ corgi_lcd_set_power (lcd -> lcd_dev , LCD_POWER_ON );
468467 backlight_update_status (lcd -> bl_dev );
469468 return 0 ;
470469}
@@ -513,7 +512,7 @@ static int corgi_lcd_probe(struct spi_device *spi)
513512 if (IS_ERR (lcd -> lcd_dev ))
514513 return PTR_ERR (lcd -> lcd_dev );
515514
516- lcd -> power = FB_BLANK_POWERDOWN ;
515+ lcd -> power = LCD_POWER_OFF ;
517516 lcd -> mode = (pdata ) ? pdata -> init_mode : CORGI_LCD_MODE_VGA ;
518517
519518 memset (& props , 0 , sizeof (struct backlight_properties ));
@@ -535,7 +534,7 @@ static int corgi_lcd_probe(struct spi_device *spi)
535534 lcd -> kick_battery = pdata -> kick_battery ;
536535
537536 spi_set_drvdata (spi , lcd );
538- corgi_lcd_set_power (lcd -> lcd_dev , FB_BLANK_UNBLANK );
537+ corgi_lcd_set_power (lcd -> lcd_dev , LCD_POWER_ON );
539538 backlight_update_status (lcd -> bl_dev );
540539
541540 lcd -> limit_mask = pdata -> limit_mask ;
@@ -550,7 +549,7 @@ static void corgi_lcd_remove(struct spi_device *spi)
550549 lcd -> bl_dev -> props .power = BACKLIGHT_POWER_ON ;
551550 lcd -> bl_dev -> props .brightness = 0 ;
552551 backlight_update_status (lcd -> bl_dev );
553- corgi_lcd_set_power (lcd -> lcd_dev , FB_BLANK_POWERDOWN );
552+ corgi_lcd_set_power (lcd -> lcd_dev , LCD_POWER_OFF );
554553}
555554
556555static struct spi_driver corgi_lcd_driver = {
0 commit comments