summaryrefslogtreecommitdiff
path: root/drivers/platform
diff options
context:
space:
mode:
authorBarnabás Pőcze <pobrn@protonmail.com>2021-02-04 00:56:22 +0300
committerHans de Goede <hdegoede@redhat.com>2021-02-04 12:21:20 +0300
commitb3ed1b7fe3786c8fe795c16ca07cf3bda67b652f (patch)
tree6f8a6c07d07d7516339a129c0a8f0e2da2be97b1 /drivers/platform
parent392cbf0a42777bb08153c76dfd0cb8c575bd6f10 (diff)
downloadlinux-b3ed1b7fe3786c8fe795c16ca07cf3bda67b652f.tar.xz
platform/x86: ideapad-laptop: check for touchpad support in _CFG
Bit 30 of _CFG is set if the device has a touchpad, check that in is_visible() for the touchpad attribute. Show 'touchpad', if supported, in the list of capabilities in the 'cfg' debugfs file. Signed-off-by: Barnabás Pőcze <pobrn@protonmail.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20210203215403.290792-21-pobrn@protonmail.com Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'drivers/platform')
-rw-r--r--drivers/platform/x86/ideapad-laptop.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index d63c19fb5569..f3d950c7fc01 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -41,10 +41,11 @@ static const char *const ideapad_wmi_fnesc_events[] = {
#endif
enum {
- CFG_CAP_BT_BIT = 16,
- CFG_CAP_3G_BIT = 17,
- CFG_CAP_WIFI_BIT = 18,
- CFG_CAP_CAM_BIT = 19,
+ CFG_CAP_BT_BIT = 16,
+ CFG_CAP_3G_BIT = 17,
+ CFG_CAP_WIFI_BIT = 18,
+ CFG_CAP_CAM_BIT = 19,
+ CFG_CAP_TOUCHPAD_BIT = 30,
};
enum {
@@ -337,6 +338,8 @@ static int debugfs_cfg_show(struct seq_file *s, void *data)
seq_printf(s, "Wireless ");
if (test_bit(CFG_CAP_CAM_BIT, &priv->cfg))
seq_printf(s, "Camera ");
+ if (test_bit(CFG_CAP_TOUCHPAD_BIT, &priv->cfg))
+ seq_printf(s, "Touchpad ");
seq_printf(s, "\nGraphic: ");
switch ((priv->cfg)&0x700) {
case 0x100:
@@ -579,7 +582,8 @@ static umode_t ideapad_is_visible(struct kobject *kobj,
else if (attr == &dev_attr_fn_lock.attr)
supported = priv->features.fn_lock;
else if (attr == &dev_attr_touchpad.attr)
- supported = priv->features.touchpad_ctrl_via_ec;
+ supported = priv->features.touchpad_ctrl_via_ec &&
+ test_bit(CFG_CAP_TOUCHPAD_BIT, &priv->cfg);
return supported ? attr->mode : 0;
}