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

title: ChipOne ICN8318 Touchscreen Controller DTB

maintainers:
  - Maulik Shah <quic_mkshah@quicinc.com>

allOf:
  - $ref: touchscreen.yaml#

properties:
  compatible:
    enum:
       - goodix,gt9916
       - goodix,gt9966

  reg:
    maxItems: 1

  reset-gpios:
    maxItems: 1

  irq-gpio:
    description: GPIO pin used for IRQ. The driver uses the interrupt gpio pin
      as output to reset the device.

  irq-flags:
    description: IRQ trigger type config.
                1 - rising edge,
                2 - falling edge,
                4 - high level,
                5 - low level.

  interrupts:
    maxItems: 1

  vdd-supply:
    description: Power supply regulator for the chip

  vddio-supply:
    description: Power supply regulator for the I2C bus

unevaluatedProperties: false

required:
  - compatible
  - reg
  - reset-gpios
  - irq-gpio
  - irq-flags
  - interrupts
  - touchscreen-size-x
  - touchscreen-size-y
  - touchscreen-size-w

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

       i2c {
        #address-cells = <1>;
        #size-cells = <0>;
        touchscreen@5d {
                    compatible = "goodix,gt9916";
                    reg = <0x5d>;
                    reset-gpio = <&msm_gpio 12 0x0>;
                    irq-gpio = <&msm_gpio 13 0x2800>;
                    irq-flags = <2>; /* 1:trigger rising, 2:trigger falling;*/
                    touchscreen-max-x = <720>;
                    touchscreen-max-y = <1280>;
                    touchscreen-max-w = <255>;
         };
       };
