All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maximilian Luz <luzmaximilian@gmail.com>
To: Andrew Kallmeyer <kallmeyeras@gmail.com>,
	platform-driver-x86@vger.kernel.org
Subject: Re: ideapad_laptop tablet mode toggle detection
Date: Sat, 4 Mar 2023 21:14:04 +0100	[thread overview]
Message-ID: <044d2716-2490-6600-33e2-ecf50f65a6e9@gmail.com> (raw)
In-Reply-To: <CAG4kvq9-qGFNRP29i4jDPL6RVLwGG86wdtTR1+VWZWu5krfv2A@mail.gmail.com>

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

  reply	other threads:[~2023-03-04 20:14 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 [this message]
2023-03-04 21:37     ` Armin Wolf
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=044d2716-2490-6600-33e2-ecf50f65a6e9@gmail.com \
    --to=luzmaximilian@gmail.com \
    --cc=kallmeyeras@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.