Am 04.03.23 um 21:14 schrieb Maximilian Luz:
Hi,
On 3/4/23 06:46, Andrew Kallmeyer wrote:
I'm still wondering about that AE_NOT_FOUND error about the WM00
device> though. It seems that the ACPI expects the kernel to define
this WM00> device as an extension point. In the DSDT I found:> >
External (_SB_.WM00, DeviceObj)
AFAIK this just means that it's external to this table (i.e. the DSDT I
assume), not that the kernel needs to define it (I'm not sure if
that's even an
option in the ACPI spec or ACPICA). So it should be in some SSDT or
the ACPI
implementation is broken (unless defining devices from the kernel is
really an
option and I'm just misinformed).
Scope (\_SB.PC00.LPCB.EC0)
{
Method (_Q44, 0, NotSerialized) // _Qxx: EC Query, xx=0x00-0xFF
{
P80B = 0x44
Notify (VPC0, 0x80) // Status Change
WEID = 0xF4
Notify (WM00, 0x80) // Status Change
}
...
Device (VPC0)
{
Name (_HID, "VPC2004") // _HID: Hardware ID
Name (_UID, Zero) // _UID: Unique ID
Name (_VPC, 0x7C0DE114)
Name (VPCD, Zero)
Additionally two other _Qxx methods (11 and 12) Notify the same
two devices. These other two are the brightness up and down keys.
The only difference is they set those two variables differently so I'll
have to read those variables as well to differentiate screen flips.
Right now my module actually detects both screen flips and
brightness key presses.
I believe that makes sense, given the ACPI code.
I haven't been able to figure out how to create the WM00 device,
I'm not even sure that's a thing in ACPI. I also haven't seen how
to read those variables.
You can use acpi_evaluate_object() and acpi_evaluate_object_typed()
for that.
Is it okay to reuse the events sent to this
VPC0 device or am I intercepting the events from some other
functionality? Any pointers would be greatly appreciated.
I guess that depends on the VPC0 device. If it doesn't have a driver
already
(which you can check by getting the HID of that device from the DSDT and
grep-ing for it in the kernel source), you can write your own driver
against
it, install the notify-handler, and do basically whatever you want.
You're not
intercepting/blocking anything by that. If there already is a driver,
you'll
have to check what that does and if you can integrate your
functionality there.
Given it's a Lenovo device and there are some drivers here, maybe it's
also
some know interface/structure, but I guess Hans would know more about
that than
I do.
Best regards,
Max
Hi,
it seems that the VPC0 ACPI device is handled by the already mentioned ideapad-laptop driver,
you probably just have to add the necessary event codes to ideapad_keymap[].
Armin Wolf