Skip to contentSkip to conversation

input: add Qualcomm SPMI haptics driver

PATCH Superseded Caleb Connolly 2 participants 2 messages Oct 10, 2022 – Oct 11, 2022

Subsystems (3)

v6 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

PATCH v6 2/2 input: add Qualcomm SPMI haptics driver

Add support for the haptics found in pmi8998 and related PMICs. Based on the ff-memless interface. Currently this driver provides a partial implementation of hardware features.

This driver only supports LRAs (Linear Resonant Actuators) in the "buffer" mode with a single wave pattern.

---
 drivers/input/misc/Kconfig                |  15 +
 drivers/input/misc/Makefile               |   1 +
 drivers/input/misc/qcom-pmi8998-haptics.c | 690 ++++++++++++++++++++++
 3 files changed, 706 insertions(+)
 create mode 100644 drivers/input/misc/qcom-pmi8998-haptics.c
drivers/input/misc/Kconfig +15 -0
index a18ab7358d8f..c3b59ea23144 100644
@@ -186,6 +186,21 @@ config INPUT_PMIC8XXX_PWRKEY
 	  To compile this driver as a module, choose M here: the
 	  module will be called pmic8xxx-pwrkey.
 
+config INPUT_QCOM_PMI8998_HAPTICS
+	tristate "Qualcomm SPMI HAPTICS"
+	depends on ARCH_QCOM
+	depends on MFD_PM8XXX || MFD_SPMI_PMIC
+	select INPUT_FF_MEMLESS
+	help
+	  This option enables support for the haptics found in pmi8998 and
+	  related PMICs. Based on the ff-memless interface.
+
+	  This driver is for hardware too new for the INPUT_PM8XXX_VIBRATOR
+	  driver.
+
+	  To compile this driver as module, choose M here: the
+	  module will be called qcom_pmi8998_haptics.
+
 config INPUT_SPARCSPKR
 	tristate "SPARC Speaker support"
 	depends on PCI && SPARC64
drivers/input/misc/Makefile +1 -0
index 28dfc444f0a9..039d0a97f2f4 100644
@@ -65,6 +65,7 @@ obj-$(CONFIG_INPUT_PMIC8XXX_PWRKEY)	+= pmic8xxx-pwrkey.o
 obj-$(CONFIG_INPUT_POWERMATE)		+= powermate.o
 obj-$(CONFIG_INPUT_PWM_BEEPER)		+= pwm-beeper.o
 obj-$(CONFIG_INPUT_PWM_VIBRA)		+= pwm-vibra.o
+obj-$(CONFIG_INPUT_QCOM_PMI8998_HAPTICS)+= qcom-pmi8998-haptics.o
 obj-$(CONFIG_INPUT_RAVE_SP_PWRBUTTON)	+= rave-sp-pwrbutton.o
 obj-$(CONFIG_INPUT_RB532_BUTTON)	+= rb532_button.o
 obj-$(CONFIG_INPUT_REGULATOR_HAPTIC)	+= regulator-haptic.o
drivers/input/misc/qcom-pmi8998-haptics.c new file +690 -0

690 lines not on this page · raw message

--
2.38.0

#1 lore raw
Quoted 20 lines · Caleb Connolly

Add support for the haptics found in pmi8998 and related PMICs. Based on the ff-memless interface. Currently this driver provides a partial implementation of hardware features.

This driver only supports LRAs (Linear Resonant Actuators) in the "buffer" mode with a single wave pattern.

---
 drivers/input/misc/Kconfig                |  15 +
 drivers/input/misc/Makefile               |   1 +
 drivers/input/misc/qcom-pmi8998-haptics.c | 690 ++++++++++++++++++++++
 3 files changed, 706 insertions(+)
 create mode 100644 drivers/input/misc/qcom-pmi8998-haptics.c
drivers/input/misc/Kconfig +0 -0
index a18ab7358d8f..c3b59ea23144 100644

drivers/input/misc/Kconfig config INPUT_PMIC8XXX_PWRKEY · line 191

Quoted 6 lines
drivers/input/misc/Kconfig +3 -0
@@ -186,6 +186,21 @@ config INPUT_PMIC8XXX_PWRKEY
 	  To compile this driver as a module, choose M here: the
 	  module will be called pmic8xxx-pwrkey.
 
+config INPUT_QCOM_PMI8998_HAPTICS
+	tristate "Qualcomm SPMI HAPTICS"
+	depends on ARCH_QCOM

|| COMPILE_TEST

drivers/input/misc/Kconfig config INPUT_PMIC8XXX_PWRKEY · line 192

Quoted 1 line
drivers/input/misc/Kconfig +1 -0
+	depends on MFD_PM8XXX || MFD_SPMI_PMIC

|| COMPILE_TEST (and actually test it)

drivers/input/misc/Kconfig config INPUT_PMIC8XXX_PWRKEY · line 203

Quoted 11 lines
drivers/input/misc/Kconfig +11 -0
+	select INPUT_FF_MEMLESS
+	help
+	  This option enables support for the haptics found in pmi8998 and
+	  related PMICs. Based on the ff-memless interface.
+
+	  This driver is for hardware too new for the INPUT_PM8XXX_VIBRATOR
+	  driver.
+
+	  To compile this driver as module, choose M here: the
+	  module will be called qcom_pmi8998_haptics.
+

Best regards,
Krzysztof