* [PATCH RFC v2 0/2] platform/x86: alienware-wmi-wmax: Extend support to many devices
@ 2025-03-09 5:13 Kurt Borja
2025-03-09 5:13 ` [PATCH RFC v2 1/2] platform/x86: wmi: Add wmidev_get_acpi_device_uid() Kurt Borja
2025-03-09 5:13 ` [PATCH RFC v2 2/2] platform/x86: alienware-wmi-wmax: Check for AWCC support using _UID Kurt Borja
0 siblings, 2 replies; 5+ messages in thread
From: Kurt Borja @ 2025-03-09 5:13 UTC (permalink / raw)
To: Armin Wolf, Hans de Goede, Ilpo Järvinen
Cc: platform-driver-x86, linux-kernel, Dell.Client.Kernel, Kurt Borja
Hi all,
After a few months of searching for acpidumps of elegible laptops, I
came to the conclusion that if I continue this way, many devices will
never get support for this interface. This is due to very few users
uploading acpidumps of their machines or contacting me of that matter.
With this patchset, hopefully all (or almost all) elegible devices will
get support.
I'm submitting this as an RFC because I'm extending the WMI API and also
extending support to many unknown laptops models.
This depends on
platform/x86: alienware-wmi-wmax: HWMON support + DebugFS + Improvements
series, because I made a few generalizations there that work even for
Alienware desktops.
I sent a v2 right away because I made some silly mistakes. Sorry for the
noise.
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
---
Changes in v2:
[1/2]
- Add kernel-doc to wmidev_get_acpi_device_uid()
[2/2]
- Reworked logic a bit to include a check for !uid before calling
strncmp()
Link to v1: https://lore.kernel.org/r/20250308-awcc-uid-v1-0-6360892d8b95@gmail.com
---
Kurt Borja (2):
platform/x86: wmi: Add wmidev_get_acpi_device_uid()
platform/x86: alienware-wmi-wmax: Check for AWCC support using _UID
drivers/platform/x86/dell/alienware-wmi-wmax.c | 15 +++++++++------
drivers/platform/x86/wmi.c | 20 +++++++++++++++++---
include/linux/wmi.h | 2 ++
3 files changed, 28 insertions(+), 9 deletions(-)
---
base-commit: e57eabe2fb044950e6ffdfe01803895043dec0b7
change-id: 20250308-awcc-uid-6ec06bb2572d
prerequisite-change-id: 20250305-hwm-f7bd91902b57:v4
prerequisite-patch-id: 06ff44ce0c6f9bce77eb61a08f358240f1485914
prerequisite-patch-id: d270ae9f1f681a6b6b9685cc13802e8baba0105f
prerequisite-patch-id: 5f744ce03af74a23560118b761ac6529a7c9b172
prerequisite-patch-id: 22c6c5256aee2c17bcd710ec1493b1abccd414cf
prerequisite-patch-id: 75191e2094746de3c12fdd885885d18b2239af89
prerequisite-patch-id: 9f26a3b64824b4f175bbea47c8c9a59fd67f3316
prerequisite-patch-id: 4ff2263e236230e1f96703265d135f0b90390ebd
prerequisite-patch-id: b8844283f8bb46c05ba2e9d7b901bdedfd941731
prerequisite-patch-id: c5122bcce8e7330cdbb18c5d43e321ce69116272
prerequisite-patch-id: ed78dcf947e19652f175d124ade13c08eb3950cc
prerequisite-patch-id: d46a626481e1c49bdd91f6add36f4d6b89edde3e
prerequisite-patch-id: e68a77ec73be34006d5dd754592285e44ffc7f68
Best regards,
--
~ Kurt
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH RFC v2 1/2] platform/x86: wmi: Add wmidev_get_acpi_device_uid()
2025-03-09 5:13 [PATCH RFC v2 0/2] platform/x86: alienware-wmi-wmax: Extend support to many devices Kurt Borja
@ 2025-03-09 5:13 ` Kurt Borja
2025-03-11 19:21 ` Armin Wolf
2025-03-09 5:13 ` [PATCH RFC v2 2/2] platform/x86: alienware-wmi-wmax: Check for AWCC support using _UID Kurt Borja
1 sibling, 1 reply; 5+ messages in thread
From: Kurt Borja @ 2025-03-09 5:13 UTC (permalink / raw)
To: Armin Wolf, Hans de Goede, Ilpo Järvinen
Cc: platform-driver-x86, linux-kernel, Dell.Client.Kernel, Kurt Borja
Add a non-deprecated version of wmi_get_acpi_device_uid().
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
---
drivers/platform/x86/wmi.c | 20 +++++++++++++++++---
include/linux/wmi.h | 2 ++
2 files changed, 19 insertions(+), 3 deletions(-)
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
index e46453750d5f1475eb87342b1c5fd04fe20df335..39f379777ad08efd3cda7313f293522c68773dbe 100644
--- a/drivers/platform/x86/wmi.c
+++ b/drivers/platform/x86/wmi.c
@@ -636,7 +636,6 @@ EXPORT_SYMBOL_GPL(wmi_has_guid);
*/
char *wmi_get_acpi_device_uid(const char *guid_string)
{
- struct wmi_block *wblock;
struct wmi_device *wdev;
char *uid;
@@ -644,8 +643,7 @@ char *wmi_get_acpi_device_uid(const char *guid_string)
if (IS_ERR(wdev))
return NULL;
- wblock = container_of(wdev, struct wmi_block, dev);
- uid = acpi_device_uid(wblock->acpi_device);
+ uid = wmidev_get_acpi_device_uid(wdev);
wmi_device_put(wdev);
@@ -653,6 +651,22 @@ char *wmi_get_acpi_device_uid(const char *guid_string)
}
EXPORT_SYMBOL_GPL(wmi_get_acpi_device_uid);
+/**
+ * wmidev_get_acpi_device_uid() - Get _UID name of a WMI device
+ * @wdev: A wmi bus device from a driver
+ *
+ * Find the _UID of the ACPI device associated with this WMI device.
+ *
+ * Return: The ACPI _UID field or NULL if there is no _UID
+ */
+char *wmidev_get_acpi_device_uid(struct wmi_device *wdev)
+{
+ struct wmi_block *wblock = container_of(wdev, struct wmi_block, dev);
+
+ return acpi_device_uid(wblock->acpi_device);
+}
+EXPORT_SYMBOL_GPL(wmidev_get_acpi_device_uid);
+
/*
* sysfs interface
*/
diff --git a/include/linux/wmi.h b/include/linux/wmi.h
index 10751c8e5e6a0ad3ac9ae317b6f8ecfb14c9a983..625c52ee125219aaa23cf946333af33ad118aafa 100644
--- a/include/linux/wmi.h
+++ b/include/linux/wmi.h
@@ -46,6 +46,8 @@ extern union acpi_object *wmidev_block_query(struct wmi_device *wdev,
acpi_status wmidev_block_set(struct wmi_device *wdev, u8 instance, const struct acpi_buffer *in);
+char *wmidev_get_acpi_device_uid(struct wmi_device *wdev);
+
u8 wmidev_instance_count(struct wmi_device *wdev);
/**
--
2.48.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH RFC v2 2/2] platform/x86: alienware-wmi-wmax: Check for AWCC support using _UID
2025-03-09 5:13 [PATCH RFC v2 0/2] platform/x86: alienware-wmi-wmax: Extend support to many devices Kurt Borja
2025-03-09 5:13 ` [PATCH RFC v2 1/2] platform/x86: wmi: Add wmidev_get_acpi_device_uid() Kurt Borja
@ 2025-03-09 5:13 ` Kurt Borja
1 sibling, 0 replies; 5+ messages in thread
From: Kurt Borja @ 2025-03-09 5:13 UTC (permalink / raw)
To: Armin Wolf, Hans de Goede, Ilpo Järvinen
Cc: platform-driver-x86, linux-kernel, Dell.Client.Kernel, Kurt Borja
The WMAX _UID of all devices that support the AWCC interface is "AWCC".
This includes the following devices which were manually verified by
reading their ACPI tables:
- Dell G16 7630
- Dell G5 5505 SE
- Alienware m16 R1
- Alienware m17 R5 AMD
- Alienware x15 R2
- Alienware 17 R5
- Alienware Aurora R12
- Alienware Aurora Ryzen Edition
And possibly many more, if not all devices with this interface.
Add a check for "AWCC" _UID in wmax_wmi_probe() as a last resort test
for support.
Signed-off-by: Kurt Borja <kuurtb@gmail.com>
---
drivers/platform/x86/dell/alienware-wmi-wmax.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/drivers/platform/x86/dell/alienware-wmi-wmax.c b/drivers/platform/x86/dell/alienware-wmi-wmax.c
index 46d11b200820cdbaa841fc97e33b339fca42104e..1a81373a9d5937b4ff5511ad2061b6dc6e40b810 100644
--- a/drivers/platform/x86/dell/alienware-wmi-wmax.c
+++ b/drivers/platform/x86/dell/alienware-wmi-wmax.c
@@ -1420,14 +1420,17 @@ static int wmax_wmi_probe(struct wmi_device *wdev, const void *context)
.upd_brightness = wmax_wmi_update_brightness,
},
};
- int ret;
+ char *uid;
- if (awcc)
- ret = alienware_awcc_setup(wdev);
- else
- ret = alienware_alienfx_setup(&pdata);
+ if (!awcc) {
+ uid = wmidev_get_acpi_device_uid(wdev);
+ if (!uid || strncmp(uid, "AWCC", 4))
+ return alienware_alienfx_setup(&pdata);
- return ret;
+ awcc = &generic_quirks;
+ }
+
+ return alienware_awcc_setup(wdev);
}
static int wmax_wmi_suspend(struct device *dev)
--
2.48.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH RFC v2 1/2] platform/x86: wmi: Add wmidev_get_acpi_device_uid()
2025-03-09 5:13 ` [PATCH RFC v2 1/2] platform/x86: wmi: Add wmidev_get_acpi_device_uid() Kurt Borja
@ 2025-03-11 19:21 ` Armin Wolf
2025-03-12 5:27 ` Kurt Borja
0 siblings, 1 reply; 5+ messages in thread
From: Armin Wolf @ 2025-03-11 19:21 UTC (permalink / raw)
To: Kurt Borja, Hans de Goede, Ilpo Järvinen
Cc: platform-driver-x86, linux-kernel, Dell.Client.Kernel
Am 09.03.25 um 06:13 schrieb Kurt Borja:
> Add a non-deprecated version of wmi_get_acpi_device_uid().
Hi,
i can understand you motivation behind this patch, but this is IMHO the wrong approach.
Nothing guarantees us that a given ACPI _UID value will reliably signal the presence of
WMI methods now or in the future. Because of this i am against this patch.
The correct way would be to use the BMOF data to check for missing WMI methods. I did
some work on that which i will announce soon.
Thanks,
Armin Wolf
> Signed-off-by: Kurt Borja <kuurtb@gmail.com>
> ---
> drivers/platform/x86/wmi.c | 20 +++++++++++++++++---
> include/linux/wmi.h | 2 ++
> 2 files changed, 19 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
> index e46453750d5f1475eb87342b1c5fd04fe20df335..39f379777ad08efd3cda7313f293522c68773dbe 100644
> --- a/drivers/platform/x86/wmi.c
> +++ b/drivers/platform/x86/wmi.c
> @@ -636,7 +636,6 @@ EXPORT_SYMBOL_GPL(wmi_has_guid);
> */
> char *wmi_get_acpi_device_uid(const char *guid_string)
> {
> - struct wmi_block *wblock;
> struct wmi_device *wdev;
> char *uid;
>
> @@ -644,8 +643,7 @@ char *wmi_get_acpi_device_uid(const char *guid_string)
> if (IS_ERR(wdev))
> return NULL;
>
> - wblock = container_of(wdev, struct wmi_block, dev);
> - uid = acpi_device_uid(wblock->acpi_device);
> + uid = wmidev_get_acpi_device_uid(wdev);
>
> wmi_device_put(wdev);
>
> @@ -653,6 +651,22 @@ char *wmi_get_acpi_device_uid(const char *guid_string)
> }
> EXPORT_SYMBOL_GPL(wmi_get_acpi_device_uid);
>
> +/**
> + * wmidev_get_acpi_device_uid() - Get _UID name of a WMI device
> + * @wdev: A wmi bus device from a driver
> + *
> + * Find the _UID of the ACPI device associated with this WMI device.
> + *
> + * Return: The ACPI _UID field or NULL if there is no _UID
> + */
> +char *wmidev_get_acpi_device_uid(struct wmi_device *wdev)
> +{
> + struct wmi_block *wblock = container_of(wdev, struct wmi_block, dev);
> +
> + return acpi_device_uid(wblock->acpi_device);
> +}
> +EXPORT_SYMBOL_GPL(wmidev_get_acpi_device_uid);
> +
> /*
> * sysfs interface
> */
> diff --git a/include/linux/wmi.h b/include/linux/wmi.h
> index 10751c8e5e6a0ad3ac9ae317b6f8ecfb14c9a983..625c52ee125219aaa23cf946333af33ad118aafa 100644
> --- a/include/linux/wmi.h
> +++ b/include/linux/wmi.h
> @@ -46,6 +46,8 @@ extern union acpi_object *wmidev_block_query(struct wmi_device *wdev,
>
> acpi_status wmidev_block_set(struct wmi_device *wdev, u8 instance, const struct acpi_buffer *in);
>
> +char *wmidev_get_acpi_device_uid(struct wmi_device *wdev);
> +
> u8 wmidev_instance_count(struct wmi_device *wdev);
>
> /**
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH RFC v2 1/2] platform/x86: wmi: Add wmidev_get_acpi_device_uid()
2025-03-11 19:21 ` Armin Wolf
@ 2025-03-12 5:27 ` Kurt Borja
0 siblings, 0 replies; 5+ messages in thread
From: Kurt Borja @ 2025-03-12 5:27 UTC (permalink / raw)
To: Armin Wolf, Hans de Goede, Ilpo Järvinen
Cc: platform-driver-x86, linux-kernel, Dell.Client.Kernel
On Tue Mar 11, 2025 at 2:21 PM -05, Armin Wolf wrote:
> Am 09.03.25 um 06:13 schrieb Kurt Borja:
>
>> Add a non-deprecated version of wmi_get_acpi_device_uid().
>
> Hi,
>
> i can understand you motivation behind this patch, but this is IMHO the wrong approach.
> Nothing guarantees us that a given ACPI _UID value will reliably signal the presence of
> WMI methods now or in the future. Because of this i am against this patch.
Yes, in the end it is a leap of faith.
I think that it's not very risky as AFAIK AWCC didn't even exist when
devices used the legacy RGB interface. Also as Mario mentioned, only a
handful of devices supported the legacy interface, compared to the large
amount of systems with the AWCC one.
But of course, there is always a possibility of regressions for some
unknown edge case.
>
> The correct way would be to use the BMOF data to check for missing WMI methods. I did
> some work on that which i will announce soon.
Anyways, this is very cool and indeed the correct approach. Hopefully
I'll be able to help a bit, as I spent some time studying Pali's
decoder.
--
~ Kurt
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2025-03-12 5:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-03-09 5:13 [PATCH RFC v2 0/2] platform/x86: alienware-wmi-wmax: Extend support to many devices Kurt Borja
2025-03-09 5:13 ` [PATCH RFC v2 1/2] platform/x86: wmi: Add wmidev_get_acpi_device_uid() Kurt Borja
2025-03-11 19:21 ` Armin Wolf
2025-03-12 5:27 ` Kurt Borja
2025-03-09 5:13 ` [PATCH RFC v2 2/2] platform/x86: alienware-wmi-wmax: Check for AWCC support using _UID Kurt Borja
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox