From: Anand Gadiyar <gadiyar@ti.com>
To: barebox@lists.infradead.org
Cc: Anand Gadiyar <gadiyar@ti.com>
Subject: [PATCH 3/4] panda: add LED support
Date: Mon, 21 May 2012 16:00:12 +0530 [thread overview]
Message-ID: <1337596213-15239-4-git-send-email-gadiyar@ti.com> (raw)
In-Reply-To: <1337596213-15239-1-git-send-email-gadiyar@ti.com>
Register GPIO7 as heartbeat LED, same as in the linux kernel.
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
---
arch/arm/boards/panda/board.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/arch/arm/boards/panda/board.c b/arch/arm/boards/panda/board.c
index fcca5dd..84b4ecd 100644
--- a/arch/arm/boards/panda/board.c
+++ b/arch/arm/boards/panda/board.c
@@ -21,6 +21,8 @@
#include <environment.h>
#include <mach/xload.h>
#include <i2c/i2c.h>
+#include <gpio.h>
+#include <led.h>
static int board_revision;
@@ -113,6 +115,22 @@ static struct i2c_board_info i2c_devices[] = {
},
};
+struct gpio_led panda_leds[] = {
+ {
+ .gpio = 7,
+ .led = {
+ .name = "heartbeat",
+ },
+ },
+};
+
+static void panda_led_init(void)
+{
+ gpio_direction_output(7, 0);
+ led_gpio_register(&panda_leds[0]);
+ led_set_trigger(LED_TRIGGER_HEARTBEAT, &panda_leds[0].led);
+}
+
static int panda_devices_init(void)
{
panda_boardrev_init();
@@ -151,6 +169,7 @@ static int panda_devices_init(void)
IORESOURCE_MEM, NULL);
panda_ehci_init();
+ panda_led_init();
armlinux_set_bootparams((void *)0x80000100);
armlinux_set_architecture(MACH_TYPE_OMAP4_PANDA);
--
1.7.1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2012-05-21 10:30 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-21 10:30 [PATCH 0/4] panda: misc patches Anand Gadiyar
2012-05-21 10:30 ` [PATCH 1/4] panda: fix crash when not using barebox as second stage Anand Gadiyar
2012-05-21 10:30 ` [PATCH 2/4] panda: add i2c and twlcore to panda Anand Gadiyar
2012-05-21 10:30 ` Anand Gadiyar [this message]
2012-05-21 10:30 ` [PATCH 4/4] panda: update defconfig for i2c and led support Anand Gadiyar
2012-05-21 19:42 ` [PATCH 0/4] panda: misc patches Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1337596213-15239-4-git-send-email-gadiyar@ti.com \
--to=gadiyar@ti.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox