linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elia Devito <eliadevito@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: mario.limonciello@dell.com, Elia Devito <eliadevito@gmail.com>,
	Alex Hung <alex.hung@canonical.com>,
	Hans de Goede <hdegoede@redhat.com>,
	Mark Gross <mgross@linux.intel.com>,
	platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH 2/3] intel-hid: add option to enable/disable switches
Date: Tue,  1 Dec 2020 20:56:16 +0100	[thread overview]
Message-ID: <20201201195615.22461-1-eliadevito@gmail.com> (raw)

Add option to force enable/disable switches support.

Signed-off-by: Elia Devito <eliadevito@gmail.com>
---
 drivers/platform/x86/intel-hid.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/platform/x86/intel-hid.c b/drivers/platform/x86/intel-hid.c
index 5093c57102cf..54f5cbfd2189 100644
--- a/drivers/platform/x86/intel-hid.c
+++ b/drivers/platform/x86/intel-hid.c
@@ -147,6 +147,10 @@ static const char *intel_hid_dsm_fn_to_method[INTEL_HID_DSM_FN_MAX] = {
 
 static unsigned long long intel_hid_dsm_fn_mask;
 static guid_t intel_dsm_guid;
+static int tablet_mode_switch = -1;
+
+module_param(tablet_mode_switch, int, 0444);
+MODULE_PARM_DESC(tablet_mode_switch, "Enable/Disable tablet mode switch (0:disable, 1:enable)");
 
 static bool intel_hid_execute_method(acpi_handle handle,
 				     enum intel_hid_dsm_fn_codes fn_index,
@@ -507,9 +511,14 @@ static bool intel_button_array_has_switches(struct platform_device *device)
 	acpi_handle handle = ACPI_HANDLE(&device->dev);
 	unsigned long long vgbs;
 
-	if (!dmi_check_system(button_array_switches_table))
+	if (tablet_mode_switch == 0)
 		return false;
 
+	if (tablet_mode_switch != 1) {
+		if (!dmi_check_system(button_array_switches_table))
+			return false;
+	}
+
 	if (!intel_hid_evaluate_method(handle, INTEL_HID_DSM_VGBS_FN, &vgbs))
 		return false;
 
-- 
2.28.0


                 reply	other threads:[~2020-12-01 19:57 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=20201201195615.22461-1-eliadevito@gmail.com \
    --to=eliadevito@gmail.com \
    --cc=alex.hung@canonical.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mario.limonciello@dell.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;
as well as URLs for NNTP newsgroup(s).