BACKPORT: FROMGIT: Input: cros-ec-keyb - allow skipping keyboard registration

If the device is a detachable (and therefore lacks full keyboard), we may
still want to load this driver because the device might have some other
buttons or switches (e.g. volume and power buttons or a tablet mode
switch). In such case we do not want to register the "main" keyboard device
to allow userspace detect when the detachable keyboard is disconnected and
adjust the system behavior for the tablet mode.

Originally it was suggested to simply skip keyboard registration if row and
columns properties didn't exist, but that approach did not convey the
intent strongly enough and also had a slight problem for migrating existing
DTBs without updating the kernel first, so it was decided to introduce new
google,cros-ec-keyb-switches to explicitly mark devices that only have
axillary buttons and switches.

Reviewed-by: Douglas Anderson <>
Signed-off-by: Stephen Boyd <>
Signed-off-by: Dmitry Torokhov <>

(cherry picked from commit ca1eadbfcd36bec73f2a2111c28e8c7e9e8ae6c0
 git:// ib/5.17-cros-ec-keyb)


TEST=emerge-strongbad chromeos-kernel-5_4; Boot on wormdingler;
     evtest shows no more cros_ec device

Cq-Depend: chromium:3625918
Change-Id: I1efb0e8126545620b68170c7c1eca5babb28c668
Commit-Queue: Douglas Anderson <>
Reviewed-by: Douglas Anderson <>
Tested-by: Stephen Boyd <>
Reviewed-by: Dmitry Torokhov <>
1 file changed