aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight/locomolcd.c
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@rpsys.net>2007-02-10 18:07:48 -0500
committerRichard Purdie <rpurdie@rpsys.net>2007-02-20 04:26:53 -0500
commit599a52d12629394236d785615808845823875868 (patch)
tree4e2dfa3a25ce761be0ecc0490acabac553f77a67 /drivers/video/backlight/locomolcd.c
parent321709c5994f952b78d567fd7083dbebbdc381b7 (diff)
backlight: Separate backlight properties from backlight ops pointers
Per device data such as brightness belongs to the indivdual device and should therefore be separate from the the backlight operation function pointers. This patch splits the two types of data and allows simplifcation of some code. Signed-off-by: Richard Purdie <rpurdie@rpsys.net>
Diffstat (limited to 'drivers/video/backlight/locomolcd.c')
-rw-r--r--drivers/video/backlight/locomolcd.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c
index 3c5abbf0d042..d1312477813e 100644
--- a/drivers/video/backlight/locomolcd.c
+++ b/drivers/video/backlight/locomolcd.c
@@ -112,11 +112,11 @@ static int current_intensity;
112 112
113static int locomolcd_set_intensity(struct backlight_device *bd) 113static int locomolcd_set_intensity(struct backlight_device *bd)
114{ 114{
115 int intensity = bd->props->brightness; 115 int intensity = bd->props.brightness;
116 116
117 if (bd->props->power != FB_BLANK_UNBLANK) 117 if (bd->props.power != FB_BLANK_UNBLANK)
118 intensity = 0; 118 intensity = 0;
119 if (bd->props->fb_blank != FB_BLANK_UNBLANK) 119 if (bd->props.fb_blank != FB_BLANK_UNBLANK)
120 intensity = 0; 120 intensity = 0;
121 if (locomolcd_flags & LOCOMOLCD_SUSPENDED) 121 if (locomolcd_flags & LOCOMOLCD_SUSPENDED)
122 intensity = 0; 122 intensity = 0;
@@ -141,10 +141,9 @@ static int locomolcd_get_intensity(struct backlight_device *bd)
141 return current_intensity; 141 return current_intensity;
142} 142}
143 143
144static struct backlight_properties locomobl_data = { 144static struct backlight_ops locomobl_data = {
145 .get_brightness = locomolcd_get_intensity, 145 .get_brightness = locomolcd_get_intensity,
146 .update_status = locomolcd_set_intensity, 146 .update_status = locomolcd_set_intensity,
147 .max_brightness = 4,
148}; 147};
149 148
150#ifdef CONFIG_PM 149#ifdef CONFIG_PM
@@ -189,7 +188,8 @@ static int locomolcd_probe(struct locomo_dev *ldev)
189 return PTR_ERR (locomolcd_bl_device); 188 return PTR_ERR (locomolcd_bl_device);
190 189
191 /* Set up frontlight so that screen is readable */ 190 /* Set up frontlight so that screen is readable */
192 locomobl_data.brightness = 2; 191 locomolcd_bl_device->props.max_brightness = 4,
192 locomolcd_bl_device->props.brightness = 2;
193 locomolcd_set_intensity(locomolcd_bl_device); 193 locomolcd_set_intensity(locomolcd_bl_device);
194 194
195 return 0; 195 return 0;