Merge tag 'net-next-5.19' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev...
[linux-block.git] / Documentation / devicetree / bindings / net / wireless / silabs,wfx.yaml
1 # SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2 # Copyright (c) 2020, Silicon Laboratories, Inc.
3 %YAML 1.2
4 ---
5
6 $id: http://devicetree.org/schemas/net/wireless/silabs,wfx.yaml#
7 $schema: http://devicetree.org/meta-schemas/core.yaml#
8
9 title: Silicon Labs WFxxx devicetree bindings
10
11 maintainers:
12   - Jérôme Pouiller <jerome.pouiller@silabs.com>
13
14 description: >
15   Support for the Wifi chip WFxxx from Silicon Labs. Currently, the only device
16   from the WFxxx series is the WF200 described here:
17      https://www.silabs.com/documents/public/data-sheets/wf200-datasheet.pdf
18
19   The WF200 can be connected via SPI or via SDIO.
20
21   For SDIO:
22
23     Declaring the WFxxx chip in device tree is mandatory (usually, the VID/PID is
24     sufficient for the SDIO devices).
25
26     It is recommended to declare a mmc-pwrseq on SDIO host above WFx. Without
27     it, you may encounter issues during reboot. The mmc-pwrseq should be
28     compatible with mmc-pwrseq-simple. Please consult
29     Documentation/devicetree/bindings/mmc/mmc-pwrseq-simple.yaml for more
30     information.
31
32   For SPI:
33
34     In add of the properties below, please consult
35     Documentation/devicetree/bindings/spi/spi-controller.yaml for optional SPI
36     related properties.
37
38 properties:
39   compatible:
40     items:
41       - enum:
42           - silabs,brd4001a # WGM160P Evaluation Board
43           - silabs,brd8022a # WF200 Evaluation Board
44           - silabs,brd8023a # WFM200 Evaluation Board
45       - const: silabs,wf200 # Chip alone without antenna
46
47   reg:
48     description:
49       When used on SDIO bus, <reg> must be set to 1. When used on SPI bus, it is
50       the chip select address of the device as defined in the SPI devices
51       bindings.
52     maxItems: 1
53
54   spi-max-frequency: true
55
56   interrupts:
57     description: The interrupt line. Should be IRQ_TYPE_EDGE_RISING. When SPI is
58       used, this property is required. When SDIO is used, the "in-band"
59       interrupt provided by the SDIO bus is used unless an interrupt is defined
60       in the Device Tree.
61     maxItems: 1
62
63   reset-gpios:
64     description: (SPI only) Phandle of gpio that will be used to reset chip
65       during probe. Without this property, you may encounter issues with warm
66       boot.
67
68       For SDIO, the reset gpio should declared using a mmc-pwrseq.
69     maxItems: 1
70
71   wakeup-gpios:
72     description: Phandle of gpio that will be used to wake-up chip. Without this
73       property, driver will disable most of power saving features.
74     maxItems: 1
75
76   silabs,antenna-config-file:
77     $ref: /schemas/types.yaml#/definitions/string
78     description: Use an alternative file for antenna configuration (aka
79       "Platform Data Set" in Silabs jargon). Default depends of "compatible"
80       string. For "silabs,wf200", the default is 'wf200.pds'.
81
82   local-mac-address: true
83
84   mac-address: true
85
86 additionalProperties: false
87
88 required:
89   - compatible
90   - reg
91
92 examples:
93   - |
94     #include <dt-bindings/gpio/gpio.h>
95     #include <dt-bindings/interrupt-controller/irq.h>
96
97     spi {
98         #address-cells = <1>;
99         #size-cells = <0>;
100
101         wifi@0 {
102             compatible = "silabs,brd8022a", "silabs,wf200";
103             pinctrl-names = "default";
104             pinctrl-0 = <&wfx_irq &wfx_gpios>;
105             reg = <0>;
106             interrupts-extended = <&gpio 16 IRQ_TYPE_EDGE_RISING>;
107             wakeup-gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
108             reset-gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
109             spi-max-frequency = <42000000>;
110         };
111     };
112
113   - |
114     #include <dt-bindings/gpio/gpio.h>
115     #include <dt-bindings/interrupt-controller/irq.h>
116
117     wfx_pwrseq: wfx_pwrseq {
118         compatible = "mmc-pwrseq-simple";
119         pinctrl-names = "default";
120         pinctrl-0 = <&wfx_reset>;
121         reset-gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
122     };
123
124     mmc {
125         mmc-pwrseq = <&wfx_pwrseq>;
126         #address-cells = <1>;
127         #size-cells = <0>;
128
129         wifi@1 {
130             compatible = "silabs,brd8022a", "silabs,wf200";
131             pinctrl-names = "default";
132             pinctrl-0 = <&wfx_wakeup>;
133             reg = <1>;
134             wakeup-gpios = <&gpio 12 GPIO_ACTIVE_HIGH>;
135         };
136     };
137 ...