From: Brian Mak <bmak@nvidia.com>
To: "Hans de Goede" <hansg@kernel.org>,
"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: "David Cemin" <dcemin@nvidia.com>,
"Lucas De Marchi" <ldemarchi@nvidia.com>,
"Kurt Borja" <kuurtb@gmail.com>,
"Stuart Hayes" <stuart.w.hayes@gmail.com>,
"Matthew Garrett" <mjg59@srcf.ucam.org>,
"Pali Rohár" <pali@kernel.org>,
"Lyndon Sanche" <lsanche@lyndeno.ca>,
"Armin Wolf" <W_Armin@gmx.de>,
"Prasanth Ksr" <prasanth.ksr@dell.com>,
"Jonathan Corbet" <corbet@lwn.net>,
"Shuah Khan" <skhan@linuxfoundation.org>,
"Randy Dunlap" <rdunlap@infradead.org>,
platform-driver-x86@vger.kernel.org, Dell.Client.Kernel@dell.com,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
"Brian Mak" <bmak@nvidia.com>
Subject: [PATCH v2 05/10] platform: dell: laptop: Compile out i8042 usage without SERIO_I8042
Date: Mon, 23 Nov 2026 15:08:56 -0800 [thread overview]
Message-ID: <20261123230905.13899-6-bmak@nvidia.com> (raw)
In-Reply-To: <20261123230905.13899-1-bmak@nvidia.com>
dell-laptop uses the i8042 controller for two things: controlling the
touchpad LED on certain models and receiving rfkill hotkey events when
dell-rbtn is not available. When SERIO_I8042 is disabled, the i8042
stubs return -ENODEV, and neither path handles that gracefully:
- The touchpad LED is registered anyway, and writes to it do nothing.
- On Latitude and Precision models with a hardware rfkill switch and
no dell-rbtn, i8042_install_filter() fails, and dell-laptop fails to
load entirely.
Only register the touchpad LED when SERIO_I8042 is enabled. When
neither dell-rbtn nor i8042 is available, skip rfkill instead of
failing to load, since there would be no way to track the hardware
switch state. Clear the rfkill pointers after unwinding so that
dell_cleanup_rfkill() does not free them again.
This prepares for dropping the hard SERIO_I8042 dependency, so that
dell-laptop can be built on platforms without an i8042 controller, such
as ARM64.
Signed-off-by: Brian Mak <bmak@nvidia.com>
---
drivers/platform/dell/dell-laptop.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/drivers/platform/dell/dell-laptop.c b/drivers/platform/dell/dell-laptop.c
index 89e85c7f7132..514449fa6e05 100644
--- a/drivers/platform/dell/dell-laptop.c
+++ b/drivers/platform/dell/dell-laptop.c
@@ -892,13 +892,17 @@ static int __init dell_setup_rfkill(void)
} else if (ret != -ENODEV) {
pr_warn("Unable to register dell rbtn notifier\n");
goto err_filter;
- } else {
+ } else if (IS_ENABLED(CONFIG_SERIO_I8042)) {
ret = i8042_install_filter(dell_laptop_i8042_filter, NULL);
if (ret) {
pr_warn("Unable to install key filter\n");
goto err_filter;
}
pr_info("Using i8042 filter function for receiving events\n");
+ } else {
+ pr_info("No source for receiving events, rfkill disabled\n");
+ ret = 0;
+ goto err_filter;
}
return 0;
@@ -915,6 +919,9 @@ static int __init dell_setup_rfkill(void)
rfkill_unregister(wifi_rfkill);
err_wifi:
rfkill_destroy(wifi_rfkill);
+ wifi_rfkill = NULL;
+ bluetooth_rfkill = NULL;
+ wwan_rfkill = NULL;
return ret;
}
@@ -1014,6 +1021,11 @@ static void touchpad_led_exit(void)
led_classdev_unregister(&touchpad_led);
}
+static bool dell_has_touchpad_led(void)
+{
+ return IS_ENABLED(CONFIG_SERIO_I8042) && quirks && quirks->touchpad_led;
+}
+
/*
* Derived from information in smbios-keyboard-ctl:
*
@@ -2487,7 +2499,7 @@ static int __init dell_init(void)
goto fail_rfkill;
}
- if (quirks && quirks->touchpad_led)
+ if (dell_has_touchpad_led())
touchpad_led_init(&platform_device->dev);
kbd_led_init(&platform_device->dev);
@@ -2564,7 +2576,7 @@ static int __init dell_init(void)
debugfs_remove_recursive(dell_laptop_dir);
dell_battery_exit();
kbd_led_exit();
- if (quirks && quirks->touchpad_led)
+ if (dell_has_touchpad_led())
touchpad_led_exit();
dell_cleanup_rfkill();
fail_rfkill:
@@ -2581,7 +2593,7 @@ static void __exit dell_exit(void)
{
dell_laptop_unregister_notifier(&dell_laptop_notifier);
debugfs_remove_recursive(dell_laptop_dir);
- if (quirks && quirks->touchpad_led)
+ if (dell_has_touchpad_led())
touchpad_led_exit();
kbd_led_exit();
dell_battery_exit();
--
2.53.0
next prev parent reply other threads:[~2026-11-23 23:10 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-23 23:08 [PATCH v2 00/10] platform: dell: Move out of x86 and support Dell XPS 16 Creator Edition Brian Mak
2026-11-23 23:08 ` [PATCH v2 01/10] platform/x86: dell: Make uart-backlight x86 only Brian Mak
2026-11-23 23:08 ` [PATCH v2 02/10] platform/x86: dell: dcdbas: Add missing kernel-doc descriptions Brian Mak
2026-11-23 23:08 ` [PATCH v2 03/10] platform: dell: Move out of x86 directory Brian Mak
2026-11-23 23:08 ` [PATCH v2 04/10] MAINTAINERS: Add Dell platform drivers entry Brian Mak
2026-11-23 23:08 ` Brian Mak [this message]
2026-11-23 23:08 ` [PATCH v2 06/10] platform: dell: Allow DELL_LAPTOP to be arch-independent Brian Mak
2026-11-23 23:08 ` [PATCH v2 07/10] platform: dell: smbios-wmi: Fix probe on RTX Spark Brian Mak
2026-11-23 23:08 ` [PATCH v2 08/10] platform: dell: smbios: Add quirk for non-functional calling interface Brian Mak
2026-11-23 23:09 ` [PATCH v2 09/10] platform: dell: laptop: Don't load if SMBIOS calls are non-functional Brian Mak
2026-11-23 23:09 ` [PATCH v2 10/10] platform: dell: pc: " Brian Mak
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=20261123230905.13899-6-bmak@nvidia.com \
--to=bmak@nvidia.com \
--cc=Dell.Client.Kernel@dell.com \
--cc=W_Armin@gmx.de \
--cc=corbet@lwn.net \
--cc=dcemin@nvidia.com \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=kuurtb@gmail.com \
--cc=ldemarchi@nvidia.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lsanche@lyndeno.ca \
--cc=mjg59@srcf.ucam.org \
--cc=pali@kernel.org \
--cc=platform-driver-x86@vger.kernel.org \
--cc=prasanth.ksr@dell.com \
--cc=rdunlap@infradead.org \
--cc=skhan@linuxfoundation.org \
--cc=stuart.w.hayes@gmail.com \
/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