[PATCH] ACPI video: prevent from reporting birghtness keyevents

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Prevent ACPI video from reporting brightness keyevents if the driver
already adjust the brightness, or userspace app will adjust the brightness
value again.

We should distinguish keyevent from uevent, keyevent is used to inform the
usespace app to do what the meaning of the key is.
And uevent is used to say that the required action is already taken,
userspace app could monitor uevent to show OSD or do any kind of
notification they want.
The backlight subsystem will emit the uevent once the brightness had
changed, so ACPI video driver doesn't have to report the keyevent.

Signed-off-by: AceLan Kao <acelan.kao@xxxxxxxxxxxxx>
---
 drivers/acpi/video.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 1e0a9e1..221cff2 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -1546,7 +1546,8 @@ static void acpi_video_device_notify(acpi_handle handle, u32 event, void *data)
 
 	acpi_notifier_call_chain(device, event, 0);
 
-	if (keycode) {
+	/* Report keyevent only if the driver didn't adjust the brightness */
+	if (keycode && !brightness_switch_enabled) {
 		input_report_key(input, keycode, 1);
 		input_sync(input);
 		input_report_key(input, keycode, 0);
-- 
1.7.9.5

--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux