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/kb3886_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/kb3886_bl.c')
-rw-r--r-- | drivers/video/backlight/kb3886_bl.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/video/backlight/kb3886_bl.c b/drivers/video/backlight/kb3886_bl.c index 939e7b830cf3..f439a8632287 100644 --- a/drivers/video/backlight/kb3886_bl.c +++ b/drivers/video/backlight/kb3886_bl.c | |||
@@ -141,20 +141,24 @@ static const struct backlight_ops kb3886bl_ops = { | |||
141 | 141 | ||
142 | static int kb3886bl_probe(struct platform_device *pdev) | 142 | static int kb3886bl_probe(struct platform_device *pdev) |
143 | { | 143 | { |
144 | struct backlight_properties props; | ||
144 | struct kb3886bl_machinfo *machinfo = pdev->dev.platform_data; | 145 | struct kb3886bl_machinfo *machinfo = pdev->dev.platform_data; |
145 | 146 | ||
146 | bl_machinfo = machinfo; | 147 | bl_machinfo = machinfo; |
147 | if (!machinfo->limit_mask) | 148 | if (!machinfo->limit_mask) |
148 | machinfo->limit_mask = -1; | 149 | machinfo->limit_mask = -1; |
149 | 150 | ||
151 | memset(&props, 0, sizeof(struct backlight_properties)); | ||
152 | props.max_brightness = machinfo->max_intensity; | ||
150 | kb3886_backlight_device = backlight_device_register("kb3886-bl", | 153 | kb3886_backlight_device = backlight_device_register("kb3886-bl", |
151 | &pdev->dev, NULL, &kb3886bl_ops); | 154 | &pdev->dev, NULL, |
155 | &kb3886bl_ops, | ||
156 | &props); | ||
152 | if (IS_ERR(kb3886_backlight_device)) | 157 | if (IS_ERR(kb3886_backlight_device)) |
153 | return PTR_ERR(kb3886_backlight_device); | 158 | return PTR_ERR(kb3886_backlight_device); |
154 | 159 | ||
155 | platform_set_drvdata(pdev, kb3886_backlight_device); | 160 | platform_set_drvdata(pdev, kb3886_backlight_device); |
156 | 161 | ||
157 | kb3886_backlight_device->props.max_brightness = machinfo->max_intensity; | ||
158 | kb3886_backlight_device->props.power = FB_BLANK_UNBLANK; | 162 | kb3886_backlight_device->props.power = FB_BLANK_UNBLANK; |
159 | kb3886_backlight_device->props.brightness = machinfo->default_intensity; | 163 | kb3886_backlight_device->props.brightness = machinfo->default_intensity; |
160 | backlight_update_status(kb3886_backlight_device); | 164 | backlight_update_status(kb3886_backlight_device); |