diff options
author | Richard Purdie <rpurdie@rpsys.net> | 2007-09-02 19:27:00 -0400 |
---|---|---|
committer | Richard Purdie <rpurdie@rpsys.net> | 2007-10-11 17:24:13 -0400 |
commit | c3f8f65046127f471d0b6193a1923185b354c011 (patch) | |
tree | 69e9178d13f9c1e02387f33fbff38fff612eb12e /arch/arm | |
parent | 18f65c793a5106b9f99822ef248e71582db03386 (diff) |
backlight: Convert corgi backlight driver into a more generic driver
Convert the corgi backlight driver to a more generic version
so it can be reused by other code rather than being Zaurus/PXA
specific.
Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-pxa/corgi.c | 18 | ||||
-rw-r--r-- | arch/arm/mach-pxa/spitz.c | 18 |
2 files changed, 32 insertions, 4 deletions
diff --git a/arch/arm/mach-pxa/corgi.c b/arch/arm/mach-pxa/corgi.c index aab27297b3c6..2363cc64fe07 100644 --- a/arch/arm/mach-pxa/corgi.c +++ b/arch/arm/mach-pxa/corgi.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
21 | #include <linux/mmc/host.h> | 21 | #include <linux/mmc/host.h> |
22 | #include <linux/pm.h> | 22 | #include <linux/pm.h> |
23 | #include <linux/backlight.h> | ||
23 | 24 | ||
24 | #include <asm/setup.h> | 25 | #include <asm/setup.h> |
25 | #include <asm/memory.h> | 26 | #include <asm/memory.h> |
@@ -142,15 +143,28 @@ struct corgissp_machinfo corgi_ssp_machinfo = { | |||
142 | /* | 143 | /* |
143 | * Corgi Backlight Device | 144 | * Corgi Backlight Device |
144 | */ | 145 | */ |
145 | static struct corgibl_machinfo corgi_bl_machinfo = { | 146 | static void corgi_bl_kick_battery(void) |
147 | { | ||
148 | void (*kick_batt)(void); | ||
149 | |||
150 | kick_batt = symbol_get(sharpsl_battery_kick); | ||
151 | if (kick_batt) { | ||
152 | kick_batt(); | ||
153 | symbol_put(sharpsl_battery_kick); | ||
154 | } | ||
155 | } | ||
156 | |||
157 | static struct generic_bl_info corgi_bl_machinfo = { | ||
158 | .name = "corgi-bl", | ||
146 | .max_intensity = 0x2f, | 159 | .max_intensity = 0x2f, |
147 | .default_intensity = 0x1f, | 160 | .default_intensity = 0x1f, |
148 | .limit_mask = 0x0b, | 161 | .limit_mask = 0x0b, |
149 | .set_bl_intensity = corgi_bl_set_intensity, | 162 | .set_bl_intensity = corgi_bl_set_intensity, |
163 | .kick_battery = corgi_bl_kick_battery, | ||
150 | }; | 164 | }; |
151 | 165 | ||
152 | static struct platform_device corgibl_device = { | 166 | static struct platform_device corgibl_device = { |
153 | .name = "corgi-bl", | 167 | .name = "generic-bl", |
154 | .dev = { | 168 | .dev = { |
155 | .parent = &corgifb_device.dev, | 169 | .parent = &corgifb_device.dev, |
156 | .platform_data = &corgi_bl_machinfo, | 170 | .platform_data = &corgi_bl_machinfo, |
diff --git a/arch/arm/mach-pxa/spitz.c b/arch/arm/mach-pxa/spitz.c index bae47e145de8..2d78199d24af 100644 --- a/arch/arm/mach-pxa/spitz.c +++ b/arch/arm/mach-pxa/spitz.c | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/interrupt.h> | 21 | #include <linux/interrupt.h> |
22 | #include <linux/mmc/host.h> | 22 | #include <linux/mmc/host.h> |
23 | #include <linux/pm.h> | 23 | #include <linux/pm.h> |
24 | #include <linux/backlight.h> | ||
24 | 25 | ||
25 | #include <asm/setup.h> | 26 | #include <asm/setup.h> |
26 | #include <asm/memory.h> | 27 | #include <asm/memory.h> |
@@ -222,14 +223,27 @@ struct corgissp_machinfo spitz_ssp_machinfo = { | |||
222 | /* | 223 | /* |
223 | * Spitz Backlight Device | 224 | * Spitz Backlight Device |
224 | */ | 225 | */ |
225 | static struct corgibl_machinfo spitz_bl_machinfo = { | 226 | static void spitz_bl_kick_battery(void) |
227 | { | ||
228 | void (*kick_batt)(void); | ||
229 | |||
230 | kick_batt = symbol_get(sharpsl_battery_kick); | ||
231 | if (kick_batt) { | ||
232 | kick_batt(); | ||
233 | symbol_put(sharpsl_battery_kick); | ||
234 | } | ||
235 | } | ||
236 | |||
237 | static struct generic_bl_info spitz_bl_machinfo = { | ||
238 | .name = "corgi-bl", | ||
226 | .default_intensity = 0x1f, | 239 | .default_intensity = 0x1f, |
227 | .limit_mask = 0x0b, | 240 | .limit_mask = 0x0b, |
228 | .max_intensity = 0x2f, | 241 | .max_intensity = 0x2f, |
242 | .kick_battery = spitz_bl_kick_battery, | ||
229 | }; | 243 | }; |
230 | 244 | ||
231 | static struct platform_device spitzbl_device = { | 245 | static struct platform_device spitzbl_device = { |
232 | .name = "corgi-bl", | 246 | .name = "generic-bl", |
233 | .dev = { | 247 | .dev = { |
234 | .platform_data = &spitz_bl_machinfo, | 248 | .platform_data = &spitz_bl_machinfo, |
235 | }, | 249 | }, |