Skip to content

Commit

Permalink
[ARM] pxa/hx4700: use platform_lcd driver
Browse files Browse the repository at this point in the history
Instead of directly registering an lcd_device, use the platform_lcd driver.
This fixes a broken build in case CONFIG_LCD_CLASS_DEVICE is not enabled.

Signed-off-by: Philipp Zabel <[email protected]>
Cc: Ben Dooks <[email protected]>
Signed-off-by: Eric Miao <[email protected]>
  • Loading branch information
pH5 authored and ericmiao committed Sep 10, 2009
1 parent 6cf4442 commit e2c509c
Showing 1 changed file with 22 additions and 34 deletions.
56 changes: 22 additions & 34 deletions arch/arm/mach-pxa/hx4700.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <mach/irda.h>
#include <mach/pxa2xx_spi.h>

#include <video/platform_lcd.h>
#include <video/w100fb.h>

#include "devices.h"
Expand Down Expand Up @@ -368,8 +369,6 @@ static struct platform_device egpio = {
* LCD - Sony display connected to ATI Imageon w3220
*/

static int lcd_power;

static void sony_lcd_init(void)
{
gpio_set_value(GPIO84_HX4700_LCD_SQN, 1);
Expand Down Expand Up @@ -410,35 +409,6 @@ static void sony_lcd_off(void)
gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 0);
}

static int hx4700_lcd_set_power(struct lcd_device *ldev, int level)
{
switch (level) {
case FB_BLANK_UNBLANK:
sony_lcd_init();
break;
case FB_BLANK_NORMAL:
case FB_BLANK_VSYNC_SUSPEND:
case FB_BLANK_HSYNC_SUSPEND:
case FB_BLANK_POWERDOWN:
sony_lcd_off();
break;
}
lcd_power = level;
return 0;
}

static int hx4700_lcd_get_power(struct lcd_device *lm)
{
return lcd_power;
}

static struct lcd_ops hx4700_lcd_ops = {
.get_power = hx4700_lcd_get_power,
.set_power = hx4700_lcd_set_power,
};

static struct lcd_device *hx4700_lcd_device;

#ifdef CONFIG_PM
static void w3220_lcd_suspend(struct w100fb_par *wfb)
{
Expand Down Expand Up @@ -573,6 +543,27 @@ static struct platform_device w3220 = {
.resource = w3220_resources,
};

static void hx4700_lcd_set_power(struct plat_lcd_data *pd, unsigned int power)
{
if (power)
sony_lcd_init();
else
sony_lcd_off();
}

static struct plat_lcd_data hx4700_lcd_data = {
.set_power = hx4700_lcd_set_power,
};

static struct platform_device hx4700_lcd = {
.name = "platform-lcd",
.id = -1,
.dev = {
.platform_data = &hx4700_lcd_data,
.parent = &w3220.dev,
},
};

/*
* Backlight
*/
Expand Down Expand Up @@ -872,9 +863,6 @@ static void __init hx4700_init(void)
pxa2xx_set_spi_info(2, &pxa_ssp2_master_info);
spi_register_board_info(ARRAY_AND_SIZE(tsc2046_board_info));

hx4700_lcd_device = lcd_device_register("w100fb", NULL,
(void *)&w3220_info, &hx4700_lcd_ops);

gpio_set_value(GPIO71_HX4700_ASIC3_nRESET, 0);
mdelay(10);
gpio_set_value(GPIO71_HX4700_ASIC3_nRESET, 1);
Expand Down

0 comments on commit e2c509c

Please sign in to comment.