xref: /freebsd/sys/contrib/device-tree/Bindings/iio/proximity/semtech,sx9324.yaml (revision 657729a89dd578d8cfc70d6616f5c65a48a8b33a)
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
7title: Semtech's SX9324 capacitive proximity sensor
8
9maintainers:
10  - Gwendal Grignou <gwendal@chromium.org>
11  - Daniel Campello <campello@chromium.org>
12
13description: |
14  Semtech's SX9324 proximity sensor.
15
16properties:
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,cs-idle-sleep:
130    description:
131      State of CS pins during sleep mode and idle time.
132    enum:
133      - hi-z
134      - gnd
135      - vdd
136
137  semtech,int-comp-resistor:
138    description:
139      Internal resistor setting for compensation.
140    enum:
141      - lowest
142      - low
143      - high
144      - highest
145
146  semtech,input-precharge-resistor-ohms:
147    default: 4000
148    multipleOf: 2000
149    minimum: 0
150    maximum: 30000
151    description:
152      Pre-charge input resistance in Ohm.
153
154  semtech,input-analog-gain:
155    $ref: /schemas/types.yaml#/definitions/uint32
156    minimum: 0
157    maximum: 3
158    description: |
159      Defines the input antenna analog gain
160      0: x1.247
161      1: x1 (default)
162      2: x0.768
163      3: x0.552
164
165required:
166  - compatible
167  - reg
168  - "#io-channel-cells"
169
170additionalProperties: false
171
172examples:
173  - |
174    #include <dt-bindings/interrupt-controller/irq.h>
175    i2c {
176      #address-cells = <1>;
177      #size-cells = <0>;
178      proximity@28 {
179        compatible = "semtech,sx9324";
180        reg = <0x28>;
181        interrupt-parent = <&pio>;
182        interrupts = <5 IRQ_TYPE_LEVEL_LOW 5>;
183        vdd-supply = <&pp3300_a>;
184        svdd-supply = <&pp1800_prox>;
185        #io-channel-cells = <1>;
186        semtech,ph0-pin = <1 2 3>;
187        semtech,ph1-pin = <3 2 1>;
188        semtech,ph2-pin = <1 2 3>;
189        semtech,ph3-pin = <3 2 1>;
190        semtech,ph01-resolution = <256>;
191        semtech,ph23-resolution = <256>;
192        semtech,startup-sensor = <1>;
193        semtech,ph01-proxraw-strength = <2>;
194        semtech,ph23-proxraw-strength = <2>;
195        semtech,avg-pos-strength = <64>;
196        semtech,int-comp-resistor = "lowest";
197        semtech,input-precharge-resistor-ohms = <2000>;
198        semtech,cs-idle-sleep = "gnd";
199      };
200    };
201