All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Pavel Kossenko (kotekompotek)" <kotekompotek@gmail.com>
To: "Corentin Chary" <corentin.chary@gmail.com>,
	"Luke D . Jones" <luke@ljones.dev>,
	"Denis Benato" <denis.benato@linux.dev>,
	"Hans de Goede" <hansg@kernel.org>,
	"Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	"Pavel Kossenko (kotekompotek)" <kotekompotek@gmail.com>
Subject: [PATCH 2/2] platform/x86: asus-laptop: Add WiMAX rfkill switch for Pegatron Lucid
Date: Sun, 11 Oct 2026 00:38:37 +0500	[thread overview]
Message-ID: <20261010193837.1120-3-kotekompotek@gmail.com> (raw)
In-Reply-To: <20261010193837.1120-1-kotekompotek@gmail.com>

On the Pegatron Lucid the ATK methods ENPR and DAPR enable and disable
a radio selected by an id. The driver exposes ids 0-2 (WLAN, Bluetooth,
WWAN) as the pega-wlan, pega-bt and pega-wwan rfkill switches, but the
DSDT also implements id 6, which drives GPIO27 and the EC bit WMHD:

  If ((Arg0 == 0x06)) { GP27 = Zero; WMHD = Zero; ALED (One) }

The firmware leaves GPIO27 high at boot. On units fitted with an Intel
Centrino Advanced-N + WiMAX 6250 combo card (8086:0087, subsystem
8086:1301) this keeps the whole card in hardware RF-kill, so Wi-Fi is
unusable even though pega-wlan is unblocked:

  iwlwifi 0000:02:00.0: reporting RF_KILL (radio disabled)

The same card works under Windows, presumably because the vendor
utility calls ENPR(6).

Register a "pega-wimax" rfkill switch for id 6. The rfkill core applies
the default unblocked state on registration, which calls ENPR(6) and
releases the card:

  iwlwifi 0000:02:00.0: RF_KILL bit toggled to enable radio.

Assisted-by: Claude Opus 5.5
Signed-off-by: Pavel Kossenko (kotekompotek) <kotekompotek@gmail.com>
---
 drivers/platform/x86/asus-laptop.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/drivers/platform/x86/asus-laptop.c b/drivers/platform/x86/asus-laptop.c
index 8e69f02..ef4c2cc 100644
--- a/drivers/platform/x86/asus-laptop.c
+++ b/drivers/platform/x86/asus-laptop.c
@@ -192,6 +192,7 @@ MODULE_PARM_DESC(als_status, "Set the ALS status on boot "
 #define PEGA_WWAN	0x02
 #define PEGA_ALS	0x04
 #define PEGA_ALS_POWER	0x05
+#define PEGA_WIMAX	0x06
 
 #define METHOD_PEGA_READ	"RDLN"
 #define PEGA_READ_ALS_H	0x02
@@ -1454,6 +1455,17 @@ static int pega_rfkill_init(struct asus_laptop *asus)
 
 	ret = pega_rfkill_setup(asus, &asus->wwan, "pega-wwan",
 				PEGA_WWAN, RFKILL_TYPE_WWAN);
+	if (ret)
+		goto exit;
+
+	/*
+	 * The firmware leaves this line asserted at boot. On units fitted
+	 * with an Intel Centrino Advanced-N + WiMAX 6250 combo card it keeps
+	 * the whole card in hardware RF-kill, Wi-Fi included. Registering
+	 * the switch unblocks it by default, which calls ENPR(6).
+	 */
+	ret = pega_rfkill_setup(asus, &asus->wimax, "pega-wimax",
+				PEGA_WIMAX, RFKILL_TYPE_WIMAX);
 
 exit:
 	if (ret)
-- 
2.47.0.windows.2


  parent reply	other threads:[~2026-10-10 19:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-10 19:38 [PATCH 0/2] platform/x86: asus-laptop: Fix Wi-Fi hard RF-kill on Pegatron Lucid Pavel Kossenko (kotekompotek)
2026-10-10 19:38 ` [PATCH 1/2] platform/x86: asus-laptop: Unregister the wimax rfkill on exit Pavel Kossenko (kotekompotek)
2026-10-19 22:16   ` Denis Benato
2026-10-10 19:38 ` Pavel Kossenko (kotekompotek) [this message]
2026-10-15 13:12   ` [PATCH 2/2] platform/x86: asus-laptop: Add WiMAX rfkill switch for Pegatron Lucid Ilpo Järvinen
2026-10-19 22:21   ` Denis Benato

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=20261010193837.1120-3-kotekompotek@gmail.com \
    --to=kotekompotek@gmail.com \
    --cc=corentin.chary@gmail.com \
    --cc=denis.benato@linux.dev \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luke@ljones.dev \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.