Am 06.03.23 um 02:41 schrieb Andrew Kallmeyer:
On Sun, Mar 5, 2023 at 5:26 PM Armin Wolf <W_Armin@xxxxxx> wrote:
I was combing through the ACPI DSDT table inside the acpidump you provided,
and i found serveral PNP0C14 devices, which hold WMI methods, events and data.
Thanks so much for the help! This is my first time looking at an ACPI
dump so I never would have found this.
Maybe you can write a wmi driver which handles both WMI objects, so that you can find out what the values
returned by GetUsageMode mean. With a bit of luck, you can use this to implement tablet mode toggle detection.
I will look into this, this does look more like the proper way to do
it so it can be put in the driver for everyone. I suppose that missing
Notify device is just unrelated then? Does setting the memory mapped
variable just automatically update these WMI devices? I was worried
that the failed notification would make the WMI devices not work, just
guessing based on the WM00 name.
If you have any pointers on where to look to see the kernel functions
involved in WMI that would be appreciated.
The modern WMI bus infrastructure introduced new methods for interacting with WMI devices, you can find
them in include/linux/wmi.h. The use of the older methods like wmi_evaluate_method() is deprecated, since
those methods assume that each WMI GUID only appears exactly once in each device, and notifications can
be unreliable. The WMI bus infrastructure does not suffer from this problems.
Maybe you could also add the WMI GUIDs to allow_duplicates[] inside drivers/platform/x86/wmi.c, so that
the WMI core does not complain should Lenovo someday decide to use multiple yoga mode sensors.
Regarding the missing WMI device: it could be that this device was used in another model, and that the
firmware engineers forgot to properly remove it when they developed the firmware for your device.
In such a case a BIOS update might help.
Armin Wolf
BTW, what is the name of your notebook model?
It is advertised as Lenovo Yoga 7i and the model number is Yoga 7 14IAL7