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