public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] AT91: Add support for blue_LED_* and add coloured_LED_init to at91/led.c
Date: Sat, 5 Sep 2009 01:47:56 +0200	[thread overview]
Message-ID: <20090904234756.GY30118@game.jcrosoft.org> (raw)
In-Reply-To: <20090820083619.GB5086@pc-ras4041.res.insa>

On 10:36 Thu 20 Aug     , Albin Tonnerre wrote:
> On Thu, Aug 20, 2009 at 02:00:45AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote :
> > On 10:49 Tue 18 Aug     , Albin Tonnerre wrote:
> > > On Tue, Aug 18, 2009 at 12:51:48AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote :
> > > > no please take a look on the other LED thread
> > > 
> > > Would you please provide a pointer to this thread ? THe only one remotely
> > > related I can find is
> > > http://lists.denx.de/pipermail/u-boot/2009-May/052160.html, and you did not
> > > participate in this one ...
> > I've as I'm the one who ask Daniel Gorsulowski to base his new code (this patch)
> > against Ulf precedent patch and as other people have done the same comment as I will do
> > no need to repeat it
> 
> Ok, so I'm really confused now. This patch does exactly what you're arguing
> against in the rest of your mail, and you still don't provide a pointer to Ulf's
> patch.
> Would you mind *explaining* to me what your plan is? I just can't get it.
something like this for assembly

.macro set_led \num, \state
	call (c or assembly) set_led_state num state
.endm

.macore set_led_red \state
	call (c or assembly) set_led_state CONFIG_SYS_LED_RED state
.endm

and for c

void set_led(int num, int state)
{
	....
}

void set_reg_led(int state)
{
	set_led(CONFIG_SYS_LED_RED, state);
}

etc... for all colour

maybe an array could help

struct leds [] = {
#ifdef CONFIG_SYS_LED_RED
	{
		.name = "red",
		.num = CONFIG_SYS_LED_RED,
	},
#endif
#ifdef CONFIG_SYS_LED_GREEN
	{
		.name = "green",
		.num = CONFIG_SYS_LED_GREEN,
	},
#endif
};

so we can create a command to manage them

static int do_set_led(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
	int i;

	if argc[1] is num && < array_size of leds
	then
		set_led(num, argv[2]);
	else if argc[1] is a colour led
	then
		set_led(get_led_num(argc[1]), argc[2]);
	fi

}

so this will not be arm specific anymore

Best Regards,
J.

  parent reply	other threads:[~2009-09-04 23:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-12 16:10 [U-Boot] [PATCH] AT91: Add support for blue_LED_* and add coloured_LED_init to at91/led.c Albin Tonnerre
2009-08-12 21:15 ` Jean-Christophe PLAGNIOL-VILLARD
2009-08-12 21:39   ` Albin Tonnerre
2009-08-17 22:51     ` Jean-Christophe PLAGNIOL-VILLARD
2009-08-18  8:49       ` Albin Tonnerre
2009-08-20  0:00         ` Jean-Christophe PLAGNIOL-VILLARD
2009-08-20  8:36           ` Albin Tonnerre
2009-08-21 21:41             ` Wolfgang Denk
2009-09-04 23:47             ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2009-09-05 11:20               ` Albin Tonnerre
2009-09-05 13:31                 ` 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=20090904234756.GY30118@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=u-boot@lists.denx.de \
    /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