You are not logged in.

#1 2020-06-21 01:53:34

Registered: 2020-06-21
Posts: 1

Detect Tablet Mode on Ideapad Yoga 900

I've recently upgraded my Levano Ideapad Yoga 900 from Windows to Arch Linux. Everything works great except I can't work out how to detect if the laptop has gone into tablet mode. Ideally I'd like to toggle the keyboard and touchpad when this happens and in the long term have it trigger some changes in awesomewm. This is a fairly niche use case, I just want to be able to watch movies on it in bed without accidentally hitting buttons.

It dose send a key code when the screen is flipped around 360 degress but in Windows tablet mode would activate at 180 degress which makes me think that there is some sort of hardware event triggered or a way of detecting the hinge angle.

Looking though the various laptop pages for Yoga models this sees to work out of the box for most models and requires slight configuration for others. I suspect that the driver for this model isn't picking up the event.

Some of the things I've tried:

Loading the thinkpad_acpi kernel module to get access to it's hotkeys ( … d#hot-keys), I thought an ideapad might be similar but even though the module loads it can't load the hot keys

Using showkeys to listen for key presses and rotating the screen as well as watching dmseg for unknown keys, nothing.

Decompiling the ACPI DSDT to look for a WMI, inspired by The WMI only contains:

[WMI, Dynamic, Provider("WmiProv"), Description("Paper Looking hot key event"), Locale("MS\\0x409"), guid("{56322276-8493-4ce8-A783-98C991274F5E}")]
  [key, read] String InstanceName;
  [read] Boolean Active;

Which might be what I'm looking for but the yoga-usage-mode has a method to get the usage mode out of the WMI where as this is just a boolean.

Getting the output of various hardware devices using sysfs while rotating the screen.

using acpi-monitor to see if an event is sent.

From what I've found online it seem that most 2in1 models use ACPI to send this event. I suspect this isn't implemented in the driver for ideapad_laptop for this particular model and I'll need to either modify the driver or write a kernel module get this information.

I'm not really sure where to start here. I'll enjoy the challenge so I'm not asking anyone to solve this for me but I just need some pointers on where to get information about how to do this. Is there a way to debug unknown acpi data? Or see if there is any hardware that hasn't been initialized by the kernel? Any tips people could give me would be greatly appreciated.

I found the Windows driver for this on the Levano website which was an easy to decompile C# app. It looks like there is a custom sensor which gives the screen to base angle. So I'm guessing this actually has nothing to do with ACPI and what I need to do is write a driver/module to get the data out of that sensor. Any clues on where I would get information on how to do this?

Last edited by karltheawesome (2020-06-21 06:12:28)


Board footer

Powered by FluxBB