aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-kernel/linux/linux-imx-2.6.35.3/0001-mx53_loco-add-USR-led-support.patch
blob: 1eff49447274b333afbf3ee363210cb1b7f7f42f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
From 564ac4b9d7da4cc8e6fdca33ca45d19649dc3366 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Eric=20B=C3=A9nard?= <eric@eukrea.com>
Date: Wed, 7 Mar 2012 23:24:54 +0100
Subject: [PATCH] mx53_loco: add USR led support
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Eric B�nard <eric@eukrea.com>
---
 arch/arm/mach-mx5/mx53_loco.c |   27 +++++++++++++++++++++++++++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-mx5/mx53_loco.c b/arch/arm/mach-mx5/mx53_loco.c
index c8417da..c91952b 100644
--- a/arch/arm/mach-mx5/mx53_loco.c
+++ b/arch/arm/mach-mx5/mx53_loco.c
@@ -835,6 +835,28 @@ static void __init fixup_mxc_board(struct machine_desc *desc, struct tag *tags,
 	}
 }
 
+static struct gpio_led gpio_leds[] = {
+	{
+		.name			= "USR",
+		.default_trigger	= "heartbeat",
+		.active_low		= 0,
+		.gpio			= USER_LED_EN,
+	},
+};
+
+static struct gpio_led_platform_data gpio_led_info = {
+	.leds		= gpio_leds,
+	.num_leds	= ARRAY_SIZE(gpio_leds),
+};
+
+static struct platform_device leds_gpio = {
+	.name	= "leds-gpio",
+	.id	= -1,
+	.dev	= {
+		.platform_data	= &gpio_led_info,
+	},
+};
+
 static void __init mx53_loco_io_init(void)
 {
 	mxc_iomux_v3_setup_multiple_pads(mx53_loco_pads,
@@ -865,6 +887,10 @@ static void __init mx53_loco_io_init(void)
 	gpio_request(DISP0_POWER_EN, "disp0-power-en");
 	gpio_direction_output(DISP0_POWER_EN, 1);
 
+	/* USR LED */
+	gpio_request(USER_LED_EN, "user-led-en");
+	gpio_direction_output(USER_LED_EN, 1);
+	gpio_free(USER_LED_EN);
 }
 
 /*!
@@ -979,6 +1005,7 @@ static void __init mxc_board_init(void)
 	loco_add_device_buttons();
 	pm_power_off = da9053_power_off;
 	pm_i2c_init(I2C1_BASE_ADDR - MX53_OFFSET);
+	platform_device_register(&leds_gpio);
 }
 
 static void __init mx53_loco_timer_init(void)
-- 
1.7.7.6