diff options
Diffstat (limited to 'drivers/acpi/video.c')
-rw-r--r-- | drivers/acpi/video.c | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c index 5d7075d25700..0ec434d2586d 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,6 +908,9 @@ 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 | ||
911 | if (acpi_video_init_brightness(device)) | ||
912 | return; | ||
913 | |||
901 | if (acpi_video_backlight_support()) { | 914 | if (acpi_video_backlight_support()) { |
902 | struct backlight_properties props; | 915 | struct backlight_properties props; |
903 | struct pci_dev *pdev; | 916 | struct pci_dev *pdev; |
@@ -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 | ||
@@ -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) |