Subject: [PATCH] [acpi video] Detect presence of device hotkey switching support - Add hotkey_init() that checks for presence of _DCS, and if it is there, check for presence of other required methods. Signed-off-by: Patrick Mochel --- drivers/acpi/drivers/video/dev-device.c | 18 ++++++++++++++++++ 1 files changed, 18 insertions(+), 0 deletions(-) applies-to: 13eade4150d1f6dba67febe84d025197b9e9a970 c6cb616133985dcb540be214e1b0bb7c5b5e549d diff --git a/drivers/acpi/drivers/video/dev-device.c b/drivers/acpi/drivers/video/dev-device.c index fd46229..c504576 100644 --- a/drivers/acpi/drivers/video/dev-device.c +++ b/drivers/acpi/drivers/video/dev-device.c @@ -220,6 +220,20 @@ static int lcd_init(struct acpi_video_de } +static int hotkey_init(struct acpi_video_dev * vd) +{ + int ret = 0; + + if (is_method(vd->v_ad, "_DCS")) { + if (is_method(vd->v_ad, "_DGS") && is_method(vd->v_ad, "_DSS")) { + vd->v_hotkey = 1; + } else + ret = -EIO; + } + return ret; +} + + /** * video_dev_init - Initialize a video device * @vd: The ACPI video device @@ -239,6 +253,10 @@ int video_dev_init(struct acpi_video_dev ret = lcd_init(vd); if (ret) return ret; + + ret = hotkey_init(vd); + if (ret) + return ret; return 0; } --- 0.99.9.GIT