[PATCH 2/5] hp-wmi: 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/hp-wmi.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index 8ba8956..d5428ea 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -554,6 +554,7 @@ static void hp_wmi_notify(u32 value, void *context)
 		input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE,
 				    hp_wmi_tablet_state());
 		input_sync(hp_wmi_input_dev);
+		kobject_uevent(&hp_wmi_input_dev->dev.kobj, KOBJ_CHANGE);
 		break;
 	case HPWMI_PARK_HDD:
 		break;
@@ -647,6 +648,7 @@ static int __init hp_wmi_input_setup(void)
 	input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE,
 			    hp_wmi_tablet_state());
 	input_sync(hp_wmi_input_dev);
+	kobject_uevent(&hp_wmi_input_dev->dev.kobj, KOBJ_CHANGE);
 
 	status = wmi_install_notify_handler(HPWMI_EVENT_GUID, hp_wmi_notify, NULL);
 	if (ACPI_FAILURE(status)) {
@@ -955,6 +957,7 @@ static int hp_wmi_resume_handler(struct device *device)
 		input_report_switch(hp_wmi_input_dev, SW_TABLET_MODE,
 				    hp_wmi_tablet_state());
 		input_sync(hp_wmi_input_dev);
+		kobject_uevent(&hp_wmi_input_dev->dev.kobj, KOBJ_CHANGE);
 	}
 
 	if (rfkill2_count)
-- 
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