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/max8925_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/max8925_bl.c')
-rw-r--r-- | drivers/video/backlight/max8925_bl.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/video/backlight/max8925_bl.c b/drivers/video/backlight/max8925_bl.c index c267069a52a3..c91adaf492cf 100644 --- a/drivers/video/backlight/max8925_bl.c +++ b/drivers/video/backlight/max8925_bl.c | |||
@@ -104,6 +104,7 @@ static int __devinit max8925_backlight_probe(struct platform_device *pdev) | |||
104 | struct max8925_backlight_pdata *pdata = NULL; | 104 | struct max8925_backlight_pdata *pdata = NULL; |
105 | struct max8925_backlight_data *data; | 105 | struct max8925_backlight_data *data; |
106 | struct backlight_device *bl; | 106 | struct backlight_device *bl; |
107 | struct backlight_properties props; | ||
107 | struct resource *res; | 108 | struct resource *res; |
108 | char name[MAX8925_NAME_SIZE]; | 109 | char name[MAX8925_NAME_SIZE]; |
109 | unsigned char value; | 110 | unsigned char value; |
@@ -133,14 +134,15 @@ static int __devinit max8925_backlight_probe(struct platform_device *pdev) | |||
133 | data->chip = chip; | 134 | data->chip = chip; |
134 | data->current_brightness = 0; | 135 | data->current_brightness = 0; |
135 | 136 | ||
137 | memset(&props, 0, sizeof(struct backlight_properties)); | ||
138 | props.max_brightness = MAX_BRIGHTNESS; | ||
136 | bl = backlight_device_register(name, &pdev->dev, data, | 139 | bl = backlight_device_register(name, &pdev->dev, data, |
137 | &max8925_backlight_ops); | 140 | &max8925_backlight_ops, &props); |
138 | if (IS_ERR(bl)) { | 141 | if (IS_ERR(bl)) { |
139 | dev_err(&pdev->dev, "failed to register backlight\n"); | 142 | dev_err(&pdev->dev, "failed to register backlight\n"); |
140 | kfree(data); | 143 | kfree(data); |
141 | return PTR_ERR(bl); | 144 | return PTR_ERR(bl); |
142 | } | 145 | } |
143 | bl->props.max_brightness = MAX_BRIGHTNESS; | ||
144 | bl->props.brightness = MAX_BRIGHTNESS; | 146 | bl->props.brightness = MAX_BRIGHTNESS; |
145 | 147 | ||
146 | platform_set_drvdata(pdev, bl); | 148 | platform_set_drvdata(pdev, bl); |