# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
%YAML 1.2
---
$id: http://devicetree.org/schemas/net/wireless/ti,wl1251.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#

title: Texas Instruments WL1251 Wireless LAN Controller

maintainers:
  - Eduard Bostina <egbostina@gmail.com>

properties:
  compatible:
    const: ti,wl1251

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  vio-supply:
    description:
      Phandle to the regulator providing VIO. Required when connected via SPI.

  ti,power-gpio:
    maxItems: 1
    description:
      GPIO connected to chip's PMEN pin if operated in SPI mode.

  ti,wl1251-has-eeprom:
    type: boolean
    description:
      The wl1251 has an EEPROM connected, which provides configuration
      data (calibration, MAC, ...).

  clocks:
    maxItems: 1

  spi-max-frequency: true
  spi-cpol: true
  spi-cpha: true

required:
  - compatible
  - reg
  - interrupts

allOf:
  - $ref: /schemas/spi/spi-peripheral-props.yaml#

unevaluatedProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    #include <dt-bindings/gpio/gpio.h>
    spi {
        #address-cells = <1>;
        #size-cells = <0>;
        wifi@0 {
            compatible = "ti,wl1251";
            reg = <0>;
            spi-max-frequency = <48000000>;
            spi-cpol;
            spi-cpha;
            interrupt-parent = <&gpio2>;
            interrupts = <10 IRQ_TYPE_NONE>;
            vio-supply = <&vio>;
            ti,power-gpio = <&gpio3 23 GPIO_ACTIVE_HIGH>;
        };
    };
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    mmc {
        #address-cells = <1>;
        #size-cells = <0>;
        wifi@1 {
            compatible = "ti,wl1251";
            reg = <1>;
            interrupt-parent = <&gpio1>;
            interrupts = <21 IRQ_TYPE_LEVEL_HIGH>;
            ti,wl1251-has-eeprom;
        };
    };