Skip to content
Snippets Groups Projects
Commit cfcd1c03 authored by Bo Shen's avatar Bo Shen Committed by Anatolij Gustschin
Browse files

video: atmel: implement lcd_setcolreg function


implement the common api lcd_setcolreg in include/lcd.h

Signed-off-by: default avatarBo Shen <voice.shen@atmel.com>
[agust: fixed commit log and gcc 4.6 -Wparentheses warnings]
Signed-off-by: default avatarAnatolij Gustschin <agust@denx.de>
parent d484b52e
No related branches found
No related tags found
No related merge requests found
...@@ -51,6 +51,18 @@ short console_row; ...@@ -51,6 +51,18 @@ short console_row;
#define lcdc_readl(reg) __raw_readl((reg)) #define lcdc_readl(reg) __raw_readl((reg))
#define lcdc_writel(reg, val) __raw_writel((val), (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) void lcd_ctrl_init(void *lcdbase)
{ {
unsigned long value; unsigned long value;
......
...@@ -217,6 +217,13 @@ struct atmel_hlcd_regs { ...@@ -217,6 +217,13 @@ struct atmel_hlcd_regs {
#define LCDC_BASECFG3_RDEF(value) \ #define LCDC_BASECFG3_RDEF(value) \
((LCDC_BASECFG3_RDEF_Msk & ((value) << LCDC_BASECFG3_RDEF_Pos))) ((LCDC_BASECFG3_RDEF_Msk & ((value) << LCDC_BASECFG3_RDEF_Pos)))
#define LCDC_BASECLUT_BCLUT_Pos 0
#define LCDC_BASECLUT_BCLUT_Msk (0xff << LCDC_BASECLUT_BCLUT_Pos)
#define LCDC_BASECLUT_GCLUT_Pos 8
#define LCDC_BASECLUT_GCLUT_Msk (0xff << LCDC_BASECLUT_GCLUT_Pos)
#define LCDC_BASECLUT_RCLUT_Pos 16
#define LCDC_BASECLUT_RCLUT_Msk (0xff << LCDC_BASECLUT_RCLUT_Pos)
#define LCDC_BASECFG4_DMA (0x1 << 8) #define LCDC_BASECFG4_DMA (0x1 << 8)
#define LCDC_BASECFG4_REP (0x1 << 9) #define LCDC_BASECFG4_REP (0x1 << 9)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment