Rafał Miłecki | 515fa75 | 2014-01-14 12:14:41 +0100 | [diff] [blame] | 1 | #include "bcm47xx_private.h" |
| 2 | |
| 3 | #include <linux/leds.h> |
| 4 | #include <bcm47xx_board.h> |
| 5 | |
Rafał Miłecki | 2d0816d | 2014-01-02 12:32:57 +0100 | [diff] [blame] | 6 | /************************************************** |
| 7 | * Database |
| 8 | **************************************************/ |
| 9 | |
| 10 | #define BCM47XX_GPIO_LED(_gpio, _color, _function, _active_low, \ |
| 11 | _default_state) \ |
| 12 | { \ |
| 13 | .name = "bcm47xx:" _color ":" _function, \ |
| 14 | .gpio = _gpio, \ |
| 15 | .active_low = _active_low, \ |
| 16 | .default_state = _default_state, \ |
| 17 | } |
| 18 | |
Rafał Miłecki | aeee3f5 | 2014-01-03 09:04:39 +0100 | [diff] [blame] | 19 | #define BCM47XX_GPIO_LED_TRIGGER(_gpio, _color, _function, _active_low, \ |
| 20 | _default_trigger) \ |
| 21 | { \ |
| 22 | .name = "bcm47xx:" _color ":" _function, \ |
| 23 | .gpio = _gpio, \ |
| 24 | .active_low = _active_low, \ |
| 25 | .default_state = LEDS_GPIO_DEFSTATE_OFF, \ |
| 26 | .default_trigger = _default_trigger, \ |
| 27 | } |
| 28 | |
Rafał Miłecki | 2d0816d | 2014-01-02 12:32:57 +0100 | [diff] [blame] | 29 | /* Asus */ |
| 30 | |
| 31 | static const struct gpio_led |
| 32 | bcm47xx_leds_asus_rtn12[] __initconst = { |
| 33 | BCM47XX_GPIO_LED(2, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 34 | BCM47XX_GPIO_LED(7, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF), |
| 35 | }; |
| 36 | |
| 37 | static const struct gpio_led |
| 38 | bcm47xx_leds_asus_rtn16[] __initconst = { |
| 39 | BCM47XX_GPIO_LED(1, "blue", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 40 | BCM47XX_GPIO_LED(7, "blue", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF), |
| 41 | }; |
| 42 | |
| 43 | static const struct gpio_led |
| 44 | bcm47xx_leds_asus_rtn66u[] __initconst = { |
| 45 | BCM47XX_GPIO_LED(12, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 46 | BCM47XX_GPIO_LED(15, "unk", "usb", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 47 | }; |
| 48 | |
| 49 | static const struct gpio_led |
| 50 | bcm47xx_leds_asus_wl300g[] __initconst = { |
| 51 | BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 52 | }; |
| 53 | |
| 54 | static const struct gpio_led |
| 55 | bcm47xx_leds_asus_wl320ge[] __initconst = { |
| 56 | BCM47XX_GPIO_LED(0, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 57 | BCM47XX_GPIO_LED(2, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 58 | BCM47XX_GPIO_LED(11, "unk", "link", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 59 | }; |
| 60 | |
| 61 | static const struct gpio_led |
| 62 | bcm47xx_leds_asus_wl330ge[] __initconst = { |
| 63 | BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 64 | }; |
| 65 | |
| 66 | static const struct gpio_led |
| 67 | bcm47xx_leds_asus_wl500gd[] __initconst = { |
| 68 | BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 69 | }; |
| 70 | |
| 71 | static const struct gpio_led |
| 72 | bcm47xx_leds_asus_wl500gpv1[] __initconst = { |
| 73 | BCM47XX_GPIO_LED(1, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 74 | }; |
| 75 | |
| 76 | static const struct gpio_led |
| 77 | bcm47xx_leds_asus_wl500gpv2[] __initconst = { |
| 78 | BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 79 | BCM47XX_GPIO_LED(1, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 80 | }; |
| 81 | |
| 82 | static const struct gpio_led |
| 83 | bcm47xx_leds_asus_wl500w[] __initconst = { |
| 84 | BCM47XX_GPIO_LED(5, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 85 | }; |
| 86 | |
| 87 | static const struct gpio_led |
| 88 | bcm47xx_leds_asus_wl520gc[] __initconst = { |
| 89 | BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 90 | BCM47XX_GPIO_LED(1, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 91 | }; |
| 92 | |
| 93 | static const struct gpio_led |
| 94 | bcm47xx_leds_asus_wl520gu[] __initconst = { |
| 95 | BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 96 | BCM47XX_GPIO_LED(1, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 97 | }; |
| 98 | |
| 99 | static const struct gpio_led |
| 100 | bcm47xx_leds_asus_wl700ge[] __initconst = { |
| 101 | BCM47XX_GPIO_LED(1, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON), /* Labeled "READY" (there is no "power" LED). Originally ON, flashing on USB activity. */ |
| 102 | }; |
| 103 | |
| 104 | static const struct gpio_led |
| 105 | bcm47xx_leds_asus_wlhdd[] __initconst = { |
| 106 | BCM47XX_GPIO_LED(0, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 107 | BCM47XX_GPIO_LED(2, "unk", "usb", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 108 | }; |
| 109 | |
| 110 | /* Belkin */ |
| 111 | |
| 112 | static const struct gpio_led |
| 113 | bcm47xx_leds_belkin_f7d4301[] __initconst = { |
| 114 | BCM47XX_GPIO_LED(10, "green", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 115 | BCM47XX_GPIO_LED(11, "amber", "power", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 116 | BCM47XX_GPIO_LED(12, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 117 | BCM47XX_GPIO_LED(13, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 118 | BCM47XX_GPIO_LED(14, "unk", "usb0", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 119 | BCM47XX_GPIO_LED(15, "unk", "usb1", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 120 | }; |
| 121 | |
| 122 | /* Buffalo */ |
| 123 | |
| 124 | static const struct gpio_led |
| 125 | bcm47xx_leds_buffalo_whr2_a54g54[] __initconst = { |
| 126 | BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 127 | }; |
| 128 | |
| 129 | static const struct gpio_led |
| 130 | bcm47xx_leds_buffalo_whr_g125[] __initconst = { |
| 131 | BCM47XX_GPIO_LED(1, "unk", "bridge", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 132 | BCM47XX_GPIO_LED(2, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 133 | BCM47XX_GPIO_LED(3, "unk", "internal", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 134 | BCM47XX_GPIO_LED(6, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 135 | BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 136 | }; |
| 137 | |
| 138 | static const struct gpio_led |
| 139 | bcm47xx_leds_buffalo_whr_g54s[] __initconst = { |
| 140 | BCM47XX_GPIO_LED(1, "unk", "bridge", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 141 | BCM47XX_GPIO_LED(2, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 142 | BCM47XX_GPIO_LED(3, "unk", "internal", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 143 | BCM47XX_GPIO_LED(6, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 144 | BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 145 | }; |
| 146 | |
| 147 | static const struct gpio_led |
| 148 | bcm47xx_leds_buffalo_whr_hp_g54[] __initconst = { |
| 149 | BCM47XX_GPIO_LED(1, "unk", "bridge", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 150 | BCM47XX_GPIO_LED(2, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 151 | BCM47XX_GPIO_LED(3, "unk", "internal", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 152 | BCM47XX_GPIO_LED(6, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 153 | BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 154 | }; |
| 155 | |
| 156 | static const struct gpio_led |
| 157 | bcm47xx_leds_buffalo_wzr_g300n[] __initconst = { |
| 158 | BCM47XX_GPIO_LED(1, "unk", "bridge", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 159 | BCM47XX_GPIO_LED(6, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 160 | BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 161 | }; |
| 162 | |
| 163 | static const struct gpio_led |
| 164 | bcm47xx_leds_buffalo_wzr_rs_g54[] __initconst = { |
| 165 | BCM47XX_GPIO_LED(6, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 166 | BCM47XX_GPIO_LED(1, "unk", "vpn", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 167 | BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 168 | }; |
| 169 | |
| 170 | static const struct gpio_led |
| 171 | bcm47xx_leds_buffalo_wzr_rs_g54hp[] __initconst = { |
| 172 | BCM47XX_GPIO_LED(6, "unk", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 173 | BCM47XX_GPIO_LED(1, "unk", "vpn", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 174 | BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 175 | }; |
| 176 | |
| 177 | /* Dell */ |
| 178 | |
| 179 | static const struct gpio_led |
| 180 | bcm47xx_leds_dell_tm2300[] __initconst = { |
| 181 | BCM47XX_GPIO_LED(6, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 182 | BCM47XX_GPIO_LED(7, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 183 | }; |
| 184 | |
| 185 | /* D-Link */ |
| 186 | |
| 187 | static const struct gpio_led |
| 188 | bcm47xx_leds_dlink_dir130[] __initconst = { |
Rafał Miłecki | aeee3f5 | 2014-01-03 09:04:39 +0100 | [diff] [blame] | 189 | BCM47XX_GPIO_LED_TRIGGER(0, "green", "status", 1, "timer"), /* Originally blinking when device is ready, separated from "power" LED */ |
Rafał Miłecki | 2d0816d | 2014-01-02 12:32:57 +0100 | [diff] [blame] | 190 | BCM47XX_GPIO_LED(6, "blue", "unk", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 191 | }; |
| 192 | |
| 193 | static const struct gpio_led |
| 194 | bcm47xx_leds_dlink_dir330[] __initconst = { |
Rafał Miłecki | aeee3f5 | 2014-01-03 09:04:39 +0100 | [diff] [blame] | 195 | BCM47XX_GPIO_LED_TRIGGER(0, "green", "status", 1, "timer"), /* Originally blinking when device is ready, separated from "power" LED */ |
Rafał Miłecki | 2d0816d | 2014-01-02 12:32:57 +0100 | [diff] [blame] | 196 | BCM47XX_GPIO_LED(4, "unk", "usb", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 197 | BCM47XX_GPIO_LED(6, "blue", "unk", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 198 | }; |
| 199 | |
| 200 | /* Huawei */ |
| 201 | |
| 202 | static const struct gpio_led |
| 203 | bcm47xx_leds_huawei_e970[] __initconst = { |
| 204 | BCM47XX_GPIO_LED(0, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF), |
| 205 | }; |
| 206 | |
| 207 | /* Linksys */ |
| 208 | |
| 209 | static const struct gpio_led |
| 210 | bcm47xx_leds_linksys_e1000v1[] __initconst = { |
| 211 | BCM47XX_GPIO_LED(0, "blue", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF), |
| 212 | BCM47XX_GPIO_LED(1, "blue", "power", 0, LEDS_GPIO_DEFSTATE_ON), |
| 213 | BCM47XX_GPIO_LED(2, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 214 | BCM47XX_GPIO_LED(4, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 215 | }; |
| 216 | |
| 217 | static const struct gpio_led |
| 218 | bcm47xx_leds_linksys_e1000v21[] __initconst = { |
| 219 | BCM47XX_GPIO_LED(5, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF), |
| 220 | BCM47XX_GPIO_LED(6, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 221 | BCM47XX_GPIO_LED(7, "amber", "wps", 0, LEDS_GPIO_DEFSTATE_OFF), |
| 222 | BCM47XX_GPIO_LED(8, "blue", "wps", 0, LEDS_GPIO_DEFSTATE_OFF), |
| 223 | }; |
| 224 | |
| 225 | static const struct gpio_led |
| 226 | bcm47xx_leds_linksys_e2000v1[] __initconst = { |
| 227 | BCM47XX_GPIO_LED(1, "blue", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF), |
| 228 | BCM47XX_GPIO_LED(2, "blue", "power", 0, LEDS_GPIO_DEFSTATE_ON), |
| 229 | BCM47XX_GPIO_LED(3, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 230 | BCM47XX_GPIO_LED(4, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 231 | }; |
| 232 | |
| 233 | static const struct gpio_led |
| 234 | bcm47xx_leds_linksys_e3000v1[] __initconst = { |
| 235 | BCM47XX_GPIO_LED(0, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 236 | BCM47XX_GPIO_LED(1, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF), |
| 237 | BCM47XX_GPIO_LED(3, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 238 | BCM47XX_GPIO_LED(5, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON), |
| 239 | BCM47XX_GPIO_LED(7, "unk", "usb", 0, LEDS_GPIO_DEFSTATE_OFF), |
| 240 | }; |
| 241 | |
| 242 | static const struct gpio_led |
| 243 | bcm47xx_leds_linksys_e3200v1[] __initconst = { |
| 244 | BCM47XX_GPIO_LED(3, "green", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 245 | }; |
| 246 | |
| 247 | static const struct gpio_led |
| 248 | bcm47xx_leds_linksys_e4200v1[] __initconst = { |
| 249 | BCM47XX_GPIO_LED(5, "white", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 250 | }; |
| 251 | |
| 252 | static const struct gpio_led |
| 253 | bcm47xx_leds_linksys_wrt150nv1[] __initconst = { |
| 254 | BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON), |
| 255 | BCM47XX_GPIO_LED(3, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 256 | BCM47XX_GPIO_LED(5, "green", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 257 | }; |
| 258 | |
| 259 | static const struct gpio_led |
| 260 | bcm47xx_leds_linksys_wrt150nv11[] __initconst = { |
| 261 | BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON), |
| 262 | BCM47XX_GPIO_LED(3, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 263 | BCM47XX_GPIO_LED(5, "green", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 264 | }; |
| 265 | |
| 266 | static const struct gpio_led |
| 267 | bcm47xx_leds_linksys_wrt160nv1[] __initconst = { |
| 268 | BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON), |
| 269 | BCM47XX_GPIO_LED(3, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 270 | BCM47XX_GPIO_LED(5, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 271 | }; |
| 272 | |
| 273 | static const struct gpio_led |
| 274 | bcm47xx_leds_linksys_wrt160nv3[] __initconst = { |
| 275 | BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON), |
| 276 | BCM47XX_GPIO_LED(2, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 277 | BCM47XX_GPIO_LED(4, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 278 | }; |
| 279 | |
| 280 | static const struct gpio_led |
| 281 | bcm47xx_leds_linksys_wrt300nv11[] __initconst = { |
| 282 | BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON), |
| 283 | BCM47XX_GPIO_LED(3, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 284 | BCM47XX_GPIO_LED(5, "green", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 285 | }; |
| 286 | |
| 287 | static const struct gpio_led |
| 288 | bcm47xx_leds_linksys_wrt310nv1[] __initconst = { |
| 289 | BCM47XX_GPIO_LED(1, "blue", "power", 0, LEDS_GPIO_DEFSTATE_ON), |
| 290 | BCM47XX_GPIO_LED(3, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 291 | BCM47XX_GPIO_LED(9, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 292 | }; |
| 293 | |
| 294 | static const struct gpio_led |
Hauke Mehrtens | 96c10de | 2014-03-02 17:49:27 +0100 | [diff] [blame] | 295 | bcm47xx_leds_linksys_wrt54gsv1[] __initconst = { |
| 296 | BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 297 | BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON), |
| 298 | BCM47XX_GPIO_LED(5, "white", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 299 | BCM47XX_GPIO_LED(7, "orange", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 300 | }; |
| 301 | |
| 302 | static const struct gpio_led |
| 303 | bcm47xx_leds_linksys_wrt54g3gv2[] __initconst = { |
| 304 | BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON), |
| 305 | BCM47XX_GPIO_LED(2, "green", "3g", 0, LEDS_GPIO_DEFSTATE_OFF), |
| 306 | BCM47XX_GPIO_LED(3, "blue", "3g", 0, LEDS_GPIO_DEFSTATE_OFF), |
| 307 | }; |
| 308 | |
| 309 | static const struct gpio_led |
Rafał Miłecki | 2d0816d | 2014-01-02 12:32:57 +0100 | [diff] [blame] | 310 | bcm47xx_leds_linksys_wrt610nv1[] __initconst = { |
| 311 | BCM47XX_GPIO_LED(0, "unk", "usb", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 312 | BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_OFF), |
| 313 | BCM47XX_GPIO_LED(3, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 314 | BCM47XX_GPIO_LED(9, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 315 | }; |
| 316 | |
| 317 | static const struct gpio_led |
| 318 | bcm47xx_leds_linksys_wrt610nv2[] __initconst = { |
| 319 | BCM47XX_GPIO_LED(0, "amber", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 320 | BCM47XX_GPIO_LED(1, "unk", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF), |
| 321 | BCM47XX_GPIO_LED(3, "blue", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 322 | BCM47XX_GPIO_LED(5, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON), |
| 323 | BCM47XX_GPIO_LED(7, "unk", "usb", 0, LEDS_GPIO_DEFSTATE_OFF), |
| 324 | }; |
| 325 | |
Hauke Mehrtens | 96c10de | 2014-03-02 17:49:27 +0100 | [diff] [blame] | 326 | static const struct gpio_led |
| 327 | bcm47xx_leds_linksys_wrtsl54gs[] __initconst = { |
| 328 | BCM47XX_GPIO_LED(0, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 329 | BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON), |
| 330 | BCM47XX_GPIO_LED(2, "white", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 331 | BCM47XX_GPIO_LED(3, "orange", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 332 | BCM47XX_GPIO_LED(7, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 333 | }; |
| 334 | |
Rafał Miłecki | 2d0816d | 2014-01-02 12:32:57 +0100 | [diff] [blame] | 335 | /* Motorola */ |
| 336 | |
| 337 | static const struct gpio_led |
| 338 | bcm47xx_leds_motorola_we800g[] __initconst = { |
| 339 | BCM47XX_GPIO_LED(1, "amber", "wlan", 0, LEDS_GPIO_DEFSTATE_OFF), |
| 340 | BCM47XX_GPIO_LED(2, "unk", "unk", 1, LEDS_GPIO_DEFSTATE_OFF), /* There are only 3 LEDs: Power, Wireless and Device (ethernet) */ |
| 341 | BCM47XX_GPIO_LED(4, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON), |
| 342 | }; |
| 343 | |
| 344 | static const struct gpio_led |
| 345 | bcm47xx_leds_motorola_wr850gp[] __initconst = { |
| 346 | BCM47XX_GPIO_LED(0, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 347 | BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON), |
| 348 | BCM47XX_GPIO_LED(6, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 349 | BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 350 | }; |
| 351 | |
| 352 | static const struct gpio_led |
| 353 | bcm47xx_leds_motorola_wr850gv2v3[] __initconst = { |
| 354 | BCM47XX_GPIO_LED(0, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 355 | BCM47XX_GPIO_LED(1, "unk", "power", 0, LEDS_GPIO_DEFSTATE_ON), |
| 356 | BCM47XX_GPIO_LED(7, "unk", "diag", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 357 | }; |
| 358 | |
| 359 | /* Netgear */ |
| 360 | |
| 361 | static const struct gpio_led |
| 362 | bcm47xx_leds_netgear_wndr3400v1[] __initconst = { |
| 363 | BCM47XX_GPIO_LED(2, "green", "usb", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 364 | BCM47XX_GPIO_LED(3, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON), |
| 365 | BCM47XX_GPIO_LED(7, "amber", "power", 0, LEDS_GPIO_DEFSTATE_OFF), |
| 366 | }; |
| 367 | |
Rafał Miłecki | 515fa75 | 2014-01-14 12:14:41 +0100 | [diff] [blame] | 368 | static const struct gpio_led |
Rafał Miłecki | e7277e1 | 2014-01-03 09:37:42 +0100 | [diff] [blame] | 369 | bcm47xx_leds_netgear_wndr4500v1[] __initconst = { |
| 370 | BCM47XX_GPIO_LED(1, "green", "wps", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 371 | BCM47XX_GPIO_LED(2, "green", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 372 | BCM47XX_GPIO_LED(3, "amber", "power", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 373 | BCM47XX_GPIO_LED(8, "green", "usb1", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 374 | BCM47XX_GPIO_LED(9, "green", "2ghz", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 375 | BCM47XX_GPIO_LED(11, "blue", "5ghz", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 376 | BCM47XX_GPIO_LED(14, "green", "usb2", 1, LEDS_GPIO_DEFSTATE_OFF), |
Rafał Miłecki | 515fa75 | 2014-01-14 12:14:41 +0100 | [diff] [blame] | 377 | }; |
| 378 | |
Rafał Miłecki | 2d0816d | 2014-01-02 12:32:57 +0100 | [diff] [blame] | 379 | static const struct gpio_led |
| 380 | bcm47xx_leds_netgear_wnr834bv2[] __initconst = { |
| 381 | BCM47XX_GPIO_LED(2, "green", "power", 0, LEDS_GPIO_DEFSTATE_ON), |
| 382 | BCM47XX_GPIO_LED(3, "amber", "power", 0, LEDS_GPIO_DEFSTATE_OFF), |
| 383 | BCM47XX_GPIO_LED(7, "unk", "connected", 0, LEDS_GPIO_DEFSTATE_OFF), |
| 384 | }; |
| 385 | |
Hauke Mehrtens | d508eb7 | 2014-03-02 17:49:28 +0100 | [diff] [blame^] | 386 | /* Siemens */ |
| 387 | static const struct gpio_led |
| 388 | bcm47xx_leds_siemens_se505v2[] __initconst = { |
| 389 | BCM47XX_GPIO_LED(0, "unk", "dmz", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 390 | BCM47XX_GPIO_LED(3, "unk", "wlan", 1, LEDS_GPIO_DEFSTATE_OFF), |
| 391 | BCM47XX_GPIO_LED(5, "unk", "power", 1, LEDS_GPIO_DEFSTATE_ON), |
| 392 | }; |
| 393 | |
Rafał Miłecki | 2d0816d | 2014-01-02 12:32:57 +0100 | [diff] [blame] | 394 | /* SimpleTech */ |
| 395 | |
| 396 | static const struct gpio_led |
| 397 | bcm47xx_leds_simpletech_simpleshare[] __initconst = { |
| 398 | BCM47XX_GPIO_LED(1, "unk", "status", 1, LEDS_GPIO_DEFSTATE_OFF), /* "Ready" LED */ |
| 399 | }; |
| 400 | |
| 401 | /************************************************** |
| 402 | * Init |
| 403 | **************************************************/ |
| 404 | |
Rafał Miłecki | 515fa75 | 2014-01-14 12:14:41 +0100 | [diff] [blame] | 405 | static struct gpio_led_platform_data bcm47xx_leds_pdata; |
| 406 | |
| 407 | #define bcm47xx_set_pdata(dev_leds) do { \ |
| 408 | bcm47xx_leds_pdata.leds = dev_leds; \ |
| 409 | bcm47xx_leds_pdata.num_leds = ARRAY_SIZE(dev_leds); \ |
| 410 | } while (0) |
| 411 | |
| 412 | void __init bcm47xx_leds_register(void) |
| 413 | { |
| 414 | enum bcm47xx_board board = bcm47xx_board_get(); |
| 415 | |
| 416 | switch (board) { |
Rafał Miłecki | 2d0816d | 2014-01-02 12:32:57 +0100 | [diff] [blame] | 417 | case BCM47XX_BOARD_ASUS_RTN12: |
| 418 | bcm47xx_set_pdata(bcm47xx_leds_asus_rtn12); |
| 419 | break; |
| 420 | case BCM47XX_BOARD_ASUS_RTN16: |
| 421 | bcm47xx_set_pdata(bcm47xx_leds_asus_rtn16); |
| 422 | break; |
| 423 | case BCM47XX_BOARD_ASUS_RTN66U: |
| 424 | bcm47xx_set_pdata(bcm47xx_leds_asus_rtn66u); |
| 425 | break; |
| 426 | case BCM47XX_BOARD_ASUS_WL300G: |
| 427 | bcm47xx_set_pdata(bcm47xx_leds_asus_wl300g); |
| 428 | break; |
| 429 | case BCM47XX_BOARD_ASUS_WL320GE: |
| 430 | bcm47xx_set_pdata(bcm47xx_leds_asus_wl320ge); |
| 431 | break; |
| 432 | case BCM47XX_BOARD_ASUS_WL330GE: |
| 433 | bcm47xx_set_pdata(bcm47xx_leds_asus_wl330ge); |
| 434 | break; |
| 435 | case BCM47XX_BOARD_ASUS_WL500GD: |
| 436 | bcm47xx_set_pdata(bcm47xx_leds_asus_wl500gd); |
| 437 | break; |
| 438 | case BCM47XX_BOARD_ASUS_WL500GPV1: |
| 439 | bcm47xx_set_pdata(bcm47xx_leds_asus_wl500gpv1); |
| 440 | break; |
| 441 | case BCM47XX_BOARD_ASUS_WL500GPV2: |
| 442 | bcm47xx_set_pdata(bcm47xx_leds_asus_wl500gpv2); |
| 443 | break; |
| 444 | case BCM47XX_BOARD_ASUS_WL500W: |
| 445 | bcm47xx_set_pdata(bcm47xx_leds_asus_wl500w); |
| 446 | break; |
| 447 | case BCM47XX_BOARD_ASUS_WL520GC: |
| 448 | bcm47xx_set_pdata(bcm47xx_leds_asus_wl520gc); |
| 449 | break; |
| 450 | case BCM47XX_BOARD_ASUS_WL520GU: |
| 451 | bcm47xx_set_pdata(bcm47xx_leds_asus_wl520gu); |
| 452 | break; |
| 453 | case BCM47XX_BOARD_ASUS_WL700GE: |
| 454 | bcm47xx_set_pdata(bcm47xx_leds_asus_wl700ge); |
| 455 | break; |
| 456 | case BCM47XX_BOARD_ASUS_WLHDD: |
| 457 | bcm47xx_set_pdata(bcm47xx_leds_asus_wlhdd); |
| 458 | break; |
| 459 | |
| 460 | case BCM47XX_BOARD_BELKIN_F7D4301: |
| 461 | bcm47xx_set_pdata(bcm47xx_leds_belkin_f7d4301); |
| 462 | break; |
| 463 | |
| 464 | case BCM47XX_BOARD_BUFFALO_WHR2_A54G54: |
| 465 | bcm47xx_set_pdata(bcm47xx_leds_buffalo_whr2_a54g54); |
| 466 | break; |
| 467 | case BCM47XX_BOARD_BUFFALO_WHR_G125: |
| 468 | bcm47xx_set_pdata(bcm47xx_leds_buffalo_whr_g125); |
| 469 | break; |
| 470 | case BCM47XX_BOARD_BUFFALO_WHR_G54S: |
| 471 | bcm47xx_set_pdata(bcm47xx_leds_buffalo_whr_g54s); |
| 472 | break; |
| 473 | case BCM47XX_BOARD_BUFFALO_WHR_HP_G54: |
| 474 | bcm47xx_set_pdata(bcm47xx_leds_buffalo_whr_hp_g54); |
| 475 | break; |
| 476 | case BCM47XX_BOARD_BUFFALO_WZR_G300N: |
| 477 | bcm47xx_set_pdata(bcm47xx_leds_buffalo_wzr_g300n); |
| 478 | break; |
| 479 | case BCM47XX_BOARD_BUFFALO_WZR_RS_G54: |
| 480 | bcm47xx_set_pdata(bcm47xx_leds_buffalo_wzr_rs_g54); |
| 481 | break; |
| 482 | case BCM47XX_BOARD_BUFFALO_WZR_RS_G54HP: |
| 483 | bcm47xx_set_pdata(bcm47xx_leds_buffalo_wzr_rs_g54hp); |
| 484 | break; |
| 485 | |
| 486 | case BCM47XX_BOARD_DELL_TM2300: |
| 487 | bcm47xx_set_pdata(bcm47xx_leds_dell_tm2300); |
| 488 | break; |
| 489 | |
| 490 | case BCM47XX_BOARD_DLINK_DIR130: |
| 491 | bcm47xx_set_pdata(bcm47xx_leds_dlink_dir130); |
| 492 | break; |
| 493 | case BCM47XX_BOARD_DLINK_DIR330: |
| 494 | bcm47xx_set_pdata(bcm47xx_leds_dlink_dir330); |
| 495 | break; |
| 496 | |
| 497 | case BCM47XX_BOARD_HUAWEI_E970: |
| 498 | bcm47xx_set_pdata(bcm47xx_leds_huawei_e970); |
| 499 | break; |
| 500 | |
| 501 | case BCM47XX_BOARD_LINKSYS_E1000V1: |
| 502 | bcm47xx_set_pdata(bcm47xx_leds_linksys_e1000v1); |
| 503 | break; |
| 504 | case BCM47XX_BOARD_LINKSYS_E1000V21: |
| 505 | bcm47xx_set_pdata(bcm47xx_leds_linksys_e1000v21); |
| 506 | break; |
| 507 | case BCM47XX_BOARD_LINKSYS_E2000V1: |
| 508 | bcm47xx_set_pdata(bcm47xx_leds_linksys_e2000v1); |
| 509 | break; |
| 510 | case BCM47XX_BOARD_LINKSYS_E3000V1: |
| 511 | bcm47xx_set_pdata(bcm47xx_leds_linksys_e3000v1); |
| 512 | break; |
| 513 | case BCM47XX_BOARD_LINKSYS_E3200V1: |
| 514 | bcm47xx_set_pdata(bcm47xx_leds_linksys_e3200v1); |
| 515 | break; |
| 516 | case BCM47XX_BOARD_LINKSYS_E4200V1: |
| 517 | bcm47xx_set_pdata(bcm47xx_leds_linksys_e4200v1); |
| 518 | break; |
| 519 | case BCM47XX_BOARD_LINKSYS_WRT150NV1: |
| 520 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt150nv1); |
| 521 | break; |
| 522 | case BCM47XX_BOARD_LINKSYS_WRT150NV11: |
| 523 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt150nv11); |
| 524 | break; |
| 525 | case BCM47XX_BOARD_LINKSYS_WRT160NV1: |
| 526 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt160nv1); |
| 527 | break; |
| 528 | case BCM47XX_BOARD_LINKSYS_WRT160NV3: |
| 529 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt160nv3); |
| 530 | break; |
| 531 | case BCM47XX_BOARD_LINKSYS_WRT300NV11: |
| 532 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt300nv11); |
| 533 | break; |
| 534 | case BCM47XX_BOARD_LINKSYS_WRT310NV1: |
| 535 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt310nv1); |
| 536 | break; |
Hauke Mehrtens | 96c10de | 2014-03-02 17:49:27 +0100 | [diff] [blame] | 537 | case BCM47XX_BOARD_LINKSYS_WRT54G: |
| 538 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54gsv1); |
| 539 | break; |
| 540 | case BCM47XX_BOARD_LINKSYS_WRT54G3GV2: |
| 541 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt54g3gv2); |
| 542 | break; |
Rafał Miłecki | 2d0816d | 2014-01-02 12:32:57 +0100 | [diff] [blame] | 543 | case BCM47XX_BOARD_LINKSYS_WRT610NV1: |
| 544 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt610nv1); |
| 545 | break; |
| 546 | case BCM47XX_BOARD_LINKSYS_WRT610NV2: |
| 547 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrt610nv2); |
| 548 | break; |
Hauke Mehrtens | 96c10de | 2014-03-02 17:49:27 +0100 | [diff] [blame] | 549 | case BCM47XX_BOARD_LINKSYS_WRTSL54GS: |
| 550 | bcm47xx_set_pdata(bcm47xx_leds_linksys_wrtsl54gs); |
| 551 | break; |
Rafał Miłecki | 2d0816d | 2014-01-02 12:32:57 +0100 | [diff] [blame] | 552 | |
| 553 | case BCM47XX_BOARD_MOTOROLA_WE800G: |
| 554 | bcm47xx_set_pdata(bcm47xx_leds_motorola_we800g); |
| 555 | break; |
| 556 | case BCM47XX_BOARD_MOTOROLA_WR850GP: |
| 557 | bcm47xx_set_pdata(bcm47xx_leds_motorola_wr850gp); |
| 558 | break; |
| 559 | case BCM47XX_BOARD_MOTOROLA_WR850GV2V3: |
| 560 | bcm47xx_set_pdata(bcm47xx_leds_motorola_wr850gv2v3); |
| 561 | break; |
| 562 | |
| 563 | case BCM47XX_BOARD_NETGEAR_WNDR3400V1: |
| 564 | bcm47xx_set_pdata(bcm47xx_leds_netgear_wndr3400v1); |
| 565 | break; |
Rafał Miłecki | 515fa75 | 2014-01-14 12:14:41 +0100 | [diff] [blame] | 566 | case BCM47XX_BOARD_NETGEAR_WNDR4500V1: |
Rafał Miłecki | e7277e1 | 2014-01-03 09:37:42 +0100 | [diff] [blame] | 567 | bcm47xx_set_pdata(bcm47xx_leds_netgear_wndr4500v1); |
Rafał Miłecki | 515fa75 | 2014-01-14 12:14:41 +0100 | [diff] [blame] | 568 | break; |
Rafał Miłecki | 2d0816d | 2014-01-02 12:32:57 +0100 | [diff] [blame] | 569 | case BCM47XX_BOARD_NETGEAR_WNR834BV2: |
| 570 | bcm47xx_set_pdata(bcm47xx_leds_netgear_wnr834bv2); |
| 571 | break; |
| 572 | |
Hauke Mehrtens | d508eb7 | 2014-03-02 17:49:28 +0100 | [diff] [blame^] | 573 | case BCM47XX_BOARD_SIEMENS_SE505V2: |
| 574 | bcm47xx_set_pdata(bcm47xx_leds_siemens_se505v2); |
| 575 | break; |
| 576 | |
Rafał Miłecki | 2d0816d | 2014-01-02 12:32:57 +0100 | [diff] [blame] | 577 | case BCM47XX_BOARD_SIMPLETECH_SIMPLESHARE: |
| 578 | bcm47xx_set_pdata(bcm47xx_leds_simpletech_simpleshare); |
| 579 | break; |
| 580 | |
Rafał Miłecki | 515fa75 | 2014-01-14 12:14:41 +0100 | [diff] [blame] | 581 | default: |
| 582 | pr_debug("No LEDs configuration found for this device\n"); |
| 583 | return; |
| 584 | } |
| 585 | |
| 586 | gpio_led_register_device(-1, &bcm47xx_leds_pdata); |
| 587 | } |