ACPI video: if no ACPI backlight support, use vendor drivers

If an ACPI graphics device supports backlight brightness functions (cmp. with
latest ACPI spec Appendix B), let the ACPI video driver control backlight and
switch backlight control off in vendor specific ACPI drivers (asus_acpi,
thinkpad_acpi, eeepc, fujitsu_laptop, msi_laptop, sony_laptop, acer-wmi).

Currently it is possible to load above drivers and let both poke on the
brightness HW registers, the video and vendor specific ACPI drivers -> bad.

This patch provides the basic support to check for BIOS capabilities before
driver loading time. Driver specific modifications are in separate follow up
patches.

"acpi_backlight=vendor"
	Prever vendor driver over ACPI driver for backlight.
"acpi_backlight=video" (default)
	Prever ACPI driver over vendor driver for backlight.

Signed-off-by: Thomas Renninger <trenn@suse.de>
Acked-by: Zhang Rui <rui.zhang@intel.com>
Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
Thomas Renninger
2008-08-01 17:37:55 +02:00
committed by Len Brown
parent 22c13f9d81
commit c3d6de698c
6 changed files with 345 additions and 43 deletions

View File

@@ -919,36 +919,6 @@ static void acpi_device_get_busid(struct acpi_device *device,
}
}
static int
acpi_video_bus_match(struct acpi_device *device)
{
acpi_handle h_dummy;
if (!device)
return -EINVAL;
/* Since there is no HID, CID for ACPI Video drivers, we have
* to check well known required nodes for each feature we support.
*/
/* 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)))
return 0;
/* Does this device able to retrieve a video ROM ? */
if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_ROM", &h_dummy)))
return 0;
/* Does this device able to configure which video head to be POSTed ? */
if (ACPI_SUCCESS(acpi_get_handle(device->handle, "_VPO", &h_dummy)) &&
ACPI_SUCCESS(acpi_get_handle(device->handle, "_GPD", &h_dummy)) &&
ACPI_SUCCESS(acpi_get_handle(device->handle, "_SPD", &h_dummy)))
return 0;
return -ENODEV;
}
/*
* acpi_bay_match - see if a device is an ejectable driver bay
*
@@ -1031,7 +1001,7 @@ static void acpi_device_set_id(struct acpi_device *device,
will get autoloaded and the device might still match
against another driver.
*/
if (ACPI_SUCCESS(acpi_video_bus_match(device)))
if (acpi_is_video_device(device))
cid_add = ACPI_VIDEO_HID;
else if (ACPI_SUCCESS(acpi_bay_match(device)))
cid_add = ACPI_BAY_HID;