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

title: GENI based Qualcomm Universal Peripheral (QUP) Serial Peripheral Interface (SPI)

maintainers:
  - Praveen Talari <praveen.talari@oss.qualcomm.com>

properties:
  compatible:
    oneOf:
      - const: qcom,sa8255p-geni-spi
      - items:
          - const: qcom,sa8797p-geni-spi
          - const: qcom,sa8255p-geni-spi

  reg:
    maxItems: 1

  dmas:
    maxItems: 2

  dma-names:
    items:
      - const: tx
      - const: rx

  interrupts:
    maxItems: 1

  power-domains:
    maxItems: 2

  power-domain-names:
    items:
      - const: power
      - const: perf

  ready-gpios:
    description:
      GPIO used by the SPI target to notify the SPI master when it is
      ready to service a transfer. Only applicable in target (slave) mode.
    maxItems: 1

required:
  - compatible
  - reg
  - interrupts
  - power-domains
  - power-domain-names

dependencies:
  ready-gpios: [ spi-slave ]

allOf:
  - $ref: /schemas/spi/spi-controller.yaml#

unevaluatedProperties: false

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

    spi@888000 {
        compatible = "qcom,sa8255p-geni-spi";
        reg = <0x888000 0x4000>;
        interrupts = <GIC_SPI 584 IRQ_TYPE_LEVEL_HIGH>;
        dmas = <&gpi_dma0 0 0 QCOM_GPI_SPI>,
               <&gpi_dma0 1 0 QCOM_GPI_SPI>;
        dma-names = "tx", "rx";
        power-domains = <&scmi0_pd 0>, <&scmi0_dvfs 0>;
        power-domain-names = "power", "perf";
    };