ath79: convert devices to interrupt-driven gpio-keys
[oweals/openwrt.git] / target / linux / ath79 / dts / ar7242_buffalo_wzr-hp-g302h-a1a0.dts
1 // SPDX-License-Identifier: GPL-2.0-or-later OR MIT
2 /dts-v1/;
3
4 #include <dt-bindings/gpio/gpio.h>
5 #include <dt-bindings/input/input.h>
6
7 #include "ar7242.dtsi"
8
9 / {
10         compatible = "buffalo,wzr-hp-g302h-a1a0", "qca,ar7242";
11         model = "Buffalo WZR-HP-G302H A1A0";
12
13         aliases {
14                 led-boot = &diag;
15                 led-failsafe = &diag;
16                 led-upgrade = &diag;
17         };
18
19         extosc: ref {
20                 compatible = "fixed-clock";
21                 #clock-cells = <0>;
22                 clock-frequency = <40000000>;
23         };
24
25         keys {
26                 compatible = "gpio-keys";
27
28                 reset {
29                         label = "reset";
30                         linux,code = <KEY_RESTART>;
31                         gpios = <&gpio 1 GPIO_ACTIVE_LOW>;
32                         debounce-interval = <60>;
33                 };
34
35                 button_usb {
36                         label = "usb";
37                         linux,code = <BTN_2>;
38                         gpios = <&gpio 7 GPIO_ACTIVE_LOW>;
39                         debounce-interval = <60>;
40                 };
41
42                 router_on {
43                         label = "router_on";
44                         linux,code = <BTN_5>;
45                         linux,input-type = <EV_SW>;
46                         gpios = <&gpio 8 GPIO_ACTIVE_HIGH>;
47                         debounce-interval = <60>;
48                 };
49
50                 movie_engine {
51                         label = "movie_engine";
52                         linux,code = <BTN_3>;
53                         linux,input-type = <EV_SW>;
54                         gpios = <&gpio 11 GPIO_ACTIVE_HIGH>;
55                         debounce-interval = <60>;
56                 };
57
58                 wps {
59                         label = "wps";
60                         linux,code = <KEY_WPS_BUTTON>;
61                         gpios = <&gpio 12 GPIO_ACTIVE_LOW>;
62                         debounce-interval = <60>;
63                 };
64         };
65
66         leds {
67                 compatible = "gpio-leds";
68
69                 diag: diag {
70                         label = "buffalo:red:diag";
71                         gpios = <&gpio 16 GPIO_ACTIVE_LOW>;
72                 };
73         };
74
75         ath9k-leds {
76                 compatible = "gpio-leds";
77
78                 usb {
79                         label = "buffalo:blue:usb";
80                         gpios = <&ath9k 4 GPIO_ACTIVE_LOW>;
81                         trigger-sources = <&hub_port>;
82                         linux,default-trigger = "usbport";
83                 };
84
85                 wireless {
86                         label = "buffalo:green:wireless";
87                         gpios = <&ath9k 5 GPIO_ACTIVE_LOW>;
88                         linux,default-trigger = "phy0tpt";
89                 };
90
91                 security {
92                         label = "buffalo:orange:security";
93                         gpios = <&ath9k 6 GPIO_ACTIVE_LOW>;
94                 };
95
96                 router {
97                         label = "buffalo:green:router";
98                         gpios = <&ath9k 7 GPIO_ACTIVE_LOW>;
99                 };
100
101                 movie_engine_on {
102                         label = "buffalo:blue:movie_engine_on";
103                         gpios = <&ath9k 8 GPIO_ACTIVE_LOW>;
104                 };
105
106                 movie_engine_off {
107                         label = "buffalo:blue:movie_engine_off";
108                         gpios = <&ath9k 9 GPIO_ACTIVE_LOW>;
109                 };
110         };
111
112         gpio-export {
113                 compatible = "gpio-export";
114                 #size-cells = <0>;
115
116                 gpio_usb_power {
117                         gpio-export,name = "buffalo:usb-power";
118                         gpio-export,output = <1>;
119                         gpios = <&gpio 13 GPIO_ACTIVE_HIGH>;
120                 };
121         };
122
123         virtual_flash {
124                 compatible = "mtd-concat";
125                 devices = <&flash0 &flash1>;
126
127                 partitions {
128                         compatible = "fixed-partitions";
129                         #address-cells = <1>;
130                         #size-cells = <1>;
131
132                         partition@0 {
133                                 reg = <0x0 0x40000>;
134                                 label = "u-boot";
135                                 read-only;
136                         };
137
138                         partition@40000 {
139                                 reg = <0x40000 0x10000>;
140                                 label = "u-boot-env";
141                         };
142
143                         art: partition@50000 {
144                                 reg = <0x50000 0x10000>;
145                                 label = "art";
146                                 read-only;
147                         };
148
149                         partition@60000 {
150                                 compatible = "denx,uimage";
151                                 reg = <0x60000 0x1f60000>;
152                                 label = "firmware";
153                         };
154
155                         partition@1fc0000 {
156                                 reg = <0x1fc0000 0x40000>;
157                                 label = "user_property";
158                                 read-only;
159                         };
160                 };
161         };
162 };
163
164 &spi {
165         status = "okay";
166         cs-gpios = <0>, <0>;
167         num-cs = <2>;
168
169         flash0: flash@0 {
170                 compatible = "jedec,spi-nor";
171                 reg = <0>;
172                 spi-max-frequency = <25000000>;
173         };
174
175         flash1: flash@1 {
176                 compatible = "jedec,spi-nor";
177                 reg = <1>;
178                 spi-max-frequency = <25000000>;
179         };
180 };
181
182 &mdio0 {
183         status = "okay";
184
185         phy-mask = <0x1>;
186
187         phy0: ethernet-phy@0 {
188                 reg = <0>;
189                 phy-mode = "rgmii";
190         };
191 };
192
193 &eth0 {
194         status = "okay";
195
196         pll-data = <0x1c000000 0x00000101 0x00001616>;
197
198         mtd-mac-address = <&art 0x120c>;
199
200         phy-mode = "rgmii";
201         phy-handle = <&phy0>;
202 };
203
204 &pcie {
205         status = "okay";
206
207         ath9k: wifi@0,0 {
208                 compatible = "pci168c,002a";
209                 reg = <0x0000 0 0 0 0>;
210                 mtd-mac-address = <&art 0x120c>;
211                 qca,no-eeprom;
212                 #gpio-cells = <2>;
213                 gpio-controller;
214         };
215 };
216
217 &pll {
218         clocks = <&extosc>;
219 };
220
221 &uart {
222         status = "okay";
223 };
224
225 &usb_phy {
226         status = "okay";
227 };
228
229 &usb {
230         #address-cells = <1>;
231         #size-cells = <0>;
232         status = "okay";
233
234         hub_port: port@1 {
235                 reg = <1>;
236                 #trigger-source-cells = <0>;
237         };
238 };