X86 platform drivers
 help / color / mirror / Atom feed
From: "Barnabás Pőcze" <pobrn@protonmail.com>
To: platform-driver-x86@vger.kernel.org,
	Hans de Goede <hdegoede@redhat.com>,
	Mark Gross <mgross@linux.intel.com>,
	Ike Panhc <ike.pan@canonical.com>
Subject: [PATCH 15/24] platform/x86: ideapad-laptop: check for touchpad support in _CFG
Date: Wed, 16 Dec 2020 01:40:08 +0000	[thread overview]
Message-ID: <20201216013857.360987-16-pobrn@protonmail.com> (raw)

Bit 31 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>

diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c
index 8a654ac0546c..1e11d5d9cd20 100644
--- a/drivers/platform/x86/ideapad-laptop.c
+++ b/drivers/platform/x86/ideapad-laptop.c
@@ -39,10 +39,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 = 31,
 };
 
 enum {
@@ -317,6 +318,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:
@@ -556,6 +559,8 @@ static umode_t ideapad_is_visible(struct kobject *kobj,
 		supported = test_bit(CFG_CAP_CAM_BIT, &priv->cfg);
 	else if (attr == &dev_attr_fan_mode.attr)
 		supported = priv->features.fan_mode;
+	else if (attr == &dev_attr_touchpad.attr)
+		supported = test_bit(CFG_CAP_TOUCHPAD_BIT, &priv->cfg);
 	else if (attr == &dev_attr_conservation_mode.attr)
 		supported = priv->features.conservation_mode;
 	else if (attr == &dev_attr_fn_lock.attr)
-- 
2.29.2



                 reply	other threads:[~2020-12-16  1:40 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201216013857.360987-16-pobrn@protonmail.com \
    --to=pobrn@protonmail.com \
    --cc=hdegoede@redhat.com \
    --cc=ike.pan@canonical.com \
    --cc=mgross@linux.intel.com \
    --cc=platform-driver-x86@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox