mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Armin Wolf <W_Armin@gmx.de>
To: hansg@kernel.org, ilpo.jarvinen@linux.intel.com
Cc: platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, i@rsplwe.com,
	rahulbheda131313@gmail.com, kento@kekto.ru, qby140326@gmail.com,
	martiya.ar@gmail.com, vlku.milos.fun@gmail.com,
	mm3885525@gmail.com, wleizc7319@gmail.com
Subject: [PATCH 2/2] platform/x86: bitland-mifs-wmi: Treat WMI_FN_SYSTEM_AC_TYPE as optional
Date: Sat,  5 Sep 2026 00:45:16 +0200	[thread overview]
Message-ID: <20260904224516.8893-3-W_Armin@gmx.de> (raw)
In-Reply-To: <20260904224516.8893-1-W_Armin@gmx.de>

Some systems only support USB-C but can still enter performance mode
if connected to a charger. Such systems usually do not support
WMI_FN_SYSTEM_AC_TYPE, so bitland_check_performance_capability()
currently always fails on them.

Fix this by treating WMI_FN_SYSTEM_AC_TYPE as optional and skip
the AC type check if WMI_FN_SYSTEM_AC_TYPE is not supported.

Tested-by: Martiya Aryan Mehr <martiya.ar@gmail.com>
Signed-off-by: Armin Wolf <W_Armin@gmx.de>
---
 Documentation/wmi/devices/bitland-mifs-wmi.rst | 3 ++-
 drivers/platform/x86/bitland-mifs-wmi.c        | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/Documentation/wmi/devices/bitland-mifs-wmi.rst b/Documentation/wmi/devices/bitland-mifs-wmi.rst
index 314b3fbdda45..27c3fd248279 100644
--- a/Documentation/wmi/devices/bitland-mifs-wmi.rst
+++ b/Documentation/wmi/devices/bitland-mifs-wmi.rst
@@ -214,7 +214,8 @@ Performance Modes
 Changing the performance mode via Command ID 0x08 (SystemPerMode) affects the
 power limits (PL1/PL2) and fan curves managed by the Embedded Controller (EC).
 Note that the "Full-speed" and "Performance" mode (1, 3) is typically only
-available when the system is connected to a DC power source (not USB-C/PD).
+available when the system is connected to a DC power source (not USB-C/PD on
+model with a dedicated DC connector).
 
 In the driver implementation, switch to performance/full-speed mode without
 DC power connected will throw the EOPNOTSUPP error.
diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c
index cdb930eb678d..dd1648b7de77 100644
--- a/drivers/platform/x86/bitland-mifs-wmi.c
+++ b/drivers/platform/x86/bitland-mifs-wmi.c
@@ -246,7 +246,11 @@ static int bitland_check_performance_capability(struct bitland_mifs_wmi_data *da
 		return -EOPNOTSUPP;
 
 	ret = bitland_mifs_wmi_call(data, &input, &output);
-	if (ret)
+	/* Not all systems support this function, do not perform further checks on them */
+	if (ret == -EOPNOTSUPP)
+		return 0;
+
+	if (ret < 0)
 		return ret;
 
 	if (output.data[0] != WMI_SYSTEM_AC_CIRCULARHOLE)
-- 
2.39.5


  parent reply	other threads:[~2026-09-04 22:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-04 22:45 [PATCH 0/2] Fix for platform profile issues on USB-C-only models Armin Wolf
2026-09-04 22:45 ` [PATCH 1/2] platform/x86: bitland-mifs-wmi: Detect failed function calls Armin Wolf
2026-09-04 22:45 ` Armin Wolf [this message]
2026-09-15 11:32 ` [PATCH 0/2] Fix for platform profile issues on USB-C-only models Ilpo Järvinen
2026-09-15 21:26   ` Armin Wolf

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=20260904224516.8893-3-W_Armin@gmx.de \
    --to=w_armin@gmx.de \
    --cc=hansg@kernel.org \
    --cc=i@rsplwe.com \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=kento@kekto.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martiya.ar@gmail.com \
    --cc=mm3885525@gmail.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=qby140326@gmail.com \
    --cc=rahulbheda131313@gmail.com \
    --cc=vlku.milos.fun@gmail.com \
    --cc=wleizc7319@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

all inboxes | Powered by JetHome®