aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa/hx4700.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-pxa/hx4700.c')
-rw-r--r--arch/arm/mach-pxa/hx4700.c65
1 files changed, 24 insertions, 41 deletions
diff --git a/arch/arm/mach-pxa/hx4700.c b/arch/arm/mach-pxa/hx4700.c
index 81359d574f88..abff9e132749 100644
--- a/arch/arm/mach-pxa/hx4700.c
+++ b/arch/arm/mach-pxa/hx4700.c
@@ -45,6 +45,7 @@
45#include <mach/irda.h> 45#include <mach/irda.h>
46#include <mach/pxa2xx_spi.h> 46#include <mach/pxa2xx_spi.h>
47 47
48#include <video/platform_lcd.h>
48#include <video/w100fb.h> 49#include <video/w100fb.h>
49 50
50#include "devices.h" 51#include "devices.h"
@@ -174,14 +175,9 @@ static int hx4700_gpio_request(struct gpio_ress *gpios, int size)
174 * IRDA 175 * IRDA
175 */ 176 */
176 177
177static void irda_transceiver_mode(struct device *dev, int mode)
178{
179 gpio_set_value(GPIO105_HX4700_nIR_ON, mode & IR_OFF);
180}
181
182static struct pxaficp_platform_data ficp_info = { 178static struct pxaficp_platform_data ficp_info = {
183 .transceiver_cap = IR_SIRMODE | IR_OFF, 179 .gpio_pwdown = GPIO105_HX4700_nIR_ON,
184 .transceiver_mode = irda_transceiver_mode, 180 .transceiver_cap = IR_SIRMODE | IR_OFF,
185}; 181};
186 182
187/* 183/*
@@ -368,8 +364,6 @@ static struct platform_device egpio = {
368 * LCD - Sony display connected to ATI Imageon w3220 364 * LCD - Sony display connected to ATI Imageon w3220
369 */ 365 */
370 366
371static int lcd_power;
372
373static void sony_lcd_init(void) 367static void sony_lcd_init(void)
374{ 368{
375 gpio_set_value(GPIO84_HX4700_LCD_SQN, 1); 369 gpio_set_value(GPIO84_HX4700_LCD_SQN, 1);
@@ -410,35 +404,6 @@ static void sony_lcd_off(void)
410 gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 0); 404 gpio_set_value(GPIO110_HX4700_LCD_LVDD_3V3_ON, 0);
411} 405}
412 406
413static int hx4700_lcd_set_power(struct lcd_device *ldev, int level)
414{
415 switch (level) {
416 case FB_BLANK_UNBLANK:
417 sony_lcd_init();
418 break;
419 case FB_BLANK_NORMAL:
420 case FB_BLANK_VSYNC_SUSPEND:
421 case FB_BLANK_HSYNC_SUSPEND:
422 case FB_BLANK_POWERDOWN:
423 sony_lcd_off();
424 break;
425 }
426 lcd_power = level;
427 return 0;
428}
429
430static int hx4700_lcd_get_power(struct lcd_device *lm)
431{
432 return lcd_power;
433}
434
435static struct lcd_ops hx4700_lcd_ops = {
436 .get_power = hx4700_lcd_get_power,
437 .set_power = hx4700_lcd_set_power,
438};
439
440static struct lcd_device *hx4700_lcd_device;
441
442#ifdef CONFIG_PM 407#ifdef CONFIG_PM
443static void w3220_lcd_suspend(struct w100fb_par *wfb) 408static void w3220_lcd_suspend(struct w100fb_par *wfb)
444{ 409{
@@ -573,6 +538,27 @@ static struct platform_device w3220 = {
573 .resource = w3220_resources, 538 .resource = w3220_resources,
574}; 539};
575 540
541static void hx4700_lcd_set_power(struct plat_lcd_data *pd, unsigned int power)
542{
543 if (power)
544 sony_lcd_init();
545 else
546 sony_lcd_off();
547}
548
549static struct plat_lcd_data hx4700_lcd_data = {
550 .set_power = hx4700_lcd_set_power,
551};
552
553static struct platform_device hx4700_lcd = {
554 .name = "platform-lcd",
555 .id = -1,
556 .dev = {
557 .platform_data = &hx4700_lcd_data,
558 .parent = &w3220.dev,
559 },
560};
561
576/* 562/*
577 * Backlight 563 * Backlight
578 */ 564 */
@@ -872,9 +858,6 @@ static void __init hx4700_init(void)
872 pxa2xx_set_spi_info(2, &pxa_ssp2_master_info); 858 pxa2xx_set_spi_info(2, &pxa_ssp2_master_info);
873 spi_register_board_info(ARRAY_AND_SIZE(tsc2046_board_info)); 859 spi_register_board_info(ARRAY_AND_SIZE(tsc2046_board_info));
874 860
875 hx4700_lcd_device = lcd_device_register("w100fb", NULL,
876 (void *)&w3220_info, &hx4700_lcd_ops);
877
878 gpio_set_value(GPIO71_HX4700_ASIC3_nRESET, 0); 861 gpio_set_value(GPIO71_HX4700_ASIC3_nRESET, 0);
879 mdelay(10); 862 mdelay(10);
880 gpio_set_value(GPIO71_HX4700_ASIC3_nRESET, 1); 863 gpio_set_value(GPIO71_HX4700_ASIC3_nRESET, 1);