[PATCH 4/5] classmate-laptop: Send uevent when SW_TABLET_MODE changes

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

 



This enables udev and userspace to react to those events without
having to explicitly poll()/select() on the device.

Signed-off-by: Carlos Garnacho <carlosg@xxxxxxxxx>
---
 drivers/platform/x86/classmate-laptop.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c
index 6dfa8d3..6329a0d 100644
--- a/drivers/platform/x86/classmate-laptop.c
+++ b/drivers/platform/x86/classmate-laptop.c
@@ -728,6 +728,7 @@ static void cmpc_tablet_handler(struct acpi_device *dev, u32 event)
 		if (ACPI_SUCCESS(cmpc_get_tablet(dev->handle, &val))) {
 			input_report_switch(inputdev, SW_TABLET_MODE, !val);
 			input_sync(inputdev);
+			kobject_uevent(&inputdev->dev.kobj, KOBJ_CHANGE);
 		}
 	}
 }
@@ -744,6 +745,7 @@ static void cmpc_tablet_idev_init(struct input_dev *inputdev)
 	if (ACPI_SUCCESS(cmpc_get_tablet(acpi->handle, &val))) {
 		input_report_switch(inputdev, SW_TABLET_MODE, !val);
 		input_sync(inputdev);
+		kobject_uevent(&inputdev->dev.kobj, KOBJ_CHANGE);
 	}
 }
 
-- 
1.8.5.1

--
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