Skip to contentSkip to conversation

Input: synaptics-rmi4: Add support for F12

PATCH In review Andrew Duggan 1 participant 1 message Nov 26, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 6/10 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.

---
 drivers/input/rmi4/Kconfig      |  10 +
 drivers/input/rmi4/Makefile     |   1 +
 drivers/input/rmi4/rmi_bus.c    |  13 +-
 drivers/input/rmi4/rmi_driver.h |   8 +
 drivers/input/rmi4/rmi_f12.c    | 487 ++++++++++++++++++++++++++++++++++++++++
 5 files changed, 518 insertions(+), 1 deletion(-)
 create mode 100644 drivers/input/rmi4/rmi_f12.c
drivers/input/rmi4/Kconfig +10 -0
index 152310a..00a5283 100644
@@ -64,3 +64,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)"
+	select 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
index 5ff604f..8db9500 100644
@@ -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 +12 -1
index 21666ae..93e919d 100644
@@ -359,14 +359,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:
@@ -385,6 +395,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
index ab9d866..670ba8a 100644
@@ -107,4 +107,12 @@ void rmi_unregister_f11_handler(void);
 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 +487 -0

487 lines not on this page · raw message

Signature · 1 line
2.5.0