Re: [PATCH 7/7] Who controls brightness functionality: vendor specific or generic video driver

Carlos Corbacho
2008-04-19T11:03:49Z

On Wednesday 16 April 2008 20:02:52 Thomas Renninger wrote:
> Who controls brightness functionality: vendor specific or generic video
> driver
>
> Depending on the capablity of ACPI graphics devices and whether they
> implement all necessary functions so that the generic ACPI video driver can
> control them, decide at driver load time whether a vendor specific device
> driver or the ACPI video driver should control the brighntess
> functionality.
>
> Signed-off-by: Thomas Renninger <trenn@suse.de>

NACK the acer-wmi bit, use the following patch instead (feel free to fold it
into your superpatch though with my sign-off).

-Carlos
--
acer-wmi: Use ACPI video driver instead of WMI where possible

If the generic ACPI video driver can control the video, then we should hand
off control to it, rather than try to handle it ourselves.

Signed-off-by: Carlos Corbacho <carlos@strangeworlds.co.uk>
---

drivers/misc/acer-wmi.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/drivers/misc/acer-wmi.c b/drivers/misc/acer-wmi.c
index dd13a37..0d69bc5 100644
--- a/drivers/misc/acer-wmi.c
+++ b/drivers/misc/acer-wmi.c
@@ -1100,6 +1100,14 @@ static int __init acer_wmi_init(void)
return -ENODEV;
}

+ if (acpi_video_support & ACPI_VIDEO_BRIGHTNESS &&
+ !(acpi_video_support & ACPI_VIDEO_FORCE_VENDOR_SPECIFIC) &&
+ has_cap(ACER_CAP_BRIGHTNESS)) {
+ interface->capability &= ~ACER_CAP_BRIGHTNESS;
+ printk(ACER_INFO "Brightness must be controlled by "
+ "generic video driver\n");
+ }
+
if (platform_driver_register(&acer_platform_driver)) {
printk(ACER_ERR "Unable to register platform driver.\n");
goto error_platform_register;