diff options
Diffstat (limited to 'drivers/video/backlight/mbp_nvidia_bl.c')
-rw-r--r-- | drivers/video/backlight/mbp_nvidia_bl.c | 55 |
1 files changed, 52 insertions, 3 deletions
diff --git a/drivers/video/backlight/mbp_nvidia_bl.c b/drivers/video/backlight/mbp_nvidia_bl.c index 2e78b0784bdc..1b5d3fe6bbbc 100644 --- a/drivers/video/backlight/mbp_nvidia_bl.c +++ b/drivers/video/backlight/mbp_nvidia_bl.c | |||
@@ -139,6 +139,51 @@ static int mbp_dmi_match(const struct dmi_system_id *id) | |||
139 | static const struct dmi_system_id __initdata mbp_device_table[] = { | 139 | static const struct dmi_system_id __initdata mbp_device_table[] = { |
140 | { | 140 | { |
141 | .callback = mbp_dmi_match, | 141 | .callback = mbp_dmi_match, |
142 | .ident = "MacBook 1,1", | ||
143 | .matches = { | ||
144 | DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), | ||
145 | DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"), | ||
146 | }, | ||
147 | .driver_data = (void *)&intel_chipset_data, | ||
148 | }, | ||
149 | { | ||
150 | .callback = mbp_dmi_match, | ||
151 | .ident = "MacBook 2,1", | ||
152 | .matches = { | ||
153 | DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), | ||
154 | DMI_MATCH(DMI_PRODUCT_NAME, "MacBook2,1"), | ||
155 | }, | ||
156 | .driver_data = (void *)&intel_chipset_data, | ||
157 | }, | ||
158 | { | ||
159 | .callback = mbp_dmi_match, | ||
160 | .ident = "MacBook 3,1", | ||
161 | .matches = { | ||
162 | DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), | ||
163 | DMI_MATCH(DMI_PRODUCT_NAME, "MacBook3,1"), | ||
164 | }, | ||
165 | .driver_data = (void *)&intel_chipset_data, | ||
166 | }, | ||
167 | { | ||
168 | .callback = mbp_dmi_match, | ||
169 | .ident = "MacBook 4,1", | ||
170 | .matches = { | ||
171 | DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), | ||
172 | DMI_MATCH(DMI_PRODUCT_NAME, "MacBook4,1"), | ||
173 | }, | ||
174 | .driver_data = (void *)&intel_chipset_data, | ||
175 | }, | ||
176 | { | ||
177 | .callback = mbp_dmi_match, | ||
178 | .ident = "MacBook 4,2", | ||
179 | .matches = { | ||
180 | DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), | ||
181 | DMI_MATCH(DMI_PRODUCT_NAME, "MacBook4,2"), | ||
182 | }, | ||
183 | .driver_data = (void *)&intel_chipset_data, | ||
184 | }, | ||
185 | { | ||
186 | .callback = mbp_dmi_match, | ||
142 | .ident = "MacBookPro 3,1", | 187 | .ident = "MacBookPro 3,1", |
143 | .matches = { | 188 | .matches = { |
144 | DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), | 189 | DMI_MATCH(DMI_SYS_VENDOR, "Apple Inc."), |
@@ -250,6 +295,7 @@ static const struct dmi_system_id __initdata mbp_device_table[] = { | |||
250 | 295 | ||
251 | static int __init mbp_init(void) | 296 | static int __init mbp_init(void) |
252 | { | 297 | { |
298 | struct backlight_properties props; | ||
253 | if (!dmi_check_system(mbp_device_table)) | 299 | if (!dmi_check_system(mbp_device_table)) |
254 | return -ENODEV; | 300 | return -ENODEV; |
255 | 301 | ||
@@ -257,14 +303,17 @@ static int __init mbp_init(void) | |||
257 | "Macbook Pro backlight")) | 303 | "Macbook Pro backlight")) |
258 | return -ENXIO; | 304 | return -ENXIO; |
259 | 305 | ||
260 | mbp_backlight_device = backlight_device_register("mbp_backlight", | 306 | memset(&props, 0, sizeof(struct backlight_properties)); |
261 | NULL, NULL, &driver_data->backlight_ops); | 307 | props.max_brightness = 15; |
308 | mbp_backlight_device = backlight_device_register("mbp_backlight", NULL, | ||
309 | NULL, | ||
310 | &driver_data->backlight_ops, | ||
311 | &props); | ||
262 | if (IS_ERR(mbp_backlight_device)) { | 312 | if (IS_ERR(mbp_backlight_device)) { |
263 | release_region(driver_data->iostart, driver_data->iolen); | 313 | release_region(driver_data->iostart, driver_data->iolen); |
264 | return PTR_ERR(mbp_backlight_device); | 314 | return PTR_ERR(mbp_backlight_device); |
265 | } | 315 | } |
266 | 316 | ||
267 | mbp_backlight_device->props.max_brightness = 15; | ||
268 | mbp_backlight_device->props.brightness = | 317 | mbp_backlight_device->props.brightness = |
269 | driver_data->backlight_ops.get_brightness(mbp_backlight_device); | 318 | driver_data->backlight_ops.get_brightness(mbp_backlight_device); |
270 | backlight_update_status(mbp_backlight_device); | 319 | backlight_update_status(mbp_backlight_device); |