1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/input/iqs269a.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Azoteq IQS269A Capacitive Touch Controller
8
9maintainers:
10  - Jeff LaBundy <jeff@labundy.com>
11
12allOf:
13  - $ref: input.yaml#
14
15description: |
16  The Azoteq IQS269A is an 8-channel capacitive touch controller that features
17  additional Hall-effect and inductive sensing capabilities.
18
19  Link to datasheet: https://www.azoteq.com/
20
21properties:
22  compatible:
23    enum:
24      - azoteq,iqs269a
25      - azoteq,iqs269a-00
26      - azoteq,iqs269a-d0
27
28  reg:
29    maxItems: 1
30
31  interrupts:
32    maxItems: 1
33
34  "#address-cells":
35    const: 1
36
37  "#size-cells":
38    const: 0
39
40  azoteq,hall-enable:
41    type: boolean
42    description:
43      Enables Hall-effect sensing on channels 6 and 7. In this case, keycodes
44      assigned to channel 6 are ignored and keycodes assigned to channel 7 are
45      interpreted as switch codes. Refer to the datasheet for requirements im-
46      posed on channels 6 and 7 by Hall-effect sensing.
47
48  azoteq,suspend-mode:
49    $ref: /schemas/types.yaml#/definitions/uint32
50    enum: [0, 1, 2, 3]
51    default: 0
52    description: |
53      Specifies the power mode during suspend as follows:
54      0: Automatic (same as normal runtime, i.e. suspend/resume disabled)
55      1: Low power (all sensing at a reduced reporting rate)
56      2: Ultra-low power (channel 0 proximity sensing)
57      3: Halt (no sensing)
58
59  azoteq,clk-div:
60    type: boolean
61    description: Divides the device's core clock by a factor of 4.
62
63  azoteq,ulp-update:
64    $ref: /schemas/types.yaml#/definitions/uint32
65    minimum: 0
66    maximum: 7
67    default: 3
68    description: Specifies the ultra-low-power mode update rate.
69
70  azoteq,reseed-offset:
71    type: boolean
72    description:
73      Applies an 8-count offset to all long-term averages upon either ATI or
74      reseed events.
75
76  azoteq,filt-str-lp-lta:
77    $ref: /schemas/types.yaml#/definitions/uint32
78    enum: [0, 1, 2, 3]
79    default: 0
80    description:
81      Specifies the long-term average filter strength during low-power mode.
82
83  azoteq,filt-str-lp-cnt:
84    $ref: /schemas/types.yaml#/definitions/uint32
85    enum: [0, 1, 2, 3]
86    default: 0
87    description:
88      Specifies the raw count filter strength during low-power mode.
89
90  azoteq,filt-str-np-lta:
91    $ref: /schemas/types.yaml#/definitions/uint32
92    enum: [0, 1, 2, 3]
93    default: 0
94    description:
95      Specifies the long-term average filter strength during normal-power mode.
96
97  azoteq,filt-str-np-cnt:
98    $ref: /schemas/types.yaml#/definitions/uint32
99    enum: [0, 1, 2, 3]
100    default: 0
101    description:
102      Specifies the raw count filter strength during normal-power mode.
103
104  azoteq,rate-np-ms:
105    minimum: 0
106    maximum: 255
107    default: 16
108    description: Specifies the report rate (in ms) during normal-power mode.
109
110  azoteq,rate-lp-ms:
111    minimum: 0
112    maximum: 255
113    default: 160
114    description: Specifies the report rate (in ms) during low-power mode.
115
116  azoteq,rate-ulp-ms:
117    multipleOf: 16
118    minimum: 0
119    maximum: 4080
120    default: 160
121    description: Specifies the report rate (in ms) during ultra-low-power mode.
122
123  azoteq,timeout-pwr-ms:
124    multipleOf: 512
125    minimum: 0
126    maximum: 130560
127    default: 2560
128    description:
129      Specifies the length of time (in ms) to wait for an event during normal-
130      power mode before transitioning to low-power mode.
131
132  azoteq,timeout-lta-ms:
133    multipleOf: 512
134    minimum: 0
135    maximum: 130560
136    default: 32768
137    description:
138      Specifies the length of time (in ms) to wait before resetting the long-
139      term average of all channels. Specify the maximum timeout to disable it
140      altogether.
141
142  azoteq,ati-band-disable:
143    type: boolean
144    description: Disables the ATI band check.
145
146  azoteq,ati-lp-only:
147    type: boolean
148    description: Limits automatic ATI to low-power mode.
149
150  azoteq,ati-band-tighten:
151    type: boolean
152    description: Tightens the ATI band from 1/8 to 1/16 of the desired target.
153
154  azoteq,filt-disable:
155    type: boolean
156    description: Disables all raw count filtering.
157
158  azoteq,gpio3-select:
159    $ref: /schemas/types.yaml#/definitions/uint32
160    minimum: 0
161    maximum: 7
162    default: 0
163    description:
164      Selects the channel for which the GPIO3 pin represents touch state.
165
166  azoteq,dual-direction:
167    type: boolean
168    description:
169      Specifies that long-term averages are to freeze in the presence of either
170      increasing or decreasing counts, thereby permitting events to be reported
171      in either direction.
172
173  azoteq,tx-freq:
174    $ref: /schemas/types.yaml#/definitions/uint32
175    enum: [0, 1, 2, 3]
176    default: 0
177    description: |
178      Specifies the inductive sensing excitation frequency as follows (paren-
179      thesized numbers represent the frequency if 'azoteq,clk-div' is present):
180      0: 16 MHz (4 MHz)
181      1: 8 MHz (2 MHz)
182      2: 4 MHz (1 MHz)
183      3: 2 MHz (500 kHz)
184
185  azoteq,global-cap-increase:
186    type: boolean
187    description: Increases the global capacitance adder from 0.5 pF to 1.5 pF.
188
189  azoteq,reseed-select:
190    $ref: /schemas/types.yaml#/definitions/uint32
191    enum: [0, 1, 2, 3]
192    default: 0
193    description: |
194      Specifies the event(s) that prompt the device to reseed (i.e. reset the
195      long-term average) of an associated channel as follows:
196      0: None
197      1: Proximity
198      2: Proximity or touch
199      3: Proximity, touch or deep touch
200
201  azoteq,tracking-enable:
202    type: boolean
203    description:
204      Enables all associated channels to track their respective reference
205      channels.
206
207  azoteq,filt-str-slider:
208    $ref: /schemas/types.yaml#/definitions/uint32
209    enum: [0, 1, 2, 3]
210    default: 1
211    description: Specifies the slider coordinate filter strength.
212
213  azoteq,touch-hold-ms:
214    multipleOf: 256
215    minimum: 256
216    maximum: 65280
217    default: 5120
218    description:
219      Specifies the length of time (in ms) for which the channel selected by
220      'azoteq,gpio3-select' must be held in a state of touch in order for an
221      approximately 60-ms pulse to be asserted on the GPIO4 pin.
222
223  linux,keycodes:
224    minItems: 1
225    maxItems: 8
226    description: |
227      Specifies the numeric keycodes associated with each available gesture in
228      the following order (enter 0 for unused gestures):
229      0: Slider 0 tap
230      1: Slider 0 hold
231      2: Slider 0 positive flick or swipe
232      3: Slider 0 negative flick or swipe
233      4: Slider 1 tap
234      5: Slider 1 hold
235      6: Slider 1 positive flick or swipe
236      7: Slider 1 negative flick or swipe
237
238  azoteq,gesture-swipe:
239    type: boolean
240    description:
241      Directs the device to interpret axial gestures as a swipe (finger remains
242      on slider) instead of a flick (finger leaves slider).
243
244  azoteq,timeout-tap-ms:
245    multipleOf: 16
246    minimum: 0
247    maximum: 4080
248    default: 400
249    description:
250      Specifies the length of time (in ms) within which a slider touch must be
251      released in order to be interpreted as a tap. Default and maximum values
252      as well as step size are reduced by a factor of 4 with device version 2.
253
254  azoteq,timeout-swipe-ms:
255    multipleOf: 16
256    minimum: 0
257    maximum: 4080
258    default: 2000
259    description:
260      Specifies the length of time (in ms) within which an axial gesture must be
261      completed in order to be interpreted as a flick or swipe. Default and max-
262      imum values as well as step size are reduced by a factor of 4 with device
263      version 2.
264
265  azoteq,thresh-swipe:
266    $ref: /schemas/types.yaml#/definitions/uint32
267    minimum: 0
268    maximum: 255
269    default: 128
270    description:
271      Specifies the number of points across which an axial gesture must travel
272      in order to be interpreted as a flick or swipe.
273
274dependencies:
275  azoteq,gesture-swipe: ["linux,keycodes"]
276  azoteq,timeout-tap-ms: ["linux,keycodes"]
277  azoteq,timeout-swipe-ms: ["linux,keycodes"]
278  azoteq,thresh-swipe: ["linux,keycodes"]
279
280patternProperties:
281  "^channel@[0-7]$":
282    type: object
283    description:
284      Represents a single sensing channel. A channel is active if defined and
285      inactive otherwise.
286
287    properties:
288      reg:
289        minimum: 0
290        maximum: 7
291        description: Index of the channel.
292
293      azoteq,reseed-disable:
294        type: boolean
295        description:
296          Prevents the channel from being reseeded if the long-term average
297          timeout (defined in 'azoteq,timeout-lta') expires.
298
299      azoteq,blocking-enable:
300        type: boolean
301        description: Specifies that the channel is a blocking channel.
302
303      azoteq,slider0-select:
304        type: boolean
305        description: Specifies that the channel participates in slider 0.
306
307      azoteq,slider1-select:
308        type: boolean
309        description: Specifies that the channel participates in slider 1.
310
311      azoteq,rx-enable:
312        $ref: /schemas/types.yaml#/definitions/uint32-array
313        minItems: 1
314        maxItems: 8
315        items:
316          minimum: 0
317          maximum: 7
318        description:
319          Specifies the CRX pin(s) associated with the channel. By default, only
320          the CRX pin corresponding to the channel's index is enabled (e.g. CRX0
321          for channel 0).
322
323      azoteq,tx-enable:
324        $ref: /schemas/types.yaml#/definitions/uint32-array
325        minItems: 1
326        maxItems: 8
327        items:
328          minimum: 0
329          maximum: 7
330        default: [0, 1, 2, 3, 4, 5, 6, 7]
331        description: Specifies the TX pin(s) associated with the channel.
332
333      azoteq,meas-cap-decrease:
334        type: boolean
335        description:
336          Decreases the internal measurement capacitance from 60 pF to 15 pF.
337
338      azoteq,rx-float-inactive:
339        type: boolean
340        description: Floats any inactive CRX pins instead of grounding them.
341
342      azoteq,local-cap-size:
343        $ref: /schemas/types.yaml#/definitions/uint32
344        enum: [0, 1, 2]
345        default: 0
346        description: |
347          Specifies the capacitance to be added to the channel as follows:
348          0: None
349          1: Global adder (based on 'azoteq,global-cap-increase')
350          2: Global adder + 0.5 pF
351
352      azoteq,invert-enable:
353        type: boolean
354        description:
355          Inverts the polarity of the states reported for proximity, touch and
356          deep-touch events relative to their respective thresholds.
357
358      azoteq,proj-bias:
359        $ref: /schemas/types.yaml#/definitions/uint32
360        enum: [0, 1, 2, 3]
361        default: 2
362        description: |
363          Specifies the bias current applied during projected-capacitance
364          sensing as follows:
365          0: 2.5 uA
366          1: 5 uA
367          2: 10 uA
368          3: 20 uA
369
370      azoteq,sense-mode:
371        $ref: /schemas/types.yaml#/definitions/uint32
372        enum: [0, 1, 9, 14, 15]
373        default: 0
374        description: |
375          Specifies the channel's sensing mode as follows:
376          0:  Self capacitance
377          1:  Projected capacitance
378          9:  Self or mutual inductance
379          14: Hall effect
380          15: Temperature
381
382      azoteq,sense-freq:
383        $ref: /schemas/types.yaml#/definitions/uint32
384        enum: [0, 1, 2, 3]
385        default: 1
386        description: |
387          Specifies the channel's sensing frequency as follows (parenthesized
388          numbers represent the frequency if 'azoteq,clk-div' is present):
389          0: 4 MHz (1 MHz)
390          1: 2 MHz (500 kHz)
391          2: 1 MHz (250 kHz)
392          3: 500 kHz (125 kHz)
393
394      azoteq,static-enable:
395        type: boolean
396        description: Enables the static front-end for the channel.
397
398      azoteq,ati-mode:
399        $ref: /schemas/types.yaml#/definitions/uint32
400        enum: [0, 1, 2, 3]
401        default: 3
402        description: |
403          Specifies the channel's ATI mode as follows:
404          0: Disabled
405          1: Semi-partial
406          2: Partial
407          3: Full
408
409      azoteq,ati-base:
410        $ref: /schemas/types.yaml#/definitions/uint32
411        enum: [75, 100, 150, 200]
412        default: 100
413        description: Specifies the channel's ATI base.
414
415      azoteq,ati-target:
416        $ref: /schemas/types.yaml#/definitions/uint32
417        multipleOf: 32
418        minimum: 0
419        maximum: 2016
420        default: 512
421        description: Specifies the channel's ATI target.
422
423      azoteq,assoc-select:
424        $ref: /schemas/types.yaml#/definitions/uint32-array
425        minItems: 1
426        maxItems: 8
427        items:
428          minimum: 0
429          maximum: 7
430        description:
431          Specifies the associated channels for which the channel serves as a
432          reference channel. By default, no channels are selected.
433
434      azoteq,assoc-weight:
435        $ref: /schemas/types.yaml#/definitions/uint32
436        minimum: 0
437        maximum: 255
438        default: 0
439        description:
440          Specifies the channel's impact weight if it acts as an associated
441          channel (0 = 0% impact, 255 = 200% impact).
442
443    patternProperties:
444      "^event-prox(-alt)?$":
445        type: object
446        $ref: input.yaml#
447        description:
448          Represents a proximity event reported by the channel in response to
449          a decrease in counts. Node names suffixed with '-alt' instead corre-
450          spond to an increase in counts.
451
452          By default, the long-term average tracks an increase in counts such
453          that only events corresponding to a decrease in counts are reported
454          (refer to the datasheet for more information).
455
456          Specify 'azoteq,dual-direction' to freeze the long-term average when
457          the counts increase or decrease such that events of either direction
458          can be reported. Alternatively, specify 'azoteq,invert-enable' to in-
459          vert the polarity of the states reported by the channel.
460
461          Complementary events (e.g. event-touch and event-touch-alt) can both
462          be present and specify different key or switch codes, but not differ-
463          ent thresholds or hysteresis (if applicable).
464
465        properties:
466          azoteq,thresh:
467            $ref: /schemas/types.yaml#/definitions/uint32
468            minimum: 0
469            maximum: 255
470            default: 10
471            description: Specifies the threshold for the event.
472
473          linux,code: true
474
475        additionalProperties: false
476
477      "^event-touch(-alt)?$":
478        type: object
479        $ref: input.yaml#
480        description: Represents a touch event reported by the channel.
481
482        properties:
483          azoteq,thresh:
484            $ref: /schemas/types.yaml#/definitions/uint32
485            minimum: 0
486            maximum: 255
487            default: 8
488            description: Specifies the threshold for the event.
489
490          azoteq,hyst:
491            $ref: /schemas/types.yaml#/definitions/uint32
492            minimum: 0
493            maximum: 15
494            default: 4
495            description: Specifies the hysteresis for the event.
496
497          linux,code: true
498
499        additionalProperties: false
500
501      "^event-deep(-alt)?$":
502        type: object
503        $ref: input.yaml#
504        description: Represents a deep-touch event reported by the channel.
505
506        properties:
507          azoteq,thresh:
508            $ref: /schemas/types.yaml#/definitions/uint32
509            minimum: 0
510            maximum: 255
511            default: 26
512            description: Specifies the threshold for the event.
513
514          azoteq,hyst:
515            $ref: /schemas/types.yaml#/definitions/uint32
516            minimum: 0
517            maximum: 15
518            default: 0
519            description: Specifies the hysteresis for the event.
520
521          linux,code: true
522
523        additionalProperties: false
524
525    required:
526      - reg
527
528    additionalProperties: false
529
530if:
531  properties:
532    compatible:
533      contains:
534        enum:
535          - azoteq,iqs269a-d0
536then:
537  patternProperties:
538    "^channel@[0-7]$":
539      properties:
540        azoteq,slider1-select: false
541else:
542  properties:
543    azoteq,touch-hold-ms: false
544
545required:
546  - compatible
547  - reg
548  - interrupts
549  - "#address-cells"
550  - "#size-cells"
551
552additionalProperties: false
553
554examples:
555  - |
556    #include <dt-bindings/input/input.h>
557    #include <dt-bindings/interrupt-controller/irq.h>
558
559    i2c {
560            #address-cells = <1>;
561            #size-cells = <0>;
562
563            touch@44 {
564                    #address-cells = <1>;
565                    #size-cells = <0>;
566
567                    compatible = "azoteq,iqs269a";
568                    reg = <0x44>;
569                    interrupt-parent = <&gpio>;
570                    interrupts = <17 IRQ_TYPE_LEVEL_LOW>;
571
572                    azoteq,hall-enable;
573                    azoteq,suspend-mode = <2>;
574
575                    linux,keycodes = <KEY_PLAYPAUSE>,
576                                     <KEY_STOPCD>,
577                                     <KEY_NEXTSONG>,
578                                     <KEY_PREVIOUSSONG>;
579
580                    azoteq,timeout-tap-ms = <400>;
581                    azoteq,timeout-swipe-ms = <800>;
582
583                    channel@0 {
584                            reg = <0x0>;
585
586                            event-prox {
587                                    linux,code = <KEY_POWER>;
588                            };
589                    };
590
591                    channel@1 {
592                            reg = <0x1>;
593                            azoteq,slider0-select;
594                    };
595
596                    channel@2 {
597                            reg = <0x2>;
598                            azoteq,slider0-select;
599                    };
600
601                    channel@3 {
602                            reg = <0x3>;
603                            azoteq,slider0-select;
604                    };
605
606                    channel@4 {
607                            reg = <0x4>;
608                            azoteq,slider0-select;
609                    };
610
611                    channel@5 {
612                            reg = <0x5>;
613                            azoteq,slider0-select;
614                    };
615
616                    channel@6 {
617                            reg = <0x6>;
618                            azoteq,invert-enable;
619                            azoteq,static-enable;
620                            azoteq,reseed-disable;
621                            azoteq,rx-enable = <0>;
622                            azoteq,sense-freq = <0x0>;
623                            azoteq,sense-mode = <0xE>;
624                            azoteq,ati-mode = <0x0>;
625                            azoteq,ati-base = <200>;
626                            azoteq,ati-target = <320>;
627                    };
628
629                    channel@7 {
630                            reg = <0x7>;
631                            azoteq,invert-enable;
632                            azoteq,static-enable;
633                            azoteq,reseed-disable;
634                            azoteq,rx-enable = <0>, <6>;
635                            azoteq,sense-freq = <0x0>;
636                            azoteq,sense-mode = <0xE>;
637                            azoteq,ati-mode = <0x3>;
638                            azoteq,ati-base = <200>;
639                            azoteq,ati-target = <320>;
640
641                            event-touch {
642                                    linux,code = <SW_LID>;
643                            };
644                    };
645            };
646    };
647
648...
649