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