On Sat, 2016-12-10 at 17:17 +0000, marmuta wrote:
> Also I skimmed through some of the kernel 4.9 sources but haven't found
> anything potentially useful yet.
> intel-vbtn.c really seems to handle power buttons only.
> acpi/button.c which creates the "Lid Switch" evdev appears to only handle lid
> switches with two positions, open and closed, for laptops presumably.
> drivers/platform/x86/ideapad-laptop.c references the Yoga 2 and exposes a
> number of sensors, but AFAICT nothing concerning detection of tablet-mode.
Here's something very interesting I've found.
rrs@learner:~$ sudo evtest
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: AT Translated Set 2 keyboard
/dev/input/event1: Power Button
/dev/input/event2: Lid Switch
/dev/input/event3: Power Button
/dev/input/event4: Video Bus
/dev/input/event5: SynPS/2 Synaptics TouchPad
/dev/input/event6: Ideapad extra buttons
/dev/input/event7: PC Speaker
/dev/input/event8: HDA Digital PCBeep
/dev/input/event9: HDA Intel PCH Mic
/dev/input/event10: HDA Intel PCH Front Headphone
/dev/input/event11: HDA Intel HDMI HDMI/DP,pcm=3
/dev/input/event12: HDA Intel HDMI HDMI/DP,pcm=7
/dev/input/event13: HDA Intel HDMI HDMI/DP,pcm=8
/dev/input/event14: ELAN Touchscreen
/dev/input/event15: Lenovo EasyCamera
Select the device event number [0-15]: 6
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0
Input device name: "Ideapad extra buttons"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 1 (KEY_ESC)
Event code 148 (KEY_PROG1)
Event code 149 (KEY_PROG2)
Event code 186 (KEY_F16)
Event code 192 (KEY_F22)
Event code 193 (KEY_F23)
Event code 202 (KEY_PROG3)
Event code 203 (KEY_PROG4)
Event code 212 (KEY_CAMERA)
Event code 227 (KEY_SWITCHVIDEOMODE)
Event code 238 (KEY_WLAN)
Event code 240 (KEY_UNKNOWN)
Event code 248 (KEY_MICMUTE)
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
±Event: time 1481395850.563699, type 4 (EV_MSC), code 4 (MSC_SCAN), value 42
Event: time 1481395850.563699, type 1 (EV_KEY), code 193 (KEY_F23), value 1
Event: time 1481395850.563699, -------------- SYN_REPORT ------------
Event: time 1481395850.563722, type 1 (EV_KEY), code 193 (KEY_F23), value 0
Event: time 1481395850.563722, -------------- SYN_REPORT ------------
Event: time 1481395868.265979, type 4 (EV_MSC), code 4 (MSC_SCAN), value 43
Event: time 1481395868.265979, type 1 (EV_KEY), code 192 (KEY_F22), value 1
Event: time 1481395868.265979, -------------- SYN_REPORT ------------
Event: time 1481395868.266000, type 1 (EV_KEY), code 192 (KEY_F22), value 0
Event: time 1481395868.266000, -------------- SYN_REPORT ------------
±Event: time 1481395988.012878, type 4 (EV_MSC), code 4 (MSC_SCAN), value 42
Event: time 1481395988.012878, type 1 (EV_KEY), code 193 (KEY_F23), value 1
Event: time 1481395988.012878, -------------- SYN_REPORT ------------
Event: time 1481395988.012888, type 1 (EV_KEY), code 193 (KEY_F23), value 0
Event: time 1481395988.012888, -------------- SYN_REPORT ------------
Event: time 1481395994.077307, type 4 (EV_MSC), code 4 (MSC_SCAN), value 43
Event: time 1481395994.077307, type 1 (EV_KEY), code 192 (KEY_F22), value 1
Event: time 1481395994.077307, -------------- SYN_REPORT ------------
Event: time 1481395994.077328, type 1 (EV_KEY), code 192 (KEY_F22), value 0
Event: time 1481395994.077328, -------------- SYN_REPORT ------------
Event: time 1481395988.012878, type 4 (EV_MSC), code 4 (MSC_SCAN), value 42
Event: time 1481395988.012878, type 1 (EV_KEY), code 193 (KEY_F23), value 1
Event: time 1481395988.012878, -------------- SYN_REPORT ------------
Event: time 1481395988.012888, type 1 (EV_KEY), code 193 (KEY_F23), value 0
Event: time 1481395988.012888, -------------- SYN_REPORT ------------
The above events are reported by evdev when switching to tablet mode.
Event: time 1481395994.077307, type 4 (EV_MSC), code 4 (MSC_SCAN), value 43
Event: time 1481395994.077307, type 1 (EV_KEY), code 192 (KEY_F22), value 1
Event: time 1481395994.077307, -------------- SYN_REPORT ------------
Event: time 1481395994.077328, type 1 (EV_KEY), code 192 (KEY_F22), value 0
Event: time 1481395994.077328, -------------- SYN_REPORT ------------
And these when switching back to Normal mode. I did the switching twice,
just to be sure that it gives persistent results.
I hope it helps.
- --
Ritesh Raj Sarraf
RESEARCHUT - http://www.researchut.com
"Necessity is the mother of invention."
-----BEGIN PGP SIGNATURE-----
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
On Sat, 2016-12-10 at 17:17 +0000, marmuta wrote: platform/ x86/ideapad- laptop. c references the Yoga 2 and exposes a
> Also I skimmed through some of the kernel 4.9 sources but haven't found
> anything potentially useful yet.
> intel-vbtn.c really seems to handle power buttons only.
> acpi/button.c which creates the "Lid Switch" evdev appears to only handle lid
> switches with two positions, open and closed, for laptops presumably.
> drivers/
> number of sensors, but AFAICT nothing concerning detection of tablet-mode.
Here's something very interesting I've found.
rrs@learner:~$ sudo evtest OMODE)
No device specified, trying to scan all of /dev/input/event*
Available devices:
/dev/input/event0: AT Translated Set 2 keyboard
/dev/input/event1: Power Button
/dev/input/event2: Lid Switch
/dev/input/event3: Power Button
/dev/input/event4: Video Bus
/dev/input/event5: SynPS/2 Synaptics TouchPad
/dev/input/event6: Ideapad extra buttons
/dev/input/event7: PC Speaker
/dev/input/event8: HDA Digital PCBeep
/dev/input/event9: HDA Intel PCH Mic
/dev/input/event10: HDA Intel PCH Front Headphone
/dev/input/event11: HDA Intel HDMI HDMI/DP,pcm=3
/dev/input/event12: HDA Intel HDMI HDMI/DP,pcm=7
/dev/input/event13: HDA Intel HDMI HDMI/DP,pcm=8
/dev/input/event14: ELAN Touchscreen
/dev/input/event15: Lenovo EasyCamera
Select the device event number [0-15]: 6
Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0
Input device name: "Ideapad extra buttons"
Supported events:
Event type 0 (EV_SYN)
Event type 1 (EV_KEY)
Event code 1 (KEY_ESC)
Event code 148 (KEY_PROG1)
Event code 149 (KEY_PROG2)
Event code 186 (KEY_F16)
Event code 192 (KEY_F22)
Event code 193 (KEY_F23)
Event code 202 (KEY_PROG3)
Event code 203 (KEY_PROG4)
Event code 212 (KEY_CAMERA)
Event code 227 (KEY_SWITCHVIDE
Event code 238 (KEY_WLAN)
Event code 240 (KEY_UNKNOWN)
Event code 248 (KEY_MICMUTE)
Event type 4 (EV_MSC)
Event code 4 (MSC_SCAN)
Properties:
Testing ... (interrupt to exit)
±Event: time 1481395850.563699, type 4 (EV_MSC), code 4 (MSC_SCAN), value 42
Event: time 1481395850.563699, type 1 (EV_KEY), code 193 (KEY_F23), value 1
Event: time 1481395850.563699, -------------- SYN_REPORT ------------
Event: time 1481395850.563722, type 1 (EV_KEY), code 193 (KEY_F23), value 0
Event: time 1481395850.563722, -------------- SYN_REPORT ------------
Event: time 1481395868.265979, type 4 (EV_MSC), code 4 (MSC_SCAN), value 43
Event: time 1481395868.265979, type 1 (EV_KEY), code 192 (KEY_F22), value 1
Event: time 1481395868.265979, -------------- SYN_REPORT ------------
Event: time 1481395868.266000, type 1 (EV_KEY), code 192 (KEY_F22), value 0
Event: time 1481395868.266000, -------------- SYN_REPORT ------------
±Event: time 1481395988.012878, type 4 (EV_MSC), code 4 (MSC_SCAN), value 42
Event: time 1481395988.012878, type 1 (EV_KEY), code 193 (KEY_F23), value 1
Event: time 1481395988.012878, -------------- SYN_REPORT ------------
Event: time 1481395988.012888, type 1 (EV_KEY), code 193 (KEY_F23), value 0
Event: time 1481395988.012888, -------------- SYN_REPORT ------------
Event: time 1481395994.077307, type 4 (EV_MSC), code 4 (MSC_SCAN), value 43
Event: time 1481395994.077307, type 1 (EV_KEY), code 192 (KEY_F22), value 1
Event: time 1481395994.077307, -------------- SYN_REPORT ------------
Event: time 1481395994.077328, type 1 (EV_KEY), code 192 (KEY_F22), value 0
Event: time 1481395994.077328, -------------- SYN_REPORT ------------
Event: time 1481395988.012878, type 4 (EV_MSC), code 4 (MSC_SCAN), value 42
Event: time 1481395988.012878, type 1 (EV_KEY), code 193 (KEY_F23), value 1
Event: time 1481395988.012878, -------------- SYN_REPORT ------------
Event: time 1481395988.012888, type 1 (EV_KEY), code 193 (KEY_F23), value 0
Event: time 1481395988.012888, -------------- SYN_REPORT ------------
The above events are reported by evdev when switching to tablet mode.
Event: time 1481395994.077307, type 4 (EV_MSC), code 4 (MSC_SCAN), value 43
Event: time 1481395994.077307, type 1 (EV_KEY), code 192 (KEY_F22), value 1
Event: time 1481395994.077307, -------------- SYN_REPORT ------------
Event: time 1481395994.077328, type 1 (EV_KEY), code 192 (KEY_F22), value 0
Event: time 1481395994.077328, -------------- SYN_REPORT ------------
And these when switching back to Normal mode. I did the switching twice,
just to be sure that it gives persistent results.
I hope it helps.
- -- www.researchut. com
Ritesh Raj Sarraf
RESEARCHUT - http://
"Necessity is the mother of invention."
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCgAdFiE EQCVDstmIVAB/ Yn02pjpYo/ LhdWkFAlhMT7wAC gkQpjpYo/ Lh /RiYrDOA7TKmhpw tm2y72niHY3etoa sDzei6XNiHzfdhE w36DoQH2Vi2B YkG83QWiQmc1XEC TECPCHKqFAWuyOy /1FGywQGdtYuTiw Ztm+ QVXGN7e3cIkr69b S/gEaO9iG9pMqth TFHL0vxqJQ46FBh QoTJ RLZxuWXdCdNxC+ e5CXoAU1Ttl/ HlHJs5o3TkUtv+ 7j9Q47Yke BlDbKU2gc1WhqKC E1Y6/DSxdlv/ iw7iZIzUlGV1puJ WwybF7Y S6r8QvaWZpRs4nN F4iyM6nrUpXxRmA t1MZkDQCTNwzawj eHE1 l2v/WMrt1p/ yS8t27sTSW2dq4g vmZQc8GAskDjVor zjXSdQ9V a9+9XSJqfHMbxk1 vzXFdIW5g9+ fbaukr7aLPP+ uGgOFm7mdwM pllfZPZQfEEz5wE LM4LDthZiO0Dnqw InWMrpG/ kOVekFK9EXF vTt/QiSQFNrkbTt q2tg91IcvmTXw55 NaGfCwfnp1G/ dmnI0k2Zg 3ymBpWUdMblTpUe c9BSoJkhlLCjkbq PY5r+k=
dWmWzA/
k31D7ABQ4iBdOcJ
9gfhR0eKN7wIP2Q
dvUp0NcMlsvuZrH
q7CngbXV6zPebv+
94Z63ASclq3KKMC
GO6qmVjDnwxb9FZ
f0EEF1ef38V36fu
ZgXXxagr7fen4G6
36VNAMgDTlps/
r9bsrpY6gseGlV+
=QSyP
-----END PGP SIGNATURE-----