diff options
Diffstat (limited to 'arch/avr32')
-rw-r--r-- | arch/avr32/boards/atngw100/setup.c | 31 | ||||
-rw-r--r-- | arch/avr32/configs/atngw100_defconfig | 16 |
2 files changed, 46 insertions, 1 deletions
diff --git a/arch/avr32/boards/atngw100/setup.c b/arch/avr32/boards/atngw100/setup.c index 6c4dc0a00e9f..2edcecdea8bd 100644 --- a/arch/avr32/boards/atngw100/setup.c +++ b/arch/avr32/boards/atngw100/setup.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
14 | #include <linux/platform_device.h> | 14 | #include <linux/platform_device.h> |
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | #include <linux/leds.h> | ||
16 | #include <linux/spi/spi.h> | 17 | #include <linux/spi/spi.h> |
17 | 18 | ||
18 | #include <asm/io.h> | 19 | #include <asm/io.h> |
@@ -21,6 +22,7 @@ | |||
21 | #include <asm/arch/at32ap7000.h> | 22 | #include <asm/arch/at32ap7000.h> |
22 | #include <asm/arch/board.h> | 23 | #include <asm/arch/board.h> |
23 | #include <asm/arch/init.h> | 24 | #include <asm/arch/init.h> |
25 | #include <asm/arch/portmux.h> | ||
24 | 26 | ||
25 | /* Initialized by bootloader-specific startup code. */ | 27 | /* Initialized by bootloader-specific startup code. */ |
26 | struct tag *bootloader_tags __initdata; | 28 | struct tag *bootloader_tags __initdata; |
@@ -100,8 +102,31 @@ void __init setup_board(void) | |||
100 | at32_setup_serial_console(0); | 102 | at32_setup_serial_console(0); |
101 | } | 103 | } |
102 | 104 | ||
105 | static const struct gpio_led ngw_leds[] = { | ||
106 | { .name = "sys", .gpio = GPIO_PIN_PA(16), .active_low = 1, | ||
107 | .default_trigger = "heartbeat", | ||
108 | }, | ||
109 | { .name = "a", .gpio = GPIO_PIN_PA(19), .active_low = 1, }, | ||
110 | { .name = "b", .gpio = GPIO_PIN_PE(19), .active_low = 1, }, | ||
111 | }; | ||
112 | |||
113 | static const struct gpio_led_platform_data ngw_led_data = { | ||
114 | .num_leds = ARRAY_SIZE(ngw_leds), | ||
115 | .leds = (void *) ngw_leds, | ||
116 | }; | ||
117 | |||
118 | static struct platform_device ngw_gpio_leds = { | ||
119 | .name = "leds-gpio", | ||
120 | .id = -1, | ||
121 | .dev = { | ||
122 | .platform_data = (void *) &ngw_led_data, | ||
123 | } | ||
124 | }; | ||
125 | |||
103 | static int __init atngw100_init(void) | 126 | static int __init atngw100_init(void) |
104 | { | 127 | { |
128 | unsigned i; | ||
129 | |||
105 | /* | 130 | /* |
106 | * ATNGW100 uses 16-bit SDRAM interface, so we don't need to | 131 | * ATNGW100 uses 16-bit SDRAM interface, so we don't need to |
107 | * reserve any pins for it. | 132 | * reserve any pins for it. |
@@ -116,6 +141,12 @@ static int __init atngw100_init(void) | |||
116 | 141 | ||
117 | at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); | 142 | at32_add_device_spi(0, spi0_board_info, ARRAY_SIZE(spi0_board_info)); |
118 | 143 | ||
144 | for (i = 0; i < ARRAY_SIZE(ngw_leds); i++) { | ||
145 | at32_select_gpio(ngw_leds[i].gpio, | ||
146 | AT32_GPIOF_OUTPUT | AT32_GPIOF_HIGH); | ||
147 | } | ||
148 | platform_device_register(&ngw_gpio_leds); | ||
149 | |||
119 | return 0; | 150 | return 0; |
120 | } | 151 | } |
121 | postcore_initcall(atngw100_init); | 152 | postcore_initcall(atngw100_init); |
diff --git a/arch/avr32/configs/atngw100_defconfig b/arch/avr32/configs/atngw100_defconfig index 49493ad3b5a9..b799a68ffd97 100644 --- a/arch/avr32/configs/atngw100_defconfig +++ b/arch/avr32/configs/atngw100_defconfig | |||
@@ -712,7 +712,21 @@ CONFIG_SPI_ATMEL=y | |||
712 | # | 712 | # |
713 | # LED devices | 713 | # LED devices |
714 | # | 714 | # |
715 | # CONFIG_NEW_LEDS is not set | 715 | CONFIG_NEW_LEDS=y |
716 | CONFIG_LEDS_CLASS=y | ||
717 | |||
718 | # | ||
719 | # LED drivers | ||
720 | # | ||
721 | CONFIG_LEDS_GPIO=y | ||
722 | |||
723 | # | ||
724 | # LED Triggers | ||
725 | # | ||
726 | CONFIG_LEDS_TRIGGERS=y | ||
727 | CONFIG_LEDS_TRIGGER_TIMER=y | ||
728 | CONFIG_LEDS_TRIGGER_HEARTBEAT=y | ||
729 | |||
716 | 730 | ||
717 | # | 731 | # |
718 | # LED drivers | 732 | # LED drivers |