diff options
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/ac.c | 2 | ||||
-rw-r--r-- | drivers/acpi/battery.c | 4 | ||||
-rw-r--r-- | drivers/acpi/blacklist.c | 58 | ||||
-rw-r--r-- | drivers/acpi/button.c | 2 | ||||
-rw-r--r-- | drivers/acpi/container.c | 5 | ||||
-rw-r--r-- | drivers/acpi/dock.c | 13 | ||||
-rw-r--r-- | drivers/acpi/fan.c | 3 | ||||
-rw-r--r-- | drivers/acpi/pci_irq.c | 1 | ||||
-rw-r--r-- | drivers/acpi/proc.c | 2 | ||||
-rw-r--r-- | drivers/acpi/sbs.c | 4 | ||||
-rw-r--r-- | drivers/acpi/scan.c | 6 | ||||
-rw-r--r-- | drivers/acpi/thermal.c | 2 | ||||
-rw-r--r-- | drivers/acpi/utils.c | 4 | ||||
-rw-r--r-- | drivers/acpi/video.c | 147 | ||||
-rw-r--r-- | drivers/acpi/video_detect.c | 8 |
15 files changed, 171 insertions, 90 deletions
diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index e7515aa43d6b..6f190bc2b8b7 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c | |||
@@ -243,6 +243,8 @@ static int acpi_ac_resume(struct device *dev) | |||
243 | kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); | 243 | kobject_uevent(&ac->charger.dev->kobj, KOBJ_CHANGE); |
244 | return 0; | 244 | return 0; |
245 | } | 245 | } |
246 | #else | ||
247 | #define acpi_ac_resume NULL | ||
246 | #endif | 248 | #endif |
247 | static SIMPLE_DEV_PM_OPS(acpi_ac_pm_ops, NULL, acpi_ac_resume); | 249 | static SIMPLE_DEV_PM_OPS(acpi_ac_pm_ops, NULL, acpi_ac_resume); |
248 | 250 | ||
diff --git a/drivers/acpi/battery.c b/drivers/acpi/battery.c index 470e7542bf31..797a6938d051 100644 --- a/drivers/acpi/battery.c +++ b/drivers/acpi/battery.c | |||
@@ -549,7 +549,7 @@ static ssize_t acpi_battery_alarm_store(struct device *dev, | |||
549 | { | 549 | { |
550 | unsigned long x; | 550 | unsigned long x; |
551 | struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev)); | 551 | struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev)); |
552 | if (sscanf(buf, "%ld\n", &x) == 1) | 552 | if (sscanf(buf, "%lu\n", &x) == 1) |
553 | battery->alarm = x/1000; | 553 | battery->alarm = x/1000; |
554 | if (acpi_battery_present(battery)) | 554 | if (acpi_battery_present(battery)) |
555 | acpi_battery_set_alarm(battery); | 555 | acpi_battery_set_alarm(battery); |
@@ -841,6 +841,8 @@ static int acpi_battery_resume(struct device *dev) | |||
841 | acpi_battery_update(battery); | 841 | acpi_battery_update(battery); |
842 | return 0; | 842 | return 0; |
843 | } | 843 | } |
844 | #else | ||
845 | #define acpi_battery_resume NULL | ||
844 | #endif | 846 | #endif |
845 | 847 | ||
846 | static SIMPLE_DEV_PM_OPS(acpi_battery_pm, NULL, acpi_battery_resume); | 848 | static SIMPLE_DEV_PM_OPS(acpi_battery_pm, NULL, acpi_battery_resume); |
diff --git a/drivers/acpi/blacklist.c b/drivers/acpi/blacklist.c index 10e4964d051a..afec4526c48a 100644 --- a/drivers/acpi/blacklist.c +++ b/drivers/acpi/blacklist.c | |||
@@ -260,14 +260,6 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { | |||
260 | }, | 260 | }, |
261 | { | 261 | { |
262 | .callback = dmi_disable_osi_win8, | 262 | .callback = dmi_disable_osi_win8, |
263 | .ident = "Dell Inspiron 15R SE", | ||
264 | .matches = { | ||
265 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
266 | DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 7520"), | ||
267 | }, | ||
268 | }, | ||
269 | { | ||
270 | .callback = dmi_disable_osi_win8, | ||
271 | .ident = "ThinkPad Edge E530", | 263 | .ident = "ThinkPad Edge E530", |
272 | .matches = { | 264 | .matches = { |
273 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | 265 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), |
@@ -322,56 +314,6 @@ static struct dmi_system_id acpi_osi_dmi_table[] __initdata = { | |||
322 | DMI_MATCH(DMI_PRODUCT_VERSION, "2349D15"), | 314 | DMI_MATCH(DMI_PRODUCT_VERSION, "2349D15"), |
323 | }, | 315 | }, |
324 | }, | 316 | }, |
325 | { | ||
326 | .callback = dmi_disable_osi_win8, | ||
327 | .ident = "HP ProBook 2013 models", | ||
328 | .matches = { | ||
329 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
330 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ProBook "), | ||
331 | DMI_MATCH(DMI_PRODUCT_NAME, " G1"), | ||
332 | }, | ||
333 | }, | ||
334 | { | ||
335 | .callback = dmi_disable_osi_win8, | ||
336 | .ident = "HP EliteBook 2013 models", | ||
337 | .matches = { | ||
338 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
339 | DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook "), | ||
340 | DMI_MATCH(DMI_PRODUCT_NAME, " G1"), | ||
341 | }, | ||
342 | }, | ||
343 | { | ||
344 | .callback = dmi_disable_osi_win8, | ||
345 | .ident = "HP ZBook 14", | ||
346 | .matches = { | ||
347 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
348 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ZBook 14"), | ||
349 | }, | ||
350 | }, | ||
351 | { | ||
352 | .callback = dmi_disable_osi_win8, | ||
353 | .ident = "HP ZBook 15", | ||
354 | .matches = { | ||
355 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
356 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ZBook 15"), | ||
357 | }, | ||
358 | }, | ||
359 | { | ||
360 | .callback = dmi_disable_osi_win8, | ||
361 | .ident = "HP ZBook 17", | ||
362 | .matches = { | ||
363 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
364 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ZBook 17"), | ||
365 | }, | ||
366 | }, | ||
367 | { | ||
368 | .callback = dmi_disable_osi_win8, | ||
369 | .ident = "HP EliteBook 8780w", | ||
370 | .matches = { | ||
371 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
372 | DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook 8780w"), | ||
373 | }, | ||
374 | }, | ||
375 | 317 | ||
376 | /* | 318 | /* |
377 | * BIOS invocation of _OSI(Linux) is almost always a BIOS bug. | 319 | * BIOS invocation of _OSI(Linux) is almost always a BIOS bug. |
diff --git a/drivers/acpi/button.c b/drivers/acpi/button.c index 11c11f6b8fa1..714e957a871a 100644 --- a/drivers/acpi/button.c +++ b/drivers/acpi/button.c | |||
@@ -80,6 +80,8 @@ static void acpi_button_notify(struct acpi_device *device, u32 event); | |||
80 | 80 | ||
81 | #ifdef CONFIG_PM_SLEEP | 81 | #ifdef CONFIG_PM_SLEEP |
82 | static int acpi_button_resume(struct device *dev); | 82 | static int acpi_button_resume(struct device *dev); |
83 | #else | ||
84 | #define acpi_button_resume NULL | ||
83 | #endif | 85 | #endif |
84 | static SIMPLE_DEV_PM_OPS(acpi_button_pm, NULL, acpi_button_resume); | 86 | static SIMPLE_DEV_PM_OPS(acpi_button_pm, NULL, acpi_button_resume); |
85 | 87 | ||
diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c index 0b6ae6eb5c4a..368f9ddb8480 100644 --- a/drivers/acpi/container.c +++ b/drivers/acpi/container.c | |||
@@ -79,9 +79,10 @@ static int container_device_attach(struct acpi_device *adev, | |||
79 | ACPI_COMPANION_SET(dev, adev); | 79 | ACPI_COMPANION_SET(dev, adev); |
80 | dev->release = acpi_container_release; | 80 | dev->release = acpi_container_release; |
81 | ret = device_register(dev); | 81 | ret = device_register(dev); |
82 | if (ret) | 82 | if (ret) { |
83 | put_device(dev); | ||
83 | return ret; | 84 | return ret; |
84 | 85 | } | |
85 | adev->driver_data = dev; | 86 | adev->driver_data = dev; |
86 | return 1; | 87 | return 1; |
87 | } | 88 | } |
diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index c431c88faaff..5bfd769fc91f 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c | |||
@@ -609,7 +609,7 @@ static int handle_eject_request(struct dock_station *ds, u32 event) | |||
609 | static void dock_notify(struct dock_station *ds, u32 event) | 609 | static void dock_notify(struct dock_station *ds, u32 event) |
610 | { | 610 | { |
611 | acpi_handle handle = ds->handle; | 611 | acpi_handle handle = ds->handle; |
612 | struct acpi_device *ad; | 612 | struct acpi_device *adev = NULL; |
613 | int surprise_removal = 0; | 613 | int surprise_removal = 0; |
614 | 614 | ||
615 | /* | 615 | /* |
@@ -632,7 +632,8 @@ static void dock_notify(struct dock_station *ds, u32 event) | |||
632 | switch (event) { | 632 | switch (event) { |
633 | case ACPI_NOTIFY_BUS_CHECK: | 633 | case ACPI_NOTIFY_BUS_CHECK: |
634 | case ACPI_NOTIFY_DEVICE_CHECK: | 634 | case ACPI_NOTIFY_DEVICE_CHECK: |
635 | if (!dock_in_progress(ds) && acpi_bus_get_device(handle, &ad)) { | 635 | acpi_bus_get_device(handle, &adev); |
636 | if (!dock_in_progress(ds) && !acpi_device_enumerated(adev)) { | ||
636 | begin_dock(ds); | 637 | begin_dock(ds); |
637 | dock(ds); | 638 | dock(ds); |
638 | if (!dock_present(ds)) { | 639 | if (!dock_present(ds)) { |
@@ -712,13 +713,11 @@ static acpi_status __init find_dock_devices(acpi_handle handle, u32 lvl, | |||
712 | static ssize_t show_docked(struct device *dev, | 713 | static ssize_t show_docked(struct device *dev, |
713 | struct device_attribute *attr, char *buf) | 714 | struct device_attribute *attr, char *buf) |
714 | { | 715 | { |
715 | struct acpi_device *tmp; | ||
716 | |||
717 | struct dock_station *dock_station = dev->platform_data; | 716 | struct dock_station *dock_station = dev->platform_data; |
717 | struct acpi_device *adev = NULL; | ||
718 | 718 | ||
719 | if (!acpi_bus_get_device(dock_station->handle, &tmp)) | 719 | acpi_bus_get_device(dock_station->handle, &adev); |
720 | return snprintf(buf, PAGE_SIZE, "1\n"); | 720 | return snprintf(buf, PAGE_SIZE, "%u\n", acpi_device_enumerated(adev)); |
721 | return snprintf(buf, PAGE_SIZE, "0\n"); | ||
722 | } | 721 | } |
723 | static DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL); | 722 | static DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL); |
724 | 723 | ||
diff --git a/drivers/acpi/fan.c b/drivers/acpi/fan.c index 1fb62900f32a..09e423f3d8ad 100644 --- a/drivers/acpi/fan.c +++ b/drivers/acpi/fan.c | |||
@@ -55,6 +55,9 @@ MODULE_DEVICE_TABLE(acpi, fan_device_ids); | |||
55 | #ifdef CONFIG_PM_SLEEP | 55 | #ifdef CONFIG_PM_SLEEP |
56 | static int acpi_fan_suspend(struct device *dev); | 56 | static int acpi_fan_suspend(struct device *dev); |
57 | static int acpi_fan_resume(struct device *dev); | 57 | static int acpi_fan_resume(struct device *dev); |
58 | #else | ||
59 | #define acpi_fan_suspend NULL | ||
60 | #define acpi_fan_resume NULL | ||
58 | #endif | 61 | #endif |
59 | static SIMPLE_DEV_PM_OPS(acpi_fan_pm, acpi_fan_suspend, acpi_fan_resume); | 62 | static SIMPLE_DEV_PM_OPS(acpi_fan_pm, acpi_fan_suspend, acpi_fan_resume); |
60 | 63 | ||
diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index 52d45ea2bc4f..361b40c10c3f 100644 --- a/drivers/acpi/pci_irq.c +++ b/drivers/acpi/pci_irq.c | |||
@@ -430,6 +430,7 @@ int acpi_pci_irq_enable(struct pci_dev *dev) | |||
430 | pin_name(pin)); | 430 | pin_name(pin)); |
431 | } | 431 | } |
432 | 432 | ||
433 | kfree(entry); | ||
433 | return 0; | 434 | return 0; |
434 | } | 435 | } |
435 | 436 | ||
diff --git a/drivers/acpi/proc.c b/drivers/acpi/proc.c index 50fe34ffe932..75c28eae8860 100644 --- a/drivers/acpi/proc.c +++ b/drivers/acpi/proc.c | |||
@@ -60,7 +60,7 @@ acpi_system_wakeup_device_seq_show(struct seq_file *seq, void *offset) | |||
60 | seq_printf(seq, "%c%-8s %s:%s\n", | 60 | seq_printf(seq, "%c%-8s %s:%s\n", |
61 | dev->wakeup.flags.run_wake ? '*' : ' ', | 61 | dev->wakeup.flags.run_wake ? '*' : ' ', |
62 | (device_may_wakeup(&dev->dev) || | 62 | (device_may_wakeup(&dev->dev) || |
63 | (ldev && device_may_wakeup(ldev))) ? | 63 | device_may_wakeup(ldev)) ? |
64 | "enabled" : "disabled", | 64 | "enabled" : "disabled", |
65 | ldev->bus ? ldev->bus->name : | 65 | ldev->bus ? ldev->bus->name : |
66 | "no-bus", dev_name(ldev)); | 66 | "no-bus", dev_name(ldev)); |
diff --git a/drivers/acpi/sbs.c b/drivers/acpi/sbs.c index d465ae6cdd00..dbd48498b938 100644 --- a/drivers/acpi/sbs.c +++ b/drivers/acpi/sbs.c | |||
@@ -450,7 +450,7 @@ static ssize_t acpi_battery_alarm_store(struct device *dev, | |||
450 | { | 450 | { |
451 | unsigned long x; | 451 | unsigned long x; |
452 | struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev)); | 452 | struct acpi_battery *battery = to_acpi_battery(dev_get_drvdata(dev)); |
453 | if (sscanf(buf, "%ld\n", &x) == 1) | 453 | if (sscanf(buf, "%lu\n", &x) == 1) |
454 | battery->alarm_capacity = x / | 454 | battery->alarm_capacity = x / |
455 | (1000 * acpi_battery_scale(battery)); | 455 | (1000 * acpi_battery_scale(battery)); |
456 | if (battery->present) | 456 | if (battery->present) |
@@ -668,6 +668,8 @@ static int acpi_sbs_resume(struct device *dev) | |||
668 | acpi_sbs_callback(sbs); | 668 | acpi_sbs_callback(sbs); |
669 | return 0; | 669 | return 0; |
670 | } | 670 | } |
671 | #else | ||
672 | #define acpi_sbs_resume NULL | ||
671 | #endif | 673 | #endif |
672 | 674 | ||
673 | static SIMPLE_DEV_PM_OPS(acpi_sbs_pm, NULL, acpi_sbs_resume); | 675 | static SIMPLE_DEV_PM_OPS(acpi_sbs_pm, NULL, acpi_sbs_resume); |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 7384158c7f87..57b053f424d1 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -484,7 +484,6 @@ static void acpi_device_hotplug(void *data, u32 src) | |||
484 | static void acpi_hotplug_notify_cb(acpi_handle handle, u32 type, void *data) | 484 | static void acpi_hotplug_notify_cb(acpi_handle handle, u32 type, void *data) |
485 | { | 485 | { |
486 | u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; | 486 | u32 ost_code = ACPI_OST_SC_NON_SPECIFIC_FAILURE; |
487 | struct acpi_scan_handler *handler = data; | ||
488 | struct acpi_device *adev; | 487 | struct acpi_device *adev; |
489 | acpi_status status; | 488 | acpi_status status; |
490 | 489 | ||
@@ -500,7 +499,10 @@ static void acpi_hotplug_notify_cb(acpi_handle handle, u32 type, void *data) | |||
500 | break; | 499 | break; |
501 | case ACPI_NOTIFY_EJECT_REQUEST: | 500 | case ACPI_NOTIFY_EJECT_REQUEST: |
502 | acpi_handle_debug(handle, "ACPI_NOTIFY_EJECT_REQUEST event\n"); | 501 | acpi_handle_debug(handle, "ACPI_NOTIFY_EJECT_REQUEST event\n"); |
503 | if (!handler->hotplug.enabled) { | 502 | if (!adev->handler) |
503 | goto err_out; | ||
504 | |||
505 | if (!adev->handler->hotplug.enabled) { | ||
504 | acpi_handle_err(handle, "Eject disabled\n"); | 506 | acpi_handle_err(handle, "Eject disabled\n"); |
505 | ost_code = ACPI_OST_SC_EJECT_NOT_SUPPORTED; | 507 | ost_code = ACPI_OST_SC_EJECT_NOT_SUPPORTED; |
506 | goto err_out; | 508 | goto err_out; |
diff --git a/drivers/acpi/thermal.c b/drivers/acpi/thermal.c index 8349a555b92b..08626c851be7 100644 --- a/drivers/acpi/thermal.c +++ b/drivers/acpi/thermal.c | |||
@@ -102,6 +102,8 @@ MODULE_DEVICE_TABLE(acpi, thermal_device_ids); | |||
102 | 102 | ||
103 | #ifdef CONFIG_PM_SLEEP | 103 | #ifdef CONFIG_PM_SLEEP |
104 | static int acpi_thermal_resume(struct device *dev); | 104 | static int acpi_thermal_resume(struct device *dev); |
105 | #else | ||
106 | #define acpi_thermal_resume NULL | ||
105 | #endif | 107 | #endif |
106 | static SIMPLE_DEV_PM_OPS(acpi_thermal_pm, NULL, acpi_thermal_resume); | 108 | static SIMPLE_DEV_PM_OPS(acpi_thermal_pm, NULL, acpi_thermal_resume); |
107 | 109 | ||
diff --git a/drivers/acpi/utils.c b/drivers/acpi/utils.c index 0347a37eb438..85e3b612bdc0 100644 --- a/drivers/acpi/utils.c +++ b/drivers/acpi/utils.c | |||
@@ -99,10 +99,6 @@ acpi_extract_package(union acpi_object *package, | |||
99 | 99 | ||
100 | union acpi_object *element = &(package->package.elements[i]); | 100 | union acpi_object *element = &(package->package.elements[i]); |
101 | 101 | ||
102 | if (!element) { | ||
103 | return AE_BAD_DATA; | ||
104 | } | ||
105 | |||
106 | switch (element->type) { | 102 | switch (element->type) { |
107 | 103 | ||
108 | case ACPI_TYPE_INTEGER: | 104 | case ACPI_TYPE_INTEGER: |
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index b727d105046d..b6ba88ed31ae 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -81,11 +81,12 @@ static bool allow_duplicates; | |||
81 | module_param(allow_duplicates, bool, 0644); | 81 | module_param(allow_duplicates, bool, 0644); |
82 | 82 | ||
83 | /* | 83 | /* |
84 | * For Windows 8 systems: if set ture and the GPU driver has | 84 | * For Windows 8 systems: used to decide if video module |
85 | * registered a backlight interface, skip registering ACPI video's. | 85 | * should skip registering backlight interface of its own. |
86 | */ | 86 | */ |
87 | static bool use_native_backlight = false; | 87 | static int use_native_backlight_param = -1; |
88 | module_param(use_native_backlight, bool, 0644); | 88 | module_param_named(use_native_backlight, use_native_backlight_param, int, 0444); |
89 | static bool use_native_backlight_dmi = false; | ||
89 | 90 | ||
90 | static int register_count; | 91 | static int register_count; |
91 | static struct mutex video_list_lock; | 92 | static struct mutex video_list_lock; |
@@ -231,9 +232,17 @@ static int acpi_video_get_next_level(struct acpi_video_device *device, | |||
231 | static int acpi_video_switch_brightness(struct acpi_video_device *device, | 232 | static int acpi_video_switch_brightness(struct acpi_video_device *device, |
232 | int event); | 233 | int event); |
233 | 234 | ||
235 | static bool acpi_video_use_native_backlight(void) | ||
236 | { | ||
237 | if (use_native_backlight_param != -1) | ||
238 | return use_native_backlight_param; | ||
239 | else | ||
240 | return use_native_backlight_dmi; | ||
241 | } | ||
242 | |||
234 | static bool acpi_video_verify_backlight_support(void) | 243 | static bool acpi_video_verify_backlight_support(void) |
235 | { | 244 | { |
236 | if (acpi_osi_is_win8() && use_native_backlight && | 245 | if (acpi_osi_is_win8() && acpi_video_use_native_backlight() && |
237 | backlight_device_registered(BACKLIGHT_RAW)) | 246 | backlight_device_registered(BACKLIGHT_RAW)) |
238 | return false; | 247 | return false; |
239 | return acpi_video_backlight_support(); | 248 | return acpi_video_backlight_support(); |
@@ -398,6 +407,12 @@ static int __init video_set_bqc_offset(const struct dmi_system_id *d) | |||
398 | return 0; | 407 | return 0; |
399 | } | 408 | } |
400 | 409 | ||
410 | static int __init video_set_use_native_backlight(const struct dmi_system_id *d) | ||
411 | { | ||
412 | use_native_backlight_dmi = true; | ||
413 | return 0; | ||
414 | } | ||
415 | |||
401 | static struct dmi_system_id video_dmi_table[] __initdata = { | 416 | static struct dmi_system_id video_dmi_table[] __initdata = { |
402 | /* | 417 | /* |
403 | * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121 | 418 | * Broken _BQC workaround http://bugzilla.kernel.org/show_bug.cgi?id=13121 |
@@ -442,6 +457,120 @@ static struct dmi_system_id video_dmi_table[] __initdata = { | |||
442 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7720"), | 457 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 7720"), |
443 | }, | 458 | }, |
444 | }, | 459 | }, |
460 | { | ||
461 | .callback = video_set_use_native_backlight, | ||
462 | .ident = "ThinkPad T430s", | ||
463 | .matches = { | ||
464 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
465 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T430s"), | ||
466 | }, | ||
467 | }, | ||
468 | { | ||
469 | .callback = video_set_use_native_backlight, | ||
470 | .ident = "ThinkPad X230", | ||
471 | .matches = { | ||
472 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
473 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X230"), | ||
474 | }, | ||
475 | }, | ||
476 | { | ||
477 | .callback = video_set_use_native_backlight, | ||
478 | .ident = "ThinkPad X1 Carbon", | ||
479 | .matches = { | ||
480 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
481 | DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X1 Carbon"), | ||
482 | }, | ||
483 | }, | ||
484 | { | ||
485 | .callback = video_set_use_native_backlight, | ||
486 | .ident = "Lenovo Yoga 13", | ||
487 | .matches = { | ||
488 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
489 | DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo IdeaPad Yoga 13"), | ||
490 | }, | ||
491 | }, | ||
492 | { | ||
493 | .callback = video_set_use_native_backlight, | ||
494 | .ident = "Dell Inspiron 7520", | ||
495 | .matches = { | ||
496 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
497 | DMI_MATCH(DMI_PRODUCT_VERSION, "Inspiron 7520"), | ||
498 | }, | ||
499 | }, | ||
500 | { | ||
501 | .callback = video_set_use_native_backlight, | ||
502 | .ident = "Acer Aspire 5733Z", | ||
503 | .matches = { | ||
504 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
505 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 5733Z"), | ||
506 | }, | ||
507 | }, | ||
508 | { | ||
509 | .callback = video_set_use_native_backlight, | ||
510 | .ident = "Acer Aspire V5-431", | ||
511 | .matches = { | ||
512 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
513 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire V5-431"), | ||
514 | }, | ||
515 | }, | ||
516 | { | ||
517 | .callback = video_set_use_native_backlight, | ||
518 | .ident = "HP ProBook 4340s", | ||
519 | .matches = { | ||
520 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
521 | DMI_MATCH(DMI_PRODUCT_VERSION, "HP ProBook 4340s"), | ||
522 | }, | ||
523 | }, | ||
524 | { | ||
525 | .callback = video_set_use_native_backlight, | ||
526 | .ident = "HP ProBook 2013 models", | ||
527 | .matches = { | ||
528 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
529 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ProBook "), | ||
530 | DMI_MATCH(DMI_PRODUCT_NAME, " G1"), | ||
531 | }, | ||
532 | }, | ||
533 | { | ||
534 | .callback = video_set_use_native_backlight, | ||
535 | .ident = "HP EliteBook 2013 models", | ||
536 | .matches = { | ||
537 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
538 | DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook "), | ||
539 | DMI_MATCH(DMI_PRODUCT_NAME, " G1"), | ||
540 | }, | ||
541 | }, | ||
542 | { | ||
543 | .callback = video_set_use_native_backlight, | ||
544 | .ident = "HP ZBook 14", | ||
545 | .matches = { | ||
546 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
547 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ZBook 14"), | ||
548 | }, | ||
549 | }, | ||
550 | { | ||
551 | .callback = video_set_use_native_backlight, | ||
552 | .ident = "HP ZBook 15", | ||
553 | .matches = { | ||
554 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
555 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ZBook 15"), | ||
556 | }, | ||
557 | }, | ||
558 | { | ||
559 | .callback = video_set_use_native_backlight, | ||
560 | .ident = "HP ZBook 17", | ||
561 | .matches = { | ||
562 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
563 | DMI_MATCH(DMI_PRODUCT_NAME, "HP ZBook 17"), | ||
564 | }, | ||
565 | }, | ||
566 | { | ||
567 | .callback = video_set_use_native_backlight, | ||
568 | .ident = "HP EliteBook 8780w", | ||
569 | .matches = { | ||
570 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
571 | DMI_MATCH(DMI_PRODUCT_NAME, "HP EliteBook 8780w"), | ||
572 | }, | ||
573 | }, | ||
445 | {} | 574 | {} |
446 | }; | 575 | }; |
447 | 576 | ||
@@ -685,6 +814,7 @@ acpi_video_init_brightness(struct acpi_video_device *device) | |||
685 | union acpi_object *o; | 814 | union acpi_object *o; |
686 | struct acpi_video_device_brightness *br = NULL; | 815 | struct acpi_video_device_brightness *br = NULL; |
687 | int result = -EINVAL; | 816 | int result = -EINVAL; |
817 | u32 value; | ||
688 | 818 | ||
689 | if (!ACPI_SUCCESS(acpi_video_device_lcd_query_levels(device, &obj))) { | 819 | if (!ACPI_SUCCESS(acpi_video_device_lcd_query_levels(device, &obj))) { |
690 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Could not query available " | 820 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Could not query available " |
@@ -715,7 +845,12 @@ acpi_video_init_brightness(struct acpi_video_device *device) | |||
715 | printk(KERN_ERR PREFIX "Invalid data\n"); | 845 | printk(KERN_ERR PREFIX "Invalid data\n"); |
716 | continue; | 846 | continue; |
717 | } | 847 | } |
718 | br->levels[count] = (u32) o->integer.value; | 848 | value = (u32) o->integer.value; |
849 | /* Skip duplicate entries */ | ||
850 | if (count > 2 && br->levels[count - 1] == value) | ||
851 | continue; | ||
852 | |||
853 | br->levels[count] = value; | ||
719 | 854 | ||
720 | if (br->levels[count] > max_level) | 855 | if (br->levels[count] > max_level) |
721 | max_level = br->levels[count]; | 856 | max_level = br->levels[count]; |
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index f0447d3daf2c..19080c8e2f2a 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c | |||
@@ -168,14 +168,6 @@ static struct dmi_system_id video_detect_dmi_table[] = { | |||
168 | DMI_MATCH(DMI_PRODUCT_NAME, "UL30A"), | 168 | DMI_MATCH(DMI_PRODUCT_NAME, "UL30A"), |
169 | }, | 169 | }, |
170 | }, | 170 | }, |
171 | { | ||
172 | .callback = video_detect_force_vendor, | ||
173 | .ident = "Lenovo Yoga 13", | ||
174 | .matches = { | ||
175 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
176 | DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo IdeaPad Yoga 13"), | ||
177 | }, | ||
178 | }, | ||
179 | { }, | 171 | { }, |
180 | }; | 172 | }; |
181 | 173 | ||