[U-Boot] [PATCH v2] misc: add gpio based status led driver

Mike Frysinger vapier at gentoo.org
Wed Jun 9 06:27:12 CEST 2010


On Tuesday, April 20, 2010 20:45:12 Thomas Chou wrote:
> +void __led_init(led_id_t mask, int state)
> +{
> +	gpio_direction_output(mask, (state == STATUS_LED_ON) ? 0 : 1);
> +}
> +
> +void __led_set(led_id_t mask, int state)
> +{
> +	gpio_set_value(mask, (state == STATUS_LED_ON) ? 0 : 1);
> +}

are these checks correct ?  "on" means a value of "1" with GPIO lines, but 
here you're setting the value to 0 when the state is "on".  so perhaps they 
should both read:
	..., state == STATUS_LED_ON);

> +void __led_toggle(led_id_t mask)
> +{
> +	gpio_set_value(mask, !gpio_get_value (mask));
> +}

no space before the (mask)
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20100609/1745ab67/attachment.pgp 


More information about the U-Boot mailing list