Commit ad20c73b authored by Carlos Alberto Lopez Perez's avatar Carlos Alberto Lopez Perez Committed by Matthew Garrett

classmate-laptop: always call input_sync() after input_report_switch()

Due to commit cdda911c evdev only
becomes readable when the buffer contains an EV_SYN/SYN_REPORT event.

So in order to read the tablet sensor data as it happens we need to
ensure that we always call input_sync() after input_report_switch()
Signed-off-by: default avatarCarlos Alberto Lopez Perez <clopez@igalia.com>
Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
parent a4f46bb9
...@@ -725,8 +725,10 @@ static void cmpc_tablet_handler(struct acpi_device *dev, u32 event) ...@@ -725,8 +725,10 @@ static void cmpc_tablet_handler(struct acpi_device *dev, u32 event)
struct input_dev *inputdev = dev_get_drvdata(&dev->dev); struct input_dev *inputdev = dev_get_drvdata(&dev->dev);
if (event == 0x81) { if (event == 0x81) {
if (ACPI_SUCCESS(cmpc_get_tablet(dev->handle, &val))) if (ACPI_SUCCESS(cmpc_get_tablet(dev->handle, &val))) {
input_report_switch(inputdev, SW_TABLET_MODE, !val); input_report_switch(inputdev, SW_TABLET_MODE, !val);
input_sync(inputdev);
}
} }
} }
...@@ -739,8 +741,10 @@ static void cmpc_tablet_idev_init(struct input_dev *inputdev) ...@@ -739,8 +741,10 @@ static void cmpc_tablet_idev_init(struct input_dev *inputdev)
set_bit(SW_TABLET_MODE, inputdev->swbit); set_bit(SW_TABLET_MODE, inputdev->swbit);
acpi = to_acpi_device(inputdev->dev.parent); acpi = to_acpi_device(inputdev->dev.parent);
if (ACPI_SUCCESS(cmpc_get_tablet(acpi->handle, &val))) if (ACPI_SUCCESS(cmpc_get_tablet(acpi->handle, &val))) {
input_report_switch(inputdev, SW_TABLET_MODE, !val); input_report_switch(inputdev, SW_TABLET_MODE, !val);
input_sync(inputdev);
}
} }
static int cmpc_tablet_add(struct acpi_device *acpi) static int cmpc_tablet_add(struct acpi_device *acpi)
...@@ -760,8 +764,10 @@ static int cmpc_tablet_resume(struct device *dev) ...@@ -760,8 +764,10 @@ static int cmpc_tablet_resume(struct device *dev)
struct input_dev *inputdev = dev_get_drvdata(dev); struct input_dev *inputdev = dev_get_drvdata(dev);
unsigned long long val = 0; unsigned long long val = 0;
if (ACPI_SUCCESS(cmpc_get_tablet(to_acpi_device(dev)->handle, &val))) if (ACPI_SUCCESS(cmpc_get_tablet(to_acpi_device(dev)->handle, &val))) {
input_report_switch(inputdev, SW_TABLET_MODE, !val); input_report_switch(inputdev, SW_TABLET_MODE, !val);
input_sync(inputdev);
}
return 0; return 0;
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment