[adm5120] add USB drivers for the NFS-101U/WU profiles
[openwrt.git] / target / linux / s3c24xx / patches-2.6.24 / 1266-fix-suspend-backlight-timing-gta01.patch.patch
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
5
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.
10
11 Signed-off-by: Mike Westerhof <mwester@dls.net>
12 ---
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(-)
17
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 = {
23
24 /* SPI */
25
26 -void gta01_jbt6k74_reset(int devidx, int level)
27 +static void gta01_jbt6k74_reset(int devidx, int level)
28 {
29 /* empty place holder; gta01 does not yet use this */
30 printk(KERN_DEBUG "gta01_jbt6k74_reset\n");
31 }
32
33 +static void gta01_jbt6k74_resuming(int devidx)
34 +{
35 + gta01bl_deferred_resume();
36 +}
37 +
38 const struct jbt6k74_platform_data gta01_jbt6k74_pdata = {
39 .reset = gta01_jbt6k74_reset,
40 + .resuming = gta01_jbt6k74_resuming,
41 };
42
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,
46 .max_intensity = 1,
47 .limit_mask = 1,
48 + .defer_resume_backlight = 1,
49 };
50
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 {
57
58 static struct gta01bl_data gta01bl;
59
60 +static int gta01bl_defer_resume_backlight;
61 +
62 #define GTA01BL_SUSPENDED 0x01
63 #define GTA01BL_BATTLOW 0x02
64
65 @@ -132,10 +134,12 @@ static int gta01bl_suspend(struct platform_device *dev, pm_message_t state)
66 {
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);
71 return 0;
72 }
73
74 -static int gta01bl_resume(struct platform_device *dev)
75 +void gta01bl_deferred_resume(void)
76 {
77 mutex_lock(&gta01bl.mutex);
78 gta01bl_init_hw();
79 @@ -143,6 +147,13 @@ static int gta01bl_resume(struct platform_device *dev)
80
81 gta01bl_flags &= ~GTA01BL_SUSPENDED;
82 gta01bl_send_intensity(gta01_backlight_device);
83 +}
84 +EXPORT_SYMBOL_GPL(gta01bl_deferred_resume);
85 +
86 +static int gta01bl_resume(struct platform_device *dev)
87 +{
88 + if (! gta01bl_defer_resume_backlight)
89 + gta01bl_deferred_resume();
90 return 0;
91 }
92 #else
93 @@ -199,6 +210,8 @@ static int __init gta01bl_probe(struct platform_device *pdev)
94 if (!machinfo->limit_mask)
95 machinfo->limit_mask = -1;
96
97 + gta01bl_defer_resume_backlight = machinfo->defer_resume_backlight;
98 +
99 gta01_backlight_device = backlight_device_register("gta01-bl",
100 &pdev->dev, NULL,
101 &gta01bl_ops);
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
106 @@ -12,10 +12,14 @@
107 #define GTA01Bv4_SYSTEM_REV 0x00000240
108
109 /* Backlight */
110 +
111 +extern void gta01bl_deferred_resume(void);
112 +
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;
118 };
119
120 /* Definitions common to all revisions */
121 --
122 1.5.6.5
123
This page took 0.056325 seconds and 5 git commands to generate.