|
18 | 18 | #include <linux/i2c.h>
|
19 | 19 | #include <linux/ata_platform.h>
|
20 | 20 | #include <linux/gpio.h>
|
| 21 | +#include <linux/gpio/machine.h> |
21 | 22 | #include <linux/delay.h>
|
22 | 23 | #include <asm/mach-types.h>
|
23 | 24 | #include <asm/mach/arch.h>
|
@@ -214,19 +215,30 @@ static void __init net2big_sata_power_init(void)
|
214 | 215 | static struct gpio_led net2big_leds[] = {
|
215 | 216 | {
|
216 | 217 | .name = "net2big:red:power",
|
217 |
| - .gpio = NET2BIG_GPIO_PWR_RED_LED, |
218 | 218 | },
|
219 | 219 | {
|
220 | 220 | .name = "net2big:blue:power",
|
221 |
| - .gpio = NET2BIG_GPIO_PWR_BLUE_LED, |
222 | 221 | },
|
223 | 222 | {
|
224 | 223 | .name = "net2big:red:sata0",
|
225 |
| - .gpio = NET2BIG_GPIO_SATA0_RED_LED, |
226 | 224 | },
|
227 | 225 | {
|
228 | 226 | .name = "net2big:red:sata1",
|
229 |
| - .gpio = NET2BIG_GPIO_SATA1_RED_LED, |
| 227 | + }, |
| 228 | +}; |
| 229 | + |
| 230 | +static struct gpiod_lookup_table net2big_leds_gpio_table = { |
| 231 | + .dev_id = "leds-gpio", |
| 232 | + .table = { |
| 233 | + GPIO_LOOKUP_IDX("orion_gpio0", NET2BIG_GPIO_PWR_RED_LED, NULL, |
| 234 | + 0, GPIO_ACTIVE_HIGH), |
| 235 | + GPIO_LOOKUP_IDX("orion_gpio0", NET2BIG_GPIO_PWR_BLUE_LED, NULL, |
| 236 | + 1, GPIO_ACTIVE_HIGH), |
| 237 | + GPIO_LOOKUP_IDX("orion_gpio0", NET2BIG_GPIO_SATA0_RED_LED, NULL, |
| 238 | + 2, GPIO_ACTIVE_HIGH), |
| 239 | + GPIO_LOOKUP_IDX("orion_gpio0", NET2BIG_GPIO_SATA1_RED_LED, NULL, |
| 240 | + 3, GPIO_ACTIVE_HIGH), |
| 241 | + { }, |
230 | 242 | },
|
231 | 243 | };
|
232 | 244 |
|
@@ -282,6 +294,7 @@ static void __init net2big_gpio_leds_init(void)
|
282 | 294 | if (err)
|
283 | 295 | pr_err("net2big: failed to setup SATA1 blue LED GPIO\n");
|
284 | 296 |
|
| 297 | + gpiod_add_lookup_table(&net2big_leds_gpio_table); |
285 | 298 | platform_device_register(&net2big_gpio_leds);
|
286 | 299 | }
|
287 | 300 |
|
|
0 commit comments