xref: /freebsd/sys/contrib/device-tree/Bindings/iio/proximity/semtech,sx9324.yaml (revision 29fc4075e69fd27de0cded313ac6000165d99f8b)
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
129required:
130  - compatible
131  - reg
132  - "#io-channel-cells"
133
134additionalProperties: false
135
136examples:
137  - |
138    #include <dt-bindings/interrupt-controller/irq.h>
139    i2c {
140      #address-cells = <1>;
141      #size-cells = <0>;
142      proximity@28 {
143        compatible = "semtech,sx9324";
144        reg = <0x28>;
145        interrupt-parent = <&pio>;
146        interrupts = <5 IRQ_TYPE_LEVEL_LOW 5>;
147        vdd-supply = <&pp3300_a>;
148        svdd-supply = <&pp1800_prox>;
149        #io-channel-cells = <1>;
150        semtech,ph0-pin = <1 2 3>;
151        semtech,ph1-pin = <3 2 1>;
152        semtech,ph2-pin = <1 2 3>;
153        semtech,ph3-pin = <3 2 1>;
154        semtech,ph01-resolution = <256>;
155        semtech,ph23-resolution = <256>;
156        semtech,startup-sensor = <1>;
157        semtech,ph01-proxraw-strength = <2>;
158        semtech,ph23-proxraw-strength = <2>;
159        semtech,avg-pos-strength = <64>;
160      };
161    };
162