code:
# 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 Capacitive Touch Controller

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

description: |
  The Azoteq IQS7222A, IQS7222B and IQS7222C 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

  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.

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,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 (IQS7222C only)
              2: GPIO4 (IQS7222C only)

              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).

          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 of movement 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 of movement 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 across which a swipe or flick gesture must
              travel in order to be acknowledged by the device. The number spec-
              ified 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 (IQS7222C only)
              2: GPIO4 (IQS7222C only)

              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 (IQS7222C only)
      gpio-2: GPIO4 (IQS7222C only)

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

    properties:
      drive-open-drain: true

    additionalProperties: false

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

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

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

          patternProperties:
            "^event-(prox|touch)$":
              properties:
                azoteq,gpio-select: false

        "^slider-[0-1]$": 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:
        "^channel-([0-9]|1[0-9])$":
          properties:
            azoteq,ulp-allow: false

        "^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>;
                            };
                    };
            };
    };

...


code:
* Broadcom Keypad Controller device tree bindings

Broadcom Keypad controller is used to interface a SoC with a matrix-type
keypad device. The keypad controller supports multiple row and column lines.
A key can be placed at each intersection of a unique row and a unique column.
The keypad controller can sense a key-press and key-release and report the
event using a interrupt to the cpu.

This binding is based on the matrix-keymap binding with the following
changes:

keypad,num-rows and keypad,num-columns are required.

Required SoC Specific Properties:
- compatible: should be "brcm,bcm-keypad"

- reg: physical base address of the controller and length of memory mapped
  region.

- interrupts: The interrupt number to the cpu.

Board Specific Properties:
- keypad,num-rows: Number of row lines connected to the keypad
  controller.

- keypad,num-columns: Number of column lines connected to the
  keypad controller.

- col-debounce-filter-period: The debounce period for the Column filter.

	KEYPAD_DEBOUNCE_1_ms	=	0
	KEYPAD_DEBOUNCE_2_ms	=	1
	KEYPAD_DEBOUNCE_4_ms	=	2
	KEYPAD_DEBOUNCE_8_ms	=	3
	KEYPAD_DEBOUNCE_16_ms	=	4
	KEYPAD_DEBOUNCE_32_ms	=	5
	KEYPAD_DEBOUNCE_64_ms	=	6
	KEYPAD_DEBOUNCE_128_ms	=	7

- status-debounce-filter-period: The debounce period for the Status filter.

	KEYPAD_DEBOUNCE_1_ms	=	0
	KEYPAD_DEBOUNCE_2_ms	=	1
	KEYPAD_DEBOUNCE_4_ms	=	2
	KEYPAD_DEBOUNCE_8_ms	=	3
	KEYPAD_DEBOUNCE_16_ms	=	4
	KEYPAD_DEBOUNCE_32_ms	=	5
	KEYPAD_DEBOUNCE_64_ms	=	6
	KEYPAD_DEBOUNCE_128_ms	=	7

- row-output-enabled: An optional property indicating whether the row or
  column is being used as output. If specified the row is being used
  as the output. Else defaults to column.

- pull-up-enabled: An optional property indicating the Keypad scan mode.
  If specified implies the keypad scan pull-up has been enabled.

- autorepeat: Boolean, Enable auto repeat feature of Linux input
	  subsystem (optional).

- linux,keymap: The keymap for keys as described in the binding document
  devicetree/bindings/input/matrix-keymap.txt.

Example:
#include "dt-bindings/input/input.h"

/ {
	keypad: keypad@180ac000 {
		/* Required SoC specific properties */
		compatible = "brcm,bcm-keypad";

		/* Required Board specific properties */
		keypad,num-rows = <5>;
		keypad,num-columns = <5>;

		linux,keymap = <MATRIX_KEY(0x00, 0x02, KEY_F) /* key_forward */
		MATRIX_KEY(0x00, 0x03, KEY_HOME) /* key_home */
		MATRIX_KEY(0x00, 0x04, KEY_M) /* key_message */
		MATRIX_KEY(0x01, 0x00, KEY_A) /* key_contacts */
		MATRIX_KEY(0x01, 0x01, KEY_1) /* key_1 */
		MATRIX_KEY(0x01, 0x02, KEY_2) /* key_2 */
		MATRIX_KEY(0x01, 0x03, KEY_3) /* key_3 */
		MATRIX_KEY(0x01, 0x04, KEY_S) /* key_speaker */
		MATRIX_KEY(0x02, 0x00, KEY_P) /* key_phone */
		MATRIX_KEY(0x02, 0x01, KEY_4) /* key_4 */
		MATRIX_KEY(0x02, 0x02, KEY_5) /* key_5 */
		MATRIX_KEY(0x02, 0x03, KEY_6) /* key_6 */
		MATRIX_KEY(0x02, 0x04, KEY_VOLUMEUP) /* key_vol_up */
		MATRIX_KEY(0x03, 0x00, KEY_C) /* key_call_log */
		MATRIX_KEY(0x03, 0x01, KEY_7) /* key_7 */
		MATRIX_KEY(0x03, 0x02, KEY_8) /* key_8 */
		MATRIX_KEY(0x03, 0x03, KEY_9) /* key_9 */
		MATRIX_KEY(0x03, 0x04, KEY_VOLUMEDOWN) /* key_vol_down */
		MATRIX_KEY(0x04, 0x00, KEY_H) /* key_headset */
		MATRIX_KEY(0x04, 0x01, KEY_KPASTERISK) /* key_* */
		MATRIX_KEY(0x04, 0x02, KEY_0) /* key_0 */
		MATRIX_KEY(0x04, 0x03, KEY_GRAVE) /* key_# */
		MATRIX_KEY(0x04, 0x04, KEY_MUTE) /* key_mute */
		>;

		/* Optional board specific properties */
		col-debounce-filter-period = <5>;
		row-output-enabled;
		pull-up-enabled;

	};
};

repo_name: angery/linux


code:
* Cirrus Logic CLPS711X matrix keypad device tree bindings

Required Properties:
- compatible:    Shall contain "cirrus,ep7209-keypad".
- row-gpios:     List of GPIOs used as row lines.
- poll-interval: Poll interval time in milliseconds.
- linux,keymap:  The definition can be found at
                 bindings/input/matrix-keymap.txt.

Optional Properties:
- autorepeat:    Enable autorepeat feature.

Example:
	keypad {
		compatible = "cirrus,ep7312-keypad", "cirrus,ep7209-keypad";
		autorepeat;
		poll-interval = <120>;
		row-gpios = <&porta 0 0>,
			    <&porta 1 0>;

		linux,keymap = <
			MATRIX_KEY(0, 0, KEY_UP)
			MATRIX_KEY(0, 1, KEY_DOWN)
			MATRIX_KEY(1, 0, KEY_LEFT)
			MATRIX_KEY(1, 1, KEY_RIGHT)
		>;
	};


code:
Motorola CPCAP on key

This module is part of the CPCAP. For more details about the whole
chip see Documentation/devicetree/bindings/mfd/motorola-cpcap.txt.

This module provides a simple power button event via an Interrupt.

Required properties:
- compatible: should be one of the following
   - "motorola,cpcap-pwrbutton"
- interrupts: irq specifier for CPCAP's ON IRQ

Example:

&cpcap {
	cpcap_pwrbutton: pwrbutton {
		compatible = "motorola,cpcap-pwrbutton";
		interrupts = <23 IRQ_TYPE_NONE>;
	};
};


code:
Cypress I2C Touchpad

Required properties:
- compatible: must be "cypress,cyapa".
- reg: I2C address of the chip.
- interrupts: interrupt to which the chip is connected (see interrupt
	binding[0]).

Optional properties:
- wakeup-source: touchpad can be used as a wakeup source.
- pinctrl-names: should be "default" (see pinctrl binding [1]).
- pinctrl-0: a phandle pointing to the pin settings for the device (see
	pinctrl binding [1]).
- vcc-supply: a phandle for the regulator supplying 3.3V power.

[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt
[1]: Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt

Example:
	&i2c0 {
		/* ... */

		/* Cypress Gen3 touchpad */
		touchpad@67 {
			compatible = "cypress,cyapa";
			reg = <0x67>;
			interrupt-parent = <&gpio>;
			interrupts = <2 IRQ_TYPE_EDGE_FALLING>;	/* GPIO 2 */
			wakeup-source;
		};

		/* Cypress Gen5 and later touchpad */
		touchpad@24 {
			compatible = "cypress,cyapa";
			reg = <0x24>;
			interrupt-parent = <&gpio>;
			interrupts = <2 IRQ_TYPE_EDGE_FALLING>;	/* GPIO 2 */
			wakeup-source;
		};

		/* ... */
	};


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/cypress,tm2-touchkey.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Samsung TM2 touch key controller

maintainers:
  - Stephan Gerhold <stephan@gerhold.net>

description: |
  Touch key controllers similar to the TM2 can be found in a wide range of
  Samsung devices. They are implemented using many different MCUs, but use
  a similar I2C protocol.

allOf:
  - $ref: input.yaml#

properties:
  compatible:
    enum:
      - cypress,tm2-touchkey
      - cypress,midas-touchkey
      - cypress,aries-touchkey
      - coreriver,tc360-touchkey

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  vdd-supply:
    description: Optional regulator for LED voltage, 3.3V.

  vcc-supply:
    description: Optional regulator for MCU, 1.8V-3.3V (depending on MCU).

  vddio-supply:
    description: |
      Optional regulator that provides digital I/O voltage,
      e.g. for pulling up the interrupt line or the I2C pins.

  linux,keycodes:
    minItems: 1
    maxItems: 4

required:
  - compatible
  - reg
  - interrupts

additionalProperties: false

examples:
  - |
    #include <dt-bindings/input/input.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        touchkey@20 {
            compatible = "cypress,tm2-touchkey";
            reg = <0x20>;
            interrupt-parent = <&gpa3>;
            interrupts = <2 IRQ_TYPE_EDGE_FALLING>;
            vcc-supply = <&ldo32_reg>;
            vdd-supply = <&ldo33_reg>;
            linux,keycodes = <KEY_MENU KEY_BACK>;
        };
    };


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/cypress-sf.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Cypress StreetFighter touchkey controller

maintainers:
  - Yassine Oudjana <y.oudjana@protonmail.com>

allOf:
  - $ref: input.yaml#

properties:
  compatible:
    const: cypress,sf3155

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  avdd-supply:
    description: Regulator for AVDD analog voltage

  vdd-supply:
    description: Regulator for VDD digital voltage

  linux,keycodes:
    minItems: 1
    maxItems: 8

required:
  - compatible
  - reg
  - interrupts
  - avdd-supply
  - vdd-supply

additionalProperties: false

examples:
  - |
    #include <dt-bindings/input/input.h>
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        touchkey@28 {
                compatible = "cypress,sf3155";
                reg = <0x28>;
                interrupt-parent = <&msmgpio>;
                interrupts = <77 IRQ_TYPE_EDGE_FALLING>;
                avdd-supply = <&vreg_l6a_1p8>;
                vdd-supply = <&vdd_3v2_tp>;
                linux,keycodes = <KEY_BACK KEY_MENU>;
        };
    };


code:
* Dialog DA9061/62/63 OnKey Module

This module is part of the DA9061/DA9062/DA9063. For more details about entire
DA9062 and DA9061 chips see Documentation/devicetree/bindings/mfd/da9062.txt
For DA9063 see Documentation/devicetree/bindings/mfd/dlg,da9063.yaml

This module provides the KEY_POWER event.

Required properties:

- compatible: should be one of the following valid compatible string lines:
	"dlg,da9061-onkey", "dlg,da9062-onkey"
	"dlg,da9062-onkey"
	"dlg,da9063-onkey"

Optional properties:

- dlg,disable-key-power : Disable power-down using a long key-press. If this
    entry exists the OnKey driver will remove support for the KEY_POWER key
    press when triggered using a long press of the OnKey.

Example: DA9063

	pmic0: da9063@58 {
		onkey {
			compatible = "dlg,da9063-onkey";
			dlg,disable-key-power;
		};
	};

Example: DA9062

	pmic0: da9062@58 {
		onkey {
			compatible = "dlg,da9062-onkey";
			dlg,disable-key-power;
		};
	};

Example: DA9061 using a fall-back compatible for the DA9062 onkey driver

	pmic0: da9061@58 {
		onkey {
			compatible = "dlg,da9061-onkey", "dlg,da9062-onkey";
			dlg,disable-key-power;
		};
	};


code:
Dialog Semiconductor DA7280 Haptics bindings

Required properties:
- compatible: Should be "dlg,da7280".
- reg: Specifies the I2C slave address.

- interrupt-parent : Specifies the phandle of the interrupt controller to
  which the IRQs from DA7280 are delivered to.

- dlg,actuator-type: Set Actuator type. it should be one of:
  "LRA" - Linear Resonance Actuator type.
  "ERM-bar" - Bar type Eccentric Rotating Mass.
  "ERM-coin" - Coin type Eccentric Rotating Mass.

- dlg,const-op-mode: Haptic operation mode for FF_CONSTANT.
  Possible values:
	1 - Direct register override(DRO) mode triggered by i2c(default),
	2 - PWM data source mode controlled by PWM duty,
- dlg,periodic-op-mode: Haptic operation mode for FF_PERIODIC.
  Possible values:
	1 - Register triggered waveform memory(RTWM) mode, the pattern
	    assigned to the PS_SEQ_ID played as much times as PS_SEQ_LOOP,
	2 - Edge triggered waveform memory(ETWM) mode, external GPI(N)
	    control are required to enable/disable and it needs to keep
	    device enabled by sending magnitude (X > 0),
	    the pattern is assigned to the GPI(N)_SEQUENCE_ID below.
	The default value is 1 for both of the operation modes.
	For more details, please see the datasheet.

- dlg,nom-microvolt: Nominal actuator voltage rating.
  Valid values: 0 - 6000000.
- dlg,abs-max-microvolt: Absolute actuator maximum voltage rating.
  Valid values: 0 - 6000000.
- dlg,imax-microamp: Actuator max current rating.
  Valid values: 0 - 252000.
  Default: 130000.
- dlg,impd-micro-ohms: the impedance of the actuator in micro ohms.
  Valid values: 0 - 1500000000.

Optional properties:
- pwms : phandle to the physical PWM(Pulse Width Modulation) device.
  PWM properties should be named "pwms". And number of cell is different
  for each pwm device.
  (See Documentation/devicetree/bindings/pwm/pwm.txt
   for further information relating to pwm properties)

- dlg,ps-seq-id: the PS_SEQ_ID(pattern ID in waveform memory inside chip)
  to play back when RTWM-MODE is enabled.
  Valid range: 0 - 15.
- dlg,ps-seq-loop: the PS_SEQ_LOOP, Number of times the pre-stored sequence
  pointed to by PS_SEQ_ID or GPI(N)_SEQUENCE_ID is repeated.
  Valid range: 0 - 15.
- dlg,gpiN-seq-id: the GPI(N)_SEQUENCE_ID, pattern to play
  when gpi0 is triggered, 'N' must be 0 - 2.
  Valid range: 0 - 15.
- dlg,gpiN-mode: the pattern mode which can select either
  "Single-pattern" or "Multi-pattern", 'N' must be 0 - 2.
- dlg,gpiN-polarity: gpiN polarity which can be chosen among
  "Rising-edge", "Falling-edge" and "Both-edge",
  'N' must be 0 - 2
  Haptic will work by this edge option in case of ETWM mode.

- dlg,resonant-freq-hz: use in case of LRA.
  the frequency range: 50 - 300.
  Default: 205.

- dlg,bemf-sens-enable: Enable for internal loop computations.
- dlg,freq-track-enable: Enable for resonant frequency tracking.
- dlg,acc-enable: Enable for active acceleration.
- dlg,rapid-stop-enable: Enable for rapid stop.
- dlg,amp-pid-enable: Enable for the amplitude PID.
- dlg,mem-array: Customized waveform memory(patterns) data downloaded to
  the device during initialization. This is an array of 100 values(u8).

For further information, see device datasheet.

======

Example:

	haptics: da7280-haptics@4a {
		compatible = "dlg,da7280";
		reg = <0x4a>;
		interrupt-parent = <&gpio6>;
		interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
		dlg,actuator-type = "LRA";
		dlg,dlg,const-op-mode = <1>;
		dlg,dlg,periodic-op-mode = <1>;
		dlg,nom-microvolt = <2000000>;
		dlg,abs-max-microvolt = <2000000>;
		dlg,imax-microamp = <170000>;
		dlg,resonant-freq-hz = <180>;
		dlg,impd-micro-ohms = <10500000>;
		dlg,freq-track-enable;
		dlg,rapid-stop-enable;
		dlg,mem-array = <
		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
		  0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
		>;
	};


code:
* D-Link DIR-685 Touchkeys

This is a I2C one-off touchkey controller based on the Cypress Semiconductor
CY8C214 MCU with some firmware in its internal 8KB flash. The circuit
board inside the router is named E119921.

The touchkey device node should be placed inside an I2C bus node.

Required properties:
- compatible: must be "dlink,dir685-touchkeys"
- reg: the I2C address of the touchkeys
- interrupts: reference to the interrupt number

Example:

touchkeys@26 {
	compatible = "dlink,dir685-touchkeys";
	reg = <0x26>;
	interrupt-parent = <&gpio0>;
	interrupts = <17 IRQ_TYPE_EDGE_FALLING>;
};


code:
National Instruments Ettus Research USRP E3x0 button driver

This module is part of the NI Ettus Research USRP E3x0 SDR.

This module provides a simple power button event via two interrupts.

Required properties:
- compatible: should be one of the following
  - "ettus,e3x0-button": For devices such as the NI Ettus Research USRP E3x0
- interrupts: should be one of the following
  - <0 30 1>, <0 31 1>: For devices such as the NI Ettus Research USRP E3x0
- interrupt-names: should be one of the following
  - "press", "release": For devices such as the NI Ettus Research USRP E3x0

Note: Interrupt numbers might vary depending on the FPGA configuration.

Example:
	button {
		compatible = "ettus,e3x0-button";
		interrupt-parent = <&intc>;
		interrupts = <0 30 1>, <0 31 1>;
		interrupt-names = "press", "release";
	}


code:
# SPDX-License-Identifier: (GPL-2.0-only or BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/elan,ekth3000.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Elantech I2C Touchpad

maintainers:
  - Dmitry Torokhov <dmitry.torokhov@gmail.com>

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

properties:
  compatible:
    const: elan,ekth3000

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  wakeup-source:
    type: boolean
    description: touchpad can be used as a wakeup source

  vcc-supply:
    description: a phandle for the regulator supplying 3.3V power

  elan,trackpoint:
    type: boolean
    description: touchpad can support a trackpoint

  elan,clickpad:
    type: boolean
    description: touchpad is a clickpad (the entire surface is a button)

  elan,middle-button:
    type: boolean
    description: touchpad has a physical middle button

  elan,x_traces:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: number of antennas on the x axis

  elan,y_traces:
    $ref: /schemas/types.yaml#/definitions/uint32
    description: number of antennas on the y axis

  touchscreen-size-x: true

  touchscreen-size-y: true

  touchscreen-x-mm: true

  touchscreen-y-mm: true

required:
  - compatible
  - reg
  - interrupts

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        touchpad@15 {
            compatible = "elan,ekth3000";
            reg = <0x15>;
            interrupt-parent = <&gpio4>;
            interrupts = <0x0 IRQ_TYPE_EDGE_FALLING>;
            wakeup-source;
        };
    };


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/elan,ekth6915.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Elan eKTH6915 touchscreen controller

maintainers:
  - Douglas Anderson <dianders@chromium.org>

description:
  Supports the Elan eKTH6915 touchscreen controller.
  This touchscreen controller uses the i2c-hid protocol with a reset GPIO.

properties:
  compatible:
    items:
      - const: elan,ekth6915

  reg:
    const: 0x10

  interrupts:
    maxItems: 1

  reset-gpios:
    description: Reset GPIO; not all touchscreens using eKTH6915 hook this up.

  vcc33-supply:
    description: The 3.3V supply to the touchscreen.

  vccio-supply:
    description:
      The IO supply to the touchscreen. Need not be specified if this is the
      same as the 3.3V supply.

required:
  - compatible
  - reg
  - interrupts
  - vcc33-supply

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>

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

      ap_ts: touchscreen@10 {
        compatible = "elan,ekth6915";
        reg = <0x10>;

        interrupt-parent = <&tlmm>;
        interrupts = <9 IRQ_TYPE_LEVEL_LOW>;

        reset-gpios = <&tlmm 8 GPIO_ACTIVE_LOW>;
        vcc33-supply = <&pp3300_ts>;
      };
    };


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/fsl,mpr121-touchkey.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Freescale MPR121 capacitive touch sensor controller

maintainers:
  - Dmitry Torokhov <dmitry.torokhov@gmail.com>

description: |
  The MPR121 supports up to 12 completely independent electrodes/capacitance
  sensing inputs in which 8 are multifunctional for LED driving and GPIO.
  https://www.nxp.com/docs/en/data-sheet/MPR121.pdf

allOf:
  - $ref: input.yaml#

anyOf:
  - required: [ interrupts ]
  - required: [ poll-interval ]

properties:
  compatible:
    const: fsl,mpr121-touchkey

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  vdd-supply: true

  linux,keycodes:
    minItems: 1
    maxItems: 12

  wakeup-source:
    description: Use any event on keypad as wakeup event.
    type: boolean

required:
  - compatible
  - reg
  - vdd-supply
  - linux,keycodes

unevaluatedProperties: false

examples:
  - |
    // Example with interrupts
    #include "dt-bindings/input/input.h"
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        touchkey@5a {
            compatible = "fsl,mpr121-touchkey";
            reg = <0x5a>;
            interrupt-parent = <&gpio1>;
            interrupts = <28 2>;
            autorepeat;
            vdd-supply = <&ldo4_reg>;
            linux,keycodes = <KEY_0>, <KEY_1>, <KEY_2>, <KEY_3>,
                             <KEY_4>, <KEY_5>, <KEY_6>, <KEY_7>,
                             <KEY_8>, <KEY_9>, <KEY_A>, <KEY_B>;
        };
    };

  - |
    // Example with polling
    #include "dt-bindings/input/input.h"
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        touchkey@5a {
            compatible = "fsl,mpr121-touchkey";
            reg = <0x5a>;
            poll-interval = <20>;
            autorepeat;
            vdd-supply = <&ldo4_reg>;
            linux,keycodes = <KEY_0>, <KEY_1>, <KEY_2>, <KEY_3>,
                             <KEY_4>, <KEY_5>, <KEY_6>, <KEY_7>,
                             <KEY_8>, <KEY_9>, <KEY_A>, <KEY_B>;
        };
    };


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/fsl,scu-key.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: i.MX SCU Client Device Node - SCU key bindings based on SCU Message Protocol

maintainers:
  - Dong Aisheng <aisheng.dong@nxp.com>

description: i.MX SCU Client Device Node
  Client nodes are maintained as children of the relevant IMX-SCU device node.

allOf:
  - $ref: input.yaml#

properties:
  compatible:
    items:
      - const: fsl,imx8qxp-sc-key
      - const: fsl,imx-sc-key

  linux,keycodes:
    maxItems: 1

required:
  - compatible
  - linux,keycodes

additionalProperties: false

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

    keys {
        compatible = "fsl,imx8qxp-sc-key", "fsl,imx-sc-key";
        linux,keycodes = <KEY_POWER>;
    };


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/goodix,gt7375p.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Goodix GT7375P touchscreen

maintainers:
  - Douglas Anderson <dianders@chromium.org>

description:
  Supports the Goodix GT7375P touchscreen.
  This touchscreen uses the i2c-hid protocol but has some non-standard
  power sequencing required.

properties:
  compatible:
    oneOf:
      - const: goodix,gt7375p
      - items:
          - const: goodix,gt7986u
          - const: goodix,gt7375p

  reg:
    enum:
      - 0x5d
      - 0x14

  interrupts:
    maxItems: 1

  reset-gpios:
    true

  vdd-supply:
    description: The 3.3V supply to the touchscreen.

required:
  - compatible
  - reg
  - interrupts
  - reset-gpios
  - vdd-supply

additionalProperties: false

examples:
  - |
    #include <dt-bindings/clock/qcom,rpmh.h>
    #include <dt-bindings/gpio/gpio.h>
    #include <dt-bindings/interrupt-controller/irq.h>

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

      ap_ts: touchscreen@5d {
        compatible = "goodix,gt7375p";
        reg = <0x5d>;

        interrupt-parent = <&tlmm>;
        interrupts = <9 IRQ_TYPE_LEVEL_LOW>;

        reset-gpios = <&tlmm 8 GPIO_ACTIVE_LOW>;
        vdd-supply = <&pp3300_ts>;
      };
    };


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---

$id: http://devicetree.org/schemas/input/google,cros-ec-keyb.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: ChromeOS EC Keyboard

maintainers:
  - Simon Glass <sjg@chromium.org>
  - Benson Leung <bleung@chromium.org>

description: |
  Google's ChromeOS EC Keyboard is a simple matrix keyboard
  implemented on a separate EC (Embedded Controller) device. It provides
  a message for reading key scans from the EC. These are then converted
  into keycodes for processing by the kernel. This device also supports
  switches/buttons like power and volume buttons.

properties:
  compatible:
    oneOf:
      - description: ChromeOS EC with only buttons/switches
        const: google,cros-ec-keyb-switches
      - description: ChromeOS EC with keyboard and possibly buttons/switches
        const: google,cros-ec-keyb

  google,needs-ghost-filter:
    description:
      Enable a ghost filter for the matrix keyboard. This is recommended
      if the EC does not have its own logic or hardware for this.
    type: boolean

  function-row-physmap:
    $ref: /schemas/types.yaml#/definitions/uint32-array
    minItems: 1
    maxItems: 15
    description: |
      An ordered u32 array describing the rows/columns (in the scan matrix)
      of top row keys from physical left (KEY_F1) to right. Each entry
      encodes the row/column as:
      (((row) & 0xFF) << 24) | (((column) & 0xFF) << 16)
      where the lower 16 bits are reserved. This property is specified only
      when the keyboard has a custom design for the top row keys.

dependencies:
  function-row-phsymap: [ 'linux,keymap' ]
  google,needs-ghost-filter: [ 'linux,keymap' ]

required:
  - compatible

if:
  properties:
    compatible:
      contains:
        const: google,cros-ec-keyb
then:
  $ref: "/schemas/input/matrix-keymap.yaml#"
  required:
    - keypad,num-rows
    - keypad,num-columns
    - linux,keymap

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/input/input.h>
    keyboard-controller {
        compatible = "google,cros-ec-keyb";
        keypad,num-rows = <8>;
        keypad,num-columns = <13>;
        google,needs-ghost-filter;
        function-row-physmap = <
            MATRIX_KEY(0x00, 0x02, 0)   /* T1 */
            MATRIX_KEY(0x03, 0x02, 0)   /* T2 */
            MATRIX_KEY(0x02, 0x02, 0)   /* T3 */
            MATRIX_KEY(0x01, 0x02, 0)   /* T4 */
            MATRIX_KEY(0x03, 0x04, 0)   /* T5 */
            MATRIX_KEY(0x02, 0x04, 0)   /* T6 */
            MATRIX_KEY(0x01, 0x04, 0)   /* T7 */
            MATRIX_KEY(0x02, 0x09, 0)   /* T8 */
            MATRIX_KEY(0x01, 0x09, 0)   /* T9 */
            MATRIX_KEY(0x00, 0x04, 0)   /* T10 */
        >;
        /*
         * Keymap entries take the form of 0xRRCCKKKK where
         * RR=Row CC=Column KKKK=Key Code
         * The values below are for a US keyboard layout and
         * are taken from the Linux driver. Note that the
         * 102ND key is not used for US keyboards.
         */
        linux,keymap = <
            /* CAPSLCK F1         B          F10     */
            0x0001003a 0x0002003b 0x00030030 0x00040044
            /* N       =          R_ALT      ESC     */
            0x00060031 0x0008000d 0x000a0064 0x01010001
            /* F4      G          F7         H       */
            0x0102003e 0x01030022 0x01040041 0x01060023
            /* '       F9         BKSPACE    L_CTRL  */
            0x01080028 0x01090043 0x010b000e 0x0200001d
            /* TAB     F3         T          F6      */
            0x0201000f 0x0202003d 0x02030014 0x02040040
            /* ]       Y          102ND      [       */
            0x0205001b 0x02060015 0x02070056 0x0208001a
            /* F8      GRAVE      F2         5       */
            0x02090042 0x03010029 0x0302003c 0x03030006
            /* F5      6          -          \       */
            0x0304003f 0x03060007 0x0308000c 0x030b002b
            /* R_CTRL  A          D          F       */
            0x04000061 0x0401001e 0x04020020 0x04030021
            /* S       K          J          ;       */
            0x0404001f 0x04050025 0x04060024 0x04080027
            /* L       ENTER      Z          C       */
            0x04090026 0x040b001c 0x0501002c 0x0502002e
            /* V       X          ,          M       */
            0x0503002f 0x0504002d 0x05050033 0x05060032
            /* L_SHIFT /          .          SPACE   */
            0x0507002a 0x05080035 0x05090034 0x050B0039
            /* 1       3          4          2       */
            0x06010002 0x06020004 0x06030005 0x06040003
            /* 8       7          0          9       */
            0x06050009 0x06060008 0x0608000b 0x0609000a
            /* L_ALT   DOWN       RIGHT      Q       */
            0x060a0038 0x060b006c 0x060c006a 0x07010010
            /* E       R          W          I       */
            0x07020012 0x07030013 0x07040011 0x07050017
            /* U       R_SHIFT    P          O       */
            0x07060016 0x07070036 0x07080019 0x07090018
            /* UP      LEFT    */
            0x070b0067 0x070c0069>;
    };
  - |
    /* No matrix keyboard, just buttons/switches */
    keyboard-controller {
        compatible = "google,cros-ec-keyb-switches";
    };
...


code:
# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/gpio-beeper.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: GPIO controlled beeper

maintainers:
  - Fabio Estevam <festevam@denx.de>

properties:
  compatible:
    const: gpio-beeper

  gpios:
    maxItems: 1
    description:
      GPIO that drives the beeper.

required:
  - compatible
  - gpios

additionalProperties: false

examples:
  - |
    #include <dt-bindings/gpio/gpio.h>
    beeper {
        compatible = "gpio-beeper";
        gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
    };


code:
* GPIO Decoder DT bindings

Required Properties:
- compatible: should be "gpio-decoder"
- gpios: a spec of gpios (at least two) to be decoded to a number with
  first entry representing the MSB.

Optional Properties:
- decoder-max-value: Maximum possible value that can be reported by
  the gpios.
- linux,axis: the input subsystem axis to map to (ABS_X/ABS_Y).
  Defaults to 0 (ABS_X).

Example:
	gpio-decoder0 {
		compatible = "gpio-decoder";
		gpios = <&pca9536 3 GPIO_ACTIVE_HIGH>,
			<&pca9536 2 GPIO_ACTIVE_HIGH>,
			<&pca9536 1 GPIO_ACTIVE_HIGH>,
			<&pca9536 0 GPIO_ACTIVE_HIGH>;
		linux,axis = <0>; /* ABS_X */
		decoder-max-value = <9>;
	};


code:
# SPDX-License-Identifier: GPL-2.0-only
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/gpio-keys.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Device-Tree bindings for GPIO attached keys

maintainers:
  - Rob Herring <robh@kernel.org>

properties:
  compatible:
    enum:
      - gpio-keys
      - gpio-keys-polled

  autorepeat: true

  label:
    description: Name of entire device

  poll-interval: true

patternProperties:
  "^(button|event|key|switch|(button|event|key|switch)-[a-z0-9-]+|[a-z0-9-]+-(button|event|key|switch))$":
    $ref: input.yaml#

    properties:
      gpios:
        maxItems: 1

      interrupts:
        maxItems: 1

      label:
        description: Descriptive name of the key.

      linux,code:
        description: Key / Axis code to emit.

      linux,input-type:
        default: 1  # EV_KEY

      linux,input-value:
        description: |
          If linux,input-type is EV_ABS or EV_REL then this
          value is sent for events this button generates when pressed.
          EV_ABS/EV_REL axis will generate an event with a value of 0
          when all buttons with linux,input-type == type and
          linux,code == axis are released. This value is interpreted
          as a signed 32 bit value, e.g. to make a button generate a
          value of -1 use:

          linux,input-value = <0xffffffff>; /* -1 */

        $ref: /schemas/types.yaml#/definitions/uint32

      debounce-interval:
        description:
          Debouncing interval time in milliseconds. If not specified defaults to 5.
        $ref: /schemas/types.yaml#/definitions/uint32

        default: 5

      wakeup-source:
        description: Button can wake-up the system.

      wakeup-event-action:
        description: |
          Specifies whether the key should wake the system when asserted, when
          deasserted, or both. This property is only valid for keys that wake up the
          system (e.g., when the "wakeup-source" property is also provided).

          Supported values are defined in linux-event-codes.h:

            EV_ACT_ANY        - both asserted and deasserted
            EV_ACT_ASSERTED   - asserted
            EV_ACT_DEASSERTED - deasserted
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [0, 1, 2]

      linux,can-disable:
        description:
          Indicates that button is connected to dedicated (not shared) interrupt
          which can be disabled to suppress events from the button.
        type: boolean

    required:
      - linux,code

    anyOf:
      - required:
          - interrupts
      - required:
          - interrupts-extended
      - required:
          - gpios

    dependencies:
      wakeup-event-action: [ wakeup-source ]
      linux,input-value: [ gpios ]

    unevaluatedProperties: false

allOf:
  - $ref: input.yaml#
  - if:
      properties:
        compatible:
          const: gpio-keys-polled
    then:
      required:
        - poll-interval
    else:
      properties:
        poll-interval: false

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>

    gpio-keys {
        compatible = "gpio-keys";
        autorepeat;

        key-up {
            label = "GPIO Key UP";
            linux,code = <103>;
            gpios = <&gpio1 0 1>;
        };

        key-down {
            label = "GPIO Key DOWN";
            linux,code = <108>;
            interrupts = <1 IRQ_TYPE_EDGE_FALLING>;
        };
    };

...


code:
* GPIO driven matrix keypad device tree bindings

GPIO driven matrix keypad is used to interface a SoC with a matrix keypad.
The matrix keypad supports multiple row and column lines, a key can be
placed at each intersection of a unique row and a unique column. The matrix
keypad can sense a key-press and key-release by means of GPIO lines and
report the event using GPIO interrupts to the cpu.

Required Properties:
- compatible:		Should be "gpio-matrix-keypad"
- row-gpios:		List of gpios used as row lines. The gpio specifier
			for this property depends on the gpio controller to
			which these row lines are connected.
- col-gpios:		List of gpios used as column lines. The gpio specifier
			for this property depends on the gpio controller to
			which these column lines are connected.
- linux,keymap:		The definition can be found at
			bindings/input/matrix-keymap.txt

Optional Properties:
- linux,no-autorepeat:	do no enable autorepeat feature.
- wakeup-source:	use any event on keypad as wakeup event.
			(Legacy property supported: "linux,wakeup")
- debounce-delay-ms:	debounce interval in milliseconds
- col-scan-delay-us:	delay, measured in microseconds, that is needed
			before we can scan keypad after activating column gpio
- drive-inactive-cols:	drive inactive columns during scan,
			default is to turn inactive columns into inputs.

Example:
	matrix-keypad {
		compatible = "gpio-matrix-keypad";
		debounce-delay-ms = <5>;
		col-scan-delay-us = <2>;

		row-gpios = <&gpio2 25 0
			     &gpio2 26 0
			     &gpio2 27 0>;

		col-gpios = <&gpio2 21 0
			     &gpio2 22 0>;

		linux,keymap = <0x0000008B
				0x0100009E
				0x02000069
				0x0001006A
				0x0101001C
				0x0201006C>;
	};


code:
Device-Tree bindings for GPIO attached mice

This simply uses standard GPIO handles to define a simple mouse connected
to 5-7 GPIO lines.

Required properties:
	- compatible: must be "gpio-mouse"
	- scan-interval-ms: The scanning interval in milliseconds
	- up-gpios: GPIO line phandle to the line indicating "up"
	- down-gpios: GPIO line phandle to the line indicating "down"
	- left-gpios: GPIO line phandle to the line indicating "left"
	- right-gpios: GPIO line phandle to the line indicating "right"

Optional properties:
	- button-left-gpios: GPIO line handle to the left mouse button
	- button-middle-gpios: GPIO line handle to the middle mouse button
	- button-right-gpios: GPIO line handle to the right mouse button
Example:

#include <dt-bindings/gpio/gpio.h>

gpio-mouse {
	compatible = "gpio-mouse";
	scan-interval-ms = <50>;
	up-gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
	down-gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
	left-gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
	right-gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
	button-left-gpios = <&gpio0 4 GPIO_ACTIVE_LOW>;
	button-middle-gpios = <&gpio0 5 GPIO_ACTIVE_LOW>;
	button-right-gpios = <&gpio0 6 GPIO_ACTIVE_LOW>;
};


code:
# SPDX-License-Identifier: GPL-2.0
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/gpio-vibrator.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: GPIO vibrator

maintainers:
  - Luca Weiss <luca@z3ntu.xyz>

description: |+
  Registers a GPIO device as vibrator, where the on/off capability is controlled by a GPIO.

properties:
  compatible:
    const: gpio-vibrator

  enable-gpios:
    maxItems: 1

  vcc-supply:
    description: Regulator that provides power

required:
  - compatible
  - enable-gpios

additionalProperties: false

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

    vibrator {
        compatible = "gpio-vibrator";
        enable-gpios = <&msmgpio 86 GPIO_ACTIVE_HIGH>;
        vcc-supply = <&pm8941_l18>;
    };


code:
# SPDX-License-Identifier: GPL-2.0-only
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/hid-over-i2c.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: HID over I2C Devices

maintainers:
  - Benjamin Tissoires <benjamin.tissoires@redhat.com>
  - Jiri Kosina <jkosina@suse.cz>

description: |+
  HID over I2C provides support for various Human Interface Devices over the
  I2C bus. These devices can be for example touchpads, keyboards, touch screens
  or sensors.

  The specification has been written by Microsoft and is currently available here:
  https://msdn.microsoft.com/en-us/library/windows/hardware/hh852380.aspx

  If this binding is used, the kernel module i2c-hid will handle the communication
  with the device and the generic hid core layer will handle the protocol.

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

properties:
  compatible:
    oneOf:
      - items:
          - enum:
              - wacom,w9013
          - const: hid-over-i2c
      - description: Just "hid-over-i2c" alone is allowed, but not recommended.
        const: hid-over-i2c

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  hid-descr-addr:
    description: HID descriptor address
    $ref: /schemas/types.yaml#/definitions/uint32

  post-power-on-delay-ms:
    description: Time required by the device after enabling its regulators
      or powering it on, before it is ready for communication.

  touchscreen-inverted-x: true

  touchscreen-inverted-y: true

  vdd-supply:
    description: 3.3V supply

  vddl-supply:
    description: 1.8V supply

  wakeup-source: true

required:
  - compatible
  - reg
  - interrupts

additionalProperties: false

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

        hid@2c {
            compatible = "hid-over-i2c";
            reg = <0x2c>;
            hid-descr-addr = <0x0020>;
            interrupts = <3 2>;
        };
    };
...


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/ibm,op-panel.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: IBM Operation Panel

maintainers:
  - Eddie James <eajames@linux.ibm.com>

allOf:
  - $ref: input.yaml#

description: |
  The IBM Operation Panel provides a simple interface to control the connected
  server. It has a display and three buttons: two directional arrows and one
  'Enter' button.

properties:
  compatible:
    const: ibm,op-panel

  reg:
    maxItems: 1

  linux,keycodes:
    minItems: 1
    maxItems: 3

required:
  - compatible
  - reg

additionalProperties: false

examples:
  - |
    #include <dt-bindings/i2c/i2c.h>
    #include <dt-bindings/input/input.h>
    i2c {
        #address-cells = <1>;
        #size-cells = <0>;

        ibm-op-panel@62 {
            compatible = "ibm,op-panel";
            reg = <(0x62 | I2C_OWN_SLAVE_ADDRESS)>;
            linux,keycodes = <KEY_UP>, <KEY_DOWN>, <KEY_ENTER>;
        };
    };


code:
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/imx-keypad.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Freescale i.MX Keypad Port(KPP)

maintainers:
  - Liu Ying <gnuiyl@gmail.com>

allOf:
  - $ref: "/schemas/input/matrix-keymap.yaml#"

description: |
  The KPP is designed to interface with a keypad matrix with 2-point contact
  or 3-point contact keys. The KPP is designed to simplify the software task
  of scanning a keypad matrix. The KPP is capable of detecting, debouncing,
  and decoding one or multiple keys pressed simultaneously on a keypad.

properties:
  compatible:
    oneOf:
      - const: fsl,imx21-kpp
      - items:
          - enum:
              - fsl,imx25-kpp
              - fsl,imx27-kpp
              - fsl,imx31-kpp
              - fsl,imx35-kpp
              - fsl,imx51-kpp
              - fsl,imx53-kpp
              - fsl,imx50-kpp
              - fsl,imx6q-kpp
              - fsl,imx6sx-kpp
              - fsl,imx6sl-kpp
              - fsl,imx6sll-kpp
              - fsl,imx6ul-kpp
              - fsl,imx7d-kpp
          - const: fsl,imx21-kpp

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  clocks:
    maxItems: 1

required:
  - compatible
  - reg
  - interrupts
  - clocks
  - linux,keymap

unevaluatedProperties: false

examples:
  - |
    keypad@73f94000 {
        compatible = "fsl,imx51-kpp", "fsl,imx21-kpp";
        reg = <0x73f94000 0x4000>;
        interrupts = <60>;
        clocks = <&clks 0>;
        pinctrl-names = "default";
        pinctrl-0 = <&pinctrl_kpp_1>;
        linux,keymap = <0x00000067	/* KEY_UP */
                        0x0001006c	/* KEY_DOWN */
                        0x00020072	/* KEY_VOLUMEDOWN */
                        0x00030066	/* KEY_HOME */
                        0x0100006a	/* KEY_RIGHT */
                        0x01010069	/* KEY_LEFT */
                        0x0102001c	/* KEY_ENTER */
                        0x01030073	/* KEY_VOLUMEUP */
                        0x02000040	/* KEY_F6 */
                        0x02010042	/* KEY_F8 */
                        0x02020043	/* KEY_F9 */
                        0x02030044	/* KEY_F10 */
                        0x0300003b	/* KEY_F1 */
                        0x0301003c	/* KEY_F2 */
                        0x0302003d	/* KEY_F3 */
                        0x03030074>;	/* KEY_POWER */
    };


code:
Input: sysrq reset sequence

A simple binding to represent a set of keys as described in
include/uapi/linux/input.h. This is to communicate a sequence of keys to the
sysrq driver. Upon holding the keys for a specified amount of time (if
specified) the system is sync'ed and reset.

Key sequences are global to the system but all the keys in a set must be coming
from the same input device.

The /chosen node should contain a 'linux,sysrq-reset-seq' child node to define
a set of keys.

Required property:
keyset: array of Linux keycodes, one keycode per cell.

Optional property:
timeout-ms: duration keys must be pressed together in milliseconds before
generating a sysrq. If omitted the system is rebooted immediately when a valid
sequence has been recognized.

Example:

 chosen {
                linux,sysrq-reset-seq {
                        keyset = <0x03
                                  0x04
                                  0x0a>;
                        timeout-ms = <3000>;
                };
         };

Would represent KEY_2, KEY_3 and KEY_9.


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/input.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Common input schema binding

maintainers:
  - Dmitry Torokhov <dmitry.torokhov@gmail.com>

properties:
  autorepeat:
    description: Enable autorepeat when key is pressed and held down.
    type: boolean

  linux,keycodes:
    description:
      Specifies an array of numeric keycode values to be used for reporting
      button presses.
    $ref: /schemas/types.yaml#/definitions/uint32-array
    items:
      minimum: 0
      maximum: 0x2ff

  linux,code:
    description:
      Specifies a single numeric keycode value to be used for reporting
      button/switch events. Specify KEY_RESERVED (0) to opt out of event
      reporting.
    $ref: /schemas/types.yaml#/definitions/uint32
    maximum: 0x2ff

  linux,input-type:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum:
      - 1   # EV_KEY
      - 2   # EV_REL
      - 3   # EV_ABS
      - 5   # EV_SW
    description:
      Specifies whether the event is to be interpreted as a key, relative,
      absolute, or switch.

  poll-interval:
    description: Poll interval time in milliseconds.
    $ref: /schemas/types.yaml#/definitions/uint32

  power-off-time-sec:
    description:
      Duration in seconds which the key should be kept pressed for device to
      power off automatically. Device with key pressed shutdown feature can
      specify this property.

  reset-time-sec:
    description:
      Duration in seconds which the key should be kept pressed for device to
      reset automatically. Device with key pressed reset feature can specify
      this property.

dependencies:
  linux,input-type: [ "linux,code" ]

additionalProperties: true


code:
# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/input/iqs269a.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Azoteq IQS269A Capacitive Touch Controller

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

description: |
  The Azoteq IQS269A is an 8-channel capacitive touch controller that features
  additional Hall-effect and inductive sensing capabilities.

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

properties:
  compatible:
    const: azoteq,iqs269a

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  "#address-cells":
    const: 1

  "#size-cells":
    const: 0

  azoteq,hall-enable:
    type: boolean
    description:
      Enables Hall-effect sensing on channels 6 and 7. In this case, keycodes
      assigned to channel 6 are ignored and keycodes assigned to channel 7 are
      interpreted as switch codes. Refer to the datasheet for requirements im-
      posed on channels 6 and 7 by Hall-effect sensing.

  azoteq,suspend-mode:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [0, 1, 2, 3]
    default: 0
    description: |
      Specifies the power mode during suspend as follows:
      0: Automatic (same as normal runtime, i.e. suspend/resume disabled)
      1: Low power (all sensing at a reduced reporting rate)
      2: Ultra-low power (channel 0 proximity sensing)
      3: Halt (no sensing)

  azoteq,clk-div:
    type: boolean
    description: Divides the device's core clock by a factor of 4.

  azoteq,ulp-update:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 0
    maximum: 7
    default: 3
    description: Specifies the ultra-low-power mode update rate.

  azoteq,reseed-offset:
    type: boolean
    description:
      Applies an 8-count offset to all long-term averages upon either ATI or
      reseed events.

  azoteq,filt-str-lp-lta:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [0, 1, 2, 3]
    default: 0
    description:
      Specifies the long-term average filter strength during low-power mode.

  azoteq,filt-str-lp-cnt:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [0, 1, 2, 3]
    default: 0
    description:
      Specifies the raw count filter strength during low-power mode.

  azoteq,filt-str-np-lta:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [0, 1, 2, 3]
    default: 0
    description:
      Specifies the long-term average filter strength during normal-power mode.

  azoteq,filt-str-np-cnt:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [0, 1, 2, 3]
    default: 0
    description:
      Specifies the raw count filter strength during normal-power mode.

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

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

  azoteq,rate-ulp-ms:
    multipleOf: 16
    minimum: 0
    maximum: 4080
    default: 160
    description: Specifies the report rate (in ms) during ultra-low-power mode.

  azoteq,timeout-pwr-ms:
    multipleOf: 512
    minimum: 0
    maximum: 130560
    default: 2560
    description:
      Specifies the length of time (in ms) to wait for an event during normal-
      power mode before transitioning to low-power mode.

  azoteq,timeout-lta-ms:
    multipleOf: 512
    minimum: 0
    maximum: 130560
    default: 32768
    description:
      Specifies the length of time (in ms) to wait before resetting the long-
      term average of all channels. Specify the maximum timeout to disable it
      altogether.

  azoteq,ati-band-disable:
    type: boolean
    description: Disables the ATI band check.

  azoteq,ati-lp-only:
    type: boolean
    description: Limits automatic ATI to low-power mode.

  azoteq,ati-band-tighten:
    type: boolean
    description: Tightens the ATI band from 1/8 to 1/16 of the desired target.

  azoteq,filt-disable:
    type: boolean
    description: Disables all raw count filtering.

  azoteq,gpio3-select:
    $ref: /schemas/types.yaml#/definitions/uint32
    minimum: 0
    maximum: 7
    default: 0
    description:
      Selects the channel for which the GPIO3 pin represents touch state.

  azoteq,dual-direction:
    type: boolean
    description:
      Specifies that long-term averages are to freeze in the presence of either
      increasing or decreasing counts, thereby permitting events to be reported
      in either direction.

  azoteq,tx-freq:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [0, 1, 2, 3]
    default: 0
    description: |
      Specifies the inductive sensing excitation frequency as follows (paren-
      thesized numbers represent the frequency if 'azoteq,clk-div' is present):
      0: 16 MHz (4 MHz)
      1: 8 MHz (2 MHz)
      2: 4 MHz (1 MHz)
      3: 2 MHz (500 kHz)

  azoteq,global-cap-increase:
    type: boolean
    description: Increases the global capacitance adder from 0.5 pF to 1.5 pF.

  azoteq,reseed-select:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [0, 1, 2, 3]
    default: 0
    description: |
      Specifies the event(s) that prompt the device to reseed (i.e. reset the
      long-term average) of an associated channel as follows:
      0: None
      1: Proximity
      2: Proximity or touch
      3: Proximity, touch or deep touch

  azoteq,tracking-enable:
    type: boolean
    description:
      Enables all associated channels to track their respective reference
      channels.

  azoteq,filt-str-slider:
    $ref: /schemas/types.yaml#/definitions/uint32
    enum: [0, 1, 2, 3]
    default: 1
    description: Specifies the slider coordinate filter strength.

patternProperties:
  "^channel@[0-7]$":
    type: object
    description:
      Represents a single sensing channel. A channel is active if defined and
      inactive otherwise.

    properties:
      reg:
        minimum: 0
        maximum: 7
        description: Index of the channel.

      azoteq,reseed-disable:
        type: boolean
        description:
          Prevents the channel from being reseeded if the long-term average
          timeout (defined in 'azoteq,timeout-lta') expires.

      azoteq,blocking-enable:
        type: boolean
        description: Specifies that the channel is a blocking channel.

      azoteq,slider0-select:
        type: boolean
        description: Specifies that the channel participates in slider 0.

      azoteq,slider1-select:
        type: boolean
        description: Specifies that the channel participates in slider 1.

      azoteq,rx-enable:
        $ref: /schemas/types.yaml#/definitions/uint32-array
        minItems: 1
        maxItems: 8
        items:
          minimum: 0
          maximum: 7
        description:
          Specifies the CRX pin(s) associated with the channel. By default, only
          the CRX pin corresponding to the channel's index is enabled (e.g. CRX0
          for channel 0).

      azoteq,tx-enable:
        $ref: /schemas/types.yaml#/definitions/uint32-array
        minItems: 1
        maxItems: 8
        items:
          minimum: 0
          maximum: 7
        default: [0, 1, 2, 3, 4, 5, 6, 7]
        description: Specifies the TX pin(s) associated with the channel.

      azoteq,meas-cap-decrease:
        type: boolean
        description:
          Decreases the internal measurement capacitance from 60 pF to 15 pF.

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

      azoteq,local-cap-size:
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [0, 1, 2]
        default: 0
        description: |
          Specifies the capacitance to be added to the channel as follows:
          0: None
          1: Global adder (based on 'azoteq,global-cap-increase')
          2: Global adder + 0.5 pF

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

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

      azoteq,sense-mode:
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [0, 1, 9, 14, 15]
        default: 0
        description: |
          Specifies the channel's sensing mode as follows:
          0:  Self capacitance
          1:  Projected capacitance
          9:  Self or mutual inductance
          14: Hall effect
          15: Temperature

      azoteq,sense-freq:
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [0, 1, 2, 3]
        default: 1
        description: |
          Specifies the channel's sensing frequency as follows (parenthesized
          numbers represent the frequency if 'azoteq,clk-div' is present):
          0: 4 MHz (1 MHz)
          1: 2 MHz (500 kHz)
          2: 1 MHz (250 kHz)
          3: 500 kHz (125 kHz)

      azoteq,static-enable:
        type: boolean
        description: Enables the static front-end for the channel.

      azoteq,ati-mode:
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [0, 1, 2, 3]
        default: 3
        description: |
          Specifies the channel's ATI mode as follows:
          0: Disabled
          1: Semi-partial
          2: Partial
          3: Full

      azoteq,ati-base:
        $ref: /schemas/types.yaml#/definitions/uint32
        enum: [75, 100, 150, 200]
        default: 100
        description: Specifies the channel's ATI base.

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

      azoteq,assoc-select:
        $ref: /schemas/types.yaml#/definitions/uint32-array
        minItems: 1
        maxItems: 8
        items:
          minimum: 0
          maximum: 7
        description:
          Specifies the associated channels for which the channel serves as a
          reference channel. By default, no channels are selected.

      azoteq,assoc-weight:
        $ref: /schemas/types.yaml#/definitions/uint32
        minimum: 0
        maximum: 255
        default: 0
        description:
          Specifies the channel's impact weight if it acts as an associated
          channel (0 = 0% impact, 255 = 200% impact).

    patternProperties:
      "^event-prox(-alt)?$":
        type: object
        $ref: input.yaml#
        description:
          Represents a proximity event reported by the channel in response to
          a decrease in counts. Node names suffixed with '-alt' instead corre-
          spond to an increase in counts.

          By default, the long-term average tracks an increase in counts such
          that only events corresponding to a decrease in counts are reported
          (refer to the datasheet for more information).

          Specify 'azoteq,dual-direction' to freeze the long-term average when
          the counts increase or decrease such that events of either direction
          can be reported. Alternatively, specify 'azoteq,invert-enable' to in-
          vert the polarity of the states reported by the channel.

          Complementary events (e.g. event-touch and event-touch-alt) can both
          be present and specify different key or switch codes, but not differ-
          ent thresholds or hysteresis (if applicable).

        properties:
          azoteq,thresh:
            $ref: /schemas/types.yaml#/definitions/uint32
            minimum: 0
            maximum: 255
            default: 10
            description: Specifies the threshold for the event.

          linux,code: true

        additionalProperties: false

      "^event-touch(-alt)?$":
        type: object
        $ref: input.yaml#
        description: Represents a touch event reported by the channel.

        properties:
          azoteq,thresh:
            $ref: /schemas/types.yaml#/definitions/uint32
            minimum: 0
            maximum: 255
            default: 8
            description: Specifies the threshold for the event.

          azoteq,hyst:
            $ref: /schemas/types.yaml#/definitions/uint32
            minimum: 0
            maximum: 15
            default: 4
            description: Specifies the hysteresis for the event.

          linux,code: true

        additionalProperties: false

      "^event-deep(-alt)?$":
        type: object
        $ref: input.yaml#
        description: Represents a deep-touch event reported by the channel.

        properties:
          azoteq,thresh:
            $ref: /schemas/types.yaml#/definitions/uint32
            minimum: 0
            maximum: 255
            default: 26
            description: Specifies the threshold for the event.

          azoteq,hyst:
            $ref: /schemas/types.yaml#/definitions/uint32
            minimum: 0
            maximum: 15
            default: 0
            description: Specifies the hysteresis for the event.

          linux,code: true

        additionalProperties: false

    required:
      - reg

    additionalProperties: false

required:
  - compatible
  - reg
  - interrupts
  - "#address-cells"
  - "#size-cells"

additionalProperties: false

examples:
  - |
    #include <dt-bindings/input/input.h>
    #include <dt-bindings/interrupt-controller/irq.h>

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

            touch@44 {
                    #address-cells = <1>;
                    #size-cells = <0>;

                    compatible = "azoteq,iqs269a";
                    reg = <0x44>;
                    interrupt-parent = <&gpio>;
                    interrupts = <17 IRQ_TYPE_LEVEL_LOW>;

                    azoteq,hall-enable;
                    azoteq,suspend-mode = <2>;

                    channel@0 {
                            reg = <0x0>;

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

                    channel@1 {
                            reg = <0x1>;
                            azoteq,slider0-select;
                    };

                    channel@2 {
                            reg = <0x2>;
                            azoteq,slider0-select;
                    };

                    channel@3 {
                            reg = <0x3>;
                            azoteq,slider0-select;
                    };

                    channel@4 {
                            reg = <0x4>;
                            azoteq,slider0-select;
                    };

                    channel@5 {
                            reg = <0x5>;
                            azoteq,slider0-select;
                    };

                    channel@6 {
                            reg = <0x6>;
                            azoteq,invert-enable;
                            azoteq,static-enable;
                            azoteq,reseed-disable;
                            azoteq,rx-enable = <0>;
                            azoteq,sense-freq = <0x0>;
                            azoteq,sense-mode = <0xE>;
                            azoteq,ati-mode = <0x0>;
                            azoteq,ati-base = <200>;
                            azoteq,ati-target = <320>;
                    };

                    channel@7 {
                            reg = <0x7>;
                            azoteq,invert-enable;
                            azoteq,static-enable;
                            azoteq,reseed-disable;
                            azoteq,rx-enable = <0>, <6>;
                            azoteq,sense-freq = <0x0>;
                            azoteq,sense-mode = <0xE>;
                            azoteq,ati-mode = <0x3>;
                            azoteq,ati-base = <200>;
                            azoteq,ati-target = <320>;

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

...