dt-bindings: iio: sx9324: Add internal compensation resistor setting
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / iio / proximity / semtech,sx9324.yaml
1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/iio/proximity/semtech,sx9324.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Semtech's SX9324 capacitive proximity sensor
8
9 maintainers:
10   - Gwendal Grignou <gwendal@chromium.org>
11   - Daniel Campello <campello@chromium.org>
12
13 description: |
14   Semtech's SX9324 proximity sensor.
15
16 properties:
17   compatible:
18     const: semtech,sx9324
19
20   reg:
21     maxItems: 1
22
23   interrupts:
24     description:
25       Generated by device to announce preceding read request has finished
26       and data is available or that a close/far proximity event has happened.
27     maxItems: 1
28
29   vdd-supply:
30     description: Main power supply
31
32   svdd-supply:
33     description: Host interface power supply
34
35   "#io-channel-cells":
36     const: 1
37
38   semtech,ph0-pin:
39     $ref: /schemas/types.yaml#/definitions/uint32-array
40     description: |
41       Array of 3 entries. Index represent the id of the CS pin.
42       Value indicates how each CS pin is used during phase 0.
43       Each of the 3 pins have the following value -
44       0 : unused (high impedance)
45       1 : measured input
46       2 : dynamic shield
47       3 : grounded.
48       For instance, CS0 measured, CS1 shield and CS2 ground is [1, 2, 3]
49     items:
50       enum: [ 0, 1, 2, 3 ]
51     minItems: 3
52     maxItems: 3
53
54   semtech,ph1-pin:
55     $ref: /schemas/types.yaml#/definitions/uint32-array
56     description: Same as ph0-pin for phase 1.
57     items:
58       enum: [ 0, 1, 2, 3 ]
59     minItems: 3
60     maxItems: 3
61
62   semtech,ph2-pin:
63     $ref: /schemas/types.yaml#/definitions/uint32-array
64     description: Same as ph0-pin for phase 2.
65     items:
66       enum: [ 0, 1, 2, 3 ]
67     minItems: 3
68     maxItems: 3
69
70   semtech,ph3-pin:
71     $ref: /schemas/types.yaml#/definitions/uint32-array
72     description: Same as ph0-pin for phase 3.
73     items:
74       enum: [ 0, 1, 2, 3 ]
75     minItems: 3
76     maxItems: 3
77
78
79   semtech,ph01-resolution:
80     $ref: /schemas/types.yaml#/definitions/uint32
81     enum: [8, 16, 32, 64, 128, 256, 512, 1024]
82     description:
83       Capacitance measurement resolution. For phase 0 and 1.
84       Higher the number, higher the resolution.
85     default: 128
86
87   semtech,ph23-resolution:
88     $ref: /schemas/types.yaml#/definitions/uint32
89     enum: [8, 16, 32, 64, 128, 256, 512, 1024]
90     description:
91       Capacitance measurement resolution. For phase 2 and 3
92     default: 128
93
94   semtech,startup-sensor:
95     $ref: /schemas/types.yaml#/definitions/uint32
96     enum: [0, 1, 2, 3]
97     default: 0
98     description: |
99       Phase used for start-up proximity detection.
100       It is used when we enable a phase to remove static offset and measure
101       only capacitance changes introduced by the user.
102
103   semtech,ph01-proxraw-strength:
104     $ref: /schemas/types.yaml#/definitions/uint32
105     minimum: 0
106     maximum: 7
107     default: 1
108     description:
109       PROXRAW filter strength for phase 0 and 1. A value of 0 represents off,
110       and other values represent 1-1/2^N.
111
112   semtech,ph23-proxraw-strength:
113     $ref: /schemas/types.yaml#/definitions/uint32
114     minimum: 0
115     maximum: 7
116     default: 1
117     description:
118       Same as proxraw-strength01, for phase 2 and 3.
119
120   semtech,avg-pos-strength:
121     $ref: /schemas/types.yaml#/definitions/uint32
122     enum: [0, 16, 64, 128, 256, 512, 1024, 4294967295]
123     default: 16
124     description: |
125       Average positive filter strength. A value of 0 represents off and
126       UINT_MAX (4294967295) represents infinite. Other values
127       represent 1-1/N.
128
129   semtech,int-comp-resistor:
130     description:
131       Internal resistor setting for compensation.
132     enum:
133       - lowest
134       - low
135       - high
136       - highest
137
138   semtech,input-precharge-resistor-ohms:
139     default: 4000
140     multipleOf: 2000
141     minimum: 0
142     maximum: 30000
143     description:
144       Pre-charge input resistance in Ohm.
145
146 required:
147   - compatible
148   - reg
149   - "#io-channel-cells"
150
151 additionalProperties: false
152
153 examples:
154   - |
155     #include <dt-bindings/interrupt-controller/irq.h>
156     i2c {
157       #address-cells = <1>;
158       #size-cells = <0>;
159       proximity@28 {
160         compatible = "semtech,sx9324";
161         reg = <0x28>;
162         interrupt-parent = <&pio>;
163         interrupts = <5 IRQ_TYPE_LEVEL_LOW 5>;
164         vdd-supply = <&pp3300_a>;
165         svdd-supply = <&pp1800_prox>;
166         #io-channel-cells = <1>;
167         semtech,ph0-pin = <1 2 3>;
168         semtech,ph1-pin = <3 2 1>;
169         semtech,ph2-pin = <1 2 3>;
170         semtech,ph3-pin = <3 2 1>;
171         semtech,ph01-resolution = <256>;
172         semtech,ph23-resolution = <256>;
173         semtech,startup-sensor = <1>;
174         semtech,ph01-proxraw-strength = <2>;
175         semtech,ph23-proxraw-strength = <2>;
176         semtech,avg-pos-strength = <64>;
177         semtech,int-comp-resistor = "lowest";
178         semtech,input-precharge-resistor-ohms = <2000>;
179       };
180     };