ff6af57694ce0e0a32b55386fa11a5fc20fa74b5
[openwrt.git] / target / linux / bcm53xx / patches-3.18 / 321-ARM-BCM5301X-Add-LEDs-for-Buffalo-devices.patch
1 From af26d75225f8b1295d4dec74b9a6a703d582fa40 Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Rafa=C5=82=20Mi=C5=82ecki?= <zajec5@gmail.com>
3 Date: Thu, 11 Dec 2014 12:13:49 +0100
4 Subject: [PATCH] ARM: BCM5301X: Add LEDs for Buffalo devices
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
10 ---
11  arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts  | 67 ++++++++++++++++++++++
12  arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts | 67 ++++++++++++++++++++++
13  2 files changed, 134 insertions(+)
14
15 diff --git a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts
16 index d472c36..6e6bdf5 100644
17 --- a/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts
18 +++ b/arch/arm/boot/dts/bcm4708-buffalo-wzr-1750dhp.dts
19 @@ -33,6 +33,73 @@
20                 };
21         };
22  
23 +       spi {
24 +               compatible = "spi-gpio";
25 +               num-chipselects = <1>;
26 +               gpio-sck = <&chipcommon 7 0>;
27 +               gpio-mosi = <&chipcommon 4 0>;
28 +               cs-gpios = <&chipcommon 6 0>;
29 +               #address-cells = <1>;
30 +               #size-cells = <0>;
31 +
32 +               hc595: gpio_spi@0 {
33 +                       compatible = "fairchild,74hc595";
34 +                       reg = <0>;
35 +                       registers-number = <1>;
36 +                       spi-max-frequency = <100000>;
37 +
38 +                       gpio-controller;
39 +                       #gpio-cells = <2>;
40 +
41 +               };
42 +       };
43 +
44 +       leds {
45 +               compatible = "gpio-leds";
46 +
47 +               power0 {
48 +                       label = "bcm53xx:red:power";
49 +                       gpios = <&hc595 1 GPIO_ACTIVE_HIGH>;
50 +                       linux,default-trigger = "default-off";
51 +               };
52 +
53 +               power1 {
54 +                       label = "bcm53xx:white:power";
55 +                       gpios = <&hc595 2 GPIO_ACTIVE_HIGH>;
56 +                       linux,default-trigger = "default-on";
57 +               };
58 +
59 +               router0 {
60 +                       label = "bcm53xx:blue:router";
61 +                       gpios = <&hc595 3 GPIO_ACTIVE_HIGH>;
62 +                       linux,default-trigger = "default-on";
63 +               };
64 +
65 +               router1 {
66 +                       label = "bcm53xx:amber:router";
67 +                       gpios = <&hc595 4 GPIO_ACTIVE_HIGH>;
68 +                       linux,default-trigger = "default-off";
69 +               };
70 +
71 +               wan {
72 +                       label = "bcm53xx:blue:wan";
73 +                       gpios = <&hc595 5 GPIO_ACTIVE_HIGH>;
74 +                       linux,default-trigger = "default-on";
75 +               };
76 +
77 +               wireless0 {
78 +                       label = "bcm53xx:blue:wireless";
79 +                       gpios = <&hc595 6 GPIO_ACTIVE_HIGH>;
80 +                       linux,default-trigger = "default-off";
81 +               };
82 +
83 +               wireless1 {
84 +                       label = "bcm53xx:amber:wireless";
85 +                       gpios = <&hc595 7 GPIO_ACTIVE_HIGH>;
86 +                       linux,default-trigger = "default-off";
87 +               };
88 +       };
89 +
90         gpio-keys {
91                 compatible = "gpio-keys-polled";
92                 #address-cells = <1>;
93 diff --git a/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts b/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts
94 index f3a0326..a31273a 100644
95 --- a/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts
96 +++ b/arch/arm/boot/dts/bcm47081-buffalo-wzr-600dhp2.dts
97 @@ -33,6 +33,73 @@
98                 };
99         };
100  
101 +       spi {
102 +               compatible = "spi-gpio";
103 +               num-chipselects = <1>;
104 +               gpio-sck = <&chipcommon 7 0>;
105 +               gpio-mosi = <&chipcommon 4 0>;
106 +               cs-gpios = <&chipcommon 6 0>;
107 +               #address-cells = <1>;
108 +               #size-cells = <0>;
109 +
110 +               hc595: gpio_spi@0 {
111 +                       compatible = "fairchild,74hc595";
112 +                       reg = <0>;
113 +                       registers-number = <1>;
114 +                       spi-max-frequency = <100000>;
115 +
116 +                       gpio-controller;
117 +                       #gpio-cells = <2>;
118 +
119 +               };
120 +       };
121 +
122 +       leds {
123 +               compatible = "gpio-leds";
124 +
125 +               power0 {
126 +                       label = "bcm53xx:green:power";
127 +                       gpios = <&hc595 1 GPIO_ACTIVE_HIGH>;
128 +                       linux,default-trigger = "default-on";
129 +               };
130 +
131 +               power1 {
132 +                       label = "bcm53xx:red:power";
133 +                       gpios = <&hc595 2 GPIO_ACTIVE_HIGH>;
134 +                       linux,default-trigger = "default-off";
135 +               };
136 +
137 +               router0 {
138 +                       label = "bcm53xx:green:router";
139 +                       gpios = <&hc595 3 GPIO_ACTIVE_HIGH>;
140 +                       linux,default-trigger = "default-on";
141 +               };
142 +
143 +               router1 {
144 +                       label = "bcm53xx:amber:router";
145 +                       gpios = <&hc595 4 GPIO_ACTIVE_HIGH>;
146 +                       linux,default-trigger = "default-off";
147 +               };
148 +
149 +               wan {
150 +                       label = "bcm53xx:green:wan";
151 +                       gpios = <&hc595 5 GPIO_ACTIVE_HIGH>;
152 +                       linux,default-trigger = "default-on";
153 +               };
154 +
155 +               wireless0 {
156 +                       label = "bcm53xx:green:wireless";
157 +                       gpios = <&hc595 6 GPIO_ACTIVE_HIGH>;
158 +                       linux,default-trigger = "default-off";
159 +               };
160 +
161 +               wireless1 {
162 +                       label = "bcm53xx:amber:wireless";
163 +                       gpios = <&hc595 7 GPIO_ACTIVE_HIGH>;
164 +                       linux,default-trigger = "default-off";
165 +               };
166 +       };
167 +
168         gpio-keys {
169                 compatible = "gpio-keys-polled";
170                 #address-cells = <1>;
171 -- 
172 1.8.4.5
173