<div dir="ltr"><div><div>Hello<br><br>My mistake, after carefully checking, it's just the pen that's not giving anything at all ; however  I am getting the exact same 5E and 5F for the screen rotation - but no ACPI event.<br><br>For the pen, I'm not getting any event at all - even with the modified kernel with the original DSDT that previously gave me such events. Unless something weird happened, my best guess is that the pen detection switch is not correctly plugged. I'll have to check that later.<br><br>Now about these tablet rotation, thinkpad-acpi expects a MHKG field in the dsdt to report them to the input layer (cf tpacpi_input_send_tabletsw)<br><br></div></div><div>In the original DSDT, MHKG is:<br>                        Method (MHKG, 0, NotSerialized)<br>                        {<br>                            Store (Zero, Local0)<br>                            ShiftLeft (\_SB.PCI0.LPC.EC.HTAB, 0x03, Local0)<br>                            Return (Local0)<br>                        }<br><br></div><div>So basically it's only reading the TMOD field from the EC, but in src/ec/lenovo/h8/acpi/ec.asl, I see MKHP, but no MKHG<br><br>A simple fix will be to add MKHG<br><br>Meanwhile, commenting out send_acpi_ev=false from hotkey_notify_usrevent seems in thinkpad-acpi.c enough. Then acpi_listen will then see the following events:<br>ibm/hotkey IBM0068:00 00000080 00005009<br>ibm/hotkey IBM0068:00 00000080 0000500a<br><br></div>(which can be mapped to screen rotation scripts)<br><div><div><br>For the raw EC events:<br>Dec  9 15:36:44 thinkpad kernel: [115080.081227] ACPI : EC: ===== TASK =====<br>Dec  9 15:36:44 thinkpad kernel: [115080.081232] ACPI : EC: ---> status = 0x28<br>Dec  9 15:36:44 thinkpad kernel: [115080.081235] ACPI : EC: <--- command = 0x84<br>Dec  9 15:36:44 thinkpad kernel: [115080.081276] ACPI : EC: ===== IRQ =====<br>Dec  9 15:36:44 thinkpad kernel: [115080.081280] ACPI : EC: ---> status = 0x09<br>Dec  9 15:36:44 thinkpad kernel: [115080.081284] ACPI : EC: ---> data = 0x5e<br>Dec  9 15:36:44 thinkpad kernel: [115080.081290] ACPI : EC: ---> status = 0x08<br>Dec  9 15:36:44 thinkpad kernel: [115080.082262] ACPI : EC: push query execution (0x5e) on queue<br><br>Dec  9 15:36:47 thinkpad kernel: [115082.603688] ACPI : EC: ===== TASK =====<br>Dec  9 15:36:47 thinkpad kernel: [115082.603692] ACPI : EC: ---> status = 0x28<br>Dec  9 15:36:47 thinkpad kernel: [115082.603695] ACPI : EC: <--- command = 0x84<br>Dec  9 15:36:47 thinkpad kernel: [115082.603734] ACPI : EC: ===== IRQ =====<br>Dec  9 15:36:47 thinkpad kernel: [115082.603739] ACPI : EC: ---> status = 0x09<br>Dec  9 15:36:47 thinkpad kernel: [115082.603743] ACPI : EC: ---> data = 0x5f<br>Dec  9 15:36:47 thinkpad kernel: [115082.603749] ACPI : EC: ---> status = 0x08<br>Dec  9 15:36:47 thinkpad kernel: [115082.604711] ACPI : EC: push query execution (0x5f) on queue<br><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Dec 5, 2014 at 7:37 AM, Charles Devereaux <span dir="ltr"><<a href="mailto:coreboot@guylhem.net" target="_blank">coreboot@guylhem.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><div><div><div><div>Hello<br><br></div>For your information, this patch does not gives me any of these ACPI events on the x60 tablet, so the patch may be specific to the X220t<br><br></div>To correct the events value, I tried to replicate your events output with :<br>enable CONFIG_DYNAMIC_DEBUG<br>echo -n 'file ec.c +p' | sudo tee /sys/kernel/debug/dynamic_debug/control<br><br>I still can't get logs similar to yours.<br><br></div>I would love to make that work. Please let me know how I can report the correct values.<br><br></div>Thanks<span><font color="#888888"><br></font></span></div><span><font color="#888888">Charles<br></font></span></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 25, 2014 at 5:02 PM, Vladimir 'φ-coder/phcoder' Serbinenko <span dir="ltr"><<a href="mailto:phcoder@gmail.com" target="_blank">phcoder@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div>On <a href="tel:25.08.2014%2022" value="+12508201422" target="_blank">25.08.2014 22</a>:53, Vladimir 'φ-coder/phcoder' Serbinenko wrote:<br>
>>> Ideally, the DSDT should be fixed within coreboot, but this goes beyond<br>
>>> my present abilities.<br>
>> Not true. Just do the same changes to the corresponding *.asl files in<br>
>> coreboot repo and send the patch to gerrit. Other than a layer of<br>
>> preprocessing, it's exactly the same code as you got from disassembly.<br>
>><br>
> Sorry, I misread you. I thought that you extracted coreboot DSDT from<br>
> running system then patched it and used as custom DSDT. I'm going to<br>
> make few experiments on my x220t.<br>
><br>
><br>
</div></div>This may interest you:<br>
On X220t<br>
stylus removal:<br>
[17424.931729] ACPI : EC: ===== TASK =====<br>
[17424.931747] ACPI : EC: ---> status = 0x28<br>
[17424.931755] ACPI : EC: <--- command = 0x84<br>
[17424.931852] ACPI : EC: ===== IRQ =====<br>
[17424.931865] ACPI : EC: ---> status = 0x09<br>
[17424.931874] ACPI : EC: ---> data = 0x5d<br>
[17424.931885] ACPI : EC: ---> status = 0x08<br>
<br>
So it's _Q5D<br>
<br>
Stylus reinsert:<br>
[17493.249126] ACPI : EC: push gpe query to the queue<br>
[17493.249198] ACPI : EC: ===== TASK =====<br>
[17493.249207] ACPI : EC: ---> status = 0x28<br>
[17493.249213] ACPI : EC: <--- command = 0x84<br>
[17493.249293] ACPI : EC: ===== IRQ =====<br>
[17493.249306] ACPI : EC: ---> status = 0x09<br>
[17493.249316] ACPI : EC: ---> data = 0x5c<br>
[17493.249329] ACPI : EC: ---> status = 0x08<br>
<br>
So it's _Q5C<br>
<br>
Turning LID around:<br>
[17582.701907] ACPI : EC: push gpe query to the queue<br>
[17582.701979] ACPI : EC: ===== TASK =====<br>
[17582.701987] ACPI : EC: ---> status = 0x28<br>
[17582.701994] ACPI : EC: <--- command = 0x84<br>
[17582.702075] ACPI : EC: ===== IRQ =====<br>
[17582.702092] ACPI : EC: ---> status = 0x09<br>
[17582.702096] ACPI : EC: ---> data = 0x5e<br>
[17582.702104] ACPI : EC: ---> status = 0x08<br>
So it's _Q5E<br>
<br>
Back to laptop layout:<br>
[17590.610440] ACPI : EC: push gpe query to the queue<br>
[17590.610513] ACPI : EC: ===== TASK =====<br>
[17590.610521] ACPI : EC: ---> status = 0x28<br>
[17590.610527] ACPI : EC: <--- command = 0x84<br>
[17590.610610] ACPI : EC: ===== IRQ =====<br>
[17590.610620] ACPI : EC: ---> status = 0x09<br>
[17590.610628] ACPI : EC: ---> data = 0x5f<br>
[17590.610641] ACPI : EC: ---> status = 0x08<br>
so it's _Q5F<br>
<br>
Do you get the same events on X60t?<br>
<br>
>From thinkpad-acpi.c:<br>
        TP_HKEY_EV_TABLET_TABLET        = 0x5009, /* tablet swivel up */<br>
        TP_HKEY_EV_TABLET_NOTEBOOK      = 0x500a, /* tablet swivel down */<br>
        TP_HKEY_EV_PEN_INSERTED         = 0x500b, /* tablet pen inserted */<br>
        TP_HKEY_EV_PEN_REMOVED          = 0x500c, /* tablet pen removed */<br>
<br>
So those are the values MHKP has to return.<br>
<br>
<a href="http://review.coreboot.org/6765" target="_blank">http://review.coreboot.org/6765</a> implements it. Please test.<br>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div></div></div></div>