classmate-laptop: always call input_sync() after input_report_switch()
Due to commit cdda911c34
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: Carlos Alberto Lopez Perez <clopez@igalia.com>
Signed-off-by: Matthew Garrett <mjg@redhat.com>
This commit is contained in:
parent
a4f46bb9fa
commit
ad20c73b05
|
@ -725,8 +725,10 @@ static void cmpc_tablet_handler(struct acpi_device *dev, u32 event)
|
|||
struct input_dev *inputdev = dev_get_drvdata(&dev->dev);
|
||||
|
||||
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_sync(inputdev);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -739,8 +741,10 @@ static void cmpc_tablet_idev_init(struct input_dev *inputdev)
|
|||
set_bit(SW_TABLET_MODE, inputdev->swbit);
|
||||
|
||||
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_sync(inputdev);
|
||||
}
|
||||
}
|
||||
|
||||
static int cmpc_tablet_add(struct acpi_device *acpi)
|
||||
|
@ -760,8 +764,10 @@ static int cmpc_tablet_resume(struct device *dev)
|
|||
struct input_dev *inputdev = dev_get_drvdata(dev);
|
||||
|
||||
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_sync(inputdev);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue