diff options
author | Liu Ying <Ying.Liu@freescale.com> | 2014-05-09 10:23:13 +0800 |
---|---|---|
committer | Nitin Garg <nitin.garg@freescale.com> | 2014-06-03 23:02:14 -0500 |
commit | 3b3f112f3ab40fd40ef963fe742fbe7e8295c602 (patch) | |
tree | f54c2f0b824e14b32fbd141bd0052f3d57d9143a /drivers | |
parent | 021e3cab881095a1bb961d4d969bf0a6564bdf8e (diff) |
ENGR00303539-2 video: mxc: Seiko WVGA panel: Add DISP pin logic
The Seiko WVGA LCD panel has a DISP pin to enable or disable the display.
The DISP pin signal could be described by the following graph according
to the panel's spec.
_____________________________________
power _____| |_____
________________________________
DISP ________| |_______
________ _____ _______________________ _______
invalid \/blank\/ valid \/
data ________/\_____/\_______________________/\_______
______________________
backlight _________________| |________
This patch adds some logic in FB_EARLY_EVENT_BLANK and FB_EVENT_BLANK
notifier handlers in the panel driver to enable and disable the pin
respectively.
Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/video/mxc/mxcfb_seiko_wvga.c | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/drivers/video/mxc/mxcfb_seiko_wvga.c b/drivers/video/mxc/mxcfb_seiko_wvga.c index 6e9abaf8566b..608dcce7ca9e 100644 --- a/drivers/video/mxc/mxcfb_seiko_wvga.c +++ b/drivers/video/mxc/mxcfb_seiko_wvga.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2011-2012 Freescale Semiconductor, Inc. All Rights Reserved. + * Copyright (C) 2011-2014 Freescale Semiconductor, Inc. All Rights Reserved. */ /* @@ -49,6 +49,9 @@ static void lcd_poweron(void); static void lcd_poweroff(void); +static void lcd_enable(void); +static void lcd_disable(void); + static struct platform_device *plcd_dev; static struct regulator *io_reg; static struct regulator *core_reg; @@ -88,16 +91,22 @@ static int lcd_fb_event(struct notifier_block *nb, unsigned long val, void *v) if (strcmp(event->info->fix.id, "mxc_elcdif_fb")) return 0; + if ((event->info->var.xres != 800) || + (event->info->var.yres != 480)) + return -EINVAL; + switch (val) { - case FB_EVENT_BLANK: - if ((event->info->var.xres != 800) || - (event->info->var.yres != 480)) { - break; - } + case FB_EARLY_EVENT_BLANK: if (*((int *)event->data) == FB_BLANK_UNBLANK) + lcd_enable(); + break; + case FB_EVENT_BLANK: + if (*((int *)event->data) == FB_BLANK_UNBLANK) { lcd_poweron(); - else + } else { + lcd_disable(); lcd_poweroff(); + } break; } return 0; @@ -218,6 +227,22 @@ static void lcd_poweroff(void) regulator_disable(core_reg); } +static void lcd_enable(void) +{ + struct fsl_mxc_lcd_platform_data *plat = plcd_dev->dev.platform_data; + + if (plat && plat->enable_pins) + plat->enable_pins(); +} + +static void lcd_disable(void) +{ + struct fsl_mxc_lcd_platform_data *plat = plcd_dev->dev.platform_data; + + if (plat && plat->disable_pins) + plat->disable_pins(); +} + static int __init seiko_wvga_lcd_init(void) { return platform_driver_register(&lcd_driver); |