
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