aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight/backlight.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/backlight/backlight.c')
-rw-r--r--drivers/video/backlight/backlight.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c
index 18829cf68b1b..e207810bba3c 100644
--- a/drivers/video/backlight/backlight.c
+++ b/drivers/video/backlight/backlight.c
@@ -13,6 +13,7 @@
13#include <linux/ctype.h> 13#include <linux/ctype.h>
14#include <linux/err.h> 14#include <linux/err.h>
15#include <linux/fb.h> 15#include <linux/fb.h>
16#include <linux/slab.h>
16 17
17#ifdef CONFIG_PMAC_BACKLIGHT 18#ifdef CONFIG_PMAC_BACKLIGHT
18#include <asm/backlight.h> 19#include <asm/backlight.h>
@@ -38,7 +39,7 @@ static int fb_notifier_callback(struct notifier_block *self,
38 mutex_lock(&bd->ops_lock); 39 mutex_lock(&bd->ops_lock);
39 if (bd->ops) 40 if (bd->ops)
40 if (!bd->ops->check_fb || 41 if (!bd->ops->check_fb ||
41 bd->ops->check_fb(evdata->info)) { 42 bd->ops->check_fb(bd, evdata->info)) {
42 bd->props.fb_blank = *(int *)evdata->data; 43 bd->props.fb_blank = *(int *)evdata->data;
43 if (bd->props.fb_blank == FB_BLANK_UNBLANK) 44 if (bd->props.fb_blank == FB_BLANK_UNBLANK)
44 bd->props.state &= ~BL_CORE_FBBLANK; 45 bd->props.state &= ~BL_CORE_FBBLANK;
@@ -269,7 +270,8 @@ EXPORT_SYMBOL(backlight_force_update);
269 * ERR_PTR() or a pointer to the newly allocated device. 270 * ERR_PTR() or a pointer to the newly allocated device.
270 */ 271 */
271struct backlight_device *backlight_device_register(const char *name, 272struct backlight_device *backlight_device_register(const char *name,
272 struct device *parent, void *devdata, const struct backlight_ops *ops) 273 struct device *parent, void *devdata, const struct backlight_ops *ops,
274 const struct backlight_properties *props)
273{ 275{
274 struct backlight_device *new_bd; 276 struct backlight_device *new_bd;
275 int rc; 277 int rc;
@@ -289,6 +291,11 @@ struct backlight_device *backlight_device_register(const char *name,
289 dev_set_name(&new_bd->dev, name); 291 dev_set_name(&new_bd->dev, name);
290 dev_set_drvdata(&new_bd->dev, devdata); 292 dev_set_drvdata(&new_bd->dev, devdata);
291 293
294 /* Set default properties */
295 if (props)
296 memcpy(&new_bd->props, props,
297 sizeof(struct backlight_properties));
298
292 rc = device_register(&new_bd->dev); 299 rc = device_register(&new_bd->dev);
293 if (rc) { 300 if (rc) {
294 kfree(new_bd); 301 kfree(new_bd);