diff options
author | Matthew Garrett <mjg@redhat.com> | 2010-02-17 16:39:44 -0500 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2010-03-16 15:47:54 -0400 |
commit | a19a6ee6cad2b20292a774c2f56ba8039b0fac9c (patch) | |
tree | 631916ce6181336c5c28eb0cf5484c40c92986b6 /drivers/video/backlight/88pm860x_bl.c | |
parent | 57e148b6a975980944f4466ccb669b1d02dfc6a1 (diff) |
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 <mjg@redhat.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'drivers/video/backlight/88pm860x_bl.c')
-rw-r--r-- | drivers/video/backlight/88pm860x_bl.c | 6 |
1 files changed, 4 insertions, 2 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); |