[U-Boot] [PATCH 06/10] mx23_olinuxino: Add support for status LED

Marek Vasut marex at denx.de
Wed Jan 30 19:14:17 CET 2013


Dear Otavio Salvador,

> On Wed, Jan 30, 2013 at 2:15 PM, Marek Vasut <marex at denx.de> wrote:
> > Dear Otavio Salvador,
> > 
> >> On Wed, Jan 30, 2013 at 2:05 PM, Marek Vasut <marex at denx.de> wrote:
> >> > Dear Otavio Salvador,
> >> > 
> >> >> On Wed, Jan 30, 2013 at 1:39 PM, Marek Vasut <marex at denx.de> wrote:
> >> >> > Dear Otavio Salvador,
> >> >> > 
> >> >> >> On Wed, Jan 30, 2013 at 12:13 PM, Marek Vasut <marex at denx.de> wrote:
> >> >> >> > Dear Otavio Salvador,
> >> >> >> > 
> >> >> >> >> This allow user to know if the bootloader is running, even
> >> >> >> >> without a serial console.
> >> >> >> >> 
> >> >> >> >> Signed-off-by: Otavio Salvador <otavio at ossystems.com.br>
> >> >> >> > 
> >> >> >> > Uh oh, how does this know which GPIO to toggle to drive the led
> >> >> >> > this time ?
> >> >> >> 
> >> >> >> The problem wasn't the code but me. I wasn't able to find the
> >> >> >> right GPIO number at that time.
> >> >> > 
> >> >> > This is not my question. My question is how does this toggle the
> >> >> > GPIO for the LED?
> >> >> 
> >> >> gpio_led driver (drivers/misc/gpio_led.c) does it.
> >> >> 
> >> >> ...
> >> >> void __led_init(led_id_t mask, int state)
> >> >> {
> >> >> 
> >> >>         gpio_request(mask, "gpio_led");
> >> >>         gpio_direction_output(mask, state == STATUS_LED_ON);
> >> >> 
> >> >> }
> >> >> 
> >> >> void __led_set(led_id_t mask, int state)
> >> >> {
> >> >> 
> >> >>         gpio_set_value(mask, state == STATUS_LED_ON);
> >> >> 
> >> >> }
> >> >> ...
> >> > 
> >> > Ok, this didn't explain much to me.
> >> > 
> >> >> > Moreover, you never set the LED GPIO as output.
> >> >> 
> >> >> The driver handles it by itself.
> >> > 
> >> > Oh ok.
> >> > 
> >> > Now that I did read through the code, I have few more questions:
> >> > 
> >> > Why can't STATUS_LED_BIT be the MX23_PAD_SSP1_DETECT__GPIO_2_1 now?
> >> 
> >> It can but than we need to include the iomux-mx23.h header. It in the
> >> end is the same thing.
> > 
> > In the end, when I read the code in two hours, I'll be wondering what
> > this magic junk is. Thus, we will go for this and apply the adjustment
> > for iomux.
> 
> So in the end you prefer me to use the MUX name? I am fine in doing it for
> v2.

Yes, for my part, I'd prefer to use the mux name.

Best regards,
Marek Vasut


More information about the U-Boot mailing list