ramips: set usb led trigger via devicetree
[oweals/openwrt.git] / target / linux / ramips / dts / W502U.dts
1 /dts-v1/;
2
3 #include "rt3050.dtsi"
4
5 #include <dt-bindings/gpio/gpio.h>
6 #include <dt-bindings/input/input.h>
7
8 / {
9         compatible = "alfanetworks,w502u", "ralink,rt3052-soc";
10         model = "ALFA Networks W502U";
11
12         aliases {
13                 led-status = &led_wps;
14         };
15
16         chosen {
17                 bootargs = "console=ttyS0,115200";
18         };
19
20         cfi@1f000000 {
21                 compatible = "cfi-flash";
22                 reg = <0x1f000000 0x800000>;
23                 bank-width = <2>;
24                 device-width = <2>;
25
26                 partitions {
27                         compatible = "fixed-partitions";
28                         #address-cells = <1>;
29                         #size-cells = <1>;
30
31                         partition@0 {
32                                 label = "u-boot";
33                                 reg = <0x0 0x30000>;
34                                 read-only;
35                         };
36
37                         partition@30000 {
38                                 label = "u-boot-env";
39                                 reg = <0x30000 0x10000>;
40                                 read-only;
41                         };
42
43                         factory: partition@40000 {
44                                 label = "factory";
45                                 reg = <0x40000 0x10000>;
46                                 read-only;
47                         };
48
49                         partition@50000 {
50                                 label = "firmware";
51                                 reg = <0x50000 0x7b0000>;
52                         };
53                 };
54         };
55
56         gpio-leds {
57                 compatible = "gpio-leds";
58
59                 usb {
60                         label = "w502u:blue:usb";
61                         gpios = <&gpio0 13 GPIO_ACTIVE_LOW>;
62                         trigger-sources = <&otg_port1>;
63                         linux,default-trigger = "usbport";
64                 };
65
66                 led_wps: wps {
67                         label = "w502u:blue:wps";
68                         gpios = <&gpio0 14 GPIO_ACTIVE_LOW>;
69                 };
70         };
71
72         gpio-keys-polled {
73                 compatible = "gpio-keys-polled";
74                 poll-interval = <20>;
75
76                 reset {
77                         label = "reset";
78                         gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
79                         linux,code = <KEY_RESTART>;
80                 };
81
82                 wps {
83                         label = "wps";
84                         gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
85                         linux,code = <KEY_WPS_BUTTON>;
86                 };
87         };
88 };
89
90 &pinctrl {
91         state_default: pinctrl0 {
92                 gpio {
93                         ralink,group = "spi", "i2c", "jtag", "rgmii", "mdio", "uartf";
94                         ralink,function = "gpio";
95                 };
96         };
97 };
98
99 &ethernet {
100         mtd-mac-address = <&factory 0x28>;
101 };
102
103 &esw {
104         mediatek,portmap = <0x3e>;
105 };
106
107 &wmac {
108         ralink,mtd-eeprom = <&factory 0>;
109 };
110
111 &otg {
112         status = "okay";
113 };