[U-Boot] [PATCH] at91: Add esd gmbh OTC570 board support

Detlev Zundel dzu at denx.de
Tue Feb 2 16:39:24 CET 2010


Hi Daniel,

> Hello Tom,
>
> thanks for reviewing...
>
> Tom wrote:
>> Daniel Gorsulowski wrote:
>>> This patch adds support for esd gmbh OTC570 board.
>>> The OTC570 is based on an Atmel AT91SAM9263 SoC.
>>>
>>> Signed-off-by: Daniel Gorsulowski <Daniel.Gorsulowski at esd.eu>
>> 
>> For u-boot-video.
>> Maybe some u-boot commands that could be common.
>> 
> <snip>
>>> +
>>> +/*
>>> + * U-Boot commands
>>> + */
>>> +
>>> +/* Set brightness */
>>> +int do_blbright(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
>>> +{
>>> +	unsigned long value = 0xff;
>>> +
>>> +	if (argc > 1) {
>>> +		value = simple_strtoul(argv[1], NULL, 0);
>>> +		if ((value >= 0) && (value <= 255)) {
>>> +			printf("Writing value %02lX ...", value);
>>> +			__raw_writel(value, (panel_info.mmio +
>>> +						ATMEL_LCDC_CONTRAST_VAL));
>>> +			puts("done\n");
>>> +		} else {
>>> +			puts("Invalid value! ");
>>> +			puts("Valid values are 0 ... 255 or 0x0 ... 0xFF\n");
>>> +			return -1;
>>> +		}
>>> +	} else {
>>> +		puts("No value given! ");
>>> +		puts("Valid values are 0 ... 255 or 0x0 ... 0xFF\n");
>>> +		return -1;
>>> +	}
>>> +	return 0;
>>> +}
>>> +U_BOOT_CMD(
>>> +	blbright,	2,	1,	do_blbright,
>>> +	"sets display brightness",
>>> +	"\n"
>>> +);
>>> +
>>> +/* Switch backlight power */
>>> +int do_blpower(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
>>> +{
>>> +	int i = 0;
>>> +	if (argc > 1) {
>>> +		i = argv[1][0] == '0';
>>> +		if (i) {
>>> +			puts("Switching backlight off... ");
>>> +			lcd_disable();
>>> +		} else {
>>> +			puts("Switching backlight on... ");
>>> +			lcd_enable();
>>> +		}
>>> +		puts("done\n");
>>> +	} else
>>> +		puts("No value given!\n");
>>> +	return 0;
>>> +}
>>> +U_BOOT_CMD(
>>> +	blpower,	2,	1,	do_blpower,
>>> +	"switches display-backlight on or off",
>>> +	"\n"
>>> +);
>> 
>> These video commands look common enough that maybe they should
>> go into common/*  Is there anything that already does this?
>>
> I'll think about, how to make these commands common. Until then I
> can live without them, so I'll remove them for now.

Indeed - if you (case insensitive) grep for "brightness", you will find
lots of implementations to set a display brightness.  Maybe we should
setup common code and defer the implementation into a weak function?  It
seems that we have a good chance to merge lots of code here.

Cheers
  Detlev

-- 
[Linux] USB consoles was a  bad hack written on a drunken dare.   I'm still
constantly amazed that the thing even works at all, let alone the fact that
people are actually using it :) 
                            -- Greg KH <20090420225358.GC28697 at kroah.com>
--
DENX Software Engineering GmbH,      MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich,  Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-40 Fax: (+49)-8142-66989-80 Email: dzu at denx.de


More information about the U-Boot mailing list