Input: synaptics-rmi4: Add support for F12
Subsystems (2)
PATCH 21/26 Input: synaptics-rmi4: Add support for F12
Function 12 implements 2D touch position sensor for newer Synaptics touch devices. It replaces F11 and no device will contain both functions.
Signed-off-by Andrew Duggan <[email protected]>
--- drivers/input/rmi4/Kconfig | 10 + drivers/input/rmi4/Makefile | 1 + drivers/input/rmi4/rmi_bus.c | 12 +- drivers/input/rmi4/rmi_driver.h | 8 + drivers/input/rmi4/rmi_f12.c | 461 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 491 insertions(+), 1 deletion(-) create mode 100644 drivers/input/rmi4/rmi_f12.c
drivers/input/rmi4/Kconfig +10 -0
@@ -80,3 +80,13 @@ config RMI4_F11_PEN If your system is not recognizing pen touches and you know your sensor supports pen input, you probably want to turn this feature off. + +config RMI4_F12 + bool "RMI4 Function 12 (2D pointing)" + depends on RMI4_2D_SENSOR + help + Say Y here if you want to add support for RMI4 function 12. + + Function 12 provides 2D multifinger pointing for touchscreens and + touchpads. For sensors that support relative pointing, F12 also + provides mouse input.
drivers/input/rmi4/Makefile +1 -0
@@ -5,6 +5,7 @@ rmi_core-$(CONFIG_RMI4_2D_SENSOR) += rmi_2d_sensor.o # Function drivers rmi_core-$(CONFIG_RMI4_F11) += rmi_f11.o +rmi_core-$(CONFIG_RMI4_F12) += rmi_f12.o # Transports obj-$(CONFIG_RMI4_I2C) += rmi_i2c.o
drivers/input/rmi4/rmi_bus.c +11 -1
@@ -360,15 +360,24 @@ static int __init rmi_bus_init(void) goto err_unregister_f01; } + error =rmi_register_f12_handler (); +if (error) { +pr_err ("%s: error registering the RMI F12 handler: %d\n" , + __func__, error); + goto err_unregister_f11; + } + error =rmi_register_physical_driver ();if (error) {pr_err ("%s: error registering the RMI physical driver: %d\n" , __func__, error); - goto err_unregister_f11; + goto err_unregister_f12; }return 0 ; +err_unregister_f12: +rmi_unregister_f12_handler (); err_unregister_f11:rmi_unregister_f11_handler (); err_unregister_f01:
@@ -387,6 +396,7 @@ static void __exit rmi_bus_exit(void)*/ rmi_unregister_physical_driver (); +rmi_unregister_f12_handler ();rmi_unregister_f11_handler ();rmi_unregister_f01_handler ();bus_unregister (&rmi_bus_type);
drivers/input/rmi4/rmi_driver.h +8 -0
@@ -155,4 +155,12 @@ static inline int rmi_register_f11_handler(void) { return 0; }static inline void rmi_unregister_f11_handler (void ) {}#endif +#ifdef CONFIG_RMI4_F12 +int rmi_register_f12_handler (void ); +void rmi_unregister_f12_handler (void ); +#else +static inline int rmi_register_f12_handler (void ) {return 0 ; } +static inline void rmi_unregister_f12_handler (void ) {} +#endif +#endif
drivers/input/rmi4/rmi_f12.c new file +461 -0
461 lines not on this page · raw message
Signature · 1 line
2.1.4
Quoted 4 lines · Andrew Duggan
Function 12 implements 2D touch position sensor for newer Synaptics touch devices. It replaces F11 and no device will contain both functions.
Signed-off-by Andrew Duggan <[email protected]>
(...)
drivers/input/rmi4/Kconfig config RMI4_F11_PEN · line 86
Quoted 3 lines
drivers/input/rmi4/Kconfig +3
-0+config RMI4_F12 + bool "RMI4 Function 12 (2D pointing)" + depends on RMI4_2D_SENSOR
So this properly depends on RMI4_2D_SENSOR (you missed this for F11 IIUC).
But I think the approach to have it select RMI4_2D_SENSOR (which is to be hidden) is a better approach.
This stand-alone F12 patch is nice though, that is how all patches should look: add a function.
Yours,
Linus Walleij