Skip to contentSkip to conversation

Looking for some pointers on WMI/EC access

DISCUSSION Javier S. Pedro 2 participants 4 messages Dec 1, 2010 x86 platform drivers

lore
Share & tools
lore
#0 lore raw

(Rescuing old discussion about some IdeaPad S10-3t firmware weirdness, where the front keys fire an EC event that is quietly consumed by DSDT)

Florian Echtler (Thu, 22 Apr 2010 10:21:28 +0200):

Quoted 2 lines

So it would be all joy and happiness if it weren't for the fact that ERQ0 is initialized to zero and is never changed anywhere else..

Just realized that a few lines below ERQ0 some bit fields are defined (AP[0-7]) that are actually on the same address as the ERQ0 byte. This makes
a lot of sense as AP[0-7] are written by WSIO (aka what wmi_set_block calls here).

Just tried setting a random bit of AP* and events started flowing in. Thank you!

Javier.

#1 lore raw
Quoted 8 lines · Javier S. Pedro

(Rescuing old discussion about some IdeaPad S10-3t firmware weirdness, where the front keys fire an EC event that is quietly consumed by DSDT)

Florian Echtler (Thu, 22 Apr 2010 10:21:28 +0200):

Quoted 2 lines

So it would be all joy and happiness if it weren't for the fact that ERQ0 is initialized to zero and is never changed anywhere else..

Quoted 7 lines

Just realized that a few lines below ERQ0 some bit fields are defined (AP[0-7]) that are actually on the same address as the ERQ0 byte. This makes
a lot of sense as AP[0-7] are written by WSIO (aka what wmi_set_block calls here).

Just tried setting a random bit of AP* and events started flowing in. Thank you!

Excellent! Send a driver and I'll get it merged.

Signature · 1 line
Matthew Garrett | [email protected]
#2 lore raw

2010/12/1 Matthew Garrett <[email protected]>:

Quoted 1 line

Excellent! Send a driver and I'll get it merged.

Note that I have read the iasl -d'd DSDT myself, so I ponder if that forbids me from writing the module (due to unclean room and all that); either way, here's the source of the test module I used [1].

Only available are the front keys -- with the rotation one not being fired when not in "tablet mode" (the EC event is not fired, seemingly) -- and also "tablet mode" detection, mapped of course to SW_TABLET_MODE.
There's also some kind of orientation detection events that I'm yet to fully understand but seem nearly useless. I would very much prefer to read the raw accelerometer values from EC or HDAPS.

Also: should this be a separate "lenovo-wmi" driver or integrated with lenovo-laptop?

[1] http://gitorious.org/iaps/lsrot/blobs/master/lsrot.c

#3 lore raw
Quoted 6 lines · Javier S. Pedro

2010/12/1 Matthew Garrett <[email protected]>:

Quoted 1 line

Excellent! Send a driver and I'll get it merged.

Note that I have read the iasl -d'd DSDT myself, so I ponder if that forbids me from writing the module (due to unclean room and all that); either way, here's the source of the test module I used [1].

We've never really worried about tainting from ACPI - you're writing coe that interfaces with that rather than copying any of their code, so it should be fine.

Quoted 7 lines

Only available are the front keys -- with the rotation one not being fired when not in "tablet mode" (the EC event is not fired, seemingly) -- and also "tablet mode" detection, mapped of course to SW_TABLET_MODE.
There's also some kind of orientation detection events that I'm yet to fully understand but seem nearly useless. I would very much prefer to read the raw accelerometer values from EC or HDAPS.

Ok.

Quoted 2 lines

Also: should this be a separate "lenovo-wmi" driver or integrated with lenovo-laptop?

I'd go with lenovo-wmi.

Quoted 1 line

[1] http://gitorious.org/iaps/lsrot/blobs/master/lsrot.c

Wonderful. I'll take a look.

Thanks!

Signature · 1 line
Matthew Garrett | [email protected]