aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/backlight/atmel-pwm-bl.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/backlight/atmel-pwm-bl.c')
-rw-r--r--drivers/video/backlight/atmel-pwm-bl.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/video/backlight/atmel-pwm-bl.c b/drivers/video/backlight/atmel-pwm-bl.c
index f625ffc69ad3..e6a66dab088c 100644
--- a/drivers/video/backlight/atmel-pwm-bl.c
+++ b/drivers/video/backlight/atmel-pwm-bl.c
@@ -17,6 +17,7 @@
17#include <linux/backlight.h> 17#include <linux/backlight.h>
18#include <linux/atmel_pwm.h> 18#include <linux/atmel_pwm.h>
19#include <linux/atmel-pwm-bl.h> 19#include <linux/atmel-pwm-bl.h>
20#include <linux/slab.h>
20 21
21struct atmel_pwm_bl { 22struct atmel_pwm_bl {
22 const struct atmel_pwm_bl_platform_data *pdata; 23 const struct atmel_pwm_bl_platform_data *pdata;
@@ -120,6 +121,7 @@ static const struct backlight_ops atmel_pwm_bl_ops = {
120 121
121static int atmel_pwm_bl_probe(struct platform_device *pdev) 122static int atmel_pwm_bl_probe(struct platform_device *pdev)
122{ 123{
124 struct backlight_properties props;
123 const struct atmel_pwm_bl_platform_data *pdata; 125 const struct atmel_pwm_bl_platform_data *pdata;
124 struct backlight_device *bldev; 126 struct backlight_device *bldev;
125 struct atmel_pwm_bl *pwmbl; 127 struct atmel_pwm_bl *pwmbl;
@@ -165,8 +167,10 @@ static int atmel_pwm_bl_probe(struct platform_device *pdev)
165 goto err_free_gpio; 167 goto err_free_gpio;
166 } 168 }
167 169
168 bldev = backlight_device_register("atmel-pwm-bl", 170 memset(&props, 0, sizeof(struct backlight_properties));
169 &pdev->dev, pwmbl, &atmel_pwm_bl_ops); 171 props.max_brightness = pdata->pwm_duty_max - pdata->pwm_duty_min;
172 bldev = backlight_device_register("atmel-pwm-bl", &pdev->dev, pwmbl,
173 &atmel_pwm_bl_ops, &props);
170 if (IS_ERR(bldev)) { 174 if (IS_ERR(bldev)) {
171 retval = PTR_ERR(bldev); 175 retval = PTR_ERR(bldev);
172 goto err_free_gpio; 176 goto err_free_gpio;
@@ -178,7 +182,6 @@ static int atmel_pwm_bl_probe(struct platform_device *pdev)
178 182
179 /* Power up the backlight by default at middle intesity. */ 183 /* Power up the backlight by default at middle intesity. */
180 bldev->props.power = FB_BLANK_UNBLANK; 184 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; 185 bldev->props.brightness = bldev->props.max_brightness / 2;
183 186
184 retval = atmel_pwm_bl_init_pwm(pwmbl); 187 retval = atmel_pwm_bl_init_pwm(pwmbl);