diff options
Diffstat (limited to 'drivers/platform/x86/classmate-laptop.c')
-rw-r--r-- | drivers/platform/x86/classmate-laptop.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/platform/x86/classmate-laptop.c b/drivers/platform/x86/classmate-laptop.c index 2ca7dd1ab3e4..c87ff16873f9 100644 --- a/drivers/platform/x86/classmate-laptop.c +++ b/drivers/platform/x86/classmate-laptop.c | |||
@@ -350,6 +350,7 @@ static void cmpc_accel_idev_init_v4(struct input_dev *inputdev) | |||
350 | inputdev->close = cmpc_accel_close_v4; | 350 | inputdev->close = cmpc_accel_close_v4; |
351 | } | 351 | } |
352 | 352 | ||
353 | #ifdef CONFIG_PM_SLEEP | ||
353 | static int cmpc_accel_suspend_v4(struct device *dev) | 354 | static int cmpc_accel_suspend_v4(struct device *dev) |
354 | { | 355 | { |
355 | struct input_dev *inputdev; | 356 | struct input_dev *inputdev; |
@@ -384,6 +385,7 @@ static int cmpc_accel_resume_v4(struct device *dev) | |||
384 | 385 | ||
385 | return 0; | 386 | return 0; |
386 | } | 387 | } |
388 | #endif | ||
387 | 389 | ||
388 | static int cmpc_accel_add_v4(struct acpi_device *acpi) | 390 | static int cmpc_accel_add_v4(struct acpi_device *acpi) |
389 | { | 391 | { |
@@ -723,8 +725,10 @@ static void cmpc_tablet_handler(struct acpi_device *dev, u32 event) | |||
723 | struct input_dev *inputdev = dev_get_drvdata(&dev->dev); | 725 | struct input_dev *inputdev = dev_get_drvdata(&dev->dev); |
724 | 726 | ||
725 | if (event == 0x81) { | 727 | if (event == 0x81) { |
726 | if (ACPI_SUCCESS(cmpc_get_tablet(dev->handle, &val))) | 728 | if (ACPI_SUCCESS(cmpc_get_tablet(dev->handle, &val))) { |
727 | input_report_switch(inputdev, SW_TABLET_MODE, !val); | 729 | input_report_switch(inputdev, SW_TABLET_MODE, !val); |
730 | input_sync(inputdev); | ||
731 | } | ||
728 | } | 732 | } |
729 | } | 733 | } |
730 | 734 | ||
@@ -737,8 +741,10 @@ static void cmpc_tablet_idev_init(struct input_dev *inputdev) | |||
737 | set_bit(SW_TABLET_MODE, inputdev->swbit); | 741 | set_bit(SW_TABLET_MODE, inputdev->swbit); |
738 | 742 | ||
739 | acpi = to_acpi_device(inputdev->dev.parent); | 743 | acpi = to_acpi_device(inputdev->dev.parent); |
740 | if (ACPI_SUCCESS(cmpc_get_tablet(acpi->handle, &val))) | 744 | if (ACPI_SUCCESS(cmpc_get_tablet(acpi->handle, &val))) { |
741 | input_report_switch(inputdev, SW_TABLET_MODE, !val); | 745 | input_report_switch(inputdev, SW_TABLET_MODE, !val); |
746 | input_sync(inputdev); | ||
747 | } | ||
742 | } | 748 | } |
743 | 749 | ||
744 | static int cmpc_tablet_add(struct acpi_device *acpi) | 750 | static int cmpc_tablet_add(struct acpi_device *acpi) |
@@ -752,15 +758,19 @@ static int cmpc_tablet_remove(struct acpi_device *acpi, int type) | |||
752 | return cmpc_remove_acpi_notify_device(acpi); | 758 | return cmpc_remove_acpi_notify_device(acpi); |
753 | } | 759 | } |
754 | 760 | ||
761 | #ifdef CONFIG_PM_SLEEP | ||
755 | static int cmpc_tablet_resume(struct device *dev) | 762 | static int cmpc_tablet_resume(struct device *dev) |
756 | { | 763 | { |
757 | struct input_dev *inputdev = dev_get_drvdata(dev); | 764 | struct input_dev *inputdev = dev_get_drvdata(dev); |
758 | 765 | ||
759 | unsigned long long val = 0; | 766 | unsigned long long val = 0; |
760 | 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))) { |
761 | input_report_switch(inputdev, SW_TABLET_MODE, !val); | 768 | input_report_switch(inputdev, SW_TABLET_MODE, !val); |
769 | input_sync(inputdev); | ||
770 | } | ||
762 | return 0; | 771 | return 0; |
763 | } | 772 | } |
773 | #endif | ||
764 | 774 | ||
765 | static SIMPLE_DEV_PM_OPS(cmpc_tablet_pm, NULL, cmpc_tablet_resume); | 775 | static SIMPLE_DEV_PM_OPS(cmpc_tablet_pm, NULL, cmpc_tablet_resume); |
766 | 776 | ||