input: pmi8998_haptics: introduce new haptics driver

Introduce a haptics driver for the pmi8998 haptics engine used by
several generations of Qualcomm SoCs (MSM8996 through SDM845).

Here we only implement a small subset of common operations, advanced
features like customising the wave pattern, driving the haptics via pwm
and several other features are either stubbed or left unimplemented for
now.

Signed-off-by: Caleb Connolly <caleb@connolly.tech>
This commit is contained in:
Caleb Connolly 2021-01-28 19:41:37 +00:00 committed by BigfootACA
parent 1271871f13
commit 5588227331
4 changed files with 1162 additions and 0 deletions

View File

@ -164,6 +164,18 @@ config INPUT_PM8XXX_VIBRATOR
To compile this driver as module, choose M here: the
module will be called pm8xxx-vibrator.
config INPUT_PMI8998_HAPTICS
tristate "Qualcomm PMI8998 HAPTICS"
depends on ARCH_QCOM
select INPUT_FF_MEMLESS
help
This option enabled support for the haptics found in pmi8998 PMICs.
Based on the ff-memless interface. Currently this driver provides
a partial implementation and ONLY supports SDM845 SoCs.
To compile this driver as module, choose M here: the
module will be called pmi8998-haptics.
config INPUT_PMIC8XXX_PWRKEY
tristate "PMIC8XXX power key support"
depends on MFD_PM8XXX

View File

@ -59,6 +59,7 @@ obj-$(CONFIG_INPUT_PCF8574) += pcf8574_keypad.o
obj-$(CONFIG_INPUT_PCSPKR) += pcspkr.o
obj-$(CONFIG_INPUT_PM8941_PWRKEY) += pm8941-pwrkey.o
obj-$(CONFIG_INPUT_PM8XXX_VIBRATOR) += pm8xxx-vibrator.o
obj-$(CONFIG_INPUT_PMI8998_HAPTICS) += pmi8998-haptics.o
obj-$(CONFIG_INPUT_PMIC8XXX_PWRKEY) += pmic8xxx-pwrkey.o
obj-$(CONFIG_INPUT_POWERMATE) += powermate.o
obj-$(CONFIG_INPUT_PWM_BEEPER) += pwm-beeper.o

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,31 @@
/* SPDX-License-Identifier: GPL-2.0 */
/*
* This header provides constants for gpio keys bindings.
*/
#ifndef _DT_BINDINGS_QCOM_PMIC_8998_HAPTICS_
#define _DT_BINDINGS_QCOM_PMIC_8998_HAPTICS_
// Actuator types
#define HAP_TYPE_LRA 0
#define HAP_TYPE_ERM 1
// LRA Wave type
#define HAP_WAVE_SINE 0
#define HAP_WAVE_SQUARE 1
// Play modes
#define HAP_PLAY_DIRECT 0
#define HAP_PLAY_BUFFER 1
#define HAP_PLAY_AUDIO 2
#define HAP_PLAY_PWM 3
#define HAP_PLAY_MAX HAP_PLAY_PWM
#define HAP_AUTO_RES_NONE 0
#define HAP_AUTO_RES_ZXD 1
#define HAP_AUTO_RES_QWD 2
#define HAP_AUTO_RES_MAX_QWD 3
#define HAP_AUTO_RES_ZXD_EOP 4
#endif /* _DT_BINDINGS_QCOM_PMIC_8998_HAPTICS_ */