diff options
author | Olof Johansson <olof@lixom.net> | 2013-08-11 18:33:54 -0400 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2013-08-11 18:33:54 -0400 |
commit | 4ddbed9618724d52a7a79c1e10ef5adb46fcccf7 (patch) | |
tree | ffe64efb333d7dcdb5b2cf43ffef97b25261702c /drivers/acpi | |
parent | 16649596d701c0f4f767bbcad7da4d6343ba8a9e (diff) | |
parent | fa8c5a811e0e7c3e1c49b2e58fcb4db549b5719a (diff) |
Merge tag 'boards-3.12' of git://git.infradead.org/linux-mvebu into next/boards
From Jason Cooper:
mvebu boards changes for v3.12
- convert kirkwood, dove, orion5x to DT init of mv643xx_eth
- _lots_ of board code removal :)
- convert kirkwood, dove and orion5x to DT init of clocksource and irqchip
* tag 'boards-3.12' of git://git.infradead.org/linux-mvebu:
ARM: plat-orion: add reg offset to DT irq driver stub
ARM: kirkwood: remove obsolete SDIO clock gate workaround
ARM: kirkwood: convert to DT irqchip and clocksource
ARM: dove: convert to DT irqchip and clocksource
ARM: orion5x: update intc device tree node to new reg layout
ARM: kirkwood: move device tree nodes to DT irqchip and clocksource
ARM: dove: move device tree nodes to DT irqchip and clocksource
ARM: orion5x: remove legacy mv643xx_eth board setup
ARM: kirkwood: remove legacy clk alias for mv643xx_eth
ARM: kirkwood: remove redundant DT board files
ARM: dove: remove legacy mv643xx_eth setup
ARM: orion5x: add gigabit ethernet and mvmdio device tree nodes
ARM: kirkwood: add gigabit ethernet and mvmdio device tree nodes
ARM: dove: add gigabit ethernet and mvmdio device tree nodes
+ Linux 3.11-rc2
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers/acpi')
-rw-r--r-- | drivers/acpi/acpi_memhotplug.c | 1 | ||||
-rw-r--r-- | drivers/acpi/acpi_processor.c | 2 | ||||
-rw-r--r-- | drivers/acpi/acpica/aclocal.h | 13 | ||||
-rw-r--r-- | drivers/acpi/internal.h | 11 | ||||
-rw-r--r-- | drivers/acpi/processor_core.c | 8 | ||||
-rw-r--r-- | drivers/acpi/processor_driver.c | 8 | ||||
-rw-r--r-- | drivers/acpi/processor_idle.c | 6 | ||||
-rw-r--r-- | drivers/acpi/scan.c | 13 | ||||
-rw-r--r-- | drivers/acpi/video.c | 98 | ||||
-rw-r--r-- | drivers/acpi/video_detect.c | 21 |
10 files changed, 138 insertions, 43 deletions
diff --git a/drivers/acpi/acpi_memhotplug.c b/drivers/acpi/acpi_memhotplug.c index c711d1144044..999adb5499c7 100644 --- a/drivers/acpi/acpi_memhotplug.c +++ b/drivers/acpi/acpi_memhotplug.c | |||
@@ -323,6 +323,7 @@ static int acpi_memory_device_add(struct acpi_device *device, | |||
323 | /* Get the range from the _CRS */ | 323 | /* Get the range from the _CRS */ |
324 | result = acpi_memory_get_device_resources(mem_device); | 324 | result = acpi_memory_get_device_resources(mem_device); |
325 | if (result) { | 325 | if (result) { |
326 | device->driver_data = NULL; | ||
326 | kfree(mem_device); | 327 | kfree(mem_device); |
327 | return result; | 328 | return result; |
328 | } | 329 | } |
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c index e9b01e35ac37..fd6c51cc3acb 100644 --- a/drivers/acpi/acpi_processor.c +++ b/drivers/acpi/acpi_processor.c | |||
@@ -340,7 +340,7 @@ static int acpi_processor_get_info(struct acpi_device *device) | |||
340 | */ | 340 | */ |
341 | static DEFINE_PER_CPU(void *, processor_device_array); | 341 | static DEFINE_PER_CPU(void *, processor_device_array); |
342 | 342 | ||
343 | static int __cpuinit acpi_processor_add(struct acpi_device *device, | 343 | static int acpi_processor_add(struct acpi_device *device, |
344 | const struct acpi_device_id *id) | 344 | const struct acpi_device_id *id) |
345 | { | 345 | { |
346 | struct acpi_processor *pr; | 346 | struct acpi_processor *pr; |
diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h index dfed26545ba2..d4a4901637cd 100644 --- a/drivers/acpi/acpica/aclocal.h +++ b/drivers/acpi/acpica/aclocal.h | |||
@@ -931,19 +931,6 @@ struct acpi_bit_register_info { | |||
931 | 931 | ||
932 | /* Structs and definitions for _OSI support and I/O port validation */ | 932 | /* Structs and definitions for _OSI support and I/O port validation */ |
933 | 933 | ||
934 | #define ACPI_OSI_WIN_2000 0x01 | ||
935 | #define ACPI_OSI_WIN_XP 0x02 | ||
936 | #define ACPI_OSI_WIN_XP_SP1 0x03 | ||
937 | #define ACPI_OSI_WINSRV_2003 0x04 | ||
938 | #define ACPI_OSI_WIN_XP_SP2 0x05 | ||
939 | #define ACPI_OSI_WINSRV_2003_SP1 0x06 | ||
940 | #define ACPI_OSI_WIN_VISTA 0x07 | ||
941 | #define ACPI_OSI_WINSRV_2008 0x08 | ||
942 | #define ACPI_OSI_WIN_VISTA_SP1 0x09 | ||
943 | #define ACPI_OSI_WIN_VISTA_SP2 0x0A | ||
944 | #define ACPI_OSI_WIN_7 0x0B | ||
945 | #define ACPI_OSI_WIN_8 0x0C | ||
946 | |||
947 | #define ACPI_ALWAYS_ILLEGAL 0x00 | 934 | #define ACPI_ALWAYS_ILLEGAL 0x00 |
948 | 935 | ||
949 | struct acpi_interface_info { | 936 | struct acpi_interface_info { |
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index 3a50a34fe176..227aca77ee1e 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h | |||
@@ -164,4 +164,15 @@ struct platform_device; | |||
164 | int acpi_create_platform_device(struct acpi_device *adev, | 164 | int acpi_create_platform_device(struct acpi_device *adev, |
165 | const struct acpi_device_id *id); | 165 | const struct acpi_device_id *id); |
166 | 166 | ||
167 | /*-------------------------------------------------------------------------- | ||
168 | Video | ||
169 | -------------------------------------------------------------------------- */ | ||
170 | #if defined(CONFIG_ACPI_VIDEO) || defined(CONFIG_ACPI_VIDEO_MODULE) | ||
171 | bool acpi_video_backlight_quirks(void); | ||
172 | bool acpi_video_verify_backlight_support(void); | ||
173 | #else | ||
174 | static inline bool acpi_video_backlight_quirks(void) { return false; } | ||
175 | static inline bool acpi_video_verify_backlight_support(void) { return false; } | ||
176 | #endif | ||
177 | |||
167 | #endif /* _ACPI_INTERNAL_H_ */ | 178 | #endif /* _ACPI_INTERNAL_H_ */ |
diff --git a/drivers/acpi/processor_core.c b/drivers/acpi/processor_core.c index 164d49569aeb..a5e9f4a5b281 100644 --- a/drivers/acpi/processor_core.c +++ b/drivers/acpi/processor_core.c | |||
@@ -253,7 +253,7 @@ static bool __init processor_physically_present(acpi_handle handle) | |||
253 | return true; | 253 | return true; |
254 | } | 254 | } |
255 | 255 | ||
256 | static void __cpuinit acpi_set_pdc_bits(u32 *buf) | 256 | static void acpi_set_pdc_bits(u32 *buf) |
257 | { | 257 | { |
258 | buf[0] = ACPI_PDC_REVISION_ID; | 258 | buf[0] = ACPI_PDC_REVISION_ID; |
259 | buf[1] = 1; | 259 | buf[1] = 1; |
@@ -265,7 +265,7 @@ static void __cpuinit acpi_set_pdc_bits(u32 *buf) | |||
265 | arch_acpi_set_pdc_bits(buf); | 265 | arch_acpi_set_pdc_bits(buf); |
266 | } | 266 | } |
267 | 267 | ||
268 | static struct acpi_object_list *__cpuinit acpi_processor_alloc_pdc(void) | 268 | static struct acpi_object_list *acpi_processor_alloc_pdc(void) |
269 | { | 269 | { |
270 | struct acpi_object_list *obj_list; | 270 | struct acpi_object_list *obj_list; |
271 | union acpi_object *obj; | 271 | union acpi_object *obj; |
@@ -308,7 +308,7 @@ static struct acpi_object_list *__cpuinit acpi_processor_alloc_pdc(void) | |||
308 | * _PDC is required for a BIOS-OS handshake for most of the newer | 308 | * _PDC is required for a BIOS-OS handshake for most of the newer |
309 | * ACPI processor features. | 309 | * ACPI processor features. |
310 | */ | 310 | */ |
311 | static int __cpuinit | 311 | static int |
312 | acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in) | 312 | acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in) |
313 | { | 313 | { |
314 | acpi_status status = AE_OK; | 314 | acpi_status status = AE_OK; |
@@ -336,7 +336,7 @@ acpi_processor_eval_pdc(acpi_handle handle, struct acpi_object_list *pdc_in) | |||
336 | return status; | 336 | return status; |
337 | } | 337 | } |
338 | 338 | ||
339 | void __cpuinit acpi_processor_set_pdc(acpi_handle handle) | 339 | void acpi_processor_set_pdc(acpi_handle handle) |
340 | { | 340 | { |
341 | struct acpi_object_list *obj_list; | 341 | struct acpi_object_list *obj_list; |
342 | 342 | ||
diff --git a/drivers/acpi/processor_driver.c b/drivers/acpi/processor_driver.c index 823be116619e..870eaf5fa547 100644 --- a/drivers/acpi/processor_driver.c +++ b/drivers/acpi/processor_driver.c | |||
@@ -118,9 +118,9 @@ static void acpi_processor_notify(acpi_handle handle, u32 event, void *data) | |||
118 | return; | 118 | return; |
119 | } | 119 | } |
120 | 120 | ||
121 | static __cpuinit int __acpi_processor_start(struct acpi_device *device); | 121 | static int __acpi_processor_start(struct acpi_device *device); |
122 | 122 | ||
123 | static int __cpuinit acpi_cpu_soft_notify(struct notifier_block *nfb, | 123 | static int acpi_cpu_soft_notify(struct notifier_block *nfb, |
124 | unsigned long action, void *hcpu) | 124 | unsigned long action, void *hcpu) |
125 | { | 125 | { |
126 | unsigned int cpu = (unsigned long)hcpu; | 126 | unsigned int cpu = (unsigned long)hcpu; |
@@ -162,7 +162,7 @@ static struct notifier_block __refdata acpi_cpu_notifier = | |||
162 | .notifier_call = acpi_cpu_soft_notify, | 162 | .notifier_call = acpi_cpu_soft_notify, |
163 | }; | 163 | }; |
164 | 164 | ||
165 | static __cpuinit int __acpi_processor_start(struct acpi_device *device) | 165 | static int __acpi_processor_start(struct acpi_device *device) |
166 | { | 166 | { |
167 | struct acpi_processor *pr = acpi_driver_data(device); | 167 | struct acpi_processor *pr = acpi_driver_data(device); |
168 | acpi_status status; | 168 | acpi_status status; |
@@ -226,7 +226,7 @@ static __cpuinit int __acpi_processor_start(struct acpi_device *device) | |||
226 | return result; | 226 | return result; |
227 | } | 227 | } |
228 | 228 | ||
229 | static int __cpuinit acpi_processor_start(struct device *dev) | 229 | static int acpi_processor_start(struct device *dev) |
230 | { | 230 | { |
231 | struct acpi_device *device; | 231 | struct acpi_device *device; |
232 | 232 | ||
diff --git a/drivers/acpi/processor_idle.c b/drivers/acpi/processor_idle.c index 0461ccc92c54..f98dd00b51a9 100644 --- a/drivers/acpi/processor_idle.c +++ b/drivers/acpi/processor_idle.c | |||
@@ -96,9 +96,7 @@ static int set_max_cstate(const struct dmi_system_id *id) | |||
96 | return 0; | 96 | return 0; |
97 | } | 97 | } |
98 | 98 | ||
99 | /* Actually this shouldn't be __cpuinitdata, would be better to fix the | 99 | static struct dmi_system_id processor_power_dmi_table[] = { |
100 | callers to only run once -AK */ | ||
101 | static struct dmi_system_id __cpuinitdata processor_power_dmi_table[] = { | ||
102 | { set_max_cstate, "Clevo 5600D", { | 100 | { set_max_cstate, "Clevo 5600D", { |
103 | DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"), | 101 | DMI_MATCH(DMI_BIOS_VENDOR,"Phoenix Technologies LTD"), |
104 | DMI_MATCH(DMI_BIOS_VERSION,"SHE845M0.86C.0013.D.0302131307")}, | 102 | DMI_MATCH(DMI_BIOS_VERSION,"SHE845M0.86C.0013.D.0302131307")}, |
@@ -1165,7 +1163,7 @@ int acpi_processor_cst_has_changed(struct acpi_processor *pr) | |||
1165 | 1163 | ||
1166 | static int acpi_processor_registered; | 1164 | static int acpi_processor_registered; |
1167 | 1165 | ||
1168 | int __cpuinit acpi_processor_power_init(struct acpi_processor *pr) | 1166 | int acpi_processor_power_init(struct acpi_processor *pr) |
1169 | { | 1167 | { |
1170 | acpi_status status = 0; | 1168 | acpi_status status = 0; |
1171 | int retval; | 1169 | int retval; |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 10985573aaa7..8a46c924effd 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -352,10 +352,12 @@ static void acpi_scan_bus_device_check(acpi_handle handle, u32 ost_source) | |||
352 | mutex_lock(&acpi_scan_lock); | 352 | mutex_lock(&acpi_scan_lock); |
353 | lock_device_hotplug(); | 353 | lock_device_hotplug(); |
354 | 354 | ||
355 | acpi_bus_get_device(handle, &device); | 355 | if (ost_source != ACPI_NOTIFY_BUS_CHECK) { |
356 | if (device) { | 356 | acpi_bus_get_device(handle, &device); |
357 | dev_warn(&device->dev, "Attempt to re-insert\n"); | 357 | if (device) { |
358 | goto out; | 358 | dev_warn(&device->dev, "Attempt to re-insert\n"); |
359 | goto out; | ||
360 | } | ||
359 | } | 361 | } |
360 | acpi_evaluate_hotplug_ost(handle, ost_source, | 362 | acpi_evaluate_hotplug_ost(handle, ost_source, |
361 | ACPI_OST_SC_INSERT_IN_PROGRESS, NULL); | 363 | ACPI_OST_SC_INSERT_IN_PROGRESS, NULL); |
@@ -1981,6 +1983,9 @@ static acpi_status acpi_bus_device_attach(acpi_handle handle, u32 lvl_not_used, | |||
1981 | if (acpi_bus_get_device(handle, &device)) | 1983 | if (acpi_bus_get_device(handle, &device)) |
1982 | return AE_CTRL_DEPTH; | 1984 | return AE_CTRL_DEPTH; |
1983 | 1985 | ||
1986 | if (device->handler) | ||
1987 | return AE_OK; | ||
1988 | |||
1984 | ret = acpi_scan_attach_handler(device); | 1989 | ret = acpi_scan_attach_handler(device); |
1985 | if (ret) | 1990 | if (ret) |
1986 | return ret > 0 ? AE_OK : AE_CTRL_DEPTH; | 1991 | return ret > 0 ? AE_OK : AE_CTRL_DEPTH; |
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 5d7075d25700..6dd237e79b4f 100644 --- a/drivers/acpi/video.c +++ b/drivers/acpi/video.c | |||
@@ -44,6 +44,8 @@ | |||
44 | #include <linux/suspend.h> | 44 | #include <linux/suspend.h> |
45 | #include <acpi/video.h> | 45 | #include <acpi/video.h> |
46 | 46 | ||
47 | #include "internal.h" | ||
48 | |||
47 | #define PREFIX "ACPI: " | 49 | #define PREFIX "ACPI: " |
48 | 50 | ||
49 | #define ACPI_VIDEO_BUS_NAME "Video Bus" | 51 | #define ACPI_VIDEO_BUS_NAME "Video Bus" |
@@ -450,6 +452,14 @@ static struct dmi_system_id video_dmi_table[] __initdata = { | |||
450 | }, | 452 | }, |
451 | { | 453 | { |
452 | .callback = video_ignore_initial_backlight, | 454 | .callback = video_ignore_initial_backlight, |
455 | .ident = "Fujitsu E753", | ||
456 | .matches = { | ||
457 | DMI_MATCH(DMI_BOARD_VENDOR, "FUJITSU"), | ||
458 | DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E753"), | ||
459 | }, | ||
460 | }, | ||
461 | { | ||
462 | .callback = video_ignore_initial_backlight, | ||
453 | .ident = "HP Pavilion dm4", | 463 | .ident = "HP Pavilion dm4", |
454 | .matches = { | 464 | .matches = { |
455 | DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), | 465 | DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), |
@@ -898,7 +908,10 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
898 | device->cap._DDC = 1; | 908 | device->cap._DDC = 1; |
899 | } | 909 | } |
900 | 910 | ||
901 | if (acpi_video_backlight_support()) { | 911 | if (acpi_video_init_brightness(device)) |
912 | return; | ||
913 | |||
914 | if (acpi_video_verify_backlight_support()) { | ||
902 | struct backlight_properties props; | 915 | struct backlight_properties props; |
903 | struct pci_dev *pdev; | 916 | struct pci_dev *pdev; |
904 | acpi_handle acpi_parent; | 917 | acpi_handle acpi_parent; |
@@ -907,9 +920,6 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
907 | static int count = 0; | 920 | static int count = 0; |
908 | char *name; | 921 | char *name; |
909 | 922 | ||
910 | result = acpi_video_init_brightness(device); | ||
911 | if (result) | ||
912 | return; | ||
913 | name = kasprintf(GFP_KERNEL, "acpi_video%d", count); | 923 | name = kasprintf(GFP_KERNEL, "acpi_video%d", count); |
914 | if (!name) | 924 | if (!name) |
915 | return; | 925 | return; |
@@ -969,6 +979,11 @@ static void acpi_video_device_find_cap(struct acpi_video_device *device) | |||
969 | if (result) | 979 | if (result) |
970 | printk(KERN_ERR PREFIX "Create sysfs link\n"); | 980 | printk(KERN_ERR PREFIX "Create sysfs link\n"); |
971 | 981 | ||
982 | } else { | ||
983 | /* Remove the brightness object. */ | ||
984 | kfree(device->brightness->levels); | ||
985 | kfree(device->brightness); | ||
986 | device->brightness = NULL; | ||
972 | } | 987 | } |
973 | } | 988 | } |
974 | 989 | ||
@@ -1351,8 +1366,8 @@ acpi_video_switch_brightness(struct acpi_video_device *device, int event) | |||
1351 | unsigned long long level_current, level_next; | 1366 | unsigned long long level_current, level_next; |
1352 | int result = -EINVAL; | 1367 | int result = -EINVAL; |
1353 | 1368 | ||
1354 | /* no warning message if acpi_backlight=vendor is used */ | 1369 | /* no warning message if acpi_backlight=vendor or a quirk is used */ |
1355 | if (!acpi_video_backlight_support()) | 1370 | if (!acpi_video_verify_backlight_support()) |
1356 | return 0; | 1371 | return 0; |
1357 | 1372 | ||
1358 | if (!device->brightness) | 1373 | if (!device->brightness) |
@@ -1532,14 +1547,20 @@ static int acpi_video_bus_put_devices(struct acpi_video_bus *video) | |||
1532 | 1547 | ||
1533 | /* acpi_video interface */ | 1548 | /* acpi_video interface */ |
1534 | 1549 | ||
1550 | /* | ||
1551 | * Win8 requires setting bit2 of _DOS to let firmware know it shouldn't | ||
1552 | * preform any automatic brightness change on receiving a notification. | ||
1553 | */ | ||
1535 | static int acpi_video_bus_start_devices(struct acpi_video_bus *video) | 1554 | static int acpi_video_bus_start_devices(struct acpi_video_bus *video) |
1536 | { | 1555 | { |
1537 | return acpi_video_bus_DOS(video, 0, 0); | 1556 | return acpi_video_bus_DOS(video, 0, |
1557 | acpi_video_backlight_quirks() ? 1 : 0); | ||
1538 | } | 1558 | } |
1539 | 1559 | ||
1540 | static int acpi_video_bus_stop_devices(struct acpi_video_bus *video) | 1560 | static int acpi_video_bus_stop_devices(struct acpi_video_bus *video) |
1541 | { | 1561 | { |
1542 | return acpi_video_bus_DOS(video, 0, 1); | 1562 | return acpi_video_bus_DOS(video, 0, |
1563 | acpi_video_backlight_quirks() ? 0 : 1); | ||
1543 | } | 1564 | } |
1544 | 1565 | ||
1545 | static void acpi_video_bus_notify(struct acpi_device *device, u32 event) | 1566 | static void acpi_video_bus_notify(struct acpi_device *device, u32 event) |
@@ -1854,6 +1875,46 @@ static int acpi_video_bus_remove(struct acpi_device *device) | |||
1854 | return 0; | 1875 | return 0; |
1855 | } | 1876 | } |
1856 | 1877 | ||
1878 | static acpi_status video_unregister_backlight(acpi_handle handle, u32 lvl, | ||
1879 | void *context, void **rv) | ||
1880 | { | ||
1881 | struct acpi_device *acpi_dev; | ||
1882 | struct acpi_video_bus *video; | ||
1883 | struct acpi_video_device *dev, *next; | ||
1884 | |||
1885 | if (acpi_bus_get_device(handle, &acpi_dev)) | ||
1886 | return AE_OK; | ||
1887 | |||
1888 | if (acpi_match_device_ids(acpi_dev, video_device_ids)) | ||
1889 | return AE_OK; | ||
1890 | |||
1891 | video = acpi_driver_data(acpi_dev); | ||
1892 | if (!video) | ||
1893 | return AE_OK; | ||
1894 | |||
1895 | acpi_video_bus_stop_devices(video); | ||
1896 | mutex_lock(&video->device_list_lock); | ||
1897 | list_for_each_entry_safe(dev, next, &video->video_device_list, entry) { | ||
1898 | if (dev->backlight) { | ||
1899 | backlight_device_unregister(dev->backlight); | ||
1900 | dev->backlight = NULL; | ||
1901 | kfree(dev->brightness->levels); | ||
1902 | kfree(dev->brightness); | ||
1903 | } | ||
1904 | if (dev->cooling_dev) { | ||
1905 | sysfs_remove_link(&dev->dev->dev.kobj, | ||
1906 | "thermal_cooling"); | ||
1907 | sysfs_remove_link(&dev->cooling_dev->device.kobj, | ||
1908 | "device"); | ||
1909 | thermal_cooling_device_unregister(dev->cooling_dev); | ||
1910 | dev->cooling_dev = NULL; | ||
1911 | } | ||
1912 | } | ||
1913 | mutex_unlock(&video->device_list_lock); | ||
1914 | acpi_video_bus_start_devices(video); | ||
1915 | return AE_OK; | ||
1916 | } | ||
1917 | |||
1857 | static int __init is_i740(struct pci_dev *dev) | 1918 | static int __init is_i740(struct pci_dev *dev) |
1858 | { | 1919 | { |
1859 | if (dev->device == 0x00D1) | 1920 | if (dev->device == 0x00D1) |
@@ -1885,14 +1946,25 @@ static int __init intel_opregion_present(void) | |||
1885 | return opregion; | 1946 | return opregion; |
1886 | } | 1947 | } |
1887 | 1948 | ||
1888 | int acpi_video_register(void) | 1949 | int __acpi_video_register(bool backlight_quirks) |
1889 | { | 1950 | { |
1890 | int result = 0; | 1951 | bool no_backlight; |
1952 | int result; | ||
1953 | |||
1954 | no_backlight = backlight_quirks ? acpi_video_backlight_quirks() : false; | ||
1955 | |||
1891 | if (register_count) { | 1956 | if (register_count) { |
1892 | /* | 1957 | /* |
1893 | * if the function of acpi_video_register is already called, | 1958 | * If acpi_video_register() has been called already, don't try |
1894 | * don't register the acpi_vide_bus again and return no error. | 1959 | * to register acpi_video_bus, but unregister backlight devices |
1960 | * if no backlight support is requested. | ||
1895 | */ | 1961 | */ |
1962 | if (no_backlight) | ||
1963 | acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, | ||
1964 | ACPI_UINT32_MAX, | ||
1965 | video_unregister_backlight, | ||
1966 | NULL, NULL, NULL); | ||
1967 | |||
1896 | return 0; | 1968 | return 0; |
1897 | } | 1969 | } |
1898 | 1970 | ||
@@ -1908,7 +1980,7 @@ int acpi_video_register(void) | |||
1908 | 1980 | ||
1909 | return 0; | 1981 | return 0; |
1910 | } | 1982 | } |
1911 | EXPORT_SYMBOL(acpi_video_register); | 1983 | EXPORT_SYMBOL(__acpi_video_register); |
1912 | 1984 | ||
1913 | void acpi_video_unregister(void) | 1985 | void acpi_video_unregister(void) |
1914 | { | 1986 | { |
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index e6bd910bc6ed..826e52def080 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c | |||
@@ -38,6 +38,8 @@ | |||
38 | #include <linux/dmi.h> | 38 | #include <linux/dmi.h> |
39 | #include <linux/pci.h> | 39 | #include <linux/pci.h> |
40 | 40 | ||
41 | #include "internal.h" | ||
42 | |||
41 | #define PREFIX "ACPI: " | 43 | #define PREFIX "ACPI: " |
42 | 44 | ||
43 | ACPI_MODULE_NAME("video"); | 45 | ACPI_MODULE_NAME("video"); |
@@ -234,6 +236,17 @@ static void acpi_video_caps_check(void) | |||
234 | acpi_video_get_capabilities(NULL); | 236 | acpi_video_get_capabilities(NULL); |
235 | } | 237 | } |
236 | 238 | ||
239 | bool acpi_video_backlight_quirks(void) | ||
240 | { | ||
241 | if (acpi_gbl_osi_data >= ACPI_OSI_WIN_8) { | ||
242 | acpi_video_caps_check(); | ||
243 | acpi_video_support |= ACPI_VIDEO_SKIP_BACKLIGHT; | ||
244 | return true; | ||
245 | } | ||
246 | return false; | ||
247 | } | ||
248 | EXPORT_SYMBOL(acpi_video_backlight_quirks); | ||
249 | |||
237 | /* Promote the vendor interface instead of the generic video module. | 250 | /* Promote the vendor interface instead of the generic video module. |
238 | * This function allow DMI blacklists to be implemented by externals | 251 | * This function allow DMI blacklists to be implemented by externals |
239 | * platform drivers instead of putting a big blacklist in video_detect.c | 252 | * platform drivers instead of putting a big blacklist in video_detect.c |
@@ -278,6 +291,14 @@ int acpi_video_backlight_support(void) | |||
278 | } | 291 | } |
279 | EXPORT_SYMBOL(acpi_video_backlight_support); | 292 | EXPORT_SYMBOL(acpi_video_backlight_support); |
280 | 293 | ||
294 | /* For the ACPI video driver use only. */ | ||
295 | bool acpi_video_verify_backlight_support(void) | ||
296 | { | ||
297 | return (acpi_video_support & ACPI_VIDEO_SKIP_BACKLIGHT) ? | ||
298 | false : acpi_video_backlight_support(); | ||
299 | } | ||
300 | EXPORT_SYMBOL(acpi_video_verify_backlight_support); | ||
301 | |||
281 | /* | 302 | /* |
282 | * Use acpi_backlight=vendor/video to force that backlight switching | 303 | * Use acpi_backlight=vendor/video to force that backlight switching |
283 | * is processed by vendor specific acpi drivers or video.ko driver. | 304 | * is processed by vendor specific acpi drivers or video.ko driver. |