diff options
Diffstat (limited to 'drivers/video/backlight')
-rw-r--r-- | drivers/video/backlight/88pm860x_bl.c | 6 | ||||
-rw-r--r-- | drivers/video/backlight/adp5520_bl.c | 11 | ||||
-rw-r--r-- | drivers/video/backlight/adx_bl.c | 8 | ||||
-rw-r--r-- | drivers/video/backlight/atmel-pwm-bl.c | 8 | ||||
-rw-r--r-- | drivers/video/backlight/backlight.c | 8 | ||||
-rw-r--r-- | drivers/video/backlight/corgi_lcd.c | 8 | ||||
-rw-r--r-- | drivers/video/backlight/cr_bllcd.c | 8 | ||||
-rw-r--r-- | drivers/video/backlight/da903x_bl.c | 7 | ||||
-rw-r--r-- | drivers/video/backlight/generic_bl.c | 8 | ||||
-rw-r--r-- | drivers/video/backlight/hp680_bl.c | 8 | ||||
-rw-r--r-- | drivers/video/backlight/jornada720_bl.c | 7 | ||||
-rw-r--r-- | drivers/video/backlight/kb3886_bl.c | 8 | ||||
-rw-r--r-- | drivers/video/backlight/locomolcd.c | 8 | ||||
-rw-r--r-- | drivers/video/backlight/max8925_bl.c | 6 | ||||
-rw-r--r-- | drivers/video/backlight/mbp_nvidia_bl.c | 10 | ||||
-rw-r--r-- | drivers/video/backlight/omap1_bl.c | 7 | ||||
-rw-r--r-- | drivers/video/backlight/progear_bl.c | 7 | ||||
-rw-r--r-- | drivers/video/backlight/pwm_bl.c | 8 | ||||
-rw-r--r-- | drivers/video/backlight/tosa_bl.c | 8 | ||||
-rw-r--r-- | drivers/video/backlight/wm831x_bl.c | 7 |
20 files changed, 102 insertions, 54 deletions
diff --git a/drivers/video/backlight/88pm860x_bl.c b/drivers/video/backlight/88pm860x_bl.c index b8f705cca438..93e25c77aeb2 100644 --- a/drivers/video/backlight/88pm860x_bl.c +++ b/drivers/video/backlight/88pm860x_bl.c | |||
@@ -187,6 +187,7 @@ static int pm860x_backlight_probe(struct platform_device *pdev) | |||
187 | struct pm860x_backlight_data *data; | 187 | struct pm860x_backlight_data *data; |
188 | struct backlight_device *bl; | 188 | struct backlight_device *bl; |
189 | struct resource *res; | 189 | struct resource *res; |
190 | struct backlight_properties props; | ||
190 | unsigned char value; | 191 | unsigned char value; |
191 | char name[MFD_NAME_SIZE]; | 192 | char name[MFD_NAME_SIZE]; |
192 | int ret; | 193 | int ret; |
@@ -223,14 +224,15 @@ static int pm860x_backlight_probe(struct platform_device *pdev) | |||
223 | return -EINVAL; | 224 | return -EINVAL; |
224 | } | 225 | } |
225 | 226 | ||
227 | memset(&props, 0, sizeof(struct backlight_properties)); | ||
228 | props.max_brightness = MAX_BRIGHTNESS; | ||
226 | bl = backlight_device_register(name, &pdev->dev, data, | 229 | bl = backlight_device_register(name, &pdev->dev, data, |
227 | &pm860x_backlight_ops); | 230 | &pm860x_backlight_ops, &props); |
228 | if (IS_ERR(bl)) { | 231 | if (IS_ERR(bl)) { |
229 | dev_err(&pdev->dev, "failed to register backlight\n"); | 232 | dev_err(&pdev->dev, "failed to register backlight\n"); |
230 | kfree(data); | 233 | kfree(data); |
231 | return PTR_ERR(bl); | 234 | return PTR_ERR(bl); |
232 | } | 235 | } |
233 | bl->props.max_brightness = MAX_BRIGHTNESS; | ||
234 | bl->props.brightness = MAX_BRIGHTNESS; | 236 | bl->props.brightness = MAX_BRIGHTNESS; |
235 | 237 | ||
236 | platform_set_drvdata(pdev, bl); | 238 | platform_set_drvdata(pdev, bl); |
diff --git a/drivers/video/backlight/adp5520_bl.c b/drivers/video/backlight/adp5520_bl.c index 86d95c228adb..5183f0e4d314 100644 --- a/drivers/video/backlight/adp5520_bl.c +++ b/drivers/video/backlight/adp5520_bl.c | |||
@@ -278,6 +278,7 @@ static const struct attribute_group adp5520_bl_attr_group = { | |||
278 | 278 | ||
279 | static int __devinit adp5520_bl_probe(struct platform_device *pdev) | 279 | static int __devinit adp5520_bl_probe(struct platform_device *pdev) |
280 | { | 280 | { |
281 | struct backlight_properties props; | ||
281 | struct backlight_device *bl; | 282 | struct backlight_device *bl; |
282 | struct adp5520_bl *data; | 283 | struct adp5520_bl *data; |
283 | int ret = 0; | 284 | int ret = 0; |
@@ -300,17 +301,17 @@ static int __devinit adp5520_bl_probe(struct platform_device *pdev) | |||
300 | 301 | ||
301 | mutex_init(&data->lock); | 302 | mutex_init(&data->lock); |
302 | 303 | ||
303 | bl = backlight_device_register(pdev->name, data->master, | 304 | memset(&props, 0, sizeof(struct backlight_properties)); |
304 | data, &adp5520_bl_ops); | 305 | props.max_brightness = ADP5020_MAX_BRIGHTNESS; |
306 | bl = backlight_device_register(pdev->name, data->master, data, | ||
307 | &adp5520_bl_ops, &props); | ||
305 | if (IS_ERR(bl)) { | 308 | if (IS_ERR(bl)) { |
306 | dev_err(&pdev->dev, "failed to register backlight\n"); | 309 | dev_err(&pdev->dev, "failed to register backlight\n"); |
307 | kfree(data); | 310 | kfree(data); |
308 | return PTR_ERR(bl); | 311 | return PTR_ERR(bl); |
309 | } | 312 | } |
310 | 313 | ||
311 | bl->props.max_brightness = | 314 | bl->props.brightness = ADP5020_MAX_BRIGHTNESS; |
312 | bl->props.brightness = ADP5020_MAX_BRIGHTNESS; | ||
313 | |||
314 | if (data->pdata->en_ambl_sens) | 315 | if (data->pdata->en_ambl_sens) |
315 | ret = sysfs_create_group(&bl->dev.kobj, | 316 | ret = sysfs_create_group(&bl->dev.kobj, |
316 | &adp5520_bl_attr_group); | 317 | &adp5520_bl_attr_group); |
diff --git a/drivers/video/backlight/adx_bl.c b/drivers/video/backlight/adx_bl.c index a683dd1be4bc..b0624b983889 100644 --- a/drivers/video/backlight/adx_bl.c +++ b/drivers/video/backlight/adx_bl.c | |||
@@ -70,6 +70,7 @@ static const struct backlight_ops adx_backlight_ops = { | |||
70 | 70 | ||
71 | static int __devinit adx_backlight_probe(struct platform_device *pdev) | 71 | static int __devinit adx_backlight_probe(struct platform_device *pdev) |
72 | { | 72 | { |
73 | struct backlight_properties props; | ||
73 | struct backlight_device *bldev; | 74 | struct backlight_device *bldev; |
74 | struct resource *res; | 75 | struct resource *res; |
75 | struct adxbl *bl; | 76 | struct adxbl *bl; |
@@ -101,14 +102,15 @@ static int __devinit adx_backlight_probe(struct platform_device *pdev) | |||
101 | goto out; | 102 | goto out; |
102 | } | 103 | } |
103 | 104 | ||
104 | bldev = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, bl, | 105 | memset(&props, 0, sizeof(struct backlight_properties)); |
105 | &adx_backlight_ops); | 106 | props.max_brightness = 0xff; |
107 | bldev = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, | ||
108 | bl, &adx_backlight_ops, &props); | ||
106 | if (!bldev) { | 109 | if (!bldev) { |
107 | ret = -ENOMEM; | 110 | ret = -ENOMEM; |
108 | goto out; | 111 | goto out; |
109 | } | 112 | } |
110 | 113 | ||
111 | bldev->props.max_brightness = 0xff; | ||
112 | bldev->props.brightness = 0xff; | 114 | bldev->props.brightness = 0xff; |
113 | bldev->props.power = FB_BLANK_UNBLANK; | 115 | bldev->props.power = FB_BLANK_UNBLANK; |
114 | 116 | ||
diff --git a/drivers/video/backlight/atmel-pwm-bl.c b/drivers/video/backlight/atmel-pwm-bl.c index f625ffc69ad3..2d9760551a4b 100644 --- a/drivers/video/backlight/atmel-pwm-bl.c +++ b/drivers/video/backlight/atmel-pwm-bl.c | |||
@@ -120,6 +120,7 @@ static const struct backlight_ops atmel_pwm_bl_ops = { | |||
120 | 120 | ||
121 | static int atmel_pwm_bl_probe(struct platform_device *pdev) | 121 | static int atmel_pwm_bl_probe(struct platform_device *pdev) |
122 | { | 122 | { |
123 | struct backlight_properties props; | ||
123 | const struct atmel_pwm_bl_platform_data *pdata; | 124 | const struct atmel_pwm_bl_platform_data *pdata; |
124 | struct backlight_device *bldev; | 125 | struct backlight_device *bldev; |
125 | struct atmel_pwm_bl *pwmbl; | 126 | struct atmel_pwm_bl *pwmbl; |
@@ -165,8 +166,10 @@ static int atmel_pwm_bl_probe(struct platform_device *pdev) | |||
165 | goto err_free_gpio; | 166 | goto err_free_gpio; |
166 | } | 167 | } |
167 | 168 | ||
168 | bldev = backlight_device_register("atmel-pwm-bl", | 169 | memset(&props, 0, sizeof(struct backlight_properties)); |
169 | &pdev->dev, pwmbl, &atmel_pwm_bl_ops); | 170 | props.max_brightness = pdata->pwm_duty_max - pdata->pwm_duty_min; |
171 | bldev = backlight_device_register("atmel-pwm-bl", &pdev->dev, pwmbl, | ||
172 | &atmel_pwm_bl_ops, &props); | ||
170 | if (IS_ERR(bldev)) { | 173 | if (IS_ERR(bldev)) { |
171 | retval = PTR_ERR(bldev); | 174 | retval = PTR_ERR(bldev); |
172 | goto err_free_gpio; | 175 | goto err_free_gpio; |
@@ -178,7 +181,6 @@ static int atmel_pwm_bl_probe(struct platform_device *pdev) | |||
178 | 181 | ||
179 | /* Power up the backlight by default at middle intesity. */ | 182 | /* Power up the backlight by default at middle intesity. */ |
180 | bldev->props.power = FB_BLANK_UNBLANK; | 183 | bldev->props.power = FB_BLANK_UNBLANK; |
181 | bldev->props.max_brightness = pdata->pwm_duty_max - pdata->pwm_duty_min; | ||
182 | bldev->props.brightness = bldev->props.max_brightness / 2; | 184 | bldev->props.brightness = bldev->props.max_brightness / 2; |
183 | 185 | ||
184 | retval = atmel_pwm_bl_init_pwm(pwmbl); | 186 | retval = atmel_pwm_bl_init_pwm(pwmbl); |
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index b800cd4eeec8..68bb838b9f11 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c | |||
@@ -269,7 +269,8 @@ EXPORT_SYMBOL(backlight_force_update); | |||
269 | * ERR_PTR() or a pointer to the newly allocated device. | 269 | * ERR_PTR() or a pointer to the newly allocated device. |
270 | */ | 270 | */ |
271 | struct backlight_device *backlight_device_register(const char *name, | 271 | struct backlight_device *backlight_device_register(const char *name, |
272 | struct device *parent, void *devdata, const struct backlight_ops *ops) | 272 | struct device *parent, void *devdata, const struct backlight_ops *ops, |
273 | const struct backlight_properties *props) | ||
273 | { | 274 | { |
274 | struct backlight_device *new_bd; | 275 | struct backlight_device *new_bd; |
275 | int rc; | 276 | int rc; |
@@ -289,6 +290,11 @@ struct backlight_device *backlight_device_register(const char *name, | |||
289 | dev_set_name(&new_bd->dev, name); | 290 | dev_set_name(&new_bd->dev, name); |
290 | dev_set_drvdata(&new_bd->dev, devdata); | 291 | dev_set_drvdata(&new_bd->dev, devdata); |
291 | 292 | ||
293 | /* Set default properties */ | ||
294 | if (props) | ||
295 | memcpy(&new_bd->props, props, | ||
296 | sizeof(struct backlight_properties)); | ||
297 | |||
292 | rc = device_register(&new_bd->dev); | 298 | rc = device_register(&new_bd->dev); |
293 | if (rc) { | 299 | if (rc) { |
294 | kfree(new_bd); | 300 | kfree(new_bd); |
diff --git a/drivers/video/backlight/corgi_lcd.c b/drivers/video/backlight/corgi_lcd.c index b4bcf8043797..73bdd8454c94 100644 --- a/drivers/video/backlight/corgi_lcd.c +++ b/drivers/video/backlight/corgi_lcd.c | |||
@@ -533,6 +533,7 @@ err_free_backlight_on: | |||
533 | 533 | ||
534 | static int __devinit corgi_lcd_probe(struct spi_device *spi) | 534 | static int __devinit corgi_lcd_probe(struct spi_device *spi) |
535 | { | 535 | { |
536 | struct backlight_properties props; | ||
536 | struct corgi_lcd_platform_data *pdata = spi->dev.platform_data; | 537 | struct corgi_lcd_platform_data *pdata = spi->dev.platform_data; |
537 | struct corgi_lcd *lcd; | 538 | struct corgi_lcd *lcd; |
538 | int ret = 0; | 539 | int ret = 0; |
@@ -559,13 +560,14 @@ static int __devinit corgi_lcd_probe(struct spi_device *spi) | |||
559 | lcd->power = FB_BLANK_POWERDOWN; | 560 | lcd->power = FB_BLANK_POWERDOWN; |
560 | lcd->mode = (pdata) ? pdata->init_mode : CORGI_LCD_MODE_VGA; | 561 | lcd->mode = (pdata) ? pdata->init_mode : CORGI_LCD_MODE_VGA; |
561 | 562 | ||
562 | lcd->bl_dev = backlight_device_register("corgi_bl", &spi->dev, | 563 | memset(&props, 0, sizeof(struct backlight_properties)); |
563 | lcd, &corgi_bl_ops); | 564 | props.max_brightness = pdata->max_intensity; |
565 | lcd->bl_dev = backlight_device_register("corgi_bl", &spi->dev, lcd, | ||
566 | &corgi_bl_ops, &props); | ||
564 | if (IS_ERR(lcd->bl_dev)) { | 567 | if (IS_ERR(lcd->bl_dev)) { |
565 | ret = PTR_ERR(lcd->bl_dev); | 568 | ret = PTR_ERR(lcd->bl_dev); |
566 | goto err_unregister_lcd; | 569 | goto err_unregister_lcd; |
567 | } | 570 | } |
568 | lcd->bl_dev->props.max_brightness = pdata->max_intensity; | ||
569 | lcd->bl_dev->props.brightness = pdata->default_intensity; | 571 | lcd->bl_dev->props.brightness = pdata->default_intensity; |
570 | lcd->bl_dev->props.power = FB_BLANK_UNBLANK; | 572 | lcd->bl_dev->props.power = FB_BLANK_UNBLANK; |
571 | 573 | ||
diff --git a/drivers/video/backlight/cr_bllcd.c b/drivers/video/backlight/cr_bllcd.c index da86db4374a0..1cce6031bff2 100644 --- a/drivers/video/backlight/cr_bllcd.c +++ b/drivers/video/backlight/cr_bllcd.c | |||
@@ -170,6 +170,7 @@ static struct lcd_ops cr_lcd_ops = { | |||
170 | 170 | ||
171 | static int cr_backlight_probe(struct platform_device *pdev) | 171 | static int cr_backlight_probe(struct platform_device *pdev) |
172 | { | 172 | { |
173 | struct backlight_properties props; | ||
173 | struct backlight_device *bdp; | 174 | struct backlight_device *bdp; |
174 | struct lcd_device *ldp; | 175 | struct lcd_device *ldp; |
175 | struct cr_panel *crp; | 176 | struct cr_panel *crp; |
@@ -190,8 +191,9 @@ static int cr_backlight_probe(struct platform_device *pdev) | |||
190 | return -ENODEV; | 191 | return -ENODEV; |
191 | } | 192 | } |
192 | 193 | ||
193 | bdp = backlight_device_register("cr-backlight", | 194 | memset(&props, 0, sizeof(struct backlight_properties)); |
194 | &pdev->dev, NULL, &cr_backlight_ops); | 195 | bdp = backlight_device_register("cr-backlight", &pdev->dev, NULL, |
196 | &cr_backlight_ops, &props); | ||
195 | if (IS_ERR(bdp)) { | 197 | if (IS_ERR(bdp)) { |
196 | pci_dev_put(lpc_dev); | 198 | pci_dev_put(lpc_dev); |
197 | return PTR_ERR(bdp); | 199 | return PTR_ERR(bdp); |
@@ -220,9 +222,7 @@ static int cr_backlight_probe(struct platform_device *pdev) | |||
220 | crp->cr_lcd_device = ldp; | 222 | crp->cr_lcd_device = ldp; |
221 | crp->cr_backlight_device->props.power = FB_BLANK_UNBLANK; | 223 | crp->cr_backlight_device->props.power = FB_BLANK_UNBLANK; |
222 | crp->cr_backlight_device->props.brightness = 0; | 224 | crp->cr_backlight_device->props.brightness = 0; |
223 | crp->cr_backlight_device->props.max_brightness = 0; | ||
224 | cr_backlight_set_intensity(crp->cr_backlight_device); | 225 | cr_backlight_set_intensity(crp->cr_backlight_device); |
225 | |||
226 | cr_lcd_set_power(crp->cr_lcd_device, FB_BLANK_UNBLANK); | 226 | cr_lcd_set_power(crp->cr_lcd_device, FB_BLANK_UNBLANK); |
227 | 227 | ||
228 | platform_set_drvdata(pdev, crp); | 228 | platform_set_drvdata(pdev, crp); |
diff --git a/drivers/video/backlight/da903x_bl.c b/drivers/video/backlight/da903x_bl.c index 74cdc640173d..686e4a789238 100644 --- a/drivers/video/backlight/da903x_bl.c +++ b/drivers/video/backlight/da903x_bl.c | |||
@@ -105,6 +105,7 @@ static int da903x_backlight_probe(struct platform_device *pdev) | |||
105 | struct da9034_backlight_pdata *pdata = pdev->dev.platform_data; | 105 | struct da9034_backlight_pdata *pdata = pdev->dev.platform_data; |
106 | struct da903x_backlight_data *data; | 106 | struct da903x_backlight_data *data; |
107 | struct backlight_device *bl; | 107 | struct backlight_device *bl; |
108 | struct backlight_properties props; | ||
108 | int max_brightness; | 109 | int max_brightness; |
109 | 110 | ||
110 | data = kzalloc(sizeof(*data), GFP_KERNEL); | 111 | data = kzalloc(sizeof(*data), GFP_KERNEL); |
@@ -134,15 +135,15 @@ static int da903x_backlight_probe(struct platform_device *pdev) | |||
134 | da903x_write(data->da903x_dev, DA9034_WLED_CONTROL2, | 135 | da903x_write(data->da903x_dev, DA9034_WLED_CONTROL2, |
135 | DA9034_WLED_ISET(pdata->output_current)); | 136 | DA9034_WLED_ISET(pdata->output_current)); |
136 | 137 | ||
137 | bl = backlight_device_register(pdev->name, data->da903x_dev, | 138 | props.max_brightness = max_brightness; |
138 | data, &da903x_backlight_ops); | 139 | bl = backlight_device_register(pdev->name, data->da903x_dev, data, |
140 | &da903x_backlight_ops, &props); | ||
139 | if (IS_ERR(bl)) { | 141 | if (IS_ERR(bl)) { |
140 | dev_err(&pdev->dev, "failed to register backlight\n"); | 142 | dev_err(&pdev->dev, "failed to register backlight\n"); |
141 | kfree(data); | 143 | kfree(data); |
142 | return PTR_ERR(bl); | 144 | return PTR_ERR(bl); |
143 | } | 145 | } |
144 | 146 | ||
145 | bl->props.max_brightness = max_brightness; | ||
146 | bl->props.brightness = max_brightness; | 147 | bl->props.brightness = max_brightness; |
147 | 148 | ||
148 | platform_set_drvdata(pdev, bl); | 149 | platform_set_drvdata(pdev, bl); |
diff --git a/drivers/video/backlight/generic_bl.c b/drivers/video/backlight/generic_bl.c index e6d348e63596..312ca619735d 100644 --- a/drivers/video/backlight/generic_bl.c +++ b/drivers/video/backlight/generic_bl.c | |||
@@ -78,6 +78,7 @@ static const struct backlight_ops genericbl_ops = { | |||
78 | 78 | ||
79 | static int genericbl_probe(struct platform_device *pdev) | 79 | static int genericbl_probe(struct platform_device *pdev) |
80 | { | 80 | { |
81 | struct backlight_properties props; | ||
81 | struct generic_bl_info *machinfo = pdev->dev.platform_data; | 82 | struct generic_bl_info *machinfo = pdev->dev.platform_data; |
82 | const char *name = "generic-bl"; | 83 | const char *name = "generic-bl"; |
83 | struct backlight_device *bd; | 84 | struct backlight_device *bd; |
@@ -89,14 +90,15 @@ static int genericbl_probe(struct platform_device *pdev) | |||
89 | if (machinfo->name) | 90 | if (machinfo->name) |
90 | name = machinfo->name; | 91 | name = machinfo->name; |
91 | 92 | ||
92 | bd = backlight_device_register (name, | 93 | memset(&props, 0, sizeof(struct backlight_properties)); |
93 | &pdev->dev, NULL, &genericbl_ops); | 94 | props.max_brightness = machinfo->max_intensity; |
95 | bd = backlight_device_register(name, &pdev->dev, NULL, &genericbl_ops, | ||
96 | &props); | ||
94 | if (IS_ERR (bd)) | 97 | if (IS_ERR (bd)) |
95 | return PTR_ERR (bd); | 98 | return PTR_ERR (bd); |
96 | 99 | ||
97 | platform_set_drvdata(pdev, bd); | 100 | platform_set_drvdata(pdev, bd); |
98 | 101 | ||
99 | bd->props.max_brightness = machinfo->max_intensity; | ||
100 | bd->props.power = FB_BLANK_UNBLANK; | 102 | bd->props.power = FB_BLANK_UNBLANK; |
101 | bd->props.brightness = machinfo->default_intensity; | 103 | bd->props.brightness = machinfo->default_intensity; |
102 | backlight_update_status(bd); | 104 | backlight_update_status(bd); |
diff --git a/drivers/video/backlight/hp680_bl.c b/drivers/video/backlight/hp680_bl.c index f7cc528d5be7..267d23f8d645 100644 --- a/drivers/video/backlight/hp680_bl.c +++ b/drivers/video/backlight/hp680_bl.c | |||
@@ -105,16 +105,18 @@ static const struct backlight_ops hp680bl_ops = { | |||
105 | 105 | ||
106 | static int __devinit hp680bl_probe(struct platform_device *pdev) | 106 | static int __devinit hp680bl_probe(struct platform_device *pdev) |
107 | { | 107 | { |
108 | struct backlight_properties props; | ||
108 | struct backlight_device *bd; | 109 | struct backlight_device *bd; |
109 | 110 | ||
110 | bd = backlight_device_register ("hp680-bl", &pdev->dev, NULL, | 111 | memset(&props, 0, sizeof(struct backlight_properties)); |
111 | &hp680bl_ops); | 112 | props.max_brightness = HP680_MAX_INTENSITY; |
113 | bd = backlight_device_register("hp680-bl", &pdev->dev, NULL, | ||
114 | &hp680bl_ops, &props); | ||
112 | if (IS_ERR(bd)) | 115 | if (IS_ERR(bd)) |
113 | return PTR_ERR(bd); | 116 | return PTR_ERR(bd); |
114 | 117 | ||
115 | platform_set_drvdata(pdev, bd); | 118 | platform_set_drvdata(pdev, bd); |
116 | 119 | ||
117 | bd->props.max_brightness = HP680_MAX_INTENSITY; | ||
118 | bd->props.brightness = HP680_DEFAULT_INTENSITY; | 120 | bd->props.brightness = HP680_DEFAULT_INTENSITY; |
119 | hp680bl_send_intensity(bd); | 121 | hp680bl_send_intensity(bd); |
120 | 122 | ||
diff --git a/drivers/video/backlight/jornada720_bl.c b/drivers/video/backlight/jornada720_bl.c index db9071fc5665..2f177b3a4885 100644 --- a/drivers/video/backlight/jornada720_bl.c +++ b/drivers/video/backlight/jornada720_bl.c | |||
@@ -101,10 +101,14 @@ static const struct backlight_ops jornada_bl_ops = { | |||
101 | 101 | ||
102 | static int jornada_bl_probe(struct platform_device *pdev) | 102 | static int jornada_bl_probe(struct platform_device *pdev) |
103 | { | 103 | { |
104 | struct backlight_properties props; | ||
104 | int ret; | 105 | int ret; |
105 | struct backlight_device *bd; | 106 | struct backlight_device *bd; |
106 | 107 | ||
107 | bd = backlight_device_register(S1D_DEVICENAME, &pdev->dev, NULL, &jornada_bl_ops); | 108 | memset(&props, 0, sizeof(struct backlight_properties)); |
109 | props.max_brightness = BL_MAX_BRIGHT; | ||
110 | bd = backlight_device_register(S1D_DEVICENAME, &pdev->dev, NULL, | ||
111 | &jornada_bl_ops, &props); | ||
108 | 112 | ||
109 | if (IS_ERR(bd)) { | 113 | if (IS_ERR(bd)) { |
110 | ret = PTR_ERR(bd); | 114 | ret = PTR_ERR(bd); |
@@ -117,7 +121,6 @@ static int jornada_bl_probe(struct platform_device *pdev) | |||
117 | /* note. make sure max brightness is set otherwise | 121 | /* note. make sure max brightness is set otherwise |
118 | you will get seemingly non-related errors when | 122 | you will get seemingly non-related errors when |
119 | trying to change brightness */ | 123 | trying to change brightness */ |
120 | bd->props.max_brightness = BL_MAX_BRIGHT; | ||
121 | jornada_bl_update_status(bd); | 124 | jornada_bl_update_status(bd); |
122 | 125 | ||
123 | platform_set_drvdata(pdev, bd); | 126 | platform_set_drvdata(pdev, bd); |
diff --git a/drivers/video/backlight/kb3886_bl.c b/drivers/video/backlight/kb3886_bl.c index 939e7b830cf3..f439a8632287 100644 --- a/drivers/video/backlight/kb3886_bl.c +++ b/drivers/video/backlight/kb3886_bl.c | |||
@@ -141,20 +141,24 @@ static const struct backlight_ops kb3886bl_ops = { | |||
141 | 141 | ||
142 | static int kb3886bl_probe(struct platform_device *pdev) | 142 | static int kb3886bl_probe(struct platform_device *pdev) |
143 | { | 143 | { |
144 | struct backlight_properties props; | ||
144 | struct kb3886bl_machinfo *machinfo = pdev->dev.platform_data; | 145 | struct kb3886bl_machinfo *machinfo = pdev->dev.platform_data; |
145 | 146 | ||
146 | bl_machinfo = machinfo; | 147 | bl_machinfo = machinfo; |
147 | if (!machinfo->limit_mask) | 148 | if (!machinfo->limit_mask) |
148 | machinfo->limit_mask = -1; | 149 | machinfo->limit_mask = -1; |
149 | 150 | ||
151 | memset(&props, 0, sizeof(struct backlight_properties)); | ||
152 | props.max_brightness = machinfo->max_intensity; | ||
150 | kb3886_backlight_device = backlight_device_register("kb3886-bl", | 153 | kb3886_backlight_device = backlight_device_register("kb3886-bl", |
151 | &pdev->dev, NULL, &kb3886bl_ops); | 154 | &pdev->dev, NULL, |
155 | &kb3886bl_ops, | ||
156 | &props); | ||
152 | if (IS_ERR(kb3886_backlight_device)) | 157 | if (IS_ERR(kb3886_backlight_device)) |
153 | return PTR_ERR(kb3886_backlight_device); | 158 | return PTR_ERR(kb3886_backlight_device); |
154 | 159 | ||
155 | platform_set_drvdata(pdev, kb3886_backlight_device); | 160 | platform_set_drvdata(pdev, kb3886_backlight_device); |
156 | 161 | ||
157 | kb3886_backlight_device->props.max_brightness = machinfo->max_intensity; | ||
158 | kb3886_backlight_device->props.power = FB_BLANK_UNBLANK; | 162 | kb3886_backlight_device->props.power = FB_BLANK_UNBLANK; |
159 | kb3886_backlight_device->props.brightness = machinfo->default_intensity; | 163 | kb3886_backlight_device->props.brightness = machinfo->default_intensity; |
160 | backlight_update_status(kb3886_backlight_device); | 164 | backlight_update_status(kb3886_backlight_device); |
diff --git a/drivers/video/backlight/locomolcd.c b/drivers/video/backlight/locomolcd.c index 00a9591b0003..7571bc26071e 100644 --- a/drivers/video/backlight/locomolcd.c +++ b/drivers/video/backlight/locomolcd.c | |||
@@ -167,6 +167,7 @@ static int locomolcd_resume(struct locomo_dev *dev) | |||
167 | 167 | ||
168 | static int locomolcd_probe(struct locomo_dev *ldev) | 168 | static int locomolcd_probe(struct locomo_dev *ldev) |
169 | { | 169 | { |
170 | struct backlight_properties props; | ||
170 | unsigned long flags; | 171 | unsigned long flags; |
171 | 172 | ||
172 | local_irq_save(flags); | 173 | local_irq_save(flags); |
@@ -182,13 +183,16 @@ static int locomolcd_probe(struct locomo_dev *ldev) | |||
182 | 183 | ||
183 | local_irq_restore(flags); | 184 | local_irq_restore(flags); |
184 | 185 | ||
185 | locomolcd_bl_device = backlight_device_register("locomo-bl", &ldev->dev, NULL, &locomobl_data); | 186 | memset(&props, 0, sizeof(struct backlight_properties)); |
187 | props.max_brightness = 4; | ||
188 | locomolcd_bl_device = backlight_device_register("locomo-bl", | ||
189 | &ldev->dev, NULL, | ||
190 | &locomobl_data, &props); | ||
186 | 191 | ||
187 | if (IS_ERR (locomolcd_bl_device)) | 192 | if (IS_ERR (locomolcd_bl_device)) |
188 | return PTR_ERR (locomolcd_bl_device); | 193 | return PTR_ERR (locomolcd_bl_device); |
189 | 194 | ||
190 | /* Set up frontlight so that screen is readable */ | 195 | /* Set up frontlight so that screen is readable */ |
191 | locomolcd_bl_device->props.max_brightness = 4, | ||
192 | locomolcd_bl_device->props.brightness = 2; | 196 | locomolcd_bl_device->props.brightness = 2; |
193 | locomolcd_set_intensity(locomolcd_bl_device); | 197 | locomolcd_set_intensity(locomolcd_bl_device); |
194 | 198 | ||
diff --git a/drivers/video/backlight/max8925_bl.c b/drivers/video/backlight/max8925_bl.c index c267069a52a3..c91adaf492cf 100644 --- a/drivers/video/backlight/max8925_bl.c +++ b/drivers/video/backlight/max8925_bl.c | |||
@@ -104,6 +104,7 @@ static int __devinit max8925_backlight_probe(struct platform_device *pdev) | |||
104 | struct max8925_backlight_pdata *pdata = NULL; | 104 | struct max8925_backlight_pdata *pdata = NULL; |
105 | struct max8925_backlight_data *data; | 105 | struct max8925_backlight_data *data; |
106 | struct backlight_device *bl; | 106 | struct backlight_device *bl; |
107 | struct backlight_properties props; | ||
107 | struct resource *res; | 108 | struct resource *res; |
108 | char name[MAX8925_NAME_SIZE]; | 109 | char name[MAX8925_NAME_SIZE]; |
109 | unsigned char value; | 110 | unsigned char value; |
@@ -133,14 +134,15 @@ static int __devinit max8925_backlight_probe(struct platform_device *pdev) | |||
133 | data->chip = chip; | 134 | data->chip = chip; |
134 | data->current_brightness = 0; | 135 | data->current_brightness = 0; |
135 | 136 | ||
137 | memset(&props, 0, sizeof(struct backlight_properties)); | ||
138 | props.max_brightness = MAX_BRIGHTNESS; | ||
136 | bl = backlight_device_register(name, &pdev->dev, data, | 139 | bl = backlight_device_register(name, &pdev->dev, data, |
137 | &max8925_backlight_ops); | 140 | &max8925_backlight_ops, &props); |
138 | if (IS_ERR(bl)) { | 141 | if (IS_ERR(bl)) { |
139 | dev_err(&pdev->dev, "failed to register backlight\n"); | 142 | dev_err(&pdev->dev, "failed to register backlight\n"); |
140 | kfree(data); | 143 | kfree(data); |
141 | return PTR_ERR(bl); | 144 | return PTR_ERR(bl); |
142 | } | 145 | } |
143 | bl->props.max_brightness = MAX_BRIGHTNESS; | ||
144 | bl->props.brightness = MAX_BRIGHTNESS; | 146 | bl->props.brightness = MAX_BRIGHTNESS; |
145 | 147 | ||
146 | platform_set_drvdata(pdev, bl); | 148 | platform_set_drvdata(pdev, bl); |
diff --git a/drivers/video/backlight/mbp_nvidia_bl.c b/drivers/video/backlight/mbp_nvidia_bl.c index 2e78b0784bdc..0881358eeace 100644 --- a/drivers/video/backlight/mbp_nvidia_bl.c +++ b/drivers/video/backlight/mbp_nvidia_bl.c | |||
@@ -250,6 +250,7 @@ static const struct dmi_system_id __initdata mbp_device_table[] = { | |||
250 | 250 | ||
251 | static int __init mbp_init(void) | 251 | static int __init mbp_init(void) |
252 | { | 252 | { |
253 | struct backlight_properties props; | ||
253 | if (!dmi_check_system(mbp_device_table)) | 254 | if (!dmi_check_system(mbp_device_table)) |
254 | return -ENODEV; | 255 | return -ENODEV; |
255 | 256 | ||
@@ -257,14 +258,17 @@ static int __init mbp_init(void) | |||
257 | "Macbook Pro backlight")) | 258 | "Macbook Pro backlight")) |
258 | return -ENXIO; | 259 | return -ENXIO; |
259 | 260 | ||
260 | mbp_backlight_device = backlight_device_register("mbp_backlight", | 261 | memset(&props, 0, sizeof(struct backlight_properties)); |
261 | NULL, NULL, &driver_data->backlight_ops); | 262 | props.max_brightness = 15; |
263 | mbp_backlight_device = backlight_device_register("mbp_backlight", NULL, | ||
264 | NULL, | ||
265 | &driver_data->backlight_ops, | ||
266 | &props); | ||
262 | if (IS_ERR(mbp_backlight_device)) { | 267 | if (IS_ERR(mbp_backlight_device)) { |
263 | release_region(driver_data->iostart, driver_data->iolen); | 268 | release_region(driver_data->iostart, driver_data->iolen); |
264 | return PTR_ERR(mbp_backlight_device); | 269 | return PTR_ERR(mbp_backlight_device); |
265 | } | 270 | } |
266 | 271 | ||
267 | mbp_backlight_device->props.max_brightness = 15; | ||
268 | mbp_backlight_device->props.brightness = | 272 | mbp_backlight_device->props.brightness = |
269 | driver_data->backlight_ops.get_brightness(mbp_backlight_device); | 273 | driver_data->backlight_ops.get_brightness(mbp_backlight_device); |
270 | backlight_update_status(mbp_backlight_device); | 274 | backlight_update_status(mbp_backlight_device); |
diff --git a/drivers/video/backlight/omap1_bl.c b/drivers/video/backlight/omap1_bl.c index a3a7f8938175..333d28e6b062 100644 --- a/drivers/video/backlight/omap1_bl.c +++ b/drivers/video/backlight/omap1_bl.c | |||
@@ -132,6 +132,7 @@ static const struct backlight_ops omapbl_ops = { | |||
132 | 132 | ||
133 | static int omapbl_probe(struct platform_device *pdev) | 133 | static int omapbl_probe(struct platform_device *pdev) |
134 | { | 134 | { |
135 | struct backlight_properties props; | ||
135 | struct backlight_device *dev; | 136 | struct backlight_device *dev; |
136 | struct omap_backlight *bl; | 137 | struct omap_backlight *bl; |
137 | struct omap_backlight_config *pdata = pdev->dev.platform_data; | 138 | struct omap_backlight_config *pdata = pdev->dev.platform_data; |
@@ -143,7 +144,10 @@ static int omapbl_probe(struct platform_device *pdev) | |||
143 | if (unlikely(!bl)) | 144 | if (unlikely(!bl)) |
144 | return -ENOMEM; | 145 | return -ENOMEM; |
145 | 146 | ||
146 | dev = backlight_device_register("omap-bl", &pdev->dev, bl, &omapbl_ops); | 147 | memset(&props, 0, sizeof(struct backlight_properties)); |
148 | props.max_brightness = OMAPBL_MAX_INTENSITY; | ||
149 | dev = backlight_device_register("omap-bl", &pdev->dev, bl, &omapbl_ops, | ||
150 | &props); | ||
147 | if (IS_ERR(dev)) { | 151 | if (IS_ERR(dev)) { |
148 | kfree(bl); | 152 | kfree(bl); |
149 | return PTR_ERR(dev); | 153 | return PTR_ERR(dev); |
@@ -160,7 +164,6 @@ static int omapbl_probe(struct platform_device *pdev) | |||
160 | omap_cfg_reg(PWL); /* Conflicts with UART3 */ | 164 | omap_cfg_reg(PWL); /* Conflicts with UART3 */ |
161 | 165 | ||
162 | dev->props.fb_blank = FB_BLANK_UNBLANK; | 166 | dev->props.fb_blank = FB_BLANK_UNBLANK; |
163 | dev->props.max_brightness = OMAPBL_MAX_INTENSITY; | ||
164 | dev->props.brightness = pdata->default_intensity; | 167 | dev->props.brightness = pdata->default_intensity; |
165 | omapbl_update_status(dev); | 168 | omapbl_update_status(dev); |
166 | 169 | ||
diff --git a/drivers/video/backlight/progear_bl.c b/drivers/video/backlight/progear_bl.c index 2ec16deb2397..809278c90738 100644 --- a/drivers/video/backlight/progear_bl.c +++ b/drivers/video/backlight/progear_bl.c | |||
@@ -61,6 +61,7 @@ static const struct backlight_ops progearbl_ops = { | |||
61 | 61 | ||
62 | static int progearbl_probe(struct platform_device *pdev) | 62 | static int progearbl_probe(struct platform_device *pdev) |
63 | { | 63 | { |
64 | struct backlight_properties props; | ||
64 | u8 temp; | 65 | u8 temp; |
65 | struct backlight_device *progear_backlight_device; | 66 | struct backlight_device *progear_backlight_device; |
66 | int ret; | 67 | int ret; |
@@ -82,9 +83,12 @@ static int progearbl_probe(struct platform_device *pdev) | |||
82 | pci_read_config_byte(sb_dev, SB_MPS1, &temp); | 83 | pci_read_config_byte(sb_dev, SB_MPS1, &temp); |
83 | pci_write_config_byte(sb_dev, SB_MPS1, temp | 0x20); | 84 | pci_write_config_byte(sb_dev, SB_MPS1, temp | 0x20); |
84 | 85 | ||
86 | memset(&props, 0, sizeof(struct backlight_properties)); | ||
87 | props.max_brightness = HW_LEVEL_MAX - HW_LEVEL_MIN; | ||
85 | progear_backlight_device = backlight_device_register("progear-bl", | 88 | progear_backlight_device = backlight_device_register("progear-bl", |
86 | &pdev->dev, NULL, | 89 | &pdev->dev, NULL, |
87 | &progearbl_ops); | 90 | &progearbl_ops, |
91 | &props); | ||
88 | if (IS_ERR(progear_backlight_device)) { | 92 | if (IS_ERR(progear_backlight_device)) { |
89 | ret = PTR_ERR(progear_backlight_device); | 93 | ret = PTR_ERR(progear_backlight_device); |
90 | goto put_sb; | 94 | goto put_sb; |
@@ -94,7 +98,6 @@ static int progearbl_probe(struct platform_device *pdev) | |||
94 | 98 | ||
95 | progear_backlight_device->props.power = FB_BLANK_UNBLANK; | 99 | progear_backlight_device->props.power = FB_BLANK_UNBLANK; |
96 | progear_backlight_device->props.brightness = HW_LEVEL_MAX - HW_LEVEL_MIN; | 100 | progear_backlight_device->props.brightness = HW_LEVEL_MAX - HW_LEVEL_MIN; |
97 | progear_backlight_device->props.max_brightness = HW_LEVEL_MAX - HW_LEVEL_MIN; | ||
98 | progearbl_set_intensity(progear_backlight_device); | 101 | progearbl_set_intensity(progear_backlight_device); |
99 | 102 | ||
100 | return 0; | 103 | return 0; |
diff --git a/drivers/video/backlight/pwm_bl.c b/drivers/video/backlight/pwm_bl.c index 9d2ec2a1cce8..b89eebc3f77d 100644 --- a/drivers/video/backlight/pwm_bl.c +++ b/drivers/video/backlight/pwm_bl.c | |||
@@ -65,6 +65,7 @@ static const struct backlight_ops pwm_backlight_ops = { | |||
65 | 65 | ||
66 | static int pwm_backlight_probe(struct platform_device *pdev) | 66 | static int pwm_backlight_probe(struct platform_device *pdev) |
67 | { | 67 | { |
68 | struct backlight_properties props; | ||
68 | struct platform_pwm_backlight_data *data = pdev->dev.platform_data; | 69 | struct platform_pwm_backlight_data *data = pdev->dev.platform_data; |
69 | struct backlight_device *bl; | 70 | struct backlight_device *bl; |
70 | struct pwm_bl_data *pb; | 71 | struct pwm_bl_data *pb; |
@@ -100,15 +101,16 @@ static int pwm_backlight_probe(struct platform_device *pdev) | |||
100 | } else | 101 | } else |
101 | dev_dbg(&pdev->dev, "got pwm for backlight\n"); | 102 | dev_dbg(&pdev->dev, "got pwm for backlight\n"); |
102 | 103 | ||
103 | bl = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, | 104 | memset(&props, 0, sizeof(struct backlight_properties)); |
104 | pb, &pwm_backlight_ops); | 105 | props.max_brightness = data->max_brightness; |
106 | bl = backlight_device_register(dev_name(&pdev->dev), &pdev->dev, pb, | ||
107 | &pwm_backlight_ops, &props); | ||
105 | if (IS_ERR(bl)) { | 108 | if (IS_ERR(bl)) { |
106 | dev_err(&pdev->dev, "failed to register backlight\n"); | 109 | dev_err(&pdev->dev, "failed to register backlight\n"); |
107 | ret = PTR_ERR(bl); | 110 | ret = PTR_ERR(bl); |
108 | goto err_bl; | 111 | goto err_bl; |
109 | } | 112 | } |
110 | 113 | ||
111 | bl->props.max_brightness = data->max_brightness; | ||
112 | bl->props.brightness = data->dft_brightness; | 114 | bl->props.brightness = data->dft_brightness; |
113 | backlight_update_status(bl); | 115 | backlight_update_status(bl); |
114 | 116 | ||
diff --git a/drivers/video/backlight/tosa_bl.c b/drivers/video/backlight/tosa_bl.c index e14ce4d469f5..f57bbf170049 100644 --- a/drivers/video/backlight/tosa_bl.c +++ b/drivers/video/backlight/tosa_bl.c | |||
@@ -80,6 +80,7 @@ static const struct backlight_ops bl_ops = { | |||
80 | static int __devinit tosa_bl_probe(struct i2c_client *client, | 80 | static int __devinit tosa_bl_probe(struct i2c_client *client, |
81 | const struct i2c_device_id *id) | 81 | const struct i2c_device_id *id) |
82 | { | 82 | { |
83 | struct backlight_properties props; | ||
83 | struct tosa_bl_data *data = kzalloc(sizeof(struct tosa_bl_data), GFP_KERNEL); | 84 | struct tosa_bl_data *data = kzalloc(sizeof(struct tosa_bl_data), GFP_KERNEL); |
84 | int ret = 0; | 85 | int ret = 0; |
85 | if (!data) | 86 | if (!data) |
@@ -99,15 +100,16 @@ static int __devinit tosa_bl_probe(struct i2c_client *client, | |||
99 | i2c_set_clientdata(client, data); | 100 | i2c_set_clientdata(client, data); |
100 | data->i2c = client; | 101 | data->i2c = client; |
101 | 102 | ||
102 | data->bl = backlight_device_register("tosa-bl", &client->dev, | 103 | memset(&props, 0, sizeof(struct backlight_properties)); |
103 | data, &bl_ops); | 104 | props.max_brightness = 512 - 1; |
105 | data->bl = backlight_device_register("tosa-bl", &client->dev, data, | ||
106 | &bl_ops, &props); | ||
104 | if (IS_ERR(data->bl)) { | 107 | if (IS_ERR(data->bl)) { |
105 | ret = PTR_ERR(data->bl); | 108 | ret = PTR_ERR(data->bl); |
106 | goto err_reg; | 109 | goto err_reg; |
107 | } | 110 | } |
108 | 111 | ||
109 | data->bl->props.brightness = 69; | 112 | data->bl->props.brightness = 69; |
110 | data->bl->props.max_brightness = 512 - 1; | ||
111 | data->bl->props.power = FB_BLANK_UNBLANK; | 113 | data->bl->props.power = FB_BLANK_UNBLANK; |
112 | 114 | ||
113 | backlight_update_status(data->bl); | 115 | backlight_update_status(data->bl); |
diff --git a/drivers/video/backlight/wm831x_bl.c b/drivers/video/backlight/wm831x_bl.c index e32add37a203..a4312709fb1b 100644 --- a/drivers/video/backlight/wm831x_bl.c +++ b/drivers/video/backlight/wm831x_bl.c | |||
@@ -125,6 +125,7 @@ static int wm831x_backlight_probe(struct platform_device *pdev) | |||
125 | struct wm831x_backlight_pdata *pdata; | 125 | struct wm831x_backlight_pdata *pdata; |
126 | struct wm831x_backlight_data *data; | 126 | struct wm831x_backlight_data *data; |
127 | struct backlight_device *bl; | 127 | struct backlight_device *bl; |
128 | struct backlight_properties props; | ||
128 | int ret, i, max_isel, isink_reg, dcdc_cfg; | 129 | int ret, i, max_isel, isink_reg, dcdc_cfg; |
129 | 130 | ||
130 | /* We need platform data */ | 131 | /* We need platform data */ |
@@ -191,15 +192,15 @@ static int wm831x_backlight_probe(struct platform_device *pdev) | |||
191 | data->current_brightness = 0; | 192 | data->current_brightness = 0; |
192 | data->isink_reg = isink_reg; | 193 | data->isink_reg = isink_reg; |
193 | 194 | ||
194 | bl = backlight_device_register("wm831x", &pdev->dev, | 195 | props.max_brightness = max_isel; |
195 | data, &wm831x_backlight_ops); | 196 | bl = backlight_device_register("wm831x", &pdev->dev, data, |
197 | &wm831x_backlight_ops, &props); | ||
196 | if (IS_ERR(bl)) { | 198 | if (IS_ERR(bl)) { |
197 | dev_err(&pdev->dev, "failed to register backlight\n"); | 199 | dev_err(&pdev->dev, "failed to register backlight\n"); |
198 | kfree(data); | 200 | kfree(data); |
199 | return PTR_ERR(bl); | 201 | return PTR_ERR(bl); |
200 | } | 202 | } |
201 | 203 | ||
202 | bl->props.max_brightness = max_isel; | ||
203 | bl->props.brightness = max_isel; | 204 | bl->props.brightness = max_isel; |
204 | 205 | ||
205 | platform_set_drvdata(pdev, bl); | 206 | platform_set_drvdata(pdev, bl); |