summaryrefslogtreecommitdiffstats
path: root/Documentation/devicetree/bindings/input/azoteq,iqs7222.yaml
blob: 5b1769c19b1735e3bd70db002581e0693498ec07 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/azoteq,iqs7222.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Azoteq IQS7222A/B/C/D Capacitive Touch Controller

maintainers:
  - Jeff LaBundy <jeff@labundy.com>

description: |
  The Azoteq IQS7222A, IQS7222B, IQS7222C and IQS7222D are multichannel
  capacitive touch controllers that feature additional sensing capabilities.

  Link to datasheets: https://www.azoteq.com/

properties:
  compatible:
    enum:
      - azoteq,iqs7222a
      - azoteq,iqs7222b
      - azoteq,iqs7222c
      - azoteq,iqs7222d

  reg:
    maxItems: 1

  irq-gpios:
    maxItems: 1
    description:
      Specifies the GPIO connected to the device's active-low RDY output.

  reset-gpios:
    maxItems: 1
    description:
      Specifies the GPIO connected to the device's active-low MCLR input. The
      device is temporarily held in hardware reset prior to initialization if
      this property is present.

  azoteq,max-counts:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [0, 1, 2, 3]
    description: |
      Specifies the maximum number of conversion periods (counts) that can be
      reported as follows:
      0: 1023
      1: 2047
      2: 4095
      3: 16384

  azoteq,auto-mode:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [0, 1, 2, 3]
    description: |
      Specifies the number of conversions to occur before an interrupt is
      generated as follows:
      0: 4
      1: 8
      2: 16
      3: 32

  azoteq,ati-frac-div-fine:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 0
    maximum: 31
    description: Specifies the preloaded ATI fine fractional divider.

  azoteq,ati-frac-div-coarse:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 0
    maximum: 31
    description: Specifies the preloaded ATI coarse fractional divider.

  azoteq,ati-comp-select:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 0
    maximum: 1023
    description: Specifies the preloaded ATI compensation selection.

  azoteq,lta-beta-lp:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 0
    maximum: 15
    description:
      Specifies the long-term average filter damping factor to be applied during
      low-power mode.

  azoteq,lta-beta-np:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 0
    maximum: 15
    description:
      Specifies the long-term average filter damping factor to be applied during
      normal-power mode.

  azoteq,counts-beta-lp:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 0
    maximum: 15
    description:
      Specifies the counts filter damping factor to be applied during low-power
      mode.

  azoteq,counts-beta-np:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 0
    maximum: 15
    description:
      Specifies the counts filter damping factor to be applied during normal-
      power mode.

  azoteq,lta-fast-beta-lp:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 0
    maximum: 15
    description:
      Specifies the long-term average filter fast damping factor to be applied
      during low-power mode.

  azoteq,lta-fast-beta-np:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 0
    maximum: 15
    description:
      Specifies the long-term average filter fast damping factor to be applied
      during normal-power mode.

  azoteq,timeout-ati-ms:
    multipleOf: 500
    minimum: 0
    maximum: 32767500
    description:
      Specifies the delay (in ms) before ATI is retried following an ATI error.

  azoteq,rate-ati-ms:
    minimum: 0
    maximum: 65535
    description: Specifies the rate (in ms) at which ATI status is evaluated.

  azoteq,timeout-np-ms:
    minimum: 0
    maximum: 65535
    description:
      Specifies the length of time (in ms) to wait for an event before moving
      from normal-power mode to low-power mode.

  azoteq,rate-np-ms:
    minimum: 0
    maximum: 3000
    description: Specifies the report rate (in ms) during normal-power mode.

  azoteq,timeout-lp-ms:
    minimum: 0
    maximum: 65535
    description:
      Specifies the length of time (in ms) to wait for an event before moving
      from low-power mode to ultra-low-power mode.

  azoteq,rate-lp-ms:
    minimum: 0
    maximum: 3000
    description: Specifies the report rate (in ms) during low-power mode.

  azoteq,timeout-ulp-ms:
    minimum: 0
    maximum: 65535
    description:
      Specifies the rate (in ms) at which channels not regularly sampled during
      ultra-low-power mode are updated.

  azoteq,rate-ulp-ms:
    minimum: 0
    maximum: 3000
    description: Specifies the report rate (in ms) during ultra-low-power mode.

  touchscreen-size-x: true
  touchscreen-size-y: true
  touchscreen-inverted-x: true
  touchscreen-inverted-y: true
  touchscreen-swapped-x-y: true

  trackpad:
    type: object
    description: Represents all channels associated with the trackpad.

    properties:
      azoteq,channel-select:
        $ref: /schemas/types.yaml#/definitions/uint32-array
        minItems: 1
        maxItems: 12
        items:
          minimum: 0
          maximum: 13
        description:
          Specifies the order of the channels that participate in the trackpad.
          Specify 255 to omit a given channel for the purpose of mapping a non-
          rectangular trackpad.

      azoteq,num-rows:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 1
        maximum: 12
        description: Specifies the number of rows that comprise the trackpad.

      azoteq,num-cols:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 1
        maximum: 12
        description: Specifies the number of columns that comprise the trackpad.

      azoteq,top-speed:
        $ref: /schemas/types.yaml#/definitions/uint32
        multipleOf: 4
        minimum: 0
        maximum: 1020
        description:
          Specifies the speed (in coordinates traveled per conversion) after
          which coordinate filtering is no longer applied.

      azoteq,bottom-speed:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 255
        description:
          Specifies the speed (in coordinates traveled per conversion) after
          which coordinate filtering is linearly reduced.

      azoteq,use-prox:
        type: boolean
        description:
          Directs the trackpad to respond to the proximity states of the
          selected channels instead of their corresponding touch states.
          Note the trackpad cannot report granular coordinates during a
          state of proximity.

    patternProperties:
      "^azoteq,lower-cal-(x|y)$":
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 255
        description: Specifies the trackpad's lower starting points.

      "^azoteq,upper-cal-(x|y)$":
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 255
        description: Specifies the trackpad's upper starting points.

      "^event-(press|tap|(swipe|flick)-(x|y)-(pos|neg))$":
        type: object
        $ref: input.yaml#
        description:
          Represents a press or gesture event reported by the trackpad. Specify
          'linux,code' under the press event to report absolute coordinates.

        properties:
          linux,code: true

          azoteq,gesture-angle-tighten:
            type: boolean
            description:
              Limits the tangent of the gesture angle to 0.5 (axial gestures
              only). If specified in one direction, the effect is applied in
              either direction.

          azoteq,gesture-max-ms:
            multipleOf: 16
            minimum: 0
            maximum: 4080
            description:
              Specifies the length of time (in ms) within which a tap, swipe
              or flick gesture must be completed in order to be acknowledged
              by the device. The number specified for any one swipe or flick
              gesture applies to all other swipe or flick gestures.

          azoteq,gesture-min-ms:
            multipleOf: 16
            minimum: 0
            maximum: 4080
            description:
              Specifies the length of time (in ms) for which a tap gesture must
              be held in order to be acknowledged by the device.

          azoteq,gesture-dist:
            $ref: /schemas/types.yaml#/definitions/uint32
            minimum: 0
            maximum: 65535
            description:
              Specifies the distance (in coordinates) across which a swipe or
              flick gesture must travel in order to be acknowledged by the
              device. The number specified for any one swipe or flick gesture
              applies to all remaining swipe or flick gestures.

              For tap gestures, this property specifies the distance from the
              original point of contact across which the contact is permitted
              to travel before the gesture is rejected by the device.

          azoteq,gpio-select:
            $ref: /schemas/types.yaml#/definitions/uint32-array
            minItems: 1
            maxItems: 3
            items:
              minimum: 0
              maximum: 2
            description: |
              Specifies one or more GPIO mapped to the event as follows:
              0: GPIO0
              1: GPIO3
              2: GPIO4

              Note that although multiple events can be mapped to a single
              GPIO, they must all be of the same type (proximity, touch or
              trackpad gesture).

        additionalProperties: false

    required:
      - azoteq,channel-select

    additionalProperties: false

patternProperties:
  "^cycle-[0-9]$":
    type: object
    description: Represents a conversion cycle serving two sensing channels.

    properties:
      azoteq,conv-period:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 255
        description: Specifies the cycle's conversion period.

      azoteq,conv-frac:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 255
        description: Specifies the cycle's conversion frequency fraction.

      azoteq,tx-enable:
        $ref: /schemas/types.yaml#/definitions/uint32-array
        minItems: 1
        maxItems: 9
        items:
          minimum: 0
          maximum: 8
        description: Specifies the CTx pin(s) associated with the cycle.

      azoteq,rx-float-inactive:
        type: boolean
        description: Floats any inactive CRx pins instead of grounding them.

      azoteq,dead-time-enable:
        type: boolean
        description:
          Increases the denominator of the conversion frequency formula by one.

      azoteq,tx-freq-fosc:
        type: boolean
        description:
          Fixes the conversion frequency to that of the device's core clock.

      azoteq,vbias-enable:
        type: boolean
        description: Enables the bias voltage for use during inductive sensing.

      azoteq,sense-mode:
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [0, 1, 2, 3]
        description: |
          Specifies the cycle's sensing mode as follows:
          0: None
          1: Self capacitive
          2: Mutual capacitive
          3: Inductive

          Note that in the case of IQS7222A, cycles 5 and 6 are restricted to
          Hall-effect sensing.

      azoteq,iref-enable:
        type: boolean
        description:
          Enables the current reference for use during various sensing modes.

      azoteq,iref-level:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 15
        description: Specifies the cycle's current reference level.

      azoteq,iref-trim:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 15
        description: Specifies the cycle's current reference trim.

    dependencies:
      azoteq,iref-level: ["azoteq,iref-enable"]
      azoteq,iref-trim: ["azoteq,iref-enable"]

    additionalProperties: false

  "^channel-([0-9]|1[0-9])$":
    type: object
    description:
      Represents a single sensing channel. A channel is active if defined and
      inactive otherwise.

      Note that in the case of IQS7222A, channels 10 and 11 are restricted to
      Hall-effect sensing with events reported on channel 10 only.

    properties:
      azoteq,ulp-allow:
        type: boolean
        description:
          Permits the device to enter ultra-low-power mode while the channel
          lies in a state of touch or proximity.

      azoteq,ref-select:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 9
        description: Specifies a separate reference channel to be followed.

      azoteq,ref-weight:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 65535
        description: Specifies the relative weight of the reference channel.

      azoteq,use-prox:
        type: boolean
        description:
          Activates the reference channel in response to proximity events
          instead of touch events.

      azoteq,counts-filt-enable:
        type: boolean
        description: Applies counts filtering to the channel.

      azoteq,ati-band:
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [0, 1, 2, 3]
        description: |
          Specifies the channel's ATI band as a fraction of its ATI target as
          follows:
          0: 1/16
          1: 1/8
          2: 1/4
          3: 1/2

      azoteq,global-halt:
        type: boolean
        description:
          Specifies that the channel's long-term average is to freeze if any
          other participating channel lies in a proximity or touch state.

      azoteq,invert-enable:
        type: boolean
        description:
          Inverts the polarity of the states reported for proximity and touch
          events relative to their respective thresholds.

      azoteq,dual-direction:
        type: boolean
        description:
          Specifies that the channel's long-term average is to freeze in the
          presence of either increasing or decreasing counts, thereby permit-
          ting events to be reported in either direction.

      azoteq,rx-enable:
        $ref: /schemas/types.yaml#/definitions/uint32-array
        minItems: 1
        maxItems: 4
        items:
          minimum: 0
          maximum: 7
        description: Specifies the CRx pin(s) associated with the channel.

      azoteq,samp-cap-double:
        type: boolean
        description: Doubles the sampling capacitance from 40 pF to 80 pF.

      azoteq,vref-half:
        type: boolean
        description: Halves the discharge threshold from 1.0 V to 0.5 V.

      azoteq,proj-bias:
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [0, 1, 2, 3]
        description: |
          Specifies the bias current applied during mutual (projected)
          capacitive sensing as follows:
          0: 2 uA
          1: 5 uA
          2: 7 uA
          3: 10 uA

      azoteq,ati-target:
        $ref: /schemas/types.yaml#/definitions/uint32
        multipleOf: 8
        minimum: 0
        maximum: 2040
        description: Specifies the channel's ATI target.

      azoteq,ati-base:
        $ref: /schemas/types.yaml#/definitions/uint32
        multipleOf: 16
        minimum: 0
        maximum: 496
        description: Specifies the channel's ATI base.

      azoteq,ati-mode:
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [0, 1, 2, 3, 4, 5]
        description: |
          Specifies the channel's ATI mode as follows:
          0: Disabled
          1: Compensation
          2: Compensation divider
          3: Fine fractional divider
          4: Coarse fractional divider
          5: Full

      azoteq,ati-frac-div-fine:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 31
        description: Specifies the channel's ATI fine fractional divider.

      azoteq,ati-frac-mult-coarse:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 15
        description: Specifies the channel's ATI coarse fractional multiplier.

      azoteq,ati-frac-div-coarse:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 31
        description: Specifies the channel's ATI coarse fractional divider.

      azoteq,ati-comp-div:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 31
        description: Specifies the channel's ATI compensation divider.

      azoteq,ati-comp-select:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 1023
        description: Specifies the channel's ATI compensation selection.

      azoteq,debounce-enter:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 15
        description: Specifies the channel's debounce entrance factor.

      azoteq,debounce-exit:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 15
        description: Specifies the channel's debounce exit factor.

    patternProperties:
      "^event-(prox|touch)$":
        type: object
        $ref: input.yaml#
        description:
          Represents a proximity or touch event reported by the channel.

        properties:
          azoteq,gpio-select:
            $ref: /schemas/types.yaml#/definitions/uint32-array
            minItems: 1
            maxItems: 3
            items:
              minimum: 0
              maximum: 2
            description: |
              Specifies one or more GPIO mapped to the event as follows:
              0: GPIO0
              1: GPIO3
              2: GPIO4

              Note that although multiple events can be mapped to a single
              GPIO, they must all be of the same type (proximity, touch or
              slider/trackpad gesture).

          azoteq,thresh:
            $ref: /schemas/types.yaml#/definitions/uint32
            description:
              Specifies the threshold for the event. Valid entries range from
              0-127 and 0-255 for proximity and touch events, respectively.

          azoteq,hyst:
            $ref: /schemas/types.yaml#/definitions/uint32
            minimum: 0
            maximum: 255
            description:
              Specifies the hysteresis for the event (touch events only).

          azoteq,timeout-press-ms:
            multipleOf: 500
            minimum: 0
            maximum: 127500
            description:
              Specifies the length of time (in ms) to wait before automatically
              releasing a press event. Specify zero to allow the press state to
              persist indefinitely.

              The IQS7222B does not feature channel-specific timeouts; the time-
              out specified for any one channel applies to all channels.

          linux,code: true

          linux,input-type:
            enum: [1, 5]
            default: 1
            description:
              Specifies whether the event is to be interpreted as a key (1)
              or a switch (5).

        additionalProperties: false

    dependencies:
      azoteq,ref-weight: ["azoteq,ref-select"]
      azoteq,use-prox: ["azoteq,ref-select"]

    additionalProperties: false

  "^slider-[0-1]$":
    type: object
    description: Represents a slider comprising three or four channels.

    properties:
      azoteq,channel-select:
        $ref: /schemas/types.yaml#/definitions/uint32-array
        minItems: 3
        maxItems: 4
        items:
          minimum: 0
          maximum: 9
        description:
          Specifies the order of the channels that participate in the slider.

      azoteq,slider-size:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 1
        maximum: 65535
        description:
          Specifies the slider's one-dimensional resolution, equal to the
          maximum coordinate plus one.

      azoteq,lower-cal:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 255
        description: Specifies the slider's lower starting point.

      azoteq,upper-cal:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 255
        description: Specifies the slider's upper starting point.

      azoteq,top-speed:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 65535
        description:
          Specifies the speed (in coordinates traveled per conversion) after
          which coordinate filtering is no longer applied.

      azoteq,bottom-speed:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 255
        description:
          Specifies the speed (in coordinates traveled per conversion) after
          which coordinate filtering is linearly reduced.

      azoteq,bottom-beta:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 7
        description:
          Specifies the coordinate filter damping factor to be applied
          while the speed of movement is below that which is specified
          by azoteq,bottom-speed.

      azoteq,static-beta:
        type: boolean
        description:
          Applies the coordinate filter damping factor specified by
          azoteq,bottom-beta regardless of the speed of movement.

      azoteq,use-prox:
        type: boolean
        description:
          Directs the slider to respond to the proximity states of the selected
          channels instead of their corresponding touch states. Note the slider
          cannot report granular coordinates during a state of proximity.

      linux,axis:
        $ref: /schemas/types.yaml#/definitions/uint32
        description:
          Specifies the absolute axis to which coordinates are mapped. Specify
          ABS_WHEEL to operate the slider as a wheel (IQS7222C only).

    patternProperties:
      "^event-(press|tap|(swipe|flick)-(pos|neg))$":
        type: object
        $ref: input.yaml#
        description:
          Represents a press or gesture (IQS7222A only) event reported by
          the slider.

        properties:
          linux,code: true

          azoteq,gesture-max-ms:
            multipleOf: 16
            minimum: 0
            maximum: 4080
            description:
              Specifies the length of time (in ms) within which a tap, swipe
              or flick gesture must be completed in order to be acknowledged
              by the device. The number specified for any one swipe or flick
              gesture applies to all remaining swipe or flick gestures.

          azoteq,gesture-min-ms:
            multipleOf: 16
            minimum: 0
            maximum: 496
            description:
              Specifies the length of time (in ms) for which a tap gesture must
              be held in order to be acknowledged by the device.

          azoteq,gesture-dist:
            $ref: /schemas/types.yaml#/definitions/uint32
            multipleOf: 16
            minimum: 0
            maximum: 4080
            description:
              Specifies the distance (in coordinates) across which a swipe or
              flick gesture must travel in order to be acknowledged by the
              device. The number specified for any one swipe or flick gesture
              applies to all remaining swipe or flick gestures.

          azoteq,gpio-select:
            $ref: /schemas/types.yaml#/definitions/uint32-array
            minItems: 1
            maxItems: 3
            items:
              minimum: 0
              maximum: 2
            description: |
              Specifies one or more GPIO mapped to the event as follows:
              0: GPIO0
              1: GPIO3
              2: GPIO4

              Note that although multiple events can be mapped to a single
              GPIO, they must all be of the same type (proximity, touch or
              slider gesture).

        additionalProperties: false

    required:
      - azoteq,channel-select

    additionalProperties: false

  "^gpio-[0-2]$":
    type: object
    description: |
      Represents a GPIO mapped to one or more events as follows:
      gpio-0: GPIO0
      gpio-1: GPIO3
      gpio-2: GPIO4

    allOf:
      - $ref: ../pinctrl/pincfg-node.yaml#

    properties:
      drive-open-drain: true

    additionalProperties: false

allOf:
  - $ref: touchscreen/touchscreen.yaml#

  - if:
      properties:
        compatible:
          contains:
            enum:
              - azoteq,iqs7222a
              - azoteq,iqs7222b
              - azoteq,iqs7222c

    then:
      properties:
        touchscreen-size-x: false
        touchscreen-size-y: false
        touchscreen-inverted-x: false
        touchscreen-inverted-y: false
        touchscreen-swapped-x-y: false

        trackpad: false

      patternProperties:
        "^channel-([0-9]|1[0-9])$":
          properties:
            azoteq,counts-filt-enable: false

  - if:
      properties:
        compatible:
          contains:
            enum:
              - azoteq,iqs7222b
              - azoteq,iqs7222c

    then:
      patternProperties:
        "^channel-([0-9]|1[0-9])$":
          properties:
            azoteq,ulp-allow: false

  - if:
      properties:
        compatible:
          contains:
            enum:
              - azoteq,iqs7222b
              - azoteq,iqs7222d

    then:
      patternProperties:
        "^cycle-[0-9]$":
          properties:
            azoteq,iref-enable: false

        "^channel-([0-9]|1[0-9])$":
          properties:
            azoteq,ref-select: false

        "^slider-[0-1]$": false

  - if:
      properties:
        compatible:
          contains:
            const: azoteq,iqs7222b

    then:
      patternProperties:
        "^channel-([0-9]|1[0-9])$":
          patternProperties:
            "^event-(prox|touch)$":
              properties:
                azoteq,gpio-select: false

        "^gpio-[0-2]$": false

  - if:
      properties:
        compatible:
          contains:
            const: azoteq,iqs7222a

    then:
      patternProperties:
        "^channel-([0-9]|1[0-9])$":
          patternProperties:
            "^event-(prox|touch)$":
              properties:
                azoteq,gpio-select:
                  maxItems: 1
                  items:
                    maximum: 0

        "^slider-[0-1]$":
          properties:
            azoteq,slider-size:
              multipleOf: 16
              minimum: 16
              maximum: 4080

            azoteq,top-speed:
              multipleOf: 4
              maximum: 1020

          patternProperties:
            "^event-(press|tap|(swipe|flick)-(pos|neg))$":
              properties:
                azoteq,gpio-select:
                  maxItems: 1
                  items:
                    maximum: 0

    else:
      patternProperties:
        "^slider-[0-1]$":
          patternProperties:
            "^event-(press|tap|(swipe|flick)-(pos|neg))$":
              properties:
                azoteq,gesture-max-ms: false

                azoteq,gesture-min-ms: false

                azoteq,gesture-dist: false

required:
  - compatible
  - reg
  - irq-gpios

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/input/input.h>

    i2c {
            #address-cells = <1>;
            #size-cells = <0>;

            iqs7222a@44 {
                    compatible = "azoteq,iqs7222a";
                    reg = <0x44>;
                    irq-gpios = <&gpio 4 GPIO_ACTIVE_LOW>;
                    azoteq,lta-beta-lp = <7>;
                    azoteq,lta-beta-np = <8>;
                    azoteq,counts-beta-lp = <2>;
                    azoteq,counts-beta-np = <3>;
                    azoteq,lta-fast-beta-lp = <3>;
                    azoteq,lta-fast-beta-np = <4>;

                    cycle-0 {
                            azoteq,conv-period = <5>;
                            azoteq,conv-frac = <127>;
                            azoteq,tx-enable = <1>, <2>, <4>, <5>;
                            azoteq,dead-time-enable;
                            azoteq,sense-mode = <2>;
                    };

                    cycle-1 {
                            azoteq,conv-period = <5>;
                            azoteq,conv-frac = <127>;
                            azoteq,tx-enable = <5>;
                            azoteq,dead-time-enable;
                            azoteq,sense-mode = <2>;
                    };

                    cycle-2 {
                            azoteq,conv-period = <5>;
                            azoteq,conv-frac = <127>;
                            azoteq,tx-enable = <4>;
                            azoteq,dead-time-enable;
                            azoteq,sense-mode = <2>;
                    };

                    cycle-3 {
                            azoteq,conv-period = <5>;
                            azoteq,conv-frac = <127>;
                            azoteq,tx-enable = <2>;
                            azoteq,dead-time-enable;
                            azoteq,sense-mode = <2>;
                    };

                    cycle-4 {
                            azoteq,conv-period = <5>;
                            azoteq,conv-frac = <127>;
                            azoteq,tx-enable = <1>;
                            azoteq,dead-time-enable;
                            azoteq,sense-mode = <2>;
                    };

                    cycle-5 {
                            azoteq,conv-period = <2>;
                            azoteq,conv-frac = <0>;
                    };

                    cycle-6 {
                            azoteq,conv-period = <2>;
                            azoteq,conv-frac = <0>;
                    };

                    channel-0 {
                            azoteq,ulp-allow;
                            azoteq,global-halt;
                            azoteq,invert-enable;
                            azoteq,rx-enable = <3>;
                            azoteq,ati-target = <800>;
                            azoteq,ati-base = <208>;
                            azoteq,ati-mode = <5>;
                    };

                    channel-1 {
                            azoteq,global-halt;
                            azoteq,invert-enable;
                            azoteq,rx-enable = <3>;
                            azoteq,ati-target = <496>;
                            azoteq,ati-base = <208>;
                            azoteq,ati-mode = <5>;
                    };

                    channel-2 {
                            azoteq,global-halt;
                            azoteq,invert-enable;
                            azoteq,rx-enable = <3>;
                            azoteq,ati-target = <496>;
                            azoteq,ati-base = <208>;
                            azoteq,ati-mode = <5>;
                    };

                    channel-3 {
                            azoteq,global-halt;
                            azoteq,invert-enable;
                            azoteq,rx-enable = <3>;
                            azoteq,ati-target = <496>;
                            azoteq,ati-base = <208>;
                            azoteq,ati-mode = <5>;
                    };

                    channel-4 {
                            azoteq,global-halt;
                            azoteq,invert-enable;
                            azoteq,rx-enable = <3>;
                            azoteq,ati-target = <496>;
                            azoteq,ati-base = <208>;
                            azoteq,ati-mode = <5>;
                    };

                    channel-5 {
                            azoteq,ulp-allow;
                            azoteq,global-halt;
                            azoteq,invert-enable;
                            azoteq,rx-enable = <6>;
                            azoteq,ati-target = <800>;
                            azoteq,ati-base = <144>;
                            azoteq,ati-mode = <5>;
                    };

                    channel-6 {
                            azoteq,global-halt;
                            azoteq,invert-enable;
                            azoteq,rx-enable = <6>;
                            azoteq,ati-target = <496>;
                            azoteq,ati-base = <160>;
                            azoteq,ati-mode = <5>;

                            event-touch {
                                    linux,code = <KEY_MUTE>;
                            };
                    };

                    channel-7 {
                            azoteq,global-halt;
                            azoteq,invert-enable;
                            azoteq,rx-enable = <6>;
                            azoteq,ati-target = <496>;
                            azoteq,ati-base = <160>;
                            azoteq,ati-mode = <5>;

                            event-touch {
                                    linux,code = <KEY_VOLUMEDOWN>;
                            };
                    };

                    channel-8 {
                            azoteq,global-halt;
                            azoteq,invert-enable;
                            azoteq,rx-enable = <6>;
                            azoteq,ati-target = <496>;
                            azoteq,ati-base = <160>;
                            azoteq,ati-mode = <5>;

                            event-touch {
                                    linux,code = <KEY_VOLUMEUP>;
                            };
                    };

                    channel-9 {
                            azoteq,global-halt;
                            azoteq,invert-enable;
                            azoteq,rx-enable = <6>;
                            azoteq,ati-target = <496>;
                            azoteq,ati-base = <160>;
                            azoteq,ati-mode = <5>;

                            event-touch {
                                    linux,code = <KEY_POWER>;
                            };
                    };

                    channel-10 {
                            azoteq,ulp-allow;
                            azoteq,ati-target = <496>;
                            azoteq,ati-base = <112>;

                            event-touch {
                                    linux,code = <SW_LID>;
                                    linux,input-type = <EV_SW>;
                            };
                    };

                    channel-11 {
                            azoteq,ati-target = <496>;
                            azoteq,ati-base = <112>;
                    };

                    slider-0 {
                            azoteq,channel-select = <1>, <2>, <3>, <4>;
                            azoteq,slider-size = <4080>;
                            azoteq,upper-cal = <50>;
                            azoteq,lower-cal = <30>;
                            azoteq,top-speed = <200>;
                            azoteq,bottom-speed = <1>;
                            azoteq,bottom-beta = <3>;

                            event-tap {
                                    linux,code = <KEY_PLAYPAUSE>;
                                    azoteq,gesture-max-ms = <400>;
                                    azoteq,gesture-min-ms = <32>;
                            };

                            event-flick-pos {
                                    linux,code = <KEY_NEXTSONG>;
                                    azoteq,gesture-max-ms = <800>;
                                    azoteq,gesture-dist = <800>;
                            };

                            event-flick-neg {
                                    linux,code = <KEY_PREVIOUSSONG>;
                            };
                    };
            };
    };

...