lcd-info.h 3.0 KB
Newer Older
A
ArcherChang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114
#ifndef __LCD_INFO_H__
#define __LCD_INFO_H__

/*
 * HBP : Horizontal Back Porch
 * HFP : Horizontal Front Porch
 * HSPW: Horizontal Sync. Pulse Width
 * PPL : Pixels-per-line = 16(PPL+1)
 */
#define ENC_PARAM_TIME0(HBP, HFP, HSPW, PPL)	\
	((((HBP)         - 1) << 24) |		\
	 (((HFP)         - 1) << 16) |		\
	 (((HSPW)        - 1) << 8 ) |		\
	 ((((PPL) >> 4) - 1) << 2 ))

/*
 * HBP : Vertical Back Porch
 * HFP : Vertical Front Porch
 * HSPW: Vertical Sync. Pulse Width
 * LPP : Lines-per-panel = LPP + 1
 */
#define ENC_PARAM_TIME1(VBP, VFP, VSPW, LPP)	\
	((((VBP)     ) << 24) |			\
	 (((VFP)     ) << 16) |			\
	 (((VSPW) - 1) << 10) |			\
	 (((LPP)  - 1) ))

/*
 * PRA : Pixel Rate Adaptive
 * IOE : Invert Panel Output Enable
 * IPC : Invert Panel Clock (Test Chip Testing)
 * IHS : Invert Horisontal Sync.
 * IVS : Invert Versical Sync.
 * PCD : Panel Clock Divisor
 */
#define ENC_PARAM_TIME2(PRA, IOE, IPC, IHS, IVS, PCD)	\
	(((PRA)     << 15) |				\
	 ((IOE)     << 14) |				\
	 ((IPC)     << 13) |				\
	 ((IHS)     << 12) |				\
	 ((IVS)     << 11) |				\
	 (((PCD) - 1) ))

/*
 * Enable YCbCr
 * Enable YCbCr422
 * FIFO threadhold
 * Panel type, 0-6bit, 1-8bit
 * LcdVComp, when to generate interrupt, 1: start of back_porch
 * Power Enable
 * Big Endian Pixel/Byte Ordering
 * BGR
 * TFT
 * LCD bits per pixel
 * Controller Enable
 */
#define ENC_PARAM_CTRL(ENYUV, ENYUV422, FIFOTH, PTYPE, VCOMP, LCD_ON, ENDIAN, BGR, TFT, BPP, LCD_EN) \
	((ENYUV        << 18) |			\
	 (ENYUV422     << 17) |			\
	 (FIFOTH       << 16) |			\
	 (PTYPE        << 15) |			\
	 (VCOMP        << 12) |			\
	 (LCD_ON       << 11) |			\
	 (ENDIAN       <<  9) |			\
	 (BGR          <<  8) |			\
	 (TFT          <<  5) |			\
	 (BPP          <<  1) |			\
	 (LCD_EN))

#if defined(CONFIG_COLOR_DEPTH16)
#define LCD_COLOR_DEPTH		0x4
#define LCD_PANEL_BPP		16
#elif defined(CONFIG_COLOR_DEPTH24)
#define LCD_COLOR_DEPTH		0x5
#define LCD_PANEL_BPP		24
#else
#define LCD_COLOR_DEPTH		0x5
#define LCD_PANEL_BPP		24
#endif

#ifdef CONFIG_PANEL_AUA036QN01

#define LCD_PANEL_WIDTH		320
#define LCD_PANEL_HEIGHT	240

#define LCD_TIME0		ENC_PARAM_TIME0(7, 6, 1, 320) /* 0x0605004c */
#define LCD_TIME1		ENC_PARAM_TIME1(1, 1, 1, 240) /* 0x010100ef */
#define LCD_TIME2		ENC_PARAM_TIME2(0, 0, 1, 1, 1, 0x7) /* 0x00003806 */
#define LCD_CTRL		ENC_PARAM_CTRL(0, 0, 1, 1, 0x3, 1, 0x0, 1, 1, LCD_COLOR_DEPTH, 1) /* 0x0001b928 */

#endif

#ifdef CONFIG_PANEL_AUA070VW04

#define LCD_PANEL_WIDTH		800
#define LCD_PANEL_HEIGHT	480

#define LCD_TIME0		ENC_PARAM_TIME0(88, 40, 128, 800)
#define LCD_TIME1		ENC_PARAM_TIME1(21, 1, 3, 480)
#define LCD_TIME2		ENC_PARAM_TIME2(0, 1, 1, 1, 1, 0x7)
#define LCD_CTRL		ENC_PARAM_CTRL(0, 0, 1, 1, 0x3, 1, 0x0, 1, 1, LCD_COLOR_DEPTH, 1)

#endif

#ifdef CONFIG_PANEL_CH7013A

#define LCD_TIME0		ENC_PARAM_TIME0(42, 10, 96, 640)
#define LCD_TIME1		ENC_PARAM_TIME1(28, 5, 2, 480)
#define LCD_TIME2		ENC_PARAM_TIME2(0, 1, 1, 0, 0, 0x3)
#define LCD_CTRL		ENC_PARAM_CTRL(0, 0, 1, 0, 0x3, 1, 0x0, 1, 1, LCD_COLOR_DEPTH, 1)

#endif /* CONFIG_CH7013A */

#endif /* __LCD_INFO_H__ */