From: amit.kucheria@linaro.org (Amit Kucheria)
To: linux-arm-kernel@lists.infradead.org
Subject: [patch 5/9] efikamx: add leds support
Date: Wed, 20 Oct 2010 14:15:58 +0300 [thread overview]
Message-ID: <20101020111558.GJ2562@matterhorn.lan> (raw)
In-Reply-To: <20101019205257.052613428@rtp-net.org>
On 10 Oct 19, Arnaud Patard wrote:
> The efika mx a 3 leds (1 blue, 1 red, 1 green) connected on GPIOS 3 13/14/15.
> Also, some special care is done for default trigger of blue led for mmc as
> the mmc host used is different between hw revisions
>
> Signed-off-by: Arnaud Patard <arnaud.patard@rtp-net.org>
> Index: linux-2.6/arch/arm/mach-mx5/board-mx51_efikamx.c
> ===================================================================
> --- linux-2.6.orig/arch/arm/mach-mx5/board-mx51_efikamx.c 2010-10-15 23:11:42.000000000 +0200
> +++ linux-2.6/arch/arm/mach-mx5/board-mx51_efikamx.c 2010-10-15 23:11:51.000000000 +0200
> @@ -18,6 +18,7 @@
> #include <linux/platform_device.h>
> #include <linux/i2c.h>
> #include <linux/gpio.h>
> +#include <linux/leds.h>
> #include <linux/delay.h>
> #include <linux/io.h>
> #include <linux/fsl_devices.h>
> @@ -43,6 +44,10 @@
> #define EFIKAMX_PCBID1 (2*32+17)
> #define EFIKAMX_PCBID2 (2*32+11)
>
> +#define EFIKAMX_BLUE_LED (2*32+13)
> +#define EFIKAMX_GREEN_LED (2*32+14)
> +#define EFIKAMX_RED_LED (2*32+15)
> +
> /* the pci ids pin have pull up. they're driven low according to board id */
> #define MX51_PAD_PCBID0 IOMUX_PAD(0x518, 0x130, 3, 0x0, 0, PAD_CTL_PUS_100K_UP)
> #define MX51_PAD_PCBID1 IOMUX_PAD(0x51C, 0x134, 3, 0x0, 0, PAD_CTL_PUS_100K_UP)
> @@ -81,6 +86,11 @@
> MX51_PAD_GPIO_1_1__ESDHC1_WP,
> MX51_PAD_GPIO_1_7__ESDHC2_WP,
> MX51_PAD_GPIO_1_8__ESDHC2_CD,
> +
> + /* leds */
> + MX51_PAD_CSI1_D9__GPIO_3_13,
> + MX51_PAD_CSI1_VSYNC__GPIO_3_14,
> + MX51_PAD_CSI1_HSYNC__GPIO_3_15,
> };
>
> /* Serial ports */
> @@ -179,6 +189,37 @@
> }
> }
>
> +static struct gpio_led mx51_efikamx_leds[] = {
> + {
> + .name = "efikamx:green",
> + .default_trigger = "default-on",
> + .gpio = EFIKAMX_GREEN_LED,
> + },
> + {
> + .name = "efikamx:red",
> + .default_trigger = "ide-disk",
> + .gpio = EFIKAMX_RED_LED,
> + },
> + {
> + .name = "efikamx:blue",
> + .default_trigger = "mmc1",
> + .gpio = EFIKAMX_BLUE_LED,
Make the default mmc0 ....
> + },
> +};
> +
> +static struct gpio_led_platform_data mx51_efikamx_leds_data = {
> + .leds = mx51_efikamx_leds,
> + .num_leds = ARRAY_SIZE(mx51_efikamx_leds),
> +};
> +
> +static struct platform_device mx51_efikamx_leds_device = {
> + .name = "leds-gpio",
> + .id = -1,
> + .dev = {
> + .platform_data = &mx51_efikamx_leds_data,
> + },
> +};
> +
> static void __init mxc_board_init(void)
> {
> mxc_iomux_v3_setup_multiple_pads(mx51efikamx_pads,
> @@ -191,6 +232,10 @@
> /* on < 1.2 boards the 2 SD controller are used */
> if (system_rev < 0x12)
> imx51_add_esdhc(1, NULL);
.. and change to mmc1 if system_rev < 0x12. That gets rid of this else
clause below.
>
> + else
> + mx51_efikamx_leds[2].default_trigger = "mmc0";
> + platform_device_register(&mx51_efikamx_leds_device);
> }
>
> static void __init mx51_efikamx_timer_init(void)
>
>
next prev parent reply other threads:[~2010-10-20 11:15 UTC|newest]
Thread overview: 43+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-10-19 20:42 [patch 0/9] efikamx support improvements Arnaud Patard (Rtp)
2010-10-19 20:42 ` [patch 1/9] efikamx: read board id Arnaud Patard (Rtp)
2010-10-19 21:15 ` Sascha Hauer
2010-10-19 21:30 ` Matt Sealey
2010-10-20 7:54 ` Amit Kucheria
2010-10-20 8:12 ` Arnaud Patard (Rtp)
2010-10-20 9:03 ` Amit Kucheria
2010-10-20 8:24 ` Sascha Hauer
2010-10-20 8:35 ` Arnaud Patard (Rtp)
2010-10-20 8:59 ` Matt Sealey
2010-10-20 9:16 ` Uwe Kleine-König
2010-10-20 17:26 ` Matt Sealey
2010-10-20 19:26 ` Loïc Minier
2010-10-20 19:53 ` Arnaud Patard (Rtp)
2010-10-21 1:32 ` Matt Sealey
2010-10-20 20:53 ` Matt Sealey
2010-10-19 20:42 ` [patch 2/9] efikamx: add mmc support Arnaud Patard (Rtp)
2010-10-19 20:42 ` [patch 3/9] imx51: enhance/fix iomux configuration Arnaud Patard (Rtp)
2010-10-19 21:04 ` Sascha Hauer
2010-10-20 8:14 ` Arnaud Patard (Rtp)
2010-10-20 9:14 ` Eric Bénard
2010-10-20 9:26 ` Arnaud Patard (Rtp)
2010-10-20 9:18 ` Eric Bénard
2010-10-20 9:29 ` Arnaud Patard (Rtp)
2010-10-20 9:41 ` Amit Kucheria
2010-10-20 10:00 ` Uwe Kleine-König
2010-10-20 10:12 ` Arnaud Patard (Rtp)
2010-10-20 12:10 ` Uwe Kleine-König
2010-10-19 20:42 ` [patch 4/9] imx51: add gpio mode for csi1 {h,v}sync Arnaud Patard (Rtp)
2010-10-19 20:42 ` [patch 5/9] efikamx: add leds support Arnaud Patard (Rtp)
2010-10-20 11:15 ` Amit Kucheria [this message]
2010-10-19 20:42 ` [patch 6/9] efikamx: add support for power key Arnaud Patard (Rtp)
2010-10-19 20:43 ` [patch 7/9] imx51: fix gpio_4_24 and gpio_4_25 pad configuration Arnaud Patard (Rtp)
2010-10-19 20:43 ` [patch 8/9] efikamx: add spi nor support Arnaud Patard (Rtp)
2010-10-20 11:26 ` Amit Kucheria
2010-10-20 12:01 ` Arnaud Patard (Rtp)
2010-10-20 12:32 ` Amit Kucheria
2010-10-20 17:36 ` Matt Sealey
2010-10-20 17:55 ` Arnaud Patard (Rtp)
2010-10-20 20:51 ` Matt Sealey
2010-10-19 20:43 ` [patch 9/9] efikamx: add reset Arnaud Patard (Rtp)
2010-10-19 23:51 ` Fabio Estevam
2010-10-20 8:13 ` Arnaud Patard (Rtp)
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=20101020111558.GJ2562@matterhorn.lan \
--to=amit.kucheria@linaro.org \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.