Re: ideapad_laptop tablet mode toggle detection

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


On Sat, Mar 4, 2023 at 1:37 PM Armin Wolf <W_Armin@xxxxxx> wrote:
> 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

I read into the ideapad-laptop code some more and found that the
ideapad_acpi_notify function ends up being the exact same handler that
I am installing in my test module. I copied over the read_ec_data code
to read the same variable and found that the screen flip event I'm
looking at is the bit 5 case which simply calls
ideapad_sync_touchpad_state (which shows up on screen in my GNOME
install). It seems this is not quite the P80B = 0x44 variable because
the only bit 5 is set (possibly it's just the first 4?) but it looks
to be enough to detect the screen flip.

So it seems like I would want to add something to send the
SW_TABLET_MODE input event there in that bit 5 case. Presumably this
would be something like the tpacpi_input_send_tabletsw and
hotkey_tablet_mode_notify_change function calls that are done in the
thinkpad-acpi driver. Would that be a reasonable thing to add to the
ideapad driver? I'm not sure how we would know about compatibility
across the other ideapad laptops. It seems I could at least get this
all working with my own module for myself for now at least (maybe a
patch of the ideapad driver because reading that variable in my module
prevents the original driver from reading it).

I did also notice that bit 10 has a comment about a tablet mode
switching signal being unreliable but on my machine bit 10 was not set
for the tablet mode switch event when I checked with my test module.

Andrew Kallmeyer

[Index of Archives]     [Linux Kernel Development]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux