public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Detlev Zundel <dzu@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] at91: Add esd gmbh OTC570 board support
Date: Tue, 02 Feb 2010 16:39:24 +0100	[thread overview]
Message-ID: <m21vh38x5f.fsf@ohwell.denx.de> (raw)
In-Reply-To: <4B5D6948.4030303@esd.eu> (Daniel Gorsulowski's message of "Mon,  25 Jan 2010 10:50:00 +0100")

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@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@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

      reply	other threads:[~2010-02-02 15:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-19  7:50 [U-Boot] [PATCH] at91: Add esd gmbh OTC570 board support Daniel Gorsulowski
2010-01-23 19:00 ` Tom
2010-01-25  9:50   ` Daniel Gorsulowski
2010-02-02 15:39     ` Detlev Zundel [this message]

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=m21vh38x5f.fsf@ohwell.denx.de \
    --to=dzu@denx.de \
    --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