mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v4] platform/x86: bitland-mifs-wmi: Fix TM2107 profile handling
@ 2026-10-22 15:02 Matias Civadda
  2026-10-23 14:13 ` Mingyou Chen
  0 siblings, 1 reply; 2+ messages in thread
From: Matias Civadda @ 2026-10-22 15:02 UTC (permalink / raw)
  To: platform-driver-x86
  Cc: linux-kernel, qby140326, ilya.gladyshev, ilpo.jarvinen, hansg,
	chris, Matias Civadda

The TIMI Redmi Book Pro 14 2022 (TM2107) stores the MIFS WMI return
code at the end of the response and uses different profile values:
0 for performance, 1 for balanced and 2 for low power.

Add a DMI entry using the existing quirks infrastructure to select
the correct response layout and profile mapping.

Skip the adapter-type query on this model to allow performance mode
with its USB-C charger, while retaining the external-power check.

Signed-off-by: Matias Civadda <matias.civadda2342001@gmail.com>
---
This patch applies on top of all patches of Mingyou Chen's v13
series:
https://lore.kernel.org/all/20261021123414.25516-1-qby140326@gmail.com/

Changes in v4:
- Rebase onto Mingyou Chen's complete v13 series.
- Drop the separate payload copy fix, which is included in v13.

 drivers/platform/x86/bitland-mifs-wmi.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c
index a4c341ffbb9b..59b930ef8729 100644
--- a/drivers/platform/x86/bitland-mifs-wmi.c
+++ b/drivers/platform/x86/bitland-mifs-wmi.c
@@ -116,7 +116,28 @@ static const struct bitland_mifs_quirks default_quirks = {
 	.num_profile_entries = ARRAY_SIZE(default_profile_entries),
 };
 
+static const struct bitland_profile_entry tm2107_profile_entries[] = {
+	{ PLATFORM_PROFILE_LOW_POWER,   2 },
+	{ PLATFORM_PROFILE_BALANCED,    1 },
+	{ PLATFORM_PROFILE_PERFORMANCE, 0 },
+};
+
+static const struct bitland_mifs_quirks tm2107_quirks = {
+	.profile_entries = tm2107_profile_entries,
+	.num_profile_entries = ARRAY_SIZE(tm2107_profile_entries),
+	.return_code_at_end = true,
+	.skip_ac_type_check = true,
+};
+
 static const struct dmi_system_id bitland_mifs_dmi_table[] = {
+	{
+		.matches = {
+			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "TIMI"),
+			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Redmi Book Pro 14 2022"),
+			DMI_EXACT_MATCH(DMI_BOARD_NAME, "TM2107"),
+		},
+		.driver_data = (void *)&tm2107_quirks,
+	},
 	{}
 };
 

base-commit: 893018d51f27ec0449155b0afe371aaf65380630
prerequisite-patch-id: 99b10cd2b70d630ab65d8a8bb02c1d4bf89b1a63
prerequisite-patch-id: 27db041f827872b8be142c310a14c79962154bd5
prerequisite-patch-id: 74fc3298fa3dceb2224dfc3d2ae4cc6d4be61c01
prerequisite-patch-id: 2bbb1371b506f5a07a1e6e69d34217195cd5ffcb
prerequisite-patch-id: b88e60d7915ad055b67478359bd9c6c9482d8433
prerequisite-patch-id: 2fe8c043993034f1a2cde98b1b2e299987d5ac7f
prerequisite-patch-id: fbf70405992dfa75ed02026d97aa16e1644fbd42
-- 
2.56.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH v4] platform/x86: bitland-mifs-wmi: Fix TM2107 profile handling
  2026-10-22 15:02 [PATCH v4] platform/x86: bitland-mifs-wmi: Fix TM2107 profile handling Matias Civadda
@ 2026-10-23 14:13 ` Mingyou Chen
  0 siblings, 0 replies; 2+ messages in thread
From: Mingyou Chen @ 2026-10-23 14:13 UTC (permalink / raw)
  To: Matias Civadda, platform-driver-x86
  Cc: linux-kernel, ilya.gladyshev, ilpo.jarvinen, hansg, chris

On 10/22/26 23:02, Matias Civadda wrote:
> The TIMI Redmi Book Pro 14 2022 (TM2107) stores the MIFS WMI return
> code at the end of the response and uses different profile values:
> 0 for performance, 1 for balanced and 2 for low power.
>
> Add a DMI entry using the existing quirks infrastructure to select
> the correct response layout and profile mapping.
>
> Skip the adapter-type query on this model to allow performance mode
> with its USB-C charger, while retaining the external-power check.
>
> Signed-off-by: Matias Civadda <matias.civadda2342001@gmail.com>
> ---
> This patch applies on top of all patches of Mingyou Chen's v13
> series:
> https://lore.kernel.org/all/20261021123414.25516-1-qby140326@gmail.com/
>
> Changes in v4:
> - Rebase onto Mingyou Chen's complete v13 series.
> - Drop the separate payload copy fix, which is included in v13.
>
>   drivers/platform/x86/bitland-mifs-wmi.c | 21 +++++++++++++++++++++
>   1 file changed, 21 insertions(+)
>
> diff --git a/drivers/platform/x86/bitland-mifs-wmi.c b/drivers/platform/x86/bitland-mifs-wmi.c
> index a4c341ffbb9b..59b930ef8729 100644
> --- a/drivers/platform/x86/bitland-mifs-wmi.c
> +++ b/drivers/platform/x86/bitland-mifs-wmi.c
> @@ -116,7 +116,28 @@ static const struct bitland_mifs_quirks default_quirks = {
>   	.num_profile_entries = ARRAY_SIZE(default_profile_entries),
>   };
>   
> +static const struct bitland_profile_entry tm2107_profile_entries[] = {
> +	{ PLATFORM_PROFILE_LOW_POWER,   2 },
> +	{ PLATFORM_PROFILE_BALANCED,    1 },
> +	{ PLATFORM_PROFILE_PERFORMANCE, 0 },
> +};
> +
> +static const struct bitland_mifs_quirks tm2107_quirks = {
> +	.profile_entries = tm2107_profile_entries,
> +	.num_profile_entries = ARRAY_SIZE(tm2107_profile_entries),
> +	.return_code_at_end = true,
> +	.skip_ac_type_check = true,
> +};
> +
>   static const struct dmi_system_id bitland_mifs_dmi_table[] = {
> +	{
> +		.matches = {
> +			DMI_EXACT_MATCH(DMI_SYS_VENDOR, "TIMI"),
> +			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "Redmi Book Pro 14 2022"),
> +			DMI_EXACT_MATCH(DMI_BOARD_NAME, "TM2107"),
> +		},
> +		.driver_data = (void *)&tm2107_quirks,
> +	},
>   	{}
>   };
Reviewed-by: Mingyou Chen <qby140326@gmail.com>
>   
>
> base-commit: 893018d51f27ec0449155b0afe371aaf65380630
> prerequisite-patch-id: 99b10cd2b70d630ab65d8a8bb02c1d4bf89b1a63
> prerequisite-patch-id: 27db041f827872b8be142c310a14c79962154bd5
> prerequisite-patch-id: 74fc3298fa3dceb2224dfc3d2ae4cc6d4be61c01
> prerequisite-patch-id: 2bbb1371b506f5a07a1e6e69d34217195cd5ffcb
> prerequisite-patch-id: b88e60d7915ad055b67478359bd9c6c9482d8433
> prerequisite-patch-id: 2fe8c043993034f1a2cde98b1b2e299987d5ac7f
> prerequisite-patch-id: fbf70405992dfa75ed02026d97aa16e1644fbd42

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-10-23 14:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-22 15:02 [PATCH v4] platform/x86: bitland-mifs-wmi: Fix TM2107 profile handling Matias Civadda
2026-10-23 14:13 ` Mingyou Chen

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®