[U-Boot] [PATCH] BeagleBoard: Added LED driver

Wolfgang Denk wd at denx.de
Thu Apr 21 00:08:02 CEST 2011


Dear Jason Kridner,

In message <1299013343-29963-1-git-send-email-jkridner at beagleboard.org> you wrote:
> Added LED driver using status_led.  USR0 is set to monitor the boot
> status.  USR1 is set to be the green LED.
> 
> Included adding configuration and command to the default configuration.
> 
> Signed-off-by: Jason Kridner <jkridner at beagleboard.org>
...
> +#ifdef STATUS_LED_GREEN
> +void green_LED_off (void)
...
> +void green_LED_on (void)
...

We doin't allow CamelCase identifiers.

> +		if (!omap_request_gpio(BEAGLE_LED_USR0)) {
> +			omap_set_gpio_direction(BEAGLE_LED_USR0, 0);
> +			omap_set_gpio_dataout(BEAGLE_LED_USR0, state);

Should you not set dataout _before_ direction?  As is, you may drive
the wrong output value for a short time. 

> +		if (!omap_request_gpio(BEAGLE_LED_USR1)) {
> +			omap_set_gpio_direction(BEAGLE_LED_USR1, 0);
> +			omap_set_gpio_dataout(BEAGLE_LED_USR1, state);

Ditto.


More information about the U-Boot mailing list