xref: /openbmc/linux/Documentation/devicetree/bindings/input/ti,drv260x.yaml (revision 6f84981772535e670e4e2df051a672af229b6694)
1*39cb018aSLuca Weiss# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2*39cb018aSLuca Weiss%YAML 1.2
3*39cb018aSLuca Weiss---
4*39cb018aSLuca Weiss$id: http://devicetree.org/schemas/input/ti,drv260x.yaml#
5*39cb018aSLuca Weiss$schema: http://devicetree.org/meta-schemas/core.yaml#
6*39cb018aSLuca Weiss
7*39cb018aSLuca Weisstitle: Texas Instruments - drv260x Haptics driver family
8*39cb018aSLuca Weiss
9*39cb018aSLuca Weissmaintainers:
10*39cb018aSLuca Weiss  - Andrew Davis <afd@ti.com>
11*39cb018aSLuca Weiss
12*39cb018aSLuca Weissproperties:
13*39cb018aSLuca Weiss  compatible:
14*39cb018aSLuca Weiss    enum:
15*39cb018aSLuca Weiss      - ti,drv2604
16*39cb018aSLuca Weiss      - ti,drv2605
17*39cb018aSLuca Weiss      - ti,drv2605l
18*39cb018aSLuca Weiss
19*39cb018aSLuca Weiss  reg:
20*39cb018aSLuca Weiss    maxItems: 1
21*39cb018aSLuca Weiss
22*39cb018aSLuca Weiss  vbat-supply:
23*39cb018aSLuca Weiss    description: Power supply to the haptic motor
24*39cb018aSLuca Weiss
25*39cb018aSLuca Weiss  # TODO: Deprecate 'mode' in favor of differently named property
26*39cb018aSLuca Weiss  mode:
27*39cb018aSLuca Weiss    $ref: /schemas/types.yaml#/definitions/uint32
28*39cb018aSLuca Weiss    description: |
29*39cb018aSLuca Weiss      Power up mode of the chip
30*39cb018aSLuca Weiss      (defined in include/dt-bindings/input/ti-drv260x.h)
31*39cb018aSLuca Weiss
32*39cb018aSLuca Weiss      DRV260X_LRA_MODE
33*39cb018aSLuca Weiss        Linear Resonance Actuator mode (Piezoelectric)
34*39cb018aSLuca Weiss
35*39cb018aSLuca Weiss      DRV260X_LRA_NO_CAL_MODE
36*39cb018aSLuca Weiss        This is a LRA Mode but there is no calibration sequence during init.
37*39cb018aSLuca Weiss        And the device is configured for real time playback mode (RTP mode).
38*39cb018aSLuca Weiss
39*39cb018aSLuca Weiss      DRV260X_ERM_MODE
40*39cb018aSLuca Weiss        Eccentric Rotating Mass mode (Rotary vibrator)
41*39cb018aSLuca Weiss    enum: [ 0, 1, 2 ]
42*39cb018aSLuca Weiss
43*39cb018aSLuca Weiss  library-sel:
44*39cb018aSLuca Weiss    $ref: /schemas/types.yaml#/definitions/uint32
45*39cb018aSLuca Weiss    description: |
46*39cb018aSLuca Weiss      These are ROM based waveforms pre-programmed into the IC.
47*39cb018aSLuca Weiss      This should be set to set the library to use at power up.
48*39cb018aSLuca Weiss      (defined in include/dt-bindings/input/ti-drv260x.h)
49*39cb018aSLuca Weiss
50*39cb018aSLuca Weiss      DRV260X_LIB_EMPTY - Do not use a pre-programmed library
51*39cb018aSLuca Weiss      DRV260X_ERM_LIB_A - Pre-programmed Library
52*39cb018aSLuca Weiss      DRV260X_ERM_LIB_B - Pre-programmed Library
53*39cb018aSLuca Weiss      DRV260X_ERM_LIB_C - Pre-programmed Library
54*39cb018aSLuca Weiss      DRV260X_ERM_LIB_D - Pre-programmed Library
55*39cb018aSLuca Weiss      DRV260X_ERM_LIB_E - Pre-programmed Library
56*39cb018aSLuca Weiss      DRV260X_ERM_LIB_F - Pre-programmed Library
57*39cb018aSLuca Weiss      DRV260X_LIB_LRA - Pre-programmed LRA Library
58*39cb018aSLuca Weiss    enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
59*39cb018aSLuca Weiss
60*39cb018aSLuca Weiss  enable-gpio:
61*39cb018aSLuca Weiss    maxItems: 1
62*39cb018aSLuca Weiss    deprecated: true
63*39cb018aSLuca Weiss
64*39cb018aSLuca Weiss  enable-gpios:
65*39cb018aSLuca Weiss    maxItems: 1
66*39cb018aSLuca Weiss
67*39cb018aSLuca Weiss  vib-rated-mv:
68*39cb018aSLuca Weiss    $ref: /schemas/types.yaml#/definitions/uint32
69*39cb018aSLuca Weiss    description: |
70*39cb018aSLuca Weiss      The rated voltage of the actuator in millivolts.
71*39cb018aSLuca Weiss      If this is not set then the value will be defaulted to 3200 mV.
72*39cb018aSLuca Weiss    default: 3200
73*39cb018aSLuca Weiss
74*39cb018aSLuca Weiss  vib-overdrive-mv:
75*39cb018aSLuca Weiss    $ref: /schemas/types.yaml#/definitions/uint32
76*39cb018aSLuca Weiss    description: |
77*39cb018aSLuca Weiss      The overdrive voltage of the actuator in millivolts.
78*39cb018aSLuca Weiss      If this is not set then the value will be defaulted to 3200 mV.
79*39cb018aSLuca Weiss    default: 3200
80*39cb018aSLuca Weiss
81*39cb018aSLuca Weissrequired:
82*39cb018aSLuca Weiss  - compatible
83*39cb018aSLuca Weiss  - reg
84*39cb018aSLuca Weiss  - enable-gpios
85*39cb018aSLuca Weiss  - mode
86*39cb018aSLuca Weiss  - library-sel
87*39cb018aSLuca Weiss
88*39cb018aSLuca WeissadditionalProperties: false
89*39cb018aSLuca Weiss
90*39cb018aSLuca Weissexamples:
91*39cb018aSLuca Weiss  - |
92*39cb018aSLuca Weiss    #include <dt-bindings/gpio/gpio.h>
93*39cb018aSLuca Weiss    #include <dt-bindings/input/ti-drv260x.h>
94*39cb018aSLuca Weiss
95*39cb018aSLuca Weiss    i2c {
96*39cb018aSLuca Weiss        #address-cells = <1>;
97*39cb018aSLuca Weiss        #size-cells = <0>;
98*39cb018aSLuca Weiss
99*39cb018aSLuca Weiss        haptics@5a {
100*39cb018aSLuca Weiss            compatible = "ti,drv2605l";
101*39cb018aSLuca Weiss            reg = <0x5a>;
102*39cb018aSLuca Weiss            vbat-supply = <&vbat>;
103*39cb018aSLuca Weiss            enable-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
104*39cb018aSLuca Weiss            mode = <DRV260X_LRA_MODE>;
105*39cb018aSLuca Weiss            library-sel = <DRV260X_LIB_LRA>;
106*39cb018aSLuca Weiss            vib-rated-mv = <3200>;
107*39cb018aSLuca Weiss            vib-overdrive-mv = <3200>;
108*39cb018aSLuca Weiss        };
109*39cb018aSLuca Weiss    };
110