diff options
Diffstat (limited to 'arch/arm/mach-mx5/board-mx51_efikamx.c')
-rw-r--r-- | arch/arm/mach-mx5/board-mx51_efikamx.c | 47 |
1 files changed, 46 insertions, 1 deletions
diff --git a/arch/arm/mach-mx5/board-mx51_efikamx.c b/arch/arm/mach-mx5/board-mx51_efikamx.c index 842d6bff6e06..386bf2af6c04 100644 --- a/arch/arm/mach-mx5/board-mx51_efikamx.c +++ b/arch/arm/mach-mx5/board-mx51_efikamx.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/platform_device.h> | 18 | #include <linux/platform_device.h> |
19 | #include <linux/i2c.h> | 19 | #include <linux/i2c.h> |
20 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
21 | #include <linux/leds.h> | ||
21 | #include <linux/delay.h> | 22 | #include <linux/delay.h> |
22 | #include <linux/io.h> | 23 | #include <linux/io.h> |
23 | #include <linux/fsl_devices.h> | 24 | #include <linux/fsl_devices.h> |
@@ -43,6 +44,10 @@ | |||
43 | #define EFIKAMX_PCBID1 (2*32 + 17) | 44 | #define EFIKAMX_PCBID1 (2*32 + 17) |
44 | #define EFIKAMX_PCBID2 (2*32 + 11) | 45 | #define EFIKAMX_PCBID2 (2*32 + 11) |
45 | 46 | ||
47 | #define EFIKAMX_BLUE_LED (2*32 + 13) | ||
48 | #define EFIKAMX_GREEN_LED (2*32 + 14) | ||
49 | #define EFIKAMX_RED_LED (2*32 + 15) | ||
50 | |||
46 | /* the pci ids pin have pull up. they're driven low according to board id */ | 51 | /* the pci ids pin have pull up. they're driven low according to board id */ |
47 | #define MX51_PAD_PCBID0 IOMUX_PAD(0x518, 0x130, 3, 0x0, 0, PAD_CTL_PUS_100K_UP) | 52 | #define MX51_PAD_PCBID0 IOMUX_PAD(0x518, 0x130, 3, 0x0, 0, PAD_CTL_PUS_100K_UP) |
48 | #define MX51_PAD_PCBID1 IOMUX_PAD(0x51C, 0x134, 3, 0x0, 0, PAD_CTL_PUS_100K_UP) | 53 | #define MX51_PAD_PCBID1 IOMUX_PAD(0x51C, 0x134, 3, 0x0, 0, PAD_CTL_PUS_100K_UP) |
@@ -80,6 +85,11 @@ static iomux_v3_cfg_t mx51efikamx_pads[] = { | |||
80 | MX51_PAD_GPIO_1_1__ESDHC1_WP, | 85 | MX51_PAD_GPIO_1_1__ESDHC1_WP, |
81 | MX51_PAD_GPIO_1_7__ESDHC2_WP, | 86 | MX51_PAD_GPIO_1_7__ESDHC2_WP, |
82 | MX51_PAD_GPIO_1_8__ESDHC2_CD, | 87 | MX51_PAD_GPIO_1_8__ESDHC2_CD, |
88 | |||
89 | /* leds */ | ||
90 | MX51_PAD_CSI1_D9__GPIO_3_13, | ||
91 | MX51_PAD_CSI1_VSYNC__GPIO_3_14, | ||
92 | MX51_PAD_CSI1_HSYNC__GPIO_3_15, | ||
83 | }; | 93 | }; |
84 | 94 | ||
85 | /* Serial ports */ | 95 | /* Serial ports */ |
@@ -178,6 +188,37 @@ static void __init mx51_efikamx_board_id(void) | |||
178 | } | 188 | } |
179 | } | 189 | } |
180 | 190 | ||
191 | static struct gpio_led mx51_efikamx_leds[] = { | ||
192 | { | ||
193 | .name = "efikamx:green", | ||
194 | .default_trigger = "default-on", | ||
195 | .gpio = EFIKAMX_GREEN_LED, | ||
196 | }, | ||
197 | { | ||
198 | .name = "efikamx:red", | ||
199 | .default_trigger = "ide-disk", | ||
200 | .gpio = EFIKAMX_RED_LED, | ||
201 | }, | ||
202 | { | ||
203 | .name = "efikamx:blue", | ||
204 | .default_trigger = "mmc0", | ||
205 | .gpio = EFIKAMX_BLUE_LED, | ||
206 | }, | ||
207 | }; | ||
208 | |||
209 | static struct gpio_led_platform_data mx51_efikamx_leds_data = { | ||
210 | .leds = mx51_efikamx_leds, | ||
211 | .num_leds = ARRAY_SIZE(mx51_efikamx_leds), | ||
212 | }; | ||
213 | |||
214 | static struct platform_device mx51_efikamx_leds_device = { | ||
215 | .name = "leds-gpio", | ||
216 | .id = -1, | ||
217 | .dev = { | ||
218 | .platform_data = &mx51_efikamx_leds_data, | ||
219 | }, | ||
220 | }; | ||
221 | |||
181 | static void __init mxc_board_init(void) | 222 | static void __init mxc_board_init(void) |
182 | { | 223 | { |
183 | mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads, | 224 | mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads, |
@@ -188,8 +229,12 @@ static void __init mxc_board_init(void) | |||
188 | imx51_add_esdhc(0, NULL); | 229 | imx51_add_esdhc(0, NULL); |
189 | 230 | ||
190 | /* on < 1.2 boards both SD controllers are used */ | 231 | /* on < 1.2 boards both SD controllers are used */ |
191 | if (system_rev < 0x12) | 232 | if (system_rev < 0x12) { |
192 | imx51_add_esdhc(1, NULL); | 233 | imx51_add_esdhc(1, NULL); |
234 | mx51_efikamx_leds[2].default_trigger = "mmc1"; | ||
235 | } | ||
236 | |||
237 | platform_device_register(&mx51_efikamx_leds_device); | ||
193 | } | 238 | } |
194 | 239 | ||
195 | static void __init mx51_efikamx_timer_init(void) | 240 | static void __init mx51_efikamx_timer_init(void) |