Bug 71929 - Tablet buttons on Thinkpad X201 Tablet not working after updating to systemd 208
Summary: Tablet buttons on Thinkpad X201 Tablet not working after updating to systemd 208
Status: RESOLVED FIXED
Alias: None
Product: systemd
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: systemd-bugs
QA Contact: systemd-bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-23 00:43 UTC by rat.o.drat
Modified: 2014-01-24 11:11 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
dmesg output (67.72 KB, text/plain)
2013-11-23 00:44 UTC, rat.o.drat
Details
dmidecode output (15.92 KB, text/plain)
2013-11-23 00:45 UTC, rat.o.drat
Details

Description rat.o.drat 2013-11-23 00:43:53 UTC
After updating to systemd 208, tablet buttons (the 5 buttons under the screen) stopped working. This issue didn't exist in previous version I was using, which was 204.

Pressing any of those buttons produces an output like this in dmesg:

[13726.144651] atkbd serio0: Unknown key pressed (translated set 2, code 0x67 on isa0060/serio0).
[13726.144699] atkbd serio0: Use 'setkeycodes 67 <keycode>' to make it known.
[13726.444565] atkbd serio0: Unknown key released (translated set 2, code 0x67 on isa0060/serio0).
[13726.444615] atkbd serio0: Use 'setkeycodes 67 <keycode>' to make it known.


Events for them are sent to /dev/input/event* and the program evtest reports:

Event: time 1385166815.250521, type 4 (EV_MSC), code 4 (MSC_SCAN), value 67
Event: time 1385166815.250521, -------------- SYN_REPORT ------------
Event: time 1385166815.550425, type 4 (EV_MSC), code 4 (MSC_SCAN), value 67
Event: time 1385166815.550425, -------------- SYN_REPORT ------------

However, X.org doesn't get them delivered (I've tested with xev).

Doing as the message in dmesg suggests solves the issue, though this is a workaround.

This might be associated with the changes in udev (I've noticed that files for keyboard mapping were changed). 
In /usr/lib/udev/hwdb.d/60-keyboard.hwdb I saw rules that should apply for those keys (keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pnThinkPad*X2*Tablet*:pvr*) but they apparently don't work. I've tried copying them to a new hwdb file in /etc/udev/hwdb.d and using a more general match (keyboard:dmi:bvn*:bvr*:bd*:svn*:pn*:pvr*) and running udevadm hwdb --update but that didn't help.

I've attached output from dmesg and dmidecode. Please tell me if any other information is needed.
Comment 1 rat.o.drat 2013-11-23 00:44:44 UTC
Created attachment 89662 [details]
dmesg output
Comment 2 rat.o.drat 2013-11-23 00:45:14 UTC
Created attachment 89663 [details]
dmidecode output
Comment 3 rat.o.drat 2013-11-23 01:39:42 UTC
I've played with this a bit and fixed the issue for me, though I haven't found a proper fix.

I've created a file  /etc/udev/hwdb.d/90-custom-keyboard.hwdb and copied there the rules for those buttons. But I replaced pnThinkPad*X2*Tablet* with pn*. So the contents are:

keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*:pvr*
 KEYBOARD_KEY_5d=menu
 KEYBOARD_KEY_63=fn
 KEYBOARD_KEY_66=screenlock
 KEYBOARD_KEY_67=cyclewindows                           # bezel circular arrow
 KEYBOARD_KEY_68=setup                                  # bezel setup / menu
 KEYBOARD_KEY_6c=direction                              # rotate screen

Now I get proper results:

Event: time 1385170153.511745, type 4 (EV_MSC), code 4 (MSC_SCAN), value 66
Event: time 1385170153.511745, type 1 (EV_KEY), code 152 (KEY_SCREENLOCK), value 1
Event: time 1385170153.511745, -------------- SYN_REPORT ------------
Event: time 1385170153.811917, type 4 (EV_MSC), code 4 (MSC_SCAN), value 66
Event: time 1385170153.811917, type 1 (EV_KEY), code 152 (KEY_SCREENLOCK), value 0
Event: time 1385170153.811917, -------------- SYN_REPORT ------------

I've tried pnThinkPad* or pn*X201*, nothing seemed to work. According to dmidecode the value matched there should be "ThinkPad X201 Tablet" (I think).

I would do more but i don't know how to debug this other than trying different strings and rebooting to see if it works.
Comment 4 Kay Sievers 2013-11-23 16:25:10 UTC
Please provide this string:

$ cat /sys/class/dmi/id/modalias 
dmi:bvnLENOVO:bvrG7ET96WW(2.56):bd09/12/2013:svnLENOVO:pn23561T0:pvrThinkPadT430s:rvnLENOVO:rn23561T0:rvrNotDefined:cvnLENOVO:ct10:cvrNotAvailable:

With this laptop, it looks more like "pvr" should be matched instead of "pvn".
Comment 5 rat.o.drat 2013-11-24 00:46:55 UTC
$ cat /sys/class/dmi/id/modalias
dmi:bvnLENOVO:bvr6QET46WW(1.16):bd06/07/2010:svnLENOVO:pn2985DMG:pvrThinkPadX201Tablet:rvnLENOVO:rn2985DMG:rvrNotAvailable:cvnLENOVO:ct10:cvrNotAvailable:
Comment 6 rat.o.drat 2013-11-24 00:58:28 UTC
After blindly posting that I realized it's the string being matched.

OK, so the rule that should work with ThinkPad X200 and X201 Tablet would be:

keyboard:dmi:bvn*:bvr*:bd*:svnLENOVO*:pn*:pvrThinkPad*X2*Tablet*

The above works for me now. 
Thanks for the help.
Comment 7 Zbigniew Jedrzejewski-Szmek 2014-01-07 01:54:55 UTC
Applied as http://cgit.freedesktop.org/systemd/systemd/commit/?id=f92164e. Please check that it works.
Comment 8 rat.o.drat 2014-01-24 11:11:54 UTC
Yes, this works.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.