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/wm831x_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/wm831x_bl.c')
-rw-r--r-- | drivers/video/backlight/wm831x_bl.c | 7 |
1 files changed, 4 insertions, 3 deletions
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); |