mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mingyou Chen <qby140326@gmail.com>
To: "Miloš Vlku" <vlku.milos.fun@gmail.com>,
	ilpo.jarvinen@linux.intel.com, hansg@kernel.org
Cc: platform-driver-x86@vger.kernel.org,
	linux-kernel@vger.kernel.org, ilya.gladyshev@linux.dev,
	uselessfire@gmail.com
Subject: Re: [PATCH] platform/x86: bitland-mifs-wmi: Add Xiaomi Redmi Book Pro 14 2024
Date: Sat, 28 Nov 2026 21:31:21 +0800	[thread overview]
Message-ID: <935e17b4-6053-43f5-b384-c5c9952ecd14@gmail.com> (raw)
In-Reply-To: <20261128074912.20008-1-vlku.milos.fun@gmail.com>

On 11/28/26 15:49, Miloš Vlku wrote:
> The Redmi Book Pro 14 2024 (board TM2307) uses the same WMAA method
> (SSDT with OEM Table ID XMCC1806) as the Redmi Book Pro 16 2024 (TM2309)
> and stores the WMI_FN_SYSTEM_PER_MODE value directly in the EC register
> QFAN. NTDP in the DSDT maps it onto the DPTF variable ODV1:
>
>    QFAN  mode        ODV1
>    1     balanced    0
>    2     quiet       2
>    3     Turbo       1
>    4     full speed  4
>
> Map these as low-power 2, balanced 1, performance 3 and max-power 4.
> Fn+K only cycles 1 -> 3 -> 2 and never offers full speed, and
> power-profiles-daemon maps its "performance" profile to platform_profile
> "performance", so full speed is exposed as max-power and is only used
> when chosen explicitly.
>
> GET returns QFAN for 1..4 and 0 for anything else, for example a 0 left
> by the default mapping, so read 0 back as balanced. Writing 0 is not
> useful: from the same 80 C start at the same power, the package cooled
> by 15.2 C in 150 s at QFAN 0 against 29.5 C at QFAN 1 (n=4 each, no
> overlap).
>
> The firmware also accepts Turbo on battery (QFAN 3 sticks with no
> charger connected), so add a battery entry for it. WMI_FN_SYSTEM_AC_TYPE
> is not implemented on this firmware, so skip the AC type check as for
> the other Xiaomi models.
>
> Values measured on BIOS RMAMT4B0P0B0B (bios_release and
> ec_firmware_release 1.11).
>
> This change was prepared with an AI coding assistant (Claude, by
> Anthropic), which read the ACPI tables and driver code and drafted the
> patch. The values and behaviour were measured on the hardware by the
> submitter.
>
> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Hi, please make sure the commits are signed by humans.

https://docs.kernel.org/process/coding-assistants.html

Replace with Assisted-by tag instead.

> Signed-off-by: Miloš Vlku <vlku.milos.fun@gmail.com>
> ---
>
> Notes:
>      Tested on the TM2307 on top of pdx86 for-next (61c0dac952b9), built for
>      7.3.6 for the hardware test: all four profiles apply and read back as
>      expected on AC and on battery, a stale QFAN of 0 reads back as balanced,
>      and power-profiles-daemon's power-saver/balanced/performance map to
>      QFAN 2/1/3. Builds cleanly in-tree with W=1.
>      
>      Anton: when we compared tables in October, the TM2309 matched these on
>      every point, so the same entry should fit with a second DMI match on
>      board_name TM2309. Happy to add it here if you can test it, or for you
>      to send it on top.
>
>   drivers/platform/x86/bitland-mifs-wmi.c | 23 +++++++++++++++++++++++
>   1 file changed, 23 insertions(+)
>
> diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c
> index f71c93aff..9bf705d4e 100644
> --- a/drivers/platform/x86/bitland-mifs-wmi.c
> +++ b/drivers/platform/x86/bitland-mifs-wmi.c
> @@ -139,6 +139,22 @@ static const struct bitland_mifs_quirks tm2135_quirks = {
>   	.skip_ac_type_check = true,
>   };
>   
> +/* GET reports 0 for an out-of-range QFAN value; treat it as balanced. */
Please remove the AI slop comment.
> +static const struct bitland_profile_entry tm2307_profile_entries[] = {
> +	{ PLATFORM_PROFILE_LOW_POWER,	0x02 },
> +	{ PLATFORM_PROFILE_BALANCED,	0x01 },
> +	{ PLATFORM_PROFILE_BALANCED,	0x00, .no_set = true },
> +	{ PLATFORM_PROFILE_PERFORMANCE,	0x03 },
> +	{ PLATFORM_PROFILE_PERFORMANCE,	0x03, .battery = true },
> +	{ PLATFORM_PROFILE_MAX_POWER,	0x04 },
> +};
> +
> +static const struct bitland_mifs_quirks tm2307_quirks = {
> +	.profile_entries = tm2307_profile_entries,
> +	.num_profile_entries = ARRAY_SIZE(tm2307_profile_entries),
> +	.skip_ac_type_check = true,
> +};
> +
>   static const struct bitland_profile_entry tm2424_profile_entries[] = {
>   	{ PLATFORM_PROFILE_LOW_POWER,   0x02 },
>   	{ PLATFORM_PROFILE_LOW_POWER,   0x0a, true },
> @@ -169,6 +185,13 @@ static const struct dmi_system_id bitland_mifs_dmi_table[] = {
>   		},
>   		.driver_data = (void *)&tm2135_quirks,
>   	},
> +	{
> +		.matches = {
> +			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "XIAOMI"),
> +			DMI_EXACT_MATCH(DMI_BOARD_NAME, "TM2307"),
> +		},
> +		.driver_data = (void *)&tm2307_quirks,
> +	},
>   	{
>   		.matches = {
>   			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "XIAOMI"),

      reply	other threads:[~2026-11-28 13:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-28  7:49 Miloš Vlku
2026-11-28 13:31 ` Mingyou Chen [this message]

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=935e17b4-6053-43f5-b384-c5c9952ecd14@gmail.com \
    --to=qby140326@gmail.com \
    --cc=hansg@kernel.org \
    --cc=ilpo.jarvinen@linux.intel.com \
    --cc=ilya.gladyshev@linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=uselessfire@gmail.com \
    --cc=vlku.milos.fun@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®