According to the ACPI spec, "_DOS method is required if the system supports display switching or LCD brightness control." But some buggy BIOSes don't export _DOS method while it provides a set of working backlight control methods. http://bugzilla.kernel.org/show_bug.cgi?id=13577 With this patch applied, ACPI video driver only gives a warning message if _DOS is missed, and continue to support the backlight control without touching _DOS method. Signed-off-by: Zhang Rui --- drivers/acpi/video.c | 18 +++++++++++------- drivers/acpi/video_detect.c | 8 ++++++-- 2 files changed, 17 insertions(+), 9 deletions(-) Index: linux-2.6/drivers/acpi/video.c =================================================================== --- linux-2.6.orig/drivers/acpi/video.c +++ linux-2.6/drivers/acpi/video.c @@ -1069,10 +1069,10 @@ static int acpi_video_bus_check(struct a */ /* Does this device support video switching? */ - if (video->cap._DOS) { - video->flags.multihead = 1; + if (video->cap._DOD) status = 0; - } + if (video->cap._DOS) + video->flags.multihead = 1; /* Does this device support retrieving a video ROM? */ if (video->cap._ROM) { @@ -1488,8 +1488,10 @@ static int acpi_video_bus_DOS_seq_show(s { struct acpi_video_bus *video = seq->private; - - seq_printf(seq, "DOS setting: <%d>\n", video->dos_setting); + if (video->cap._DOS) + seq_printf(seq, "DOS setting: <%d>\n", video->dos_setting); + else + seq_printf(seq, "N/A\n"); return 0; } @@ -1556,6 +1558,8 @@ acpi_video_bus_write_DOS(struct file *fi char str[12] = { 0 }; unsigned long opt; + if (!video->cap._DOS) + return -EINVAL; if (!video || count + 1 > sizeof str) return -EINVAL; @@ -2035,12 +2039,12 @@ static int acpi_video_bus_put_devices(st static int acpi_video_bus_start_devices(struct acpi_video_bus *video) { - return acpi_video_bus_DOS(video, 0, 0); + return video->cap._DOS ? acpi_video_bus_DOS(video, 0, 0) : 0; } static int acpi_video_bus_stop_devices(struct acpi_video_bus *video) { - return acpi_video_bus_DOS(video, 0, 1); + return video->cap._DOS ? acpi_video_bus_DOS(video, 0, 1) : 0; } static void acpi_video_bus_notify(struct acpi_device *device, u32 event) Index: linux-2.6/drivers/acpi/video_detect.c =================================================================== --- linux-2.6.orig/drivers/acpi/video_detect.c +++ linux-2.6/drivers/acpi/video_detect.c @@ -81,9 +81,13 @@ long acpi_is_video_device(struct acpi_de return 0; /* Does this device able to support video switching ? */ - if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy)) && - ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOS", &h_dummy))) + if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_DOD", &h_dummy))) { + if (ACPI_FAILURE(acpi_get_handle(device->handle, "_DOS", + &h_dummy))) + printk(KERN_WARNING FW_BUG PREFIX "ACPI video bus " + "device misses _DOS function\n"); video_caps |= ACPI_VIDEO_OUTPUT_SWITCHING; + } /* Does this device able to retrieve a video ROM ? */ if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ROM", &h_dummy)))