Keyboard and touchpad only work on kernel 5.6

Could you please try libinput debug-events and evtest on the kernel where the devices work?

yes,

libinput debug-events

~ >>> uname -r                                                                 
5.6.19-3-rt12-MANJARO
~ >>> libinput debug-events                                                                                                                          
-event2   DEVICE_ADDED     Power Button                      seat0 default group1  cap:k
-event14  DEVICE_ADDED     Video Bus                         seat0 default group2  cap:k
-event0   DEVICE_ADDED     Lid Switch                        seat0 default group3  cap:S
-event1   DEVICE_ADDED     Power Button                      seat0 default group4  cap:k
-event5   DEVICE_ADDED     Logitech Wireless Mouse PID:4022  seat0 default group5  cap:p left scroll-nat scroll-button
-event4   DEVICE_ADDED     Logitech Wireless Keyboard PID:4023 seat0 default group6  cap:kp scroll-nat
-event8   DEVICE_ADDED     HP Truevision HD: HP Truevision   seat0 default group7  cap:k
-event10  DEVICE_ADDED     ELAN0732:00 04F3:0358             seat0 default group8  cap:t  size 251x143mm ntouches 10 calib
-event6   DEVICE_ADDED     Intel Virtual Button driver       seat0 default group9  cap:kS
-event3   DEVICE_ADDED     AT Translated Set 2 keyboard      seat0 default group10 cap:k
-event9   DEVICE_ADDED     SynPS/2 Synaptics TouchPad        seat0 default group11 cap:pg  size 98x58mm tap(dl off) left scroll-nat scroll-2fg-edge click-buttonareas-clickfinger dwt-on
-event7   DEVICE_ADDED     HP Wireless hotkeys               seat0 default group12 cap:k
-event22  DEVICE_ADDED     HP WMI hotkeys                    seat0 default group13 cap:kS
-event3   KEYBOARD_KEY     +0.000s	*** (-1) pressed
a event3   KEYBOARD_KEY     +0.084s	*** (-1) released
 event3   KEYBOARD_KEY     +0.667s	*** (-1) pressed
s event3   KEYBOARD_KEY     +0.748s	*** (-1) released
-event9   POINTER_MOTION   +2.799s	  0.16/  0.06 ( +2.00/ +0.72)
 event9   POINTER_MOTION   +2.961s	  0.08/ -0.12 ( +1.00/ -1.44)
 event9   POINTER_MOTION   +2.991s	 -0.10/ -0.14 ( -1.00/ -1.44)
 event9   POINTER_MOTION   +3.001s	  0.15/ -0.22 ( +1.00/ -1.44)
 event9   POINTER_MOTION   +3.012s	 -2.77/ -1.33 (-12.00/ -5.77)
 event9   POINTER_MOTION   +3.032s	  0.22/  0.00 ( +1.00/ +0.00)
-event3   KEYBOARD_KEY     +6.216s	*** (-1) pressed
 event3   KEYBOARD_KEY     +6.348s	*** (-1) pressed

evtest

~ >>> evtest                                                                                                                                         
No device specified, trying to scan all of /dev/input/event*
Not running as root, no devices may be available.
Available devices:
/dev/input/event0:	Lid Switch
/dev/input/event1:	Power Button
/dev/input/event2:	Power Button
/dev/input/event3:	AT Translated Set 2 keyboard
/dev/input/event4:	Logitech Wireless Keyboard PID:4023
/dev/input/event5:	Logitech Wireless Mouse PID:4022
/dev/input/event6:	Intel Virtual Button driver
/dev/input/event7:	HP Wireless hotkeys
/dev/input/event8:	HP Truevision HD: HP Truevision
/dev/input/event9:	SynPS/2 Synaptics TouchPad
/dev/input/event10:	ELAN0732:00 04F3:0358
/dev/input/event11:	HDA Intel PCH Mic
/dev/input/event12:	HDA Intel PCH Headphone
/dev/input/event13:	PC Speaker
/dev/input/event14:	Video Bus
/dev/input/event15:	HDA Intel HDMI HDMI/DP,pcm=3
/dev/input/event16:	HDA Intel HDMI HDMI/DP,pcm=7
/dev/input/event17:	HDA Intel HDMI HDMI/DP,pcm=8
/dev/input/event18:	HDA Intel HDMI HDMI/DP,pcm=9
/dev/input/event19:	HDA Intel HDMI HDMI/DP,pcm=10
/dev/input/event20:	ELAN0732:00 04F3:0358 UNKNOWN
/dev/input/event21:	ELAN0732:00 04F3:0358 UNKNOWN
/dev/input/event22:	HP WMI hotkeys
/dev/input/event23:	ST LIS3LV02DL Accelerometer
Select the device event number [0-23]: 3
Input driver version is 1.0.1
Input device ID: bus 0x11 vendor 0x1 product 0x1 version 0xab41
Input device name: "AT Translated Set 2 keyboard"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 1 (KEY_ESC)
    Event code 2 (KEY_1)
    Event code 3 (KEY_2)
    Event code 4 (KEY_3)
    Event code 5 (KEY_4)
    Event code 6 (KEY_5)
    Event code 7 (KEY_6)
    Event code 8 (KEY_7)
    Event code 9 (KEY_8)
    Event code 10 (KEY_9)
    Event code 11 (KEY_0)
    Event code 12 (KEY_MINUS)
    Event code 13 (KEY_EQUAL)
    Event code 14 (KEY_BACKSPACE)
    Event code 15 (KEY_TAB)
    Event code 16 (KEY_Q)
    Event code 17 (KEY_W)
    Event code 18 (KEY_E)
    Event code 19 (KEY_R)
    Event code 20 (KEY_T)
    Event code 21 (KEY_Y)
    Event code 22 (KEY_U)
    Event code 23 (KEY_I)
    Event code 24 (KEY_O)
    Event code 25 (KEY_P)
    Event code 26 (KEY_LEFTBRACE)
    Event code 27 (KEY_RIGHTBRACE)
    Event code 28 (KEY_ENTER)
    Event code 29 (KEY_LEFTCTRL)
    Event code 30 (KEY_A)
    Event code 31 (KEY_S)
    Event code 32 (KEY_D)
    Event code 33 (KEY_F)
    Event code 34 (KEY_G)
    Event code 35 (KEY_H)
    Event code 36 (KEY_J)
    Event code 37 (KEY_K)
    Event code 38 (KEY_L)
    Event code 39 (KEY_SEMICOLON)
    Event code 40 (KEY_APOSTROPHE)
    Event code 41 (KEY_GRAVE)
    Event code 42 (KEY_LEFTSHIFT)
    Event code 43 (KEY_BACKSLASH)
    Event code 44 (KEY_Z)
    Event code 45 (KEY_X)
    Event code 46 (KEY_C)
    Event code 47 (KEY_V)
    Event code 48 (KEY_B)
    Event code 49 (KEY_N)
    Event code 50 (KEY_M)
    Event code 51 (KEY_COMMA)
    Event code 52 (KEY_DOT)
    Event code 53 (KEY_SLASH)
    Event code 54 (KEY_RIGHTSHIFT)
    Event code 55 (KEY_KPASTERISK)
    Event code 56 (KEY_LEFTALT)
    Event code 57 (KEY_SPACE)
    Event code 58 (KEY_CAPSLOCK)
    Event code 59 (KEY_F1)
    Event code 60 (KEY_F2)
    Event code 61 (KEY_F3)
    Event code 62 (KEY_F4)
    Event code 63 (KEY_F5)
    Event code 64 (KEY_F6)
    Event code 65 (KEY_F7)
    Event code 66 (KEY_F8)
    Event code 67 (KEY_F9)
    Event code 68 (KEY_F10)
    Event code 69 (KEY_NUMLOCK)
    Event code 70 (KEY_SCROLLLOCK)
    Event code 71 (KEY_KP7)
    Event code 72 (KEY_KP8)
    Event code 73 (KEY_KP9)
    Event code 74 (KEY_KPMINUS)
    Event code 75 (KEY_KP4)
    Event code 76 (KEY_KP5)
    Event code 77 (KEY_KP6)
    Event code 78 (KEY_KPPLUS)
    Event code 79 (KEY_KP1)
    Event code 80 (KEY_KP2)
    Event code 81 (KEY_KP3)
    Event code 82 (KEY_KP0)
    Event code 83 (KEY_KPDOT)
    Event code 85 (KEY_ZENKAKUHANKAKU)
    Event code 86 (KEY_102ND)
    Event code 87 (KEY_F11)
    Event code 88 (KEY_F12)
    Event code 89 (KEY_RO)
    Event code 90 (KEY_KATAKANA)
    Event code 91 (KEY_HIRAGANA)
    Event code 92 (KEY_HENKAN)
    Event code 93 (KEY_KATAKANAHIRAGANA)
    Event code 94 (KEY_MUHENKAN)
    Event code 95 (KEY_KPJPCOMMA)
    Event code 96 (KEY_KPENTER)
    Event code 97 (KEY_RIGHTCTRL)
    Event code 98 (KEY_KPSLASH)
    Event code 99 (KEY_SYSRQ)
    Event code 100 (KEY_RIGHTALT)
    Event code 102 (KEY_HOME)
    Event code 103 (KEY_UP)
    Event code 104 (KEY_PAGEUP)
    Event code 105 (KEY_LEFT)
    Event code 106 (KEY_RIGHT)
    Event code 107 (KEY_END)
    Event code 108 (KEY_DOWN)
    Event code 109 (KEY_PAGEDOWN)
    Event code 110 (KEY_INSERT)
    Event code 111 (KEY_DELETE)
    Event code 112 (KEY_MACRO)
    Event code 113 (KEY_MUTE)
    Event code 114 (KEY_VOLUMEDOWN)
    Event code 115 (KEY_VOLUMEUP)
    Event code 116 (KEY_POWER)
    Event code 117 (KEY_KPEQUAL)
    Event code 118 (KEY_KPPLUSMINUS)
    Event code 119 (KEY_PAUSE)
    Event code 121 (KEY_KPCOMMA)
    Event code 122 (KEY_HANGUEL)
    Event code 123 (KEY_HANJA)
    Event code 124 (KEY_YEN)
    Event code 125 (KEY_LEFTMETA)
    Event code 126 (KEY_RIGHTMETA)
    Event code 127 (KEY_COMPOSE)
    Event code 128 (KEY_STOP)
    Event code 138 (KEY_HELP)
    Event code 140 (KEY_CALC)
    Event code 142 (KEY_SLEEP)
    Event code 143 (KEY_WAKEUP)
    Event code 152 (KEY_SCREENLOCK)
    Event code 155 (KEY_MAIL)
    Event code 156 (KEY_BOOKMARKS)
    Event code 157 (KEY_COMPUTER)
    Event code 158 (KEY_BACK)
    Event code 159 (KEY_FORWARD)
    Event code 163 (KEY_NEXTSONG)
    Event code 164 (KEY_PLAYPAUSE)
    Event code 165 (KEY_PREVIOUSSONG)
    Event code 166 (KEY_STOPCD)
    Event code 172 (KEY_HOMEPAGE)
    Event code 173 (KEY_REFRESH)
    Event code 183 (KEY_F13)
    Event code 184 (KEY_F14)
    Event code 185 (KEY_F15)
    Event code 192 (KEY_F22)
    Event code 193 (KEY_F23)
    Event code 210 (KEY_PRINT)
    Event code 212 (KEY_CAMERA)
    Event code 217 (KEY_SEARCH)
    Event code 224 (KEY_BRIGHTNESSDOWN)
    Event code 225 (KEY_BRIGHTNESSUP)
    Event code 226 (KEY_MEDIA)
    Event code 227 (KEY_SWITCHVIDEOMODE)
    Event code 236 (KEY_BATTERY)
    Event code 238 (KEY_WLAN)
    Event code 240 (KEY_UNKNOWN)
    Event code 389 (KEY_DVD)
    Event code 465 (KEY_FN_ESC)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
  Event type 17 (EV_LED)
    Event code 0 (LED_NUML) state 1
    Event code 1 (LED_CAPSL) state 0
    Event code 2 (LED_SCROLLL) state 0
Key repeat handling:
  Repeat type 20 (EV_REP)
    Repeat code 0 (REP_DELAY)
      Value    250
    Repeat code 1 (REP_PERIOD)
      Value     33
Properties:
Testing ... (interrupt to exit)
Event: time 1599680404.332876, type 17 (EV_LED), code 0 (LED_NUML), value 0
Event: time 1599680404.332876, type 4 (EV_MSC), code 4 (MSC_SCAN), value 9c
Event: time 1599680404.332876, type 1 (EV_KEY), code 96 (KEY_KPENTER), value 0
Event: time 1599680404.332876, -------------- SYN_REPORT ------------
Event: time 1599680406.585714, type 4 (EV_MSC), code 4 (MSC_SCAN), value 10
Event: time 1599680406.585714, type 1 (EV_KEY), code 16 (KEY_Q), value 1
Event: time 1599680406.585714, -------------- SYN_REPORT ------------
qEvent: time 1599680406.679400, type 4 (EV_MSC), code 4 (MSC_SCAN), value 10
Event: time 1599680406.679400, type 1 (EV_KEY), code 16 (KEY_Q), value 0
Event: time 1599680406.679400, -------------- SYN_REPORT ------------
Event: time 1599680408.003106, type 4 (EV_MSC), code 4 (MSC_SCAN), value 12
Event: time 1599680408.003106, type 1 (EV_KEY), code 18 (KEY_E), value 1
Event: time 1599680408.003106, -------------- SYN_REPORT ------------
eEvent: time 1599680408.084025, type 4 (EV_MSC), code 4 (MSC_SCAN), value 12
Event: time 1599680408.084025, type 1 (EV_KEY), code 18 (KEY_E), value 0
Event: time 1599680408.084025, -------------- SYN_REPORT ------------
Event: time 1599680408.627585, type 4 (EV_MSC), code 4 (MSC_SCAN), value 1d
Event: time 1599680408.627585, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 1
Event: time 1599680408.627585, -------------- SYN_REPORT ------------
Event: time 1599680408.869309, type 4 (EV_MSC), code 4 (MSC_SCAN), value 1d
Event: time 1599680408.869309, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 2
Event: time 1599680408.869309, -------------- SYN_REPORT ------------
Event: time 1599680408.899782, type 4 (EV_MSC), code 4 (MSC_SCAN), value 1d
Event: time 1599680408.899782, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 2
Event: time 1599680408.899782, -------------- SYN_REPORT ------------
Event: time 1599680408.932919, type 4 (EV_MSC), code 4 (MSC_SCAN), value 1d
Event: time 1599680408.932919, type 1 (EV_KEY), code 29 (KEY_LEFTCTRL), value 2
Event: time 1599680408.932919, -------------- SYN_REPORT ------------
Event: time 1599680408.946321, type 4 (EV_MSC), code 4 (MSC_SCAN), value 2e
Event: time 1599680408.946321, type 1 (EV_KEY), code 46 (KEY_C), value 1
Event: time 1599680408.946321, -------------- SYN_REPORT ------------
^C%  
~ >>> evtest                                                                                                                                         
No device specified, trying to scan all of /dev/input/event*
Not running as root, no devices may be available.
Available devices:
/dev/input/event0:	Lid Switch
/dev/input/event1:	Power Button
/dev/input/event2:	Power Button
/dev/input/event3:	AT Translated Set 2 keyboard
/dev/input/event4:	Logitech Wireless Keyboard PID:4023
/dev/input/event5:	Logitech Wireless Mouse PID:4022
/dev/input/event6:	Intel Virtual Button driver
/dev/input/event7:	HP Wireless hotkeys
/dev/input/event8:	HP Truevision HD: HP Truevision
/dev/input/event9:	SynPS/2 Synaptics TouchPad
/dev/input/event10:	ELAN0732:00 04F3:0358
/dev/input/event11:	HDA Intel PCH Mic
/dev/input/event12:	HDA Intel PCH Headphone
/dev/input/event13:	PC Speaker
/dev/input/event14:	Video Bus
/dev/input/event15:	HDA Intel HDMI HDMI/DP,pcm=3
/dev/input/event16:	HDA Intel HDMI HDMI/DP,pcm=7
/dev/input/event17:	HDA Intel HDMI HDMI/DP,pcm=8
/dev/input/event18:	HDA Intel HDMI HDMI/DP,pcm=9
/dev/input/event19:	HDA Intel HDMI HDMI/DP,pcm=10
/dev/input/event20:	ELAN0732:00 04F3:0358 UNKNOWN
/dev/input/event21:	ELAN0732:00 04F3:0358 UNKNOWN
/dev/input/event22:	HP WMI hotkeys
/dev/input/event23:	ST LIS3LV02DL Accelerometer
Select the device event number [0-23]: 9
Input driver version is 1.0.1
Input device ID: bus 0x11 vendor 0x2 product 0x7 version 0x1b1
Input device name: "SynPS/2 Synaptics TouchPad"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 272 (BTN_LEFT)
    Event code 325 (BTN_TOOL_FINGER)
    Event code 328 (BTN_TOOL_QUINTTAP)
    Event code 330 (BTN_TOUCH)
    Event code 333 (BTN_TOOL_DOUBLETAP)
    Event code 334 (BTN_TOOL_TRIPLETAP)
    Event code 335 (BTN_TOOL_QUADTAP)
  Event type 3 (EV_ABS)
    Event code 0 (ABS_X)
      Value   1947
      Min     1380
      Max     5672
      Resolution      44
    Event code 1 (ABS_Y)
      Value   2980
      Min     1192
      Max     4722
      Resolution      61
    Event code 24 (ABS_PRESSURE)
      Value      0
      Min        0
      Max      255
    Event code 28 (ABS_TOOL_WIDTH)
      Value      0
      Min        0
      Max       15
    Event code 47 (ABS_MT_SLOT)
      Value      0
      Min        0
      Max        1
    Event code 53 (ABS_MT_POSITION_X)
      Value      0
      Min     1380
      Max     5672
      Resolution      44
    Event code 54 (ABS_MT_POSITION_Y)
      Value      0
      Min     1192
      Max     4722
      Resolution      61
    Event code 57 (ABS_MT_TRACKING_ID)
      Value      0
      Min        0
      Max    65535
    Event code 58 (ABS_MT_PRESSURE)
      Value      0
      Min        0
      Max      255
Properties:
  Property type 0 (INPUT_PROP_POINTER)
  Property type 2 (INPUT_PROP_BUTTONPAD)
Testing ... (interrupt to exit)
Event: time 1599680522.773442, type 3 (EV_ABS), code 57 (ABS_MT_TRACKING_ID), value 18
Event: time 1599680522.773442, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 3667
Event: time 1599680522.773442, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 3072
Event: time 1599680522.773442, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 43
Event: time 1599680522.773442, type 1 (EV_KEY), code 330 (BTN_TOUCH), value 1
Event: time 1599680522.773442, type 3 (EV_ABS), code 0 (ABS_X), value 3667
Event: time 1599680522.773442, type 3 (EV_ABS), code 1 (ABS_Y), value 3072
Event: time 1599680522.773442, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 43
Event: time 1599680522.773442, type 1 (EV_KEY), code 325 (BTN_TOOL_FINGER), value 1
Event: time 1599680522.773442, -------------- SYN_REPORT ------------
Event: time 1599680522.784245, type 3 (EV_ABS), code 53 (ABS_MT_POSITION_X), value 3669
Event: time 1599680522.784245, type 3 (EV_ABS), code 54 (ABS_MT_POSITION_Y), value 3071
Event: time 1599680522.784245, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 49
Event: time 1599680522.784245, type 3 (EV_ABS), code 0 (ABS_X), value 3669
Event: time 1599680522.784245, type 3 (EV_ABS), code 1 (ABS_Y), value 3071
Event: time 1599680522.784245, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 49
Event: time 1599680522.784245, -------------- SYN_REPORT ------------
Event: time 1599680522.794083, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 52
Event: time 1599680522.794083, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 52
Event: time 1599680522.794083, -------------- SYN_REPORT ------------
Event: time 1599680522.803848, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 55
Event: time 1599680522.803848, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 55
Event: time 1599680522.803848, -------------- SYN_REPORT ------------
Event: time 1599680522.814859, type 3 (EV_ABS), code 58 (ABS_MT_PRESSURE), value 56
Event: time 1599680522.814859, type 3 (EV_ABS), code 24 (ABS_PRESSURE), value 56
Event: time 1599680522.814859, -------------- SYN_REPORT ------------

all the events were from the built-in touchpad and keyboard

@pobrn @megavolt, thanks for the help.

I found this work around which seems to be working pretty well so far,
bbs .archlinux .org/viewtopic.php?id=257963

in summary create a udev rule on etc/udev/rules.d/99-hp-libinput.rules (hp in my case)
with

ACTION=="add|change", KERNEL=="event[0-9]*", ATTRS{name}=="Intel Virtual Button driver", ENV{LIBINPUT_IGNORE_DEVICE}="1"

apparently intel virtual button driver should not have a switch capability on libinput

I still don’t understand why this is not a problem on 5.6.
Where should this be reported and should this be marked as solution?

1 Like

Technically, it should have that since the driver does support it. I think your problem has to do with a change backported from v5.8.

Could you please run evtest for the intel virtual button device on both kernels? Can you also check the content of cat /sys/devices/virtual/dmi/id/chassis_type?

By the way, you can mark any answer as solution. If you want to report it, I suggest you write to the platform-driver-x86 kernel mailing list (the driver in question is intel-vbtn).

~ >>> cat /sys/devices/virtual/dmi/id/chassis_type                             
10

evtest did not register any event while pressing keys or moving the pointer on both kernels

Input driver version is 1.0.1
Input device ID: bus 0x19 vendor 0x0 product 0x0 version 0x0
Input device name: "Intel Virtual Button driver"
Supported events:
  Event type 0 (EV_SYN)
  Event type 1 (EV_KEY)
    Event code 114 (KEY_VOLUMEDOWN)
    Event code 115 (KEY_VOLUMEUP)
    Event code 116 (KEY_POWER)
    Event code 125 (KEY_LEFTMETA)
    Event code 240 (KEY_UNKNOWN)
    Event code 561 (?)
  Event type 4 (EV_MSC)
    Event code 4 (MSC_SCAN)
  Event type 5 (EV_SW)
    Event code 1 (SW_TABLET_MODE) state 0
    Event code 5 (SW_DOCK) state 0
Properties:
Testing ... (interrupt to exit)

but on 5.4 (where it does not work) the line for tablet mode was on a different state

 Event code 1 (SW_TABLET_MODE) state 1

which is probably blocking the keyboard and touchpad,

but putting it in tablet mode by unfolding (I’m not sure if this is the right term here) completely and only when it’s fully unfolded, disables the keyboard and touchpad on the working kernel, still without registering events on evtest for the intel virtual button driver.

also, I removed the udev file for the reposrts on this post

I am pretty sure this is in fact the problem.

Can you run evtest, then close it, then fold the laptop (put it in table mode), then run evtest again? Does SW_TABLET_MODE change?

It did not change the state on both kernels

Hmmm. Could you please start acpi_listen (kernel doesn’t matter) (install the acpid package if it’s not installed yet, then start acpid: sudo systemctl start acpid) , and see if anything appears if you “fold”/“unfold” the computer?

~ >>> sudo systemctl start acpid.service                                    [1]
~ >>> acpi_listen

did not have any output when folding/unfolding the laptop, I removed the ac adapter just to make sure it was registering something, which it was, it also registers regular opening and closing the lid

Please install the acpica package, create a directory, step into it, then run sudo acpidump > acpi.bin, then acpixtract acpi.bin, then iasl -d *.dat and please upload dsdt.dsl somewhere.

filebin .net/e1x29ym3jjo9q5ah

Thanks. I’m not sure which, but either the kernel driver (intel-vbtn) or the ACPI firmware is wrong. I find that particularly interesting that no ACPI events fire when the device is “folded” because they should. Could you start sudo dmesg -w and see if any ACPI related errors/warnings appear when you fold the device? Have you tested it on Windows, by the way? Does this “tablet mode” work there (touchpad+keyboard works in normal operation, it is disabled when the device is “folded”)?

the only lines with the word error or warning:

[    0.655922] acpi PNP0A08:00: _OSC failed (AE_ERROR); disabling ASPM
[    1.247266] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.LPCB.HEC.ECRD], AE_NOT_FOUND (20190816/psargs-330)
[    1.247282] ACPI Error: Aborting method \_TZ.TZ00._TMP due to previous error (AE_NOT_FOUND) (20190816/psparse-529)
[    1.247632] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.LPCB.HEC.ECRD], AE_NOT_FOUND (20190816/psargs-330)
[    1.247642] ACPI Error: Aborting method \_TZ.TZ00._TMP due to previous error (AE_NOT_FOUND) (20190816/psparse-529)
[    1.247804] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.LPCB.HEC.ECRD], AE_NOT_FOUND (20190816/psargs-330)
[    1.247813] ACPI Error: Aborting method \_TZ.TZ01._TMP due to previous error (AE_NOT_FOUND) (20190816/psparse-529)
[    1.247957] ACPI BIOS Error (bug): Could not resolve symbol [\_SB.PCI0.LPCB.HEC.ECRD], AE_NOT_FOUND (20190816/psargs-330)
[    1.247966] ACPI Error: Aborting method \_TZ.TZ01._TMP due to previous error (AE_NOT_FOUND) (20190816/psparse-529)
[    1.268106] RAS: Correctable Errors collector initialized.
[    4.029079] random: 1 urandom warning(s) missed due to ratelimiting

Folding and unfolding the device did not trigger new lines on dmesg.

I don’t recall testing this on windows, but I was using ubuntu 18.04 before which worked fine (I think it might’ve been the kernel 5.3, but I’m not sure) the update to 20.04 broke the keyboard and touchpad that’s when i switched to manjaro.

Yes, this is a kernel regression, unfortunately. I’ll write to the (hopefully) appropriate maintainers to get this sorted out (if you haven’t already).

I have not reported this anywhere,
@pobrn thanks for all the help, I’ll stick with the udev workaround for now.

I heard back from kernel maintainers, and built a kernel (Manjaro 5.4.61) with an experimental patch. I’d really appreciate if you could try it out. Please boot into a kernel that’s not 5.4.x, and remove the 5.4.x kernel, then install the patched version:

sudo pacman -Syu
sudo pacman -U linux54-headers-5.4.64-1-x86_64.pkg.tar.zst
sudo pacman -U linux54-5.4.64-1-x86_64.pkg.tar.zst

SHA256 sums:

e1ff88fce1ea86817a82edb1cca2a2bc09d29b7953deaa8e05dd4d6ba51ebcfa  linux54-5.4.64-1-x86_64.pkg.tar.zst
d72d035be556b0c748ef17957614f95ca3594e9c60578ad0299d1861343d4b4c  linux54-headers-5.4.64-1-x86_64.pkg.tar.zst

Please remove the udev rule when testing it. Also confirm that evtest shows that SW_TABLET_MODE is zero. Please also start sudo evemu-record (install the evemu package) and then “fold”/“unfold” the machine, and provide the output (even if nothing appears when you fold it).

Patched kernel is here: https://ufile.io/f/xudbc

I tested the pateched kernel, the keyboard and touchpad are working properly.
evtest line:

Event code 1 (SW_TABLET_MODE) state 0

evemu

~ >>> sudo evemu-record                                         
[sudo] password for mgf-x360: 
Available devices:
/dev/input/event0:	Lid Switch
/dev/input/event1:	Power Button
/dev/input/event2:	Power Button
/dev/input/event3:	AT Translated Set 2 keyboard
/dev/input/event4:	HP Truevision HD: HP Truevision
/dev/input/event5:	Logitech Wireless Keyboard PID:4023
/dev/input/event6:	Logitech Wireless Mouse PID:4022
/dev/input/event8:	Intel Virtual Button driver
/dev/input/event9:	HP Wireless hotkeys
/dev/input/event10:	PC Speaker
/dev/input/event11:	HDA Intel PCH Mic
/dev/input/event12:	HDA Intel PCH Headphone
/dev/input/event13:	Video Bus
/dev/input/event14:	HDA Intel HDMI HDMI/DP,pcm=3
/dev/input/event15:	HDA Intel HDMI HDMI/DP,pcm=7
/dev/input/event16:	HDA Intel HDMI HDMI/DP,pcm=8
/dev/input/event17:	HDA Intel HDMI HDMI/DP,pcm=9
/dev/input/event18:	HDA Intel HDMI HDMI/DP,pcm=10
/dev/input/event19:	HP WMI hotkeys
/dev/input/event20:	SynPS/2 Synaptics TouchPad
/dev/input/event21:	ST LIS3LV02DL Accelerometer
Select the device event number [0-21]: 8
# EVEMU 1.3
# Kernel: 5.4.64-1-MANJARO
# DMI: dmi:bvnInsyde:bvrF.28:bd08/11/2015:svnHewlett-Packard:pnHPPavilion11x360PC:pvr0979110000405F00000310180:rvnHewlett-Packard:rn8050:rvr64.20:cvnHewlett-Packard:ct10:cvrChassisVersion:
# Input device name: "Intel Virtual Button driver"
# Input device ID: bus 0x19 vendor 0000 product 0000 version 0000
# Supported events:
#   Event type 0 (EV_SYN)
#     Event code 0 (SYN_REPORT)
#     Event code 1 (SYN_CONFIG)
#     Event code 2 (SYN_MT_REPORT)
#     Event code 3 (SYN_DROPPED)
#     Event code 4 ((null))
#     Event code 5 ((null))
#     Event code 6 ((null))
#     Event code 7 ((null))
#     Event code 8 ((null))
#     Event code 9 ((null))
#     Event code 10 ((null))
#     Event code 11 ((null))
#     Event code 12 ((null))
#     Event code 13 ((null))
#     Event code 14 ((null))
#     Event code 15 (SYN_MAX)
#   Event type 1 (EV_KEY)
#     Event code 114 (KEY_VOLUMEDOWN)
#     Event code 115 (KEY_VOLUMEUP)
#     Event code 116 (KEY_POWER)
#     Event code 125 (KEY_LEFTMETA)
#     Event code 240 (KEY_UNKNOWN)
#     Event code 561 (KEY_ROTATE_LOCK_TOGGLE)
#   Event type 4 (EV_MSC)
#     Event code 4 (MSC_SCAN)
#   Event type 5 (EV_SW)
#     Event code 1 (SW_TABLET_MODE)
#        State 0
#     Event code 5 (SW_DOCK)
#        State 0
# Properties:
N: Intel Virtual Button driver
I: 0019 0000 0000 0000
P: 00 00 00 00 00 00 00 00
B: 00 0b 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 1c 20
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 01 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 02 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 01 00 00 00 00 00 00 00 00
B: 02 00 00 00 00 00 00 00 00
B: 03 00 00 00 00 00 00 00 00
B: 04 10 00 00 00 00 00 00 00
B: 05 22 00 00 00 00 00 00 00
B: 11 00 00 00 00 00 00 00 00
B: 12 00 00 00 00 00 00 00 00
B: 14 00 00 00 00 00 00 00 00
B: 15 00 00 00 00 00 00 00 00
B: 15 00 00 00 00 00 00 00 00
################################
#      Waiting for events      #
################################
~ >>>

nothing was reported on evtest or evemu when putting the lid on tablet mode, but it does block the keyboard and touchpad. I only checked the Intel Virtual Button Driver though.
Thanks again.

I just want to be sure: no events appear in evtest nor evemu-record when going to tablet mode, but the touchpad and keyboard are disabled in tablet mode? And if you run evtest or evemu-record in both tablet and normal mode, do they report SW_TABLET_MODE as 0 or 1?

Yes, switching to and from tablet mode does not record events on evtest or evemu-record for the intel virtual button driver.

Yes, the built-in keyboard and touchpad are not responsive when the lid is completely

evtest always shows Event code 1 (SW_TABLET_MODE) state 0 for the intel virtual button driver.
evemu-record SW_TABLET_MODE is always on State 0 for the intel virtual button driver.

I see. Could you please run evtest on the “intel virtual button” device and just copy the listed event types/codes?