diff options
author | Hans de Goede <hdegoede@redhat.com> | 2014-07-18 06:21:47 -0400 |
---|---|---|
committer | Matthew Garrett <matthew.garrett@nebula.com> | 2014-08-16 04:23:54 -0400 |
commit | f79a901331a823ae370584b15cd39dd110b95a0a (patch) | |
tree | 2acefae31f55da03b4e2d7eed1c50f2f44d351a3 /drivers/platform | |
parent | 6d6ded3bdb0ed6f65d1f58d5d84971f6b3a39b70 (diff) |
ideapad-laptop: Disable touchpad interface on Yoga models
Yoga models don't offer touchpad ctrl through the ideapad interface, causing
ideapad_sync_touchpad_state to send wrong touchpad enable/disable events.
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Matthew Garrett <matthew.garrett@nebula.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r-- | drivers/platform/x86/ideapad-laptop.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c index b0e3a2eef0ac..84641877df28 100644 --- a/drivers/platform/x86/ideapad-laptop.c +++ b/drivers/platform/x86/ideapad-laptop.c | |||
@@ -88,6 +88,7 @@ struct ideapad_private { | |||
88 | struct dentry *debug; | 88 | struct dentry *debug; |
89 | unsigned long cfg; | 89 | unsigned long cfg; |
90 | bool has_hw_rfkill_switch; | 90 | bool has_hw_rfkill_switch; |
91 | bool has_touchpad_control; | ||
91 | }; | 92 | }; |
92 | 93 | ||
93 | static bool no_bt_rfkill; | 94 | static bool no_bt_rfkill; |
@@ -766,6 +767,9 @@ static void ideapad_sync_touchpad_state(struct ideapad_private *priv) | |||
766 | { | 767 | { |
767 | unsigned long value; | 768 | unsigned long value; |
768 | 769 | ||
770 | if (!priv->has_touchpad_control) | ||
771 | return; | ||
772 | |||
769 | /* Without reading from EC touchpad LED doesn't switch state */ | 773 | /* Without reading from EC touchpad LED doesn't switch state */ |
770 | if (!read_ec_data(priv->adev->handle, VPCCMD_R_TOUCHPAD, &value)) { | 774 | if (!read_ec_data(priv->adev->handle, VPCCMD_R_TOUCHPAD, &value)) { |
771 | /* Some IdeaPads don't really turn off touchpad - they only | 775 | /* Some IdeaPads don't really turn off touchpad - they only |
@@ -840,6 +844,28 @@ static struct dmi_system_id no_hw_rfkill_list[] = { | |||
840 | {} | 844 | {} |
841 | }; | 845 | }; |
842 | 846 | ||
847 | /* | ||
848 | * Some models don't offer touchpad ctrl through the ideapad interface, causing | ||
849 | * ideapad_sync_touchpad_state to send wrong touchpad enable/disable events. | ||
850 | */ | ||
851 | static struct dmi_system_id no_touchpad_ctrl_list[] = { | ||
852 | { | ||
853 | .ident = "Lenovo Yoga 1 series", | ||
854 | .matches = { | ||
855 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
856 | DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo IdeaPad Yoga"), | ||
857 | }, | ||
858 | }, | ||
859 | { | ||
860 | .ident = "Lenovo Yoga 2 11 / 13 / Pro", | ||
861 | .matches = { | ||
862 | DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), | ||
863 | DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo Yoga 2"), | ||
864 | }, | ||
865 | }, | ||
866 | {} | ||
867 | }; | ||
868 | |||
843 | static int ideapad_acpi_add(struct platform_device *pdev) | 869 | static int ideapad_acpi_add(struct platform_device *pdev) |
844 | { | 870 | { |
845 | int ret, i; | 871 | int ret, i; |
@@ -863,6 +889,7 @@ static int ideapad_acpi_add(struct platform_device *pdev) | |||
863 | priv->adev = adev; | 889 | priv->adev = adev; |
864 | priv->platform_device = pdev; | 890 | priv->platform_device = pdev; |
865 | priv->has_hw_rfkill_switch = !dmi_check_system(no_hw_rfkill_list); | 891 | priv->has_hw_rfkill_switch = !dmi_check_system(no_hw_rfkill_list); |
892 | priv->has_touchpad_control = !dmi_check_system(no_touchpad_ctrl_list); | ||
866 | 893 | ||
867 | ret = ideapad_sysfs_init(priv); | 894 | ret = ideapad_sysfs_init(priv); |
868 | if (ret) | 895 | if (ret) |