From: Armin Wolf <W_Armin@gmx.de>
To: Maximilian Luz <luzmaximilian@gmail.com>,
Andrew Kallmeyer <kallmeyeras@gmail.com>,
platform-driver-x86@vger.kernel.org
Subject: Re: ideapad_laptop tablet mode toggle detection
Date: Sat, 4 Mar 2023 22:37:34 +0100 [thread overview]
Message-ID: <2267dadd-f1a9-e064-6f3f-e3aea459cf5a@gmx.de> (raw)
In-Reply-To: <044d2716-2490-6600-33e2-ecf50f65a6e9@gmail.com>
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
next prev parent reply other threads:[~2023-03-04 21:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-01 4:45 ideapad_laptop tablet mode toggle detection Andrew Kallmeyer
2023-03-04 5:46 ` Andrew Kallmeyer
2023-03-04 20:14 ` Maximilian Luz
2023-03-04 21:37 ` Armin Wolf [this message]
2023-03-05 5:42 ` Andrew Kallmeyer
2023-03-05 21:40 ` Armin Wolf
2023-03-05 22:59 ` Andrew Kallmeyer
2023-03-06 1:26 ` Armin Wolf
2023-03-06 1:41 ` Andrew Kallmeyer
2023-03-06 1:58 ` Armin Wolf
2023-03-06 1:41 ` Armin Wolf
2023-03-06 8:38 ` Hans de Goede
2023-03-08 5:14 ` Andrew Kallmeyer
2023-03-08 5:21 ` Andrew Kallmeyer
2023-03-08 10:13 ` Hans de Goede
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2267dadd-f1a9-e064-6f3f-e3aea459cf5a@gmx.de \
--to=w_armin@gmx.de \
--cc=kallmeyeras@gmail.com \
--cc=luzmaximilian@gmail.com \
--cc=platform-driver-x86@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox