linux/drivers/input/serio
Hans de Goede 94b6e6ee17 Input: i8042 - allow insmod to succeed on devices without an i8042 controller
[ Upstream commit b1884583fc ]

The i8042 module exports several symbols which may be used by other
modules.

Before this commit it would refuse to load (when built as a module itself)
on systems without an i8042 controller.

This is a problem specifically for the asus-nb-wmi module. Many Asus
laptops support the Asus WMI interface. Some of them have an i8042
controller and need to use i8042_install_filter() to filter some kbd
events. Other models do not have an i8042 controller (e.g. they use an
USB attached kbd).

Before this commit the asus-nb-wmi driver could not be loaded on Asus
models without an i8042 controller, when the i8042 code was built as
a module (as Arch Linux does) because the module_init function of the
i8042 module would fail with -ENODEV and thus the i8042_install_filter
symbol could not be loaded.

This commit fixes this by exiting from module_init with a return code
of 0 if no controller is found.  It also adds a i8042_present bool to
make the module_exit function a no-op in this case and also adds a
check for i8042_present to the exported i8042_command function.

The latter i8042_present check should not really be necessary because
when builtin that function can already be used on systems without
an i8042 controller, but better safe then sorry.

Reported-and-tested-by: Marius Iacob <themariusus@gmail.com>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20201008112628.3979-2-hdegoede@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-12-02 08:48:08 +01:00
..
altera_ps2.c
ambakmi.c
ams_delta_serio.c
apbps2.c
arc_ps2.c
ct82c710.c
gscps2.c parisc: Fix serio address output 2019-12-05 09:19:57 +01:00
hil_mlc.c hil/parisc: Disable HIL driver when it gets stuck 2020-11-05 11:08:54 +01:00
hp_sdc_mlc.c hil/parisc: Disable HIL driver when it gets stuck 2020-11-05 11:08:54 +01:00
hp_sdc.c parisc: Fix HP SDC hpa address output 2019-12-05 09:19:57 +01:00
hyperv-keyboard.c Input: hyperv-keyboard: Use in-place iterator API in the channel callback 2019-09-10 10:33:49 +01:00
i8042-io.h
i8042-ip22io.h
i8042-jazzio.h
i8042-ppcio.h
i8042-snirm.h
i8042-sparcio.h
i8042-unicore32io.h
i8042-x86ia64io.h Input: i8042 - add nopnp quirk for Acer Aspire 5 A515 2020-10-07 08:00:05 +02:00
i8042.c Input: i8042 - allow insmod to succeed on devices without an i8042 controller 2020-12-02 08:48:08 +01:00
i8042.h
Kconfig
libps2.c
maceps2.c
Makefile
olpc_apsp.c
parkbd.c
pcips2.c
ps2-gpio.c Input: ps2-gpio - flush TX work when closing port 2019-03-23 20:09:44 +01:00
ps2mult.c
q40kbd.c
rpckbd.c
sa1111ps2.c
serio_raw.c
serio.c
serport.c
sun4i-ps2.c Input: sun4i-ps2 - fix handling of platform_get_irq() error 2020-10-30 10:38:24 +01:00
userio.c
xilinx_ps2.c