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