mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org, Nicolas Ferre <nicolas.ferre@atmel.com>
Cc: Patrice VILCHEZ <patrice.vilchez@atmel.com>
Subject: [PATCH 12/14] at91sam9m10g45ek: add leds support
Date: Mon, 12 Mar 2012 12:18:00 +0100	[thread overview]
Message-ID: <1331551082-7730-12-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <1331551082-7730-1-git-send-email-plagnioj@jcrosoft.com>

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
 arch/arm/boards/at91sam9m10g45ek/init.c     |   37 +++++++++++++++++++++++++++
 arch/arm/configs/at91sam9m10g45ek_defconfig |    5 +++
 2 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boards/at91sam9m10g45ek/init.c b/arch/arm/boards/at91sam9m10g45ek/init.c
index 1525795..8371376 100644
--- a/arch/arm/boards/at91sam9m10g45ek/init.c
+++ b/arch/arm/boards/at91sam9m10g45ek/init.c
@@ -128,6 +128,42 @@ static void ek_add_device_mci(void)
 static void ek_add_device_mci(void) {}
 #endif
 
+#ifdef CONFIG_LED_GPIO
+struct gpio_led ek_leds[] = {
+	{
+		.gpio		= AT91_PIN_PD30,
+		.led = {
+			.name = "d8",
+		},
+	}, {
+		.active_low	= 1,
+		.gpio		= AT91_PIN_PD0,
+		.led = {
+			.name = "d6",
+		},
+	}, {
+		.active_low	= 1,
+		.gpio		= AT91_PIN_PD31,
+		.led = {
+			.name = "d7",
+		},
+	},
+};
+
+static void ek_device_add_leds(void)
+{
+	int i;
+
+	for (i = 0; i < ARRAY_SIZE(ek_leds); i++) {
+		at91_set_gpio_output(ek_leds[i].gpio, ek_leds[i].active_low);
+		led_gpio_register(&ek_leds[i]);
+	}
+	led_set_trigger(LED_TRIGGER_HEARTBEAT, &ek_leds[0].led);
+}
+#else
+static void ek_device_add_leds(void) {}
+#endif
+
 static int at91sam9m10g45ek_mem_init(void)
 {
 	at91_add_device_sdram(128 * 1024 * 1024);
@@ -141,6 +177,7 @@ static int at91sam9m10g45ek_devices_init(void)
 	ek_add_device_nand();
 	at91_add_device_eth(&macb_pdata);
 	ek_add_device_mci();
+	ek_device_add_leds();
 
 	devfs_add_partition("nand0", 0x00000, SZ_128K, PARTITION_FIXED, "at91bootstrap_raw");
 	dev_add_bb_dev("at91bootstrap_raw", "at91bootstrap");
diff --git a/arch/arm/configs/at91sam9m10g45ek_defconfig b/arch/arm/configs/at91sam9m10g45ek_defconfig
index 548fe6c..03e6e4a 100644
--- a/arch/arm/configs/at91sam9m10g45ek_defconfig
+++ b/arch/arm/configs/at91sam9m10g45ek_defconfig
@@ -38,6 +38,8 @@ CONFIG_CMD_TIMEOUT=y
 CONFIG_CMD_PARTITION=y
 CONFIG_CMD_GPIO=y
 CONFIG_CMD_UNCOMPRESS=y
+CONFIG_CMD_LED=y
+CONFIG_CMD_LED_TRIGGER=y
 CONFIG_NET=y
 CONFIG_NET_DHCP=y
 CONFIG_NET_NFS=y
@@ -57,5 +59,8 @@ CONFIG_UBI=y
 CONFIG_MCI=y
 CONFIG_MCI_WRITE=y
 CONFIG_MCI_ATMEL=y
+CONFIG_LED=y
+CONFIG_LED_GPIO=y
+CONFIG_LED_TRIGGERS=y
 CONFIG_FS_FAT=y
 CONFIG_FS_FAT_WRITE=y
-- 
1.7.7


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  parent reply	other threads:[~2012-03-12 11:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-12 11:17 [PATCH 01/14] macb: fix mmu support Jean-Christophe PLAGNIOL-VILLARD
2012-03-12 11:17 ` [PATCH 02/14] at91sam9263ek: add runtime nor detection Jean-Christophe PLAGNIOL-VILLARD
2012-03-12 11:17 ` [PATCH 03/14] at91sam9263ek: add leds support Jean-Christophe PLAGNIOL-VILLARD
2012-03-12 11:17 ` [PATCH 04/14] at91sam9263ek: add dfu and usb serial support Jean-Christophe PLAGNIOL-VILLARD
2012-03-12 11:17 ` [PATCH 05/14] at91sam9263ek: update defconfig Jean-Christophe PLAGNIOL-VILLARD
2012-03-12 11:17 ` [PATCH 06/14] at91sam9261ek/9g10ek: update partition layout Jean-Christophe PLAGNIOL-VILLARD
2012-03-12 11:17 ` [PATCH 07/14] at91sam9261ek/9g10ek: add leds support Jean-Christophe PLAGNIOL-VILLARD
2012-03-12 11:17 ` [PATCH 08/14] at91sam9261ek/9g10ek: add dfu and usb serial support Jean-Christophe PLAGNIOL-VILLARD
2012-03-12 11:17 ` [PATCH 09/14] at91sam9261ek/9g10ek: add gpio Keyboard support Jean-Christophe PLAGNIOL-VILLARD
2012-03-12 11:17 ` [PATCH 10/14] at91sam9261ek/9g10ek: update board supprt Jean-Christophe PLAGNIOL-VILLARD
2012-03-12 11:17 ` [PATCH 11/14] at91sam9m10g45ek: update partition layout Jean-Christophe PLAGNIOL-VILLARD
2012-03-12 11:18 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2012-03-12 11:18 ` [PATCH 13/14] at91sam9m10g45ek: update defconfig Jean-Christophe PLAGNIOL-VILLARD
2012-03-12 11:18 ` [PATCH 14/14] at91sam9260ek/9g20ek: " Jean-Christophe PLAGNIOL-VILLARD
2012-03-13 13:37 ` [PATCH 01/14] macb: fix mmu support Sascha Hauer
2012-03-13 17:13   ` Jean-Christophe PLAGNIOL-VILLARD

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=1331551082-7730-12-git-send-email-plagnioj@jcrosoft.com \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    --cc=nicolas.ferre@atmel.com \
    --cc=patrice.vilchez@atmel.com \
    /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