From b0bcd39edf624df7c576fc4fb491607202c1b55c Mon Sep 17 00:00:00 2001 From: Mike Westerhof Date: Wed, 19 Nov 2008 17:10:48 +0000 Subject: fix-suspend-backlight-timing-gta01.patch This patch adds the gta01 backlight callback that defers the restoring of the backlight until after the jbt driver has resumed. This doesn't eliminate the flashing of the LCD on the gta01, but it reduces it considerably. Signed-off-by: Mike Westerhof --- drivers/video/backlight/gta01_bl.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'drivers/video') diff --git a/drivers/video/backlight/gta01_bl.c b/drivers/video/backlight/gta01_bl.c index 301ec9c217f..34c19c8bf47 100644 --- a/drivers/video/backlight/gta01_bl.c +++ b/drivers/video/backlight/gta01_bl.c @@ -57,6 +57,8 @@ struct gta01bl_data { static struct gta01bl_data gta01bl; +static int gta01bl_defer_resume_backlight; + #define GTA01BL_SUSPENDED 0x01 #define GTA01BL_BATTLOW 0x02 @@ -132,10 +134,12 @@ static int gta01bl_suspend(struct platform_device *dev, pm_message_t state) { gta01bl_flags |= GTA01BL_SUSPENDED; gta01bl_send_intensity(gta01_backlight_device); + neo1973_gpb_setpin(GTA01_GPIO_BACKLIGHT, 0); + s3c2410_gpio_cfgpin(GTA01_GPIO_BACKLIGHT, S3C2410_GPIO_OUTPUT); return 0; } -static int gta01bl_resume(struct platform_device *dev) +void gta01bl_deferred_resume(void) { mutex_lock(>a01bl.mutex); gta01bl_init_hw(); @@ -143,6 +147,13 @@ static int gta01bl_resume(struct platform_device *dev) gta01bl_flags &= ~GTA01BL_SUSPENDED; gta01bl_send_intensity(gta01_backlight_device); +} +EXPORT_SYMBOL_GPL(gta01bl_deferred_resume); + +static int gta01bl_resume(struct platform_device *dev) +{ + if (! gta01bl_defer_resume_backlight) + gta01bl_deferred_resume(); return 0; } #else @@ -199,6 +210,8 @@ static int __init gta01bl_probe(struct platform_device *pdev) if (!machinfo->limit_mask) machinfo->limit_mask = -1; + gta01bl_defer_resume_backlight = machinfo->defer_resume_backlight; + gta01_backlight_device = backlight_device_register("gta01-bl", &pdev->dev, NULL, >a01bl_ops); -- cgit v1.2.3