Skip to contentSkip to conversation

Input: synaptics-rmi4: Add support for F30

PATCH Superseded Andrew Duggan 1 participant 1 message Feb 3, 2016

Subsystems (2)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

PATCH v3 7/10 Input: synaptics-rmi4: Add support for F30

RMI4 F30 supports input from clickpad buttons and controls LEDs located on the touchpad PCB. This patch adds support of the clickpad buttons and defers supporting LEDs for the future.

---
 drivers/input/rmi4/Kconfig      |   9 +
 drivers/input/rmi4/Makefile     |   1 +
 drivers/input/rmi4/rmi_bus.c    |   3 +
 drivers/input/rmi4/rmi_driver.h |   1 +
 drivers/input/rmi4/rmi_f30.c    | 408 ++++++++++++++++++++++++++++++++++++++++
 include/linux/rmi.h             |  16 ++
 6 files changed, 438 insertions(+)
 create mode 100644 drivers/input/rmi4/rmi_f30.c
drivers/input/rmi4/Kconfig +9 -0
index aabb854..284faec 100644
@@ -43,3 +43,12 @@ config RMI4_F12
 	  Function 12 provides 2D multifinger pointing for touchscreens and
 	  touchpads. For sensors that support relative pointing, F12 also
 	  provides mouse input.
+
+config RMI4_F30
+	bool "RMI4 Function 30 (GPIO LED)"
+	depends on RMI4_CORE
+	help
+	  Say Y here if you want to add support for RMI4 function 30.
+
+	  Function 30 provides GPIO and LED support for RMI4 devices. This
+	  includes support for buttons on TouchPads and ClickPads.
drivers/input/rmi4/Makefile +1 -0
index d01e703..ad7156d 100644
@@ -6,6 +6,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
+rmi_core-$(CONFIG_RMI4_F30) += rmi_f30.o
 
 # Transports
 obj-$(CONFIG_RMI4_I2C) += rmi_i2c.o
drivers/input/rmi4/rmi_bus.c +3 -0
index 106ecec..5db7169 100644
@@ -312,6 +312,9 @@ static struct rmi_function_handler *fn_handlers[] = {
 #ifdef CONFIG_RMI4_F12
 	&rmi_f12_handler,
 #endif
+#ifdef CONFIG_RMI4_F30
+	&rmi_f30_handler,
+#endif
 };
 
 #define RMI_FN_HANDLER_ARRAY_SIZE \
drivers/input/rmi4/rmi_driver.h +1 -0
index ed9127d..6e140fa 100644
@@ -101,4 +101,5 @@ char *rmi_f01_get_product_ID(struct rmi_function *fn);
 extern struct rmi_function_handler rmi_f01_handler;
 extern struct rmi_function_handler rmi_f11_handler;
 extern struct rmi_function_handler rmi_f12_handler;
+extern struct rmi_function_handler rmi_f30_handler;
 #endif
drivers/input/rmi4/rmi_f30.c new file +408 -0

408 lines not on this page · raw message

include/linux/rmi.h +16 -0
index 2c48ae2..dca1b25 100644
@@ -102,6 +102,21 @@ struct rmi_2d_sensor_platform_data {
 };
 
 /**
+ * struct rmi_f30_data - overrides defaults for a single F30 GPIOs/LED chip.
+ * @buttonpad - the touchpad is a buttonpad, so enable only the first actual
+ * button that is found.
+ * @trackstick_buttons - Set when the function 30 is handling the physical
+ * buttons of the trackstick (as a PD/2 passthrough device.
+ * @disable - the touchpad incorrectly reports F30 and it should be ignored.
+ * This is a special case which is due to misconfigured firmware.
+ */
+struct rmi_f30_data {
+	bool buttonpad;
+	bool trackstick_buttons;
+	bool disable;
+};
+
+/**
  * struct rmi_f01_power - override default power management settings.
  *
  */
@@ -151,6 +166,7 @@ struct rmi_device_platform_data {
 	/* function handler pdata */
 	struct rmi_2d_sensor_platform_data *sensor_pdata;
 	struct rmi_f01_power_management power_management;
+	struct rmi_f30_data *f30_data;
 };
 
 /**
Signature · 1 line
2.5.0