summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/input/ti,drv260x.yaml
blob: c6245c5b9e2e6a0b75a4190fadc64da8adb4d100 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/ti,drv260x.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments - drv260x Haptics driver family

maintainers:
  - Andrew Davis <afd@ti.com>

properties:
  compatible:
    enum:
      - ti,drv2604
      - ti,drv2605
      - ti,drv2605l

  reg:
    maxItems: 1

  vbat-supply:
    description: Power supply to the haptic motor

  # TODO: Deprecate 'mode' in favor of differently named property
  mode:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      Power up mode of the chip
      (defined in include/dt-bindings/input/ti-drv260x.h)

      DRV260X_LRA_MODE
        Linear Resonance Actuator mode (Piezoelectric)

      DRV260X_LRA_NO_CAL_MODE
        This is a LRA Mode but there is no calibration sequence during init.
        And the device is configured for real time playback mode (RTP mode).

      DRV260X_ERM_MODE
        Eccentric Rotating Mass mode (Rotary vibrator)
    enum: [ 0, 1, 2 ]

  library-sel:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      These are ROM based waveforms pre-programmed into the IC.
      This should be set to set the library to use at power up.
      (defined in include/dt-bindings/input/ti-drv260x.h)

      DRV260X_LIB_EMPTY - Do not use a pre-programmed library
      DRV260X_ERM_LIB_A - Pre-programmed Library
      DRV260X_ERM_LIB_B - Pre-programmed Library
      DRV260X_ERM_LIB_C - Pre-programmed Library
      DRV260X_ERM_LIB_D - Pre-programmed Library
      DRV260X_ERM_LIB_E - Pre-programmed Library
      DRV260X_ERM_LIB_F - Pre-programmed Library
      DRV260X_LIB_LRA - Pre-programmed LRA Library
    enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ]

  enable-gpio:
    maxItems: 1
    deprecated: true

  enable-gpios:
    maxItems: 1

  vib-rated-mv:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      The rated voltage of the actuator in millivolts.
      If this is not set then the value will be defaulted to 3200 mV.
    default: 3200

  vib-overdrive-mv:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: |
      The overdrive voltage of the actuator in millivolts.
      If this is not set then the value will be defaulted to 3200 mV.
    default: 3200

required:
  - compatible
  - reg
  - enable-gpios
  - mode
  - library-sel

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/input/ti-drv260x.h>

    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        haptics@5a {
            compatible = "ti,drv2605l";
            reg = <0x5a>;
            vbat-supply = <&vbat>;
            enable-gpios = <&gpio1 28 GPIO_ACTIVE_HIGH>;
            mode = <DRV260X_LRA_MODE>;
            library-sel = <DRV260X_LIB_LRA>;
            vib-rated-mv = <3200>;
            vib-overdrive-mv = <3200>;
        };
    };