[PATCH v8 1/9] dt-bindings: input: Add Qualcomm PMI8998 / PM660 haptics
From: David Heidelberg via B4 Relay
Date: Sun Nov 29 2026 - 19:14:33 EST
From: David Heidelberg <david@xxxxxxx>
Document the haptics module found in the Qualcomm PMI8998 PMIC. It drives
an LRA or ERM actuator from an 8-sample waveform buffer, a fixed voltage,
an audio stream or a PWM input, and reports short circuits and buffer
completion through two interrupts.
The module predates the HAP530 design covered by qcom,spmi-haptics.yaml
and has a different register layout, so it gets its own schema and no
qcom,spmi-haptics fallback compatible. The resonance period and maximum
drive voltage properties reuse the qcom,lra-period-us and
qcom,vmax-microvolt names from that binding.
Add the shared constants header include/dt-bindings/input/qcom,haptics.h
for the actuator type, auto-resonance detection mode, play mode, waveform
shape and high-impedance options, along with properties for ERM sample
duration, repeat counts, brake pattern and accepted auto-resonance drive
period variation. LRA-only properties are required for LRA actuators (the
default) and disallowed for ERM actuators.
Based on work of Casey Connolly.
Signed-off-by: David Heidelberg <david@xxxxxxx>
---
.../bindings/input/qcom,pmi8998-haptics.yaml | 256 +++++++++++++++++++++
MAINTAINERS | 8 +
include/dt-bindings/input/qcom,haptics.h | 46 ++++
3 files changed, 310 insertions(+)
diff --git a/Documentation/devicetree/bindings/input/qcom,pmi8998-haptics.yaml b/Documentation/devicetree/bindings/input/qcom,pmi8998-haptics.yaml
new file mode 100644
index 0000000000000..2a296b6096e02
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/qcom,pmi8998-haptics.yaml
@@ -0,0 +1,256 @@
+# SPDX-License-Identifier: GPL-2.0-only
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/qcom,pmi8998-haptics.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Qualcomm PMI8998 / PM660 PMIC haptics
+
+maintainers:
+ - David Heidelberg <david@xxxxxxx>
+
+description:
+ The haptics module inside the Qualcomm PMI8998 and PM660 PMICs drives a
+ linear resonant actuator (LRA) or an eccentric rotating mass (ERM) motor
+ from an internal 8-sample waveform buffer, a fixed voltage, an audio stream
+ or a PWM input.
+
+properties:
+ compatible:
+ enum:
+ - qcom,pm660-haptics
+ - qcom,pmi8998-haptics
+
+ reg:
+ maxItems: 1
+
+ interrupts:
+ items:
+ - description: Short circuit detected on the actuator output
+ - description: Waveform buffer played, next set of samples can be loaded
+
+ interrupt-names:
+ items:
+ - const: short
+ - const: play
+
+ qcom,actuator-type:
+ description:
+ Type of actuator connected to the haptics output.
+ See include/dt-bindings/input/qcom,haptics.h for the available types.
+ $ref: /schemas/types.yaml#/definitions/uint32
+ enum:
+ - 0 # QCOM_HAPTICS_ACTUATOR_LRA
+ - 1 # QCOM_HAPTICS_ACTUATOR_ERM
+ default: 0
+
+ qcom,lra-period-us:
+ description:
+ Resonance period of the LRA in microseconds (1000000 / resonant
+ frequency in Hz). Each waveform sample is played for this long.
+ minimum: 5
+ maximum: 20475
+ multipleOf: 5
+
+ qcom,play-rate-us:
+ description:
+ Play duration of each sample in the 8-sample waveform buffer
+ for an ERM actuator.
+ default: 5715
+ minimum: 5
+ maximum: 20475
+ multipleOf: 5
+
+ qcom,vmax-microvolt:
+ description:
+ Maximum drive voltage of the actuator.
+ minimum: 116000
+ maximum: 3596000
+ multipleOf: 116000
+
+ qcom,lra-auto-res-mode:
+ description:
+ Detection mode of the auto resonance of the LRA.
+ See include/dt-bindings/input/qcom,haptics.h for the available modes.
+ $ref: /schemas/types.yaml#/definitions/uint32
+ enum:
+ - 0 # QCOM_LRA_AUTO_RES_MODE_QWD
+ - 1 # QCOM_LRA_AUTO_RES_MODE_ZXD_EOP
+
+ qcom,lra-res-cal-period:
+ description:
+ Number of LRA cycles used to calibrate the resonance frequency during
+ the auto resonance detection.
+ $ref: /schemas/types.yaml#/definitions/uint32
+ enum: [4, 8, 16, 32, 64, 128, 256]
+
+ qcom,play-mode:
+ description:
+ Play mode of the haptics module. In the direct mode the actuator is
+ driven at the resonance frequency (LRA) or with a constant voltage
+ (ERM), in the buffer mode the waveform buffer of the module is played.
+ See include/dt-bindings/input/qcom,haptics.h for the available modes.
+ $ref: /schemas/types.yaml#/definitions/uint32
+ enum: [0, 1]
+
+ qcom,wave-shape:
+ description:
+ Shape of the waveform driven into the LRA actuator.
+ See include/dt-bindings/input/qcom,haptics.h for the available shapes.
+ $ref: /schemas/types.yaml#/definitions/uint32
+ enum:
+ - 0 # QCOM_HAPTICS_WAVE_SHAPE_SINE
+ - 1 # QCOM_HAPTICS_WAVE_SHAPE_SQUARE
+
+ qcom,lra-high-z:
+ description:
+ High impedance option applied to the LRA while the auto resonance
+ detection runs. See include/dt-bindings/input/qcom,haptics.h for the
+ available options.
+ $ref: /schemas/types.yaml#/definitions/uint32
+ enum: [0, 1, 2, 3]
+
+ qcom,wave-rep-cnt:
+ description:
+ Number of times the waveform is repeated in buffer mode.
+ $ref: /schemas/types.yaml#/definitions/uint32
+ default: 1
+ enum: [1, 2, 4, 8, 16, 32, 64, 128]
+
+ qcom,wave-samp-rep-cnt:
+ description:
+ Number of times the waveform samples are repeated in buffer mode.
+ $ref: /schemas/types.yaml#/definitions/uint32
+ default: 1
+ enum: [1, 2, 4, 8]
+
+ qcom,brake-pattern:
+ $ref: /schemas/types.yaml#/definitions/uint32-array
+ description:
+ Brake pattern applied at the end of the playback. It consists of four
+ values, one for each cycle of the brake. 0 disables the brake for the
+ cycle, 1 drives a quarter of the maximum voltage, 2 a half and 3 the
+ maximum voltage. The brake is disabled if the property is absent.
+ minItems: 4
+ maxItems: 4
+ items:
+ minimum: 0
+ maximum: 3
+
+ qcom,drive-period-min-variation-percent:
+ description:
+ Minimum variation of the drive period measured by the auto resonance
+ detection. The auto resonance is disabled when the measured drive
+ period is outside of the accepted range.
+ default: 25
+ minimum: 1
+ maximum: 99
+
+ qcom,drive-period-max-variation-percent:
+ description:
+ Maximum variation of the drive period measured by the auto resonance
+ detection. The auto resonance is disabled when the measured drive
+ period is outside of the accepted range.
+ default: 25
+ minimum: 1
+ maximum: 99
+
+required:
+ - compatible
+ - reg
+ - interrupts
+ - interrupt-names
+ - qcom,vmax-microvolt
+ - qcom,play-mode
+
+allOf:
+ - if:
+ properties:
+ qcom,actuator-type:
+ const: 1
+ required:
+ - qcom,actuator-type
+ then:
+ properties:
+ qcom,lra-period-us: false
+ qcom,lra-auto-res-mode: false
+ qcom,lra-res-cal-period: false
+ qcom,wave-shape: false
+ qcom,lra-high-z: false
+ qcom,drive-period-min-variation-percent: false
+ qcom,drive-period-max-variation-percent: false
+ else:
+ properties:
+ qcom,play-rate-us: false
+ required:
+ - qcom,lra-period-us
+ - qcom,lra-auto-res-mode
+ - qcom,lra-res-cal-period
+ - qcom,wave-shape
+ - qcom,lra-high-z
+
+ - if:
+ properties:
+ compatible:
+ contains:
+ const: qcom,pmi8998-haptics
+ then:
+ properties:
+ qcom,lra-res-cal-period:
+ maximum: 32
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/input/qcom,haptics.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+ #include <dt-bindings/spmi/spmi.h>
+
+ pmic@3 {
+ compatible = "qcom,pmi8998", "qcom,spmi-pmic";
+ reg = <0x3 SPMI_USID>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ haptics@c000 {
+ compatible = "qcom,pmi8998-haptics";
+ reg = <0xc000>;
+ interrupts = <0x3 0xc0 0x0 IRQ_TYPE_EDGE_BOTH>,
+ <0x3 0xc0 0x1 IRQ_TYPE_EDGE_BOTH>;
+ interrupt-names = "short", "play";
+
+ qcom,lra-auto-res-mode = <QCOM_LRA_AUTO_RES_MODE_ZXD_EOP>;
+ qcom,lra-high-z = <QCOM_HAPTICS_LRA_HIGH_Z_OPT1>;
+ qcom,lra-period-us = <4255>;
+ qcom,lra-res-cal-period = <32>;
+ qcom,play-mode = <QCOM_HAPTICS_PLAY_MODE_BUFFER>;
+ qcom,vmax-microvolt = <2088000>;
+ qcom,wave-shape = <QCOM_HAPTICS_WAVE_SHAPE_SINE>;
+ };
+ };
+
+ - |
+ #include <dt-bindings/input/qcom,haptics.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+ #include <dt-bindings/spmi/spmi.h>
+
+ pmic@1 {
+ compatible = "qcom,pm660";
+ reg = <0x1 SPMI_USID>;
+ #address-cells = <1>;
+ #size-cells = <0>;
+
+ haptics@c000 {
+ compatible = "qcom,pm660-haptics";
+ reg = <0xc000>;
+ interrupts = <0x1 0xc0 0x0 IRQ_TYPE_EDGE_BOTH>,
+ <0x1 0xc0 0x1 IRQ_TYPE_EDGE_BOTH>;
+ interrupt-names = "short", "play";
+
+ qcom,actuator-type = <QCOM_HAPTICS_ACTUATOR_ERM>;
+ qcom,play-mode = <QCOM_HAPTICS_PLAY_MODE_DIRECT>;
+ qcom,play-rate-us = <6665>;
+ qcom,vmax-microvolt = <3132000>;
+ };
+ };
diff --git a/MAINTAINERS b/MAINTAINERS
index c00d3612c9acf..301689be7665d 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -23383,16 +23383,24 @@ F: include/linux/firmware/qcom/qcom_pas.h
QUALCOMM SMB CHARGER DRIVER
M: Casey Connolly <casey.connolly@xxxxxxxxxx>
L: linux-arm-msm@xxxxxxxxxxxxxxx
S: Maintained
F: Documentation/devicetree/bindings/power/supply/qcom,pmi8998-charger.yaml
F: drivers/power/supply/qcom_smbx.c
+QUALCOMM PMI8998 HAPTICS DRIVER
+M: David Heidelberg <david@xxxxxxx>
+L: linux-arm-msm@xxxxxxxxxxxxxxx
+L: linux-input@xxxxxxxxxxxxxxx
+S: Maintained
+F: Documentation/devicetree/bindings/input/qcom,pmi8998-haptics.yaml
+F: include/dt-bindings/input/qcom,haptics.h
+
QUALCOMM PPE DRIVER
M: Luo Jie <jie.luo@xxxxxxxxxxxxxxxx>
L: netdev@xxxxxxxxxxxxxxx
S: Maintained
F: Documentation/devicetree/bindings/net/qcom,ipq9574-ppe.yaml
F: Documentation/networking/device_drivers/ethernet/qualcomm/ppe/ppe.rst
F: drivers/net/ethernet/qualcomm/ppe/
diff --git a/include/dt-bindings/input/qcom,haptics.h b/include/dt-bindings/input/qcom,haptics.h
new file mode 100644
index 0000000000000..7ac0d426a16d0
--- /dev/null
+++ b/include/dt-bindings/input/qcom,haptics.h
@@ -0,0 +1,46 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+
+#ifndef _DT_BINDINGS_INPUT_QCOM_HAPTICS_H
+#define _DT_BINDINGS_INPUT_QCOM_HAPTICS_H
+
+/*
+ * Actuator types driven by the haptics module
+ */
+#define QCOM_HAPTICS_ACTUATOR_LRA 0
+#define QCOM_HAPTICS_ACTUATOR_ERM 1
+
+/*
+ * Auto resonance detection modes of the LRA
+ *
+ * QCOM_LRA_AUTO_RES_MODE_QWD detects the quarter wave of the actuator,
+ * QCOM_LRA_AUTO_RES_MODE_ZXD_EOP detects the zero crossing at the end of
+ * a period. The mode depends on the actuator.
+ */
+#define QCOM_LRA_AUTO_RES_MODE_QWD 0
+#define QCOM_LRA_AUTO_RES_MODE_ZXD_EOP 1
+
+/*
+ * Play modes of the haptics module
+ *
+ * QCOM_HAPTICS_PLAY_MODE_DIRECT drives the actuator at the resonance
+ * frequency with the drive voltage, QCOM_HAPTICS_PLAY_MODE_BUFFER plays
+ * the waveform buffer of the module.
+ */
+#define QCOM_HAPTICS_PLAY_MODE_DIRECT 0
+#define QCOM_HAPTICS_PLAY_MODE_BUFFER 1
+
+/*
+ * Shape of the waveform driven into the actuator
+ */
+#define QCOM_HAPTICS_WAVE_SHAPE_SINE 0
+#define QCOM_HAPTICS_WAVE_SHAPE_SQUARE 1
+
+/*
+ * High impedance options of the auto resonance detection
+ */
+#define QCOM_HAPTICS_LRA_HIGH_Z_NONE 0
+#define QCOM_HAPTICS_LRA_HIGH_Z_OPT1 1
+#define QCOM_HAPTICS_LRA_HIGH_Z_OPT2 2
+#define QCOM_HAPTICS_LRA_HIGH_Z_OPT3 3
+
+#endif
--
2.55.0