1 From 9ee405d79609106ea330b21d54f30b853e262296 Mon Sep 17 00:00:00 2001
2 From: Mike Westerhof <mwester@dls.net>
3 Date: Fri, 8 Aug 2008 13:10:59 +0100
4 Subject: [PATCH] fix-suspend-backlight-timing-gta01.patch
6 This patch adds the gta01 backlight callback that defers the
7 restoring of the backlight until after the jbt driver has
8 resumed. This doesn't eliminate the flashing of the LCD on
9 the gta01, but it reduces it considerably.
11 Signed-off-by: Mike Westerhof <mwester@dls.net>
13 arch/arm/mach-s3c2410/mach-gta01.c | 9 ++++++++-
14 drivers/video/backlight/gta01_bl.c | 15 ++++++++++++++-
15 include/asm-arm/arch-s3c2410/gta01.h | 4 ++++
16 3 files changed, 26 insertions(+), 2 deletions(-)
18 diff --git a/arch/arm/mach-s3c2410/mach-gta01.c b/arch/arm/mach-s3c2410/mach-gta01.c
19 index f3f87cf..9e42df0 100644
20 --- a/arch/arm/mach-s3c2410/mach-gta01.c
21 +++ b/arch/arm/mach-s3c2410/mach-gta01.c
22 @@ -507,14 +507,20 @@ static struct s3c2410_ts_mach_info gta01_ts_cfg = {
26 -void gta01_jbt6k74_reset(int devidx, int level)
27 +static void gta01_jbt6k74_reset(int devidx, int level)
29 /* empty place holder; gta01 does not yet use this */
30 printk(KERN_DEBUG "gta01_jbt6k74_reset\n");
33 +static void gta01_jbt6k74_resuming(int devidx)
35 + gta01bl_deferred_resume();
38 const struct jbt6k74_platform_data gta01_jbt6k74_pdata = {
39 .reset = gta01_jbt6k74_reset,
40 + .resuming = gta01_jbt6k74_resuming,
43 static struct spi_board_info gta01_spi_board_info[] = {
44 @@ -584,6 +590,7 @@ static struct gta01bl_machinfo backlight_machinfo = {
45 .default_intensity = 1,
48 + .defer_resume_backlight = 1,
51 static struct resource gta01_bl_resources[] = {
52 diff --git a/drivers/video/backlight/gta01_bl.c b/drivers/video/backlight/gta01_bl.c
53 index 301ec9c..34c19c8 100644
54 --- a/drivers/video/backlight/gta01_bl.c
55 +++ b/drivers/video/backlight/gta01_bl.c
56 @@ -57,6 +57,8 @@ struct gta01bl_data {
58 static struct gta01bl_data gta01bl;
60 +static int gta01bl_defer_resume_backlight;
62 #define GTA01BL_SUSPENDED 0x01
63 #define GTA01BL_BATTLOW 0x02
65 @@ -132,10 +134,12 @@ static int gta01bl_suspend(struct platform_device *dev, pm_message_t state)
67 gta01bl_flags |= GTA01BL_SUSPENDED;
68 gta01bl_send_intensity(gta01_backlight_device);
69 + neo1973_gpb_setpin(GTA01_GPIO_BACKLIGHT, 0);
70 + s3c2410_gpio_cfgpin(GTA01_GPIO_BACKLIGHT, S3C2410_GPIO_OUTPUT);
74 -static int gta01bl_resume(struct platform_device *dev)
75 +void gta01bl_deferred_resume(void)
77 mutex_lock(>a01bl.mutex);
79 @@ -143,6 +147,13 @@ static int gta01bl_resume(struct platform_device *dev)
81 gta01bl_flags &= ~GTA01BL_SUSPENDED;
82 gta01bl_send_intensity(gta01_backlight_device);
84 +EXPORT_SYMBOL_GPL(gta01bl_deferred_resume);
86 +static int gta01bl_resume(struct platform_device *dev)
88 + if (! gta01bl_defer_resume_backlight)
89 + gta01bl_deferred_resume();
93 @@ -199,6 +210,8 @@ static int __init gta01bl_probe(struct platform_device *pdev)
94 if (!machinfo->limit_mask)
95 machinfo->limit_mask = -1;
97 + gta01bl_defer_resume_backlight = machinfo->defer_resume_backlight;
99 gta01_backlight_device = backlight_device_register("gta01-bl",
102 diff --git a/include/asm-arm/arch-s3c2410/gta01.h b/include/asm-arm/arch-s3c2410/gta01.h
103 index 1cc2099..989aa55 100644
104 --- a/include/asm-arm/arch-s3c2410/gta01.h
105 +++ b/include/asm-arm/arch-s3c2410/gta01.h
107 #define GTA01Bv4_SYSTEM_REV 0x00000240
111 +extern void gta01bl_deferred_resume(void);
113 struct gta01bl_machinfo {
114 unsigned int default_intensity;
115 unsigned int max_intensity;
116 unsigned int limit_mask;
117 + unsigned int defer_resume_backlight;
120 /* Definitions common to all revisions */