aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2007-09-02 19:27:00 -0400
committerRichard Purdie <rpurdie@rpsys.net>2007-10-11 17:24:13 -0400
commitc3f8f65046127f471d0b6193a1923185b354c011 (patch)
tree69e9178d13f9c1e02387f33fbff38fff612eb12e /drivers/video
parent18f65c793a5106b9f99822ef248e71582db03386 (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 'drivers/video')
-rw-r--r--drivers/video/backlight/Kconfig11
-rw-r--r--drivers/video/backlight/corgi_bl.c22
2 files changed, 16 insertions, 17 deletions
diff --git a/drivers/video/backlight/Kconfig b/drivers/video/backlight/Kconfig
index b6f936a09185..9609a6c676be 100644
--- a/drivers/video/backlight/Kconfig
+++ b/drivers/video/backlight/Kconfig
@@ -51,12 +51,13 @@ config BACKLIGHT_CLASS_DEVICE
51 select the proper drivers which depend on this option. 51 select the proper drivers which depend on this option.
52 52
53config BACKLIGHT_CORGI 53config BACKLIGHT_CORGI
54 tristate "Sharp Corgi Backlight Driver (SL Series)" 54 tristate "Generic (aka Sharp Corgi) Backlight Driver"
55 depends on BACKLIGHT_CLASS_DEVICE && PXA_SHARPSL 55 depends on BACKLIGHT_CLASS_DEVICE
56 default y 56 default n
57 help 57 help
58 If you have a Sharp Zaurus SL-C7xx, SL-Cxx00 or SL-6000x say y to enable the 58 Say y to enable the generic platform backlight driver previously
59 backlight driver. 59 known as the Corgi backlight driver. If you have a Sharp Zaurus
60 SL-C7xx, SL-Cxx00 or SL-6000x say y. Most users can say n.
60 61
61config BACKLIGHT_LOCOMO 62config BACKLIGHT_LOCOMO
62 tristate "Sharp LOCOMO LCD/Backlight Driver" 63 tristate "Sharp LOCOMO LCD/Backlight Driver"
diff --git a/drivers/video/backlight/corgi_bl.c b/drivers/video/backlight/corgi_bl.c
index ce00e18a4e5d..4d4d037e3ec9 100644
--- a/drivers/video/backlight/corgi_bl.c
+++ b/drivers/video/backlight/corgi_bl.c
@@ -18,13 +18,11 @@
18#include <linux/mutex.h> 18#include <linux/mutex.h>
19#include <linux/fb.h> 19#include <linux/fb.h>
20#include <linux/backlight.h> 20#include <linux/backlight.h>
21#include <asm/arch/sharpsl.h>
22#include <asm/hardware/sharpsl_pm.h>
23 21
24static int corgibl_intensity; 22static int corgibl_intensity;
25static struct backlight_properties corgibl_data; 23static struct backlight_properties corgibl_data;
26static struct backlight_device *corgi_backlight_device; 24static struct backlight_device *corgi_backlight_device;
27static struct corgibl_machinfo *bl_machinfo; 25static struct generic_bl_info *bl_machinfo;
28 26
29static unsigned long corgibl_flags; 27static unsigned long corgibl_flags;
30#define CORGIBL_SUSPENDED 0x01 28#define CORGIBL_SUSPENDED 0x01
@@ -32,7 +30,6 @@ static unsigned long corgibl_flags;
32 30
33static int corgibl_send_intensity(struct backlight_device *bd) 31static int corgibl_send_intensity(struct backlight_device *bd)
34{ 32{
35 void (*corgi_kick_batt)(void);
36 int intensity = bd->props.brightness; 33 int intensity = bd->props.brightness;
37 34
38 if (bd->props.power != FB_BLANK_UNBLANK) 35 if (bd->props.power != FB_BLANK_UNBLANK)
@@ -48,11 +45,8 @@ static int corgibl_send_intensity(struct backlight_device *bd)
48 45
49 corgibl_intensity = intensity; 46 corgibl_intensity = intensity;
50 47
51 corgi_kick_batt = symbol_get(sharpsl_battery_kick); 48 if (bl_machinfo->kick_battery)
52 if (corgi_kick_batt) { 49 bl_machinfo->kick_battery();
53 corgi_kick_batt();
54 symbol_put(sharpsl_battery_kick);
55 }
56 50
57 return 0; 51 return 0;
58} 52}
@@ -107,13 +101,17 @@ static struct backlight_ops corgibl_ops = {
107 101
108static int corgibl_probe(struct platform_device *pdev) 102static int corgibl_probe(struct platform_device *pdev)
109{ 103{
110 struct corgibl_machinfo *machinfo = pdev->dev.platform_data; 104 struct generic_bl_info *machinfo = pdev->dev.platform_data;
105 const char *name = "generic-bl";
111 106
112 bl_machinfo = machinfo; 107 bl_machinfo = machinfo;
113 if (!machinfo->limit_mask) 108 if (!machinfo->limit_mask)
114 machinfo->limit_mask = -1; 109 machinfo->limit_mask = -1;
115 110
116 corgi_backlight_device = backlight_device_register ("corgi-bl", 111 if (machinfo->name)
112 name = machinfo->name;
113
114 corgi_backlight_device = backlight_device_register (name,
117 &pdev->dev, NULL, &corgibl_ops); 115 &pdev->dev, NULL, &corgibl_ops);
118 if (IS_ERR (corgi_backlight_device)) 116 if (IS_ERR (corgi_backlight_device))
119 return PTR_ERR (corgi_backlight_device); 117 return PTR_ERR (corgi_backlight_device);
@@ -149,7 +147,7 @@ static struct platform_driver corgibl_driver = {
149 .suspend = corgibl_suspend, 147 .suspend = corgibl_suspend,
150 .resume = corgibl_resume, 148 .resume = corgibl_resume,
151 .driver = { 149 .driver = {
152 .name = "corgi-bl", 150 .name = "generic-bl",
153 }, 151 },
154}; 152};
155 153