diff options
author | Carlos Alberto Lopez Perez <clopez@igalia.com> | 2012-08-02 13:50:21 -0400 |
---|---|---|
committer | Matthew Garrett <mjg@redhat.com> | 2012-08-17 17:34:42 -0400 |
commit | ad20c73b05ea40cfdb42758506fb6b6befa3c9e5 (patch) | |
tree | 07eeadff66cf83c353d9f3ef115c9530484701c5 /drivers/platform | |
parent | a4f46bb9fa84642e356898ee44b670989622f8bb (diff) |
classmate-laptop: always call input_sync() after input_report_switch()
Due to commit cdda911c34006f1089f3c87b1a1f31ab3a4722f2 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>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/classmate-laptop.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c index cd33add118ce..c87ff16873f9 100644 --- a/drivers/platform/x86/classmate-laptop.c +++ b/drivers/platform/x86/classmate-laptop.c | |||
@@ -725,8 +725,10 @@ static void cmpc_tablet_handler(struct acpi_device *dev, u32 event) | |||
725 | struct input_dev *inputdev = dev_get_drvdata(&dev->dev); | 725 | struct input_dev *inputdev = dev_get_drvdata(&dev->dev); |
726 | 726 | ||
727 | if (event == 0x81) { | 727 | if (event == 0x81) { |
728 | if (ACPI_SUCCESS(cmpc_get_tablet(dev->handle, &val))) | 728 | if (ACPI_SUCCESS(cmpc_get_tablet(dev->handle, &val))) { |
729 | input_report_switch(inputdev, SW_TABLET_MODE, !val); | 729 | input_report_switch(inputdev, SW_TABLET_MODE, !val); |
730 | input_sync(inputdev); | ||
731 | } | ||
730 | } | 732 | } |
731 | } | 733 | } |
732 | 734 | ||
@@ -739,8 +741,10 @@ static void cmpc_tablet_idev_init(struct input_dev *inputdev) | |||
739 | set_bit(SW_TABLET_MODE, inputdev->swbit); | 741 | set_bit(SW_TABLET_MODE, inputdev->swbit); |
740 | 742 | ||
741 | acpi = to_acpi_device(inputdev->dev.parent); | 743 | acpi = to_acpi_device(inputdev->dev.parent); |
742 | if (ACPI_SUCCESS(cmpc_get_tablet(acpi->handle, &val))) | 744 | if (ACPI_SUCCESS(cmpc_get_tablet(acpi->handle, &val))) { |
743 | input_report_switch(inputdev, SW_TABLET_MODE, !val); | 745 | input_report_switch(inputdev, SW_TABLET_MODE, !val); |
746 | input_sync(inputdev); | ||
747 | } | ||
744 | } | 748 | } |
745 | 749 | ||
746 | static int cmpc_tablet_add(struct acpi_device *acpi) | 750 | static int cmpc_tablet_add(struct acpi_device *acpi) |
@@ -760,8 +764,10 @@ static int cmpc_tablet_resume(struct device *dev) | |||
760 | struct input_dev *inputdev = dev_get_drvdata(dev); | 764 | struct input_dev *inputdev = dev_get_drvdata(dev); |
761 | 765 | ||
762 | unsigned long long val = 0; | 766 | unsigned long long val = 0; |
763 | if (ACPI_SUCCESS(cmpc_get_tablet(to_acpi_device(dev)->handle, &val))) | 767 | if (ACPI_SUCCESS(cmpc_get_tablet(to_acpi_device(dev)->handle, &val))) { |
764 | input_report_switch(inputdev, SW_TABLET_MODE, !val); | 768 | input_report_switch(inputdev, SW_TABLET_MODE, !val); |
769 | input_sync(inputdev); | ||
770 | } | ||
765 | return 0; | 771 | return 0; |
766 | } | 772 | } |
767 | #endif | 773 | #endif |