From a19a6ee6cad2b20292a774c2f56ba8039b0fac9c Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Wed, 17 Feb 2010 16:39:44 -0500 Subject: backlight: Allow properties to be passed at registration Values such as max_brightness should be set before backlights are registered, but the current API doesn't allow that. Add a parameter to backlight_device_register and update drivers to ensure that they set this correctly. Signed-off-by: Matthew Garrett Signed-off-by: Richard Purdie --- drivers/video/bf54x-lq043fb.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers/video/bf54x-lq043fb.c') diff --git a/drivers/video/bf54x-lq043fb.c b/drivers/video/bf54x-lq043fb.c index 814312a7452f..54df3d44af8f 100644 --- a/drivers/video/bf54x-lq043fb.c +++ b/drivers/video/bf54x-lq043fb.c @@ -501,6 +501,7 @@ static irqreturn_t bfin_bf54x_irq_error(int irq, void *dev_id) static int __devinit bfin_bf54x_probe(struct platform_device *pdev) { + struct backlight_properties props; struct bfin_bf54xfb_info *info; struct fb_info *fbinfo; int ret; @@ -645,10 +646,10 @@ static int __devinit bfin_bf54x_probe(struct platform_device *pdev) goto out8; } #ifndef NO_BL_SUPPORT - bl_dev = - backlight_device_register("bf54x-bl", NULL, NULL, - &bfin_lq043fb_bl_ops); - bl_dev->props.max_brightness = 255; + memset(&props, 0, sizeof(struct backlight_properties)); + props.max_brightness = 255; + bl_dev = backlight_device_register("bf54x-bl", NULL, NULL, + &bfin_lq043fb_bl_ops, &props); lcd_dev = lcd_device_register(DRIVER_NAME, &pdev->dev, NULL, &bfin_lcd_ops); lcd_dev->props.max_contrast = 255, printk(KERN_INFO "Done.\n"); -- cgit v1.2.1