* [PATCH v2] platform/x86: bitland-mifs-wmi: Add Redmi G 2022 (TM2135) quirk
@ 2026-11-12 19:59 Yun Wang
2026-11-12 20:53 ` Ilpo Järvinen
0 siblings, 1 reply; 2+ messages in thread
From: Yun Wang @ 2026-11-12 19:59 UTC (permalink / raw)
To: Hans de Goede, Ilpo Järvinen
Cc: platform-driver-x86, linux-kernel, Mingyou Chen, Ilya Gladyshev,
Armin Wolf, Chris Taraszka, Yu Pan
The Redmi G 2022 (board TM2135, BIOS RMGAD6T0P1313) implements only
three modes: 0x02 for quiet, 0x01 for balanced and 0x03 for performance.
The default profile table maps balanced to 0x00, but this firmware
recognizes it as the performance mode. Because the firmware does not
implement the AC adapter type query, setting balanced-performance or
performance fails with -ENODATA.
Add a DMI entry with a three-entry profile table for this model and
enable skip_ac_type_check. 0x04 is not used for performance: writing it
succeeds and the value reads back as 0x04, but in three test runs on
7.2.11 the firmware did not emit WMI event 0x16, which it emits after
every other mode change. The Fn+K hotkey also cycles only through the
three modes above.
Tested on this machine with this patch and the series it depends on,
built as an out-of-tree module and loaded on a 7.2.14 kernel. Writing
low-power, balanced, and performance succeeds, the profile reads back
correctly, and the firmware emits one 0x16 event for each (values 2, 1,
and 3). Writing balanced-performance is rejected, and Fn+K cycles
through low-power, balanced, and performance.
Claude Code (claude-opus-5-5) analyzed the ACPI tables, wrote the test
scripts, specified the change and corrected this changelog. I wrote the
code and the changelog and ran the tests on this machine.
Link: https://lore.kernel.org/platform-driver-x86/OT2JfRLDi6yHShYvywRZoFBYdW-TUgdKqKtahRM5b0cZxNo6eGZHnO5dKf4oYFaEtZhEsqU-Q-2OFe0D-qToJMVUrS5_d2aa2Q5LD50ISIc=@proton.me/
Link: https://lore.kernel.org/all/BelDdF5woNEBX6dZ3_zJDEbVkifs1pdxEjtQ1yC-aKyZahijFJCllxm0l_SqZ5Hsj61D8wfJNa7uDSuNKmyyxo2S0tZp9QS5yaafeZUxvxE=@proton.me/
Suggested-by: Mingyou Chen <qby140326@gmail.com>
Tested-by: Yu Pan <neko205@aosc.io>
Signed-off-by: Yun Wang <7z0423arsenova@proton.me>
---
Changes in v2:
- Rebased onto review-ilpo-next, which now has Mingyou Chen's merge
series (v16) and Chris Taraszka's Xiaomi Book Pro 14 series. The
TM2135 entries now follow the TM2424 ones; the added lines are the
same as in v1.
- Added Yu Pan's Tested-by.
- Retested with this patch on top of review-ilpo-next, built as an
out-of-tree module and loaded on a 7.4-rc2 based kernel: the results
are the same as described in the changelog.
v1: https://lore.kernel.org/all/20261106143114.95008-1-7z0423arsenova@proton.me/
drivers/platform/x86/bitland-mifs-wmi.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c
index d834168381..3aac9d17ff 100644
--- a/drivers/platform/x86/bitland-mifs-wmi.c
+++ b/drivers/platform/x86/bitland-mifs-wmi.c
@@ -128,6 +128,18 @@ static const struct bitland_mifs_quirks tm2424_quirks = {
.skip_ac_type_check = true,
};
+static const struct bitland_profile_entry tm2135_profile_entries[] = {
+ { PLATFORM_PROFILE_LOW_POWER, 0x02 },
+ { PLATFORM_PROFILE_BALANCED, 0x01 },
+ { PLATFORM_PROFILE_PERFORMANCE, 0x03 },
+};
+
+static const struct bitland_mifs_quirks tm2135_quirks = {
+ .profile_entries = tm2135_profile_entries,
+ .num_profile_entries = ARRAY_SIZE(tm2135_profile_entries),
+ .skip_ac_type_check = true,
+};
+
static const struct dmi_system_id bitland_mifs_dmi_table[] = {
{
.matches = {
@@ -136,6 +148,13 @@ static const struct dmi_system_id bitland_mifs_dmi_table[] = {
},
.driver_data = (void *)&tm2424_quirks,
},
+ {
+ .matches = {
+ DMI_EXACT_MATCH(DMI_SYS_VENDOR, "TIMI"),
+ DMI_EXACT_MATCH(DMI_BOARD_NAME, "TM2135"),
+ },
+ .driver_data = (void *)&tm2135_quirks,
+ },
{}
};
base-commit: 11b27ad8c8078e18b74d0d507180422bfafc962e
--
2.56.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH v2] platform/x86: bitland-mifs-wmi: Add Redmi G 2022 (TM2135) quirk
2026-11-12 19:59 [PATCH v2] platform/x86: bitland-mifs-wmi: Add Redmi G 2022 (TM2135) quirk Yun Wang
@ 2026-11-12 20:53 ` Ilpo Järvinen
0 siblings, 0 replies; 2+ messages in thread
From: Ilpo Järvinen @ 2026-11-12 20:53 UTC (permalink / raw)
To: Yun Wang
Cc: Hans de Goede, platform-driver-x86, LKML, Mingyou Chen,
Ilya Gladyshev, Armin Wolf, Chris Taraszka, Yu Pan
On Thu, 12 Nov 2026, Yun Wang wrote:
> The Redmi G 2022 (board TM2135, BIOS RMGAD6T0P1313) implements only
> three modes: 0x02 for quiet, 0x01 for balanced and 0x03 for performance.
> The default profile table maps balanced to 0x00, but this firmware
> recognizes it as the performance mode. Because the firmware does not
> implement the AC adapter type query, setting balanced-performance or
> performance fails with -ENODATA.
>
> Add a DMI entry with a three-entry profile table for this model and
> enable skip_ac_type_check. 0x04 is not used for performance: writing it
> succeeds and the value reads back as 0x04, but in three test runs on
> 7.2.11 the firmware did not emit WMI event 0x16, which it emits after
> every other mode change. The Fn+K hotkey also cycles only through the
> three modes above.
>
> Tested on this machine with this patch and the series it depends on,
> built as an out-of-tree module and loaded on a 7.2.14 kernel. Writing
> low-power, balanced, and performance succeeds, the profile reads back
> correctly, and the firmware emits one 0x16 event for each (values 2, 1,
> and 3). Writing balanced-performance is rejected, and Fn+K cycles
> through low-power, balanced, and performance.
>
> Claude Code (claude-opus-5-5) analyzed the ACPI tables, wrote the test
> scripts, specified the change and corrected this changelog. I wrote the
> code and the changelog and ran the tests on this machine.
>
> Link: https://lore.kernel.org/platform-driver-x86/OT2JfRLDi6yHShYvywRZoFBYdW-TUgdKqKtahRM5b0cZxNo6eGZHnO5dKf4oYFaEtZhEsqU-Q-2OFe0D-qToJMVUrS5_d2aa2Q5LD50ISIc=@proton.me/
> Link: https://lore.kernel.org/all/BelDdF5woNEBX6dZ3_zJDEbVkifs1pdxEjtQ1yC-aKyZahijFJCllxm0l_SqZ5Hsj61D8wfJNa7uDSuNKmyyxo2S0tZp9QS5yaafeZUxvxE=@proton.me/
> Suggested-by: Mingyou Chen <qby140326@gmail.com>
> Tested-by: Yu Pan <neko205@aosc.io>
> Signed-off-by: Yun Wang <7z0423arsenova@proton.me>
> ---
> Changes in v2:
> - Rebased onto review-ilpo-next, which now has Mingyou Chen's merge
> series (v16) and Chris Taraszka's Xiaomi Book Pro 14 series. The
> TM2135 entries now follow the TM2424 ones; the added lines are the
> same as in v1.
> - Added Yu Pan's Tested-by.
> - Retested with this patch on top of review-ilpo-next, built as an
> out-of-tree module and loaded on a 7.4-rc2 based kernel: the results
> are the same as described in the changelog.
>
> v1: https://lore.kernel.org/all/20261106143114.95008-1-7z0423arsenova@proton.me/
>
> drivers/platform/x86/bitland-mifs-wmi.c | 19 +++++++++++++++++++
> 1 file changed, 19 insertions(+)
>
> diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c
> index d834168381..3aac9d17ff 100644
> --- a/drivers/platform/x86/bitland-mifs-wmi.c
> +++ b/drivers/platform/x86/bitland-mifs-wmi.c
> @@ -128,6 +128,18 @@ static const struct bitland_mifs_quirks tm2424_quirks = {
> .skip_ac_type_check = true,
> };
>
> +static const struct bitland_profile_entry tm2135_profile_entries[] = {
> + { PLATFORM_PROFILE_LOW_POWER, 0x02 },
> + { PLATFORM_PROFILE_BALANCED, 0x01 },
> + { PLATFORM_PROFILE_PERFORMANCE, 0x03 },
> +};
> +
> +static const struct bitland_mifs_quirks tm2135_quirks = {
> + .profile_entries = tm2135_profile_entries,
> + .num_profile_entries = ARRAY_SIZE(tm2135_profile_entries),
> + .skip_ac_type_check = true,
> +};
> +
> static const struct dmi_system_id bitland_mifs_dmi_table[] = {
> {
> .matches = {
> @@ -136,6 +148,13 @@ static const struct dmi_system_id bitland_mifs_dmi_table[] = {
> },
> .driver_data = (void *)&tm2424_quirks,
> },
> + {
> + .matches = {
> + DMI_EXACT_MATCH(DMI_SYS_VENDOR, "TIMI"),
> + DMI_EXACT_MATCH(DMI_BOARD_NAME, "TM2135"),
> + },
> + .driver_data = (void *)&tm2135_quirks,
> + },
Thanks, but I already took v1 resolving the conflict myself. I used the
opposite order than you so that the board names are "increasing".
--
i.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-12 20:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12 19:59 [PATCH v2] platform/x86: bitland-mifs-wmi: Add Redmi G 2022 (TM2135) quirk Yun Wang
2026-11-12 20:53 ` Ilpo Järvinen
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®