diff options
author | Bo Shen <voice.shen@atmel.com> | 2012-11-08 17:49:14 +0000 |
---|---|---|
committer | Anatolij Gustschin <agust@denx.de> | 2012-11-10 14:04:08 +0100 |
commit | cfcd1c03e44fc22f2146948dc9f341b28e6ec583 (patch) | |
tree | 52c5d4d4c53e1c5ff6d8ac9e59163326512e7063 /drivers/video | |
parent | d484b52e6fcb28dc011ce45718294496c6ea83d0 (diff) | |
download | u-boot-imx-cfcd1c03e44fc22f2146948dc9f341b28e6ec583.zip u-boot-imx-cfcd1c03e44fc22f2146948dc9f341b28e6ec583.tar.gz u-boot-imx-cfcd1c03e44fc22f2146948dc9f341b28e6ec583.tar.bz2 |
video: atmel: implement lcd_setcolreg function
implement the common api lcd_setcolreg in include/lcd.h
Signed-off-by: Bo Shen <voice.shen@atmel.com>
[agust: fixed commit log and gcc 4.6 -Wparentheses warnings]
Signed-off-by: Anatolij Gustschin <agust@denx.de>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/atmel_hlcdfb.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/video/atmel_hlcdfb.c b/drivers/video/atmel_hlcdfb.c index beb7fa3..b10ca4b 100644 --- a/drivers/video/atmel_hlcdfb.c +++ b/drivers/video/atmel_hlcdfb.c @@ -51,6 +51,18 @@ short console_row; #define lcdc_readl(reg) __raw_readl((reg)) #define lcdc_writel(reg, val) __raw_writel((val), (reg)) +/* + * the CLUT register map as following + * RCLUT(24 ~ 16), GCLUT(15 ~ 8), BCLUT(7 ~ 0) + */ +void lcd_setcolreg(ushort regno, ushort red, ushort green, ushort blue) +{ + lcdc_writel(((red << LCDC_BASECLUT_RCLUT_Pos) & LCDC_BASECLUT_RCLUT_Msk) + | ((green << LCDC_BASECLUT_GCLUT_Pos) & LCDC_BASECLUT_GCLUT_Msk) + | ((blue << LCDC_BASECLUT_BCLUT_Pos) & LCDC_BASECLUT_BCLUT_Msk), + panel_info.mmio + ATMEL_LCDC_LUT(regno)); +} + void lcd_ctrl_init(void *lcdbase) { unsigned long value; |