linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: tony@atomide.com (Tony Lindgren)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 7/7] omap4: board-omap4panda: adding leds status1 and status2
Date: Fri, 24 Sep 2010 17:27:20 -0700	[thread overview]
Message-ID: <20100925002720.24551.11276.stgit@baageli.muru.com> (raw)
In-Reply-To: <20100925002608.24551.67183.stgit@baageli.muru.com>

From: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>

At Pandaboard we have 2 status leds, so adding them with similar usage as
we have for Beagleboard (heartbeat and mmc0). The patch basically adds the
platform data required by leds-gpio driver.

Signed-off-by: Ricardo Salveti de Araujo <ricardo.salveti@canonical.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/mach-omap2/board-omap4panda.c |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-omap2/board-omap4panda.c b/arch/arm/mach-omap2/board-omap4panda.c
index c03d1d5..22a8fd3 100644
--- a/arch/arm/mach-omap2/board-omap4panda.c
+++ b/arch/arm/mach-omap2/board-omap4panda.c
@@ -20,6 +20,7 @@
 #include <linux/init.h>
 #include <linux/platform_device.h>
 #include <linux/io.h>
+#include <linux/leds.h>
 #include <linux/gpio.h>
 #include <linux/usb/otg.h>
 #include <linux/i2c/twl.h>
@@ -40,6 +41,36 @@
 #include "hsmmc.h"
 
 
+static struct gpio_led gpio_leds[] = {
+	{
+		.name			= "pandaboard::status1",
+		.default_trigger	= "heartbeat",
+		.gpio			= 7,
+	},
+	{
+		.name			= "pandaboard::status2",
+		.default_trigger	= "mmc0",
+		.gpio			= 8,
+	},
+};
+
+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 struct platform_device *panda_devices[] __initdata = {
+	&leds_gpio,
+};
+
 static void __init omap4_panda_init_irq(void)
 {
 	omap2_init_common_hw(NULL, NULL);
@@ -277,6 +308,7 @@ static void __init omap4_panda_init(void)
 	int status;
 
 	omap4_panda_i2c_init();
+	platform_add_devices(panda_devices, ARRAY_SIZE(panda_devices));
 	omap_serial_init();
 	omap4_twl6030_hsmmc_init(mmc);
 	/* OMAP4 Panda uses internal transceiver so register nop transceiver */

      parent reply	other threads:[~2010-09-25  0:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-09-25  0:26 [PATCH 0/7] omap board changes for v2.6.37 merge window Tony Lindgren
2010-09-25  0:27 ` [PATCH 1/7] hmc5843: Digital compass board file Tony Lindgren
2010-09-25  0:27 ` [PATCH 2/7] omap: Beagle: revision detection Tony Lindgren
2010-09-25  0:27 ` [PATCH 3/7] omap: Beagle: only Cx boards use pin 23 for write protect Tony Lindgren
2010-09-25  0:27 ` [PATCH 4/7] omap: Beagle: no gpio_wp pin connection on xM Tony Lindgren
2010-09-25  0:27 ` [PATCH 5/7] Adding i2c eeprom driver to read EDID Tony Lindgren
2010-09-25  0:27 ` [PATCH 6/7] omap: 4430sdp board support for proximity sensor Tony Lindgren
2010-09-25  0:27 ` Tony Lindgren [this message]

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=20100925002720.24551.11276.stgit@baageli.muru.com \
    --to=tony@atomide.com \
    --cc=linux-arm-kernel@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;
as well as URLs for NNTP newsgroup(s).