Lines Matching +full:1 +full:- +full:bit +full:- +full:only
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
3 * TW5864 driver - registers description
8 /* According to TW5864_datasheet_0.6d.pdf, tw5864b1-ds.pdf */
10 /* Register Description - Direct Map Space */
11 /* 0x0000 ~ 0x1ffc - H264 Register Map */
12 /* [15:0] The Version register for H264 core (Read Only) */
18 #define TW5864_EMU_EN_DDR BIT(0)
19 /* Enable bit for Inter module */
20 #define TW5864_EMU_EN_ME BIT(1)
21 /* Enable bit for Sensor Interface module */
22 #define TW5864_EMU_EN_SEN BIT(2)
23 /* Enable bit for Host Burst Access */
24 #define TW5864_EMU_EN_BHOST BIT(3)
25 /* Enable bit for Loop Filter module */
26 #define TW5864_EMU_EN_LPF BIT(4)
27 /* Enable bit for PLBK module */
28 #define TW5864_EMU_EN_PLBK BIT(5)
38 #define TW5864_DSP_FRAME_TYPE_D1 BIT(6)
45 #define TW5864_VLC_SLICE_END BIT(0)
47 #define TW5864_MAS_SLICE_END BIT(4)
49 #define TW5864_START_NSLICE BIT(15)
52 * [15:0] Two bit for each channel (channel 0 ~ 7). Each two bits are the buffer
72 * 1: Decode
74 #define TW5864_DSP_CODEC_MODE BIT(0)
76 * 0->3 4 VLC data buffer in DDR (1M each)
77 * 0->7 8 VLC data buffer in DDR (512k each)
81 * 0 4CIF in 1 MB
82 * 1 1CIF in 1 MB
84 #define TW5864_CIF_MAP_MD BIT(6)
86 * 0 2 falf D1 in 1 MB
87 * 1 1 half D1 in 1 MB
89 #define TW5864_HD1_MAP_MD BIT(7)
91 #define TW5864_VLC_VLD BIT(8)
93 #define TW5864_MV_VECT_VLD BIT(9)
95 #define TW5864_MV_FLAG_VLD BIT(10)
132 * 1 DDRA
135 /* VLC Flow Control: 1 for enable */
139 * If DSP_MB_DELAY == 1, MB delay is DSP_MB_DELAY * 128
147 /* DDR-DPR Burst Read Enable */
148 #define TW5864_DDR_BRST_EN BIT(13)
152 * 1 Select DDRB
154 #define TW5864_DDR_AB_SEL BIT(14)
157 * 0 Single R/W Access (Host <-> DDR)
158 * 1 Burst R/W Access (Host <-> DPR)
160 #define TW5864_DDR_MODE BIT(15)
174 * [15:0]: ENC_BUF_PTR_REC[31:16] Two bit for each channel (channel 8 ~ 15).
179 /* Current MV Flag Status Pointer for Channel n. (Read only) */
181 * [1:0] CH0_MV_PTR, ..., [15:14] CH7_MV_PTR
185 * [1:0] CH8_MV_PTR, ..., [15:14] CH15_MV_PTR
190 * [15:0] Reset Current MV Flag Status Pointer for Channel n (one bit each)
196 * Inter_Mode Start. 2-nd bit? A guess. Missing in datasheet. Without this bit
199 #define TW5864_DSP_INTER_ST BIT(1)
201 #define TW5864_DI_EN BIT(2)
203 * De-interlacer Mode
204 * 1 Shuffled frame
205 * 0 Normal Un-Shuffled Frame
207 #define TW5864_DI_MD BIT(3)
210 * 11: Un-used
211 * 10: down-sample to 1/4
212 * 01: down-sample to 1/2
213 * 00: down-sample disabled
218 * 11: Un-used
219 * 10: down-sample to 1/4
220 * 01: down-sample to 1/2
221 * 00: down-sample disabled
225 * 1 Dual Stream
228 #define TW5864_DUAL_STR BIT(8)
232 /* Number of reference frame (Default 1 for TW5864B) */
240 * Skip Offset Enable bit
242 * 1 DSP_SKIP_OFFSET value is used in HW
251 #define TW5864_QPEL_EN BIT(0)
253 #define TW5864_HPEL_EN BIT(1)
255 #define TW5864_ME_EN BIT(2)
257 #define TW5864_INTRA_EN BIT(3)
259 #define TW5864_SKIP_EN BIT(4)
289 /* OSD enable bit for each channel */
292 /* 0x0280 ~ 0x029c - Motion Vector for 1st 4x4 Block, e.g., 80 (X), 84 (Y) */
294 /* 0x02a0 ~ 0x02bc - Motion Vector for 2nd 4x4 Block, e.g., A0 (X), A4 (Y) */
296 /* 0x02c0 ~ 0x02dc - Motion Vector for 3rd 4x4 Block, e.g., C0 (X), C4 (Y) */
298 /* 0x02e0 ~ 0x02fc - Motion Vector for 4th 4x4 Block, e.g., E0 (X), E4 (Y) */
312 * 0x5 Only 4x4
313 * 0x6 Only 16x16
336 /* 0x0800 ~ 0x09ff - Quantization TABLE Values */
345 * 1 Progressive in part A in bus n
348 #define TW5864_PROG_A BIT(0)
350 * 1 Progressive in part B in bus n
353 #define TW5864_PROG_B BIT(1)
355 * 1 Frame Mode in bus n
358 #define TW5864_FRAME BIT(2)
361 * 1 1D1 + 4 CIF in bus n
365 /* Bus 1 goes in TW5864_FRAME_BUS1 in [4:0] */
379 * 0x2cf: 1 D1 + 3 CIF
383 * 0x2cf: 1 D1 + 3 CIF
387 * 0x23f: 1D1 + 3CIF (PAL)
390 * 0x1df: 1D1 + 3CIF (NTSC)
394 * 0x23f: 1D1 + 3CIF (PAL)
397 * 0x1df: 1D1 + 3CIF (NTSC)
406 * 1: the bus mapped Channel n Full D1
413 * 1 The bus mapped Channel select partB Mode
422 * Swap byte order of VLC stream in d-word.
423 * 1 Normal (VLC output= [31:0])
426 #define TW5864_VLC_BYTE_SWP BIT(6)
428 #define TW5864_VLC_ADD03_EN BIT(7)
429 /* Number of bit for VLC bit Align */
434 * 1 CDC_VLCS_MAS read VLC stream
437 #define TW5864_VLC_INF_SEL BIT(13)
439 #define TW5864_VLC_OVFL_CNTL BIT(14)
441 * 1 PCI Master Mode
444 #define TW5864_VLC_PCI_SEL BIT(15)
447 * 1 Disable Adding 03 to VLC header of "00000001"
449 #define TW5864_VLC_A03_DISAB BIT(16)
451 * Status of VLC stream in DDR (one bit for each buffer)
452 * 1 VLC is ready in buffer n (HW set)
458 /* Total number of bit in the slice */
460 /* Total number of bit in the residue */
465 /* VLC BK0 full status, write '1' to clear */
466 #define TW5864_VLC_BK0_FULL BIT(0)
467 /* VLC BK1 full status, write '1' to clear */
468 #define TW5864_VLC_BK1_FULL BIT(1)
469 /* VLC end slice status, write '1' to clear */
470 #define TW5864_VLC_END_SLICE BIT(2)
471 /* VLC Buffer overflow status, write '1' to clear */
472 #define TW5864_DSP_RD_OF BIT(3)
473 /* VLC string length in either buffer 0 or 1 at end of frame */
479 /* [0] VLC Encoder Interrupt. Write '1' to clear */
487 * 1 Read VLC lookup Memory
490 #define TW5864_VLC_RD_MEM BIT(0)
492 * 1 Read VLC Stream Memory in burst mode
495 #define TW5864_VLC_RD_BRST BIT(1)
497 /* 0x2000 ~ 0x2ffc - H264 Stream Memory Map */
501 * VLC_STREAM_MEM[1] address: 0x2004
509 /* 0x4000 ~ 0x4ffc - Audio Register Map */
510 /* [31:0] config 1ms cnt = Realtime clk/1000 */
516 #define TW5864_ADPCM_DEC BIT(0)
518 #define TW5864_ADPCM_IN_DATA BIT(1)
520 #define TW5864_ADPCM_ENC BIT(2)
524 /* Record path PCM Audio enable bit for each channel */
527 #define TW5864_SPK_ORG_EN BIT(16)
529 * 0 16bit
530 * 1 8bit
532 #define TW5864_AD_BIT_MODE BIT(17)
542 * 1 16K
549 #define TW5864_TEST_ADLOOP_EN BIT(30)
552 * 1 PCI Initiator Mode
554 #define TW5864_AUD_MODE BIT(31)
558 /* Record path ADPCM audio channel enable, one bit for each */
561 #define TW5864_SPK_ADPCM_EN BIT(16)
568 * Bit[2:0] ch0
569 * Bit[5:3] ch1
570 * Bit[8:6] ch2
571 * Bit[11:9] ch3
572 * Bit[14:12] ch4
573 * Bit[17:15] ch5
574 * Bit[20:18] ch6
575 * Bit[23:21] ch7
576 * Bit[26:24] ch8
577 * Bit[29:27] ch9
578 * Bit[32:30] ch10
579 * Bit[35:33] ch11
580 * Bit[38:36] ch12
581 * Bit[41:39] ch13
582 * Bit[44:42] ch14
583 * Bit[47:45] ch15
584 * Bit[50:48] ch16
603 * Bit[3:0] ch0
604 * Bit[7:4] ch1
605 * Bit[11:8] ch2
606 * Bit[15:12] ch3
607 * Bit[19:16] ch4
608 * Bit[23:20] ch5
609 * Bit[27:24] ch6
610 * Bit[31:28] ch7
611 * Bit[35:32] ch8
612 * Bit[39:36] ch9
613 * Bit[43:40] ch10
614 * Bit[47:44] ch11
615 * Bit[51:48] ch12
616 * Bit[55:52] ch13
617 * Bit[59:56] ch14
618 * Bit[63:60] ch15
619 * Bit[67:64] ch16
641 * The register is applicable to PCI initiator mode only. Used to select PCM(0)
642 * or ADPCM(1) audio data sent to PC. One bit for each channel
646 * Audio flow control mode selection bit.
649 * 1 Flow control enabled
651 #define TW5864_PCI_FLOW_EN BIT(16)
653 * When PCI_FLOW_EN is set, PCI need to toggle this bit to send an audio frame
656 #define TW5864_PCI_AUD_FRM_EN BIT(17)
658 /* [1:0] CS valid to data valid CLK cycles when writing operation */
667 * 1 vlc stream to ddr buffers
669 #define TW5864_SYNC_CFG BIT(7)
672 * 1 SYNC Address sampled on Falling edge
674 #define TW5864_SYNC_ADR_EDGE BIT(0)
675 #define TW5864_VLC_STR_DELAY_SHIFT 1
678 * 1 One system clock delay
682 #define TW5864_VLC_STR_DELAY (3 << 1)
685 * 1 Falling edge output
687 #define TW5864_VLC_OUT_EDGE BIT(3)
690 * [1:0]
699 * The system / DDR clock (166 MHz) is generated with an on-chip system clock
702 * CLK_OUT = CLK_IN * (M+1) / ((N+1) * P)
720 * [1:0]: SYSPLL_N[6:5], [3:2]: SYSPLL_P, [4]: SYSPLL_IREF, [7:5]: SYSPLL_CP_SEL
730 * 1 30% higher current
732 #define TW5864_SYSPLL_IREF BIT(4)
735 * 0 1,5 uA
736 * 1 4 uA
748 * [1:0]: SYSPLL_VCO, [3:2]: SYSPLL_LP_X8, [5:4]: SYSPLL_ICP_SEL,
765 * 1 6.6K ohms (default)
782 * 1 5pF added
784 #define TW5864_SYSPLL_LPF_5PF BIT(6)
788 * 1 Rising edge
790 #define TW5864_SYSPLL_ED_SEL BIT(7)
796 #define TW5864_SYSPLL_RST BIT(0)
798 #define TW5864_SYSPLL_PD BIT(4)
804 * Become valid after sync to the xtal clock domain. This bit is set only if
805 * LOAD register bit is also set to 1.
807 #define TW5864_SRST BIT(0)
810 * Interface clock domain. The configuration setting becomes effective only if
811 * LOAD register bit is also set to 1.
813 #define TW5864_SYSPLL_CFG BIT(2)
816 * Interface clock domain. The configuration setting becomes effective only if
817 * the LOAD register bit is also set to 1.
819 #define TW5864_SPLL_CFG BIT(4)
821 * Set this bit to latch the SRST, SYSPLL_CFG, SPLL_CFG setting into the xtal
822 * clock domain to restart the PLL. This bit is self cleared.
824 #define TW5864_LOAD BIT(3)
829 /* 0x8800 ~ 0x88fc - Interrupt Register Map */
832 * 1 Edge trigger mode
848 * 1 High level or pos-edge is assertion
849 * 0 Low level or neg-edge is assertion
856 * 1 Interrupt output is high assertion
862 * Bit[0]: VLC 4k RAM interrupt
863 * Bit[1]: BURST DDR RAM interrupt
864 * Bit[2]: MV DSP interrupt
865 * Bit[3]: video lost interrupt
866 * Bit[4]: gpio 0 interrupt
867 * Bit[5]: gpio 1 interrupt
868 * Bit[6]: gpio 2 interrupt
869 * Bit[7]: gpio 3 interrupt
870 * Bit[8]: gpio 4 interrupt
871 * Bit[9]: gpio 5 interrupt
872 * Bit[10]: gpio 6 interrupt
873 * Bit[11]: gpio 7 interrupt
874 * Bit[12]: JPEG interrupt
875 * Bit[13:15]: Reserved
880 * Bit[0]: Reserved
881 * Bit[1]: VLC done interrupt
882 * Bit[2]: Reserved
883 * Bit[3]: AD Vsync interrupt
884 * Bit[4]: Preview eof interrupt
885 * Bit[5]: Preview overflow interrupt
886 * Bit[6]: Timer interrupt
887 * Bit[7]: Reserved
888 * Bit[8]: Audio eof interrupt
889 * Bit[9]: I2C done interrupt
890 * Bit[10]: AD interrupt
891 * Bit[11:15]: Reserved
896 #define TW5864_INTR_VLC_RAM BIT(0)
897 #define TW5864_INTR_BURST BIT(1)
898 #define TW5864_INTR_MV_DSP BIT(2)
899 #define TW5864_INTR_VIN_LOST BIT(3)
901 #define TW5864_INTR_GPIO(n) (1 << (4 + n))
902 #define TW5864_INTR_JPEG BIT(12)
903 #define TW5864_INTR_VLC_DONE BIT(17)
904 #define TW5864_INTR_AD_VSYNC BIT(19)
905 #define TW5864_INTR_PV_EOF BIT(20)
906 #define TW5864_INTR_PV_OVERFLOW BIT(21)
907 #define TW5864_INTR_TIMER BIT(22)
908 #define TW5864_INTR_AUD_EOF BIT(24)
909 #define TW5864_INTR_I2C_DONE BIT(25)
910 #define TW5864_INTR_AD BIT(26)
912 /* 0x9000 ~ 0x920c - Video Capture (VIF) Register Map */
914 * H264EN_CH_STATUS[n] Status of Vsync synchronized H264EN_CH_EN (Read Only)
915 * 1 Channel Enabled
921 * 1 Channel Enabled
928 * 1 Downscale Y to 1/2
934 * 1 Progressive (Not valid for TW5864)
942 * 1 Max 2 channels
969 * 11 D1 with 1/2 size in X (for CIF frame)
973 * [1:0]: H264EN_CH0_FMT,
978 * [1:0]: H264EN_CH8_FMT (?),
992 * H264EN_BUSm_MAP_CHn The 16-to-1 MUX configuration register for each encoding
1012 /* 0xa000 ~ 0xa8ff - DDR Controller Register Map */
1046 * availability of the first bit of output data, default is 3
1055 * DDR_ON_CHIP_MAP [1:0]
1057 * 1 512M DDR on board
1058 * 2 1G DDR on board
1060 * 0 Only one DDR chip
1061 * 1 Two DDR chips
1068 * 1 DDR self-test mode
1070 #define TW5864_MASTER_MODE BIT(0)
1072 * 0 DDR self-test single read/write
1073 * 1 DDR self-test burst read/write
1075 #define TW5864_SINGLE_PROC BIT(1)
1077 * 0 DDR self-test write command
1078 * 1 DDR self-test read command
1080 #define TW5864_WRITE_FLAG BIT(2)
1084 * 1 write 32'hffffffff to DDR
1090 /* [7:0] The maximum data of one burst in DDR self-test mode */
1092 /* [15:0] The maximum burst counter (bit 15~0) in DDR self-test mode */
1094 /* The maximum burst counter (bit 31~16) in DDR self-test mode */
1096 /* [0]: Start one DDR self-test */
1098 /* The maximum error counter (bit 15 ~ 0) in DDR self-test */
1103 /* The maximum error counter (bit 30 ~ 16) in DDR self-test */
1105 /* DDR self-test end flag */
1114 /* 0xb004 ~ 0xb018 - HW version/ARB12 Register Map */
1120 /* Audio data in to DDR enable (default 1) */
1121 #define TW5864_AUD_DATA_IN_ENB BIT(0)
1122 /* Audio encode request to DDR enable (default 1) */
1123 #define TW5864_AUD_ENC_REQ_ENB BIT(1)
1124 /* Audio decode request0 to DDR enable (default 1) */
1125 #define TW5864_AUD_DEC_REQ0_ENB BIT(2)
1126 /* Audio decode request1 to DDR enable (default 1) */
1127 #define TW5864_AUD_DEC_REQ1_ENB BIT(3)
1128 /* VLC stream request to DDR enable (default 1) */
1129 #define TW5864_VLC_STRM_REQ_ENB BIT(4)
1130 /* H264 MV request to DDR enable (default 1) */
1131 #define TW5864_DVM_MV_REQ_ENB BIT(5)
1132 /* mux_core MVD request to DDR enable (default 1) */
1133 #define TW5864_MVD_REQ_ENB BIT(6)
1134 /* mux_core MVD temp data request to DDR enable (default 1) */
1135 #define TW5864_MVD_TMP_REQ_ENB BIT(7)
1136 /* JPEG request to DDR enable (default 1) */
1137 #define TW5864_JPEG_REQ_ENB BIT(8)
1138 /* mv_flag request to DDR enable (default 1) */
1139 #define TW5864_MV_FLAG_REQ_ENB BIT(9)
1143 /* ARB12 Enable (default 1) */
1144 #define TW5864_ARB12_ENB BIT(15)
1148 /* 0xb800 ~ 0xb80c - Indirect Access Register Map */
1157 * (1) Write IND_DATA at 0xb804 ~ 0xb807
1159 * (3) Write IND_ADDR at 0xb800 ~ 0xb801. Set R/W to "1", ENABLE to "1"
1161 * (1) Read BUSY flag from 0xb803. Wait until BUSY signal is 0.
1162 * (2) Write IND_ADDR at 0xb800 ~ 0xb801. Set R/W to "0", ENABLE to "1"
1170 /* Wait until this bit is "0" before using indirect access */
1171 #define TW5864_BUSY BIT(31)
1172 /* Activate the indirect access. This bit is self cleared */
1173 #define TW5864_ENABLE BIT(25)
1175 #define TW5864_RW BIT(24)
1180 /* 0xc000 ~ 0xc7fc - Preview Register Map */
1183 * [15:0] Status of Vsync Synchronized PCI_PV_CH_EN (Read Only)
1184 * 1 Channel Enabled
1190 * 1 Channel Enable
1195 /* 0xc800 ~ 0xc804 - JPEG Capture Register Map */
1197 /* 0xd000 ~ 0xd0fc - JPEG Control Register Map */
1200 /* 0xe000 ~ 0xfc04 - Motion Vector Register Map */
1209 /* mv bank0 full status , write "1" to clear */
1210 #define TW5864_MV_BK0_FULL BIT(0)
1211 /* mv bank1 full status , write "1" to clear */
1212 #define TW5864_MV_BK1_FULL BIT(1)
1213 /* slice end status; write "1" to clear */
1214 #define TW5864_MV_EOF BIT(2)
1215 /* mv encode interrupt status; write "1" to clear */
1216 #define TW5864_MV_DSP_INTR BIT(3)
1217 /* mv write memory overflow, write "1" to clear */
1218 #define TW5864_DSP_WR_OF BIT(4)
1222 /* The configured status bit written into bit 15 of 0xfc04 */
1223 #define TW5864_MPI_DDR_SEL BIT(13)
1230 * 1 MV is saved in DDR
1232 #define TW5864_MPI_DDR_SEL2 BIT(15)
1234 /* 0x18000 ~ 0x181fc - PCI Master/Slave Control Map */
1238 #define TW5864_VLC_DONE_INTR BIT(1)
1240 #define TW5864_AD_VSYNC_INTR BIT(3)
1242 #define TW5864_PREV_EOF_INTR BIT(4)
1244 #define TW5864_PREV_OVERFLOW_INTR BIT(5)
1246 #define TW5864_TIMER_INTR BIT(6)
1248 #define TW5864_AUDIO_EOF_INTR BIT(8)
1250 #define TW5864_IIC_DONE_INTR BIT(24)
1252 #define TW5864_AD_INTR_REG BIT(25)
1257 #define TW5864_PCI_MAST_ENB BIT(0)
1261 #define TW5864_AD_MAST_ENB BIT(3)
1263 #define TW5864_PREV_MAST_ENB BIT(4)
1265 #define TW5864_PREV_OVERFLOW_ENB BIT(5)
1267 #define TW5864_TIMER_INTR_ENB BIT(6)
1269 #define TW5864_JPEG_MAST_ENB BIT(7)
1274 #define TW5864_IIC_INTR_ENB BIT(24)
1276 #define TW5864_AD_INTR_ENB BIT(25)
1278 #define TW5864_PCI_TAR_BURST_ENB BIT(26)
1280 #define TW5864_PCI_VLC_BURST_ENB BIT(27)
1281 /* ddr burst enable (1 enable, and must set DDR_BRST_EN) */
1282 #define TW5864_PCI_DDR_BURST_ENB BIT(28)
1301 #define TW5864_PCI_VLC_INTR_ENB BIT(1)
1303 #define TW5864_PCI_PREV_INTR_ENB BIT(4)
1305 #define TW5864_PCI_PREV_OF_INTR_ENB BIT(5)
1307 #define TW5864_PCI_JPEG_INTR_ENB BIT(7)
1309 #define TW5864_PCI_AUD_INTR_ENB BIT(8)
1312 * Every channel of preview and audio have ping-pong buffers in system memory,
1331 /* rd/wr flag rd=1,wr=0 */
1332 #define TW5864_IIC_RW BIT(16)
1338 * bit to 1. Then poll this bit, value 1 indicate iic transaction have
1341 #define TW5864_IIC_DONE BIT(24)
1346 #define TW5864_APP_SOFT_RST BIT(0)
1348 /* PCI interface version, read only */
1374 * Configuration register for 9[or 10] CIFs or 1D1+15QCIF Preview mode.
1375 * PREV_PCI_ENB_CHN[0] Enable 9th preview channel (9CIF prev) or 1D1 channel in
1376 * (1D1+15QCIF prev)
1377 * PREV_PCI_ENB_CHN[1] Enable 10th preview channel
1386 * 0 1ms
1387 * 1 2ms
1407 /* 0x80000 ~ 0x87fff - DDR Burst RW Register Map */
1411 /* Length of 32-bit data burst */
1416 * 1 Write Burst to DDR
1418 #define TW5864_BRST_RW BIT(16)
1419 /* Begin a new DDR Burst. This bit is self cleared */
1420 #define TW5864_NEW_BRST_CMD BIT(17)
1422 #define TW5864_BRST_END BIT(24)
1424 #define TW5864_SING_ERR_INTR BIT(25)
1426 #define TW5864_BRST_ERR_INTR BIT(26)
1428 #define TW5864_BRST_END_INTR BIT(27)
1430 #define TW5864_SINGLE_ERR BIT(28)
1432 #define TW5864_SINGLE_BUSY BIT(29)
1434 #define TW5864_BRST_ERR BIT(30)
1436 #define TW5864_BRST_BUSY BIT(31)
1438 /* [27:0] DDR Access Address. Bit [1:0] has to be 0 */
1440 /* DDR Access Internal Buffer Address. Bit [1:0] has to be 0 */
1444 /* 0x84000 - 0x87ffc */
1454 /* Read-only register */
1458 * 1 Video not present. (sync is not detected in number of consecutive line
1462 #define TW5864_INDIR_VIN_0_VDLOSS BIT(7)
1464 * 1 Horizontal sync PLL is locked to the incoming video source.
1467 #define TW5864_INDIR_VIN_0_HLOCK BIT(6)
1469 * 1 Sub-carrier PLL is locked to the incoming video source.
1470 * 0 Sub-carrier PLL is not locked.
1472 #define TW5864_INDIR_VIN_0_SLOCK BIT(5)
1474 * 1 Even field is being decoded.
1477 #define TW5864_INDIR_VIN_0_FLD BIT(4)
1479 * 1 Vertical logic is locked to the incoming video source.
1482 #define TW5864_INDIR_VIN_0_VLOCK BIT(3)
1484 * 1 No color burst signal detected.
1487 #define TW5864_INDIR_VIN_0_MONO BIT(1)
1490 * 1 50Hz source detected
1494 #define TW5864_INDIR_VIN_0_DET50 BIT(0)
1497 /* VCR signal indicator. Read-only. */
1498 #define TW5864_INDIR_VIN_1_VCR BIT(7)
1499 /* Weak signal indicator 2. Read-only. */
1500 #define TW5864_INDIR_VIN_1_WKAIR BIT(6)
1501 /* Weak signal indicator controlled by WKTH. Read-only. */
1502 #define TW5864_INDIR_VIN_1_WKAIR1 BIT(5)
1504 * 1 = Standard signal
1505 * 0 = Non-standard signal
1506 * Read-only
1508 #define TW5864_INDIR_VIN_1_VSTD BIT(4)
1510 * 1 = Non-interlaced signal
1512 * Read-only
1514 #define TW5864_INDIR_VIN_1_NINTL BIT(3)
1537 #define TW5864_INDIR_VIN_6_VDELAY_XY_HI BIT(4)
1538 #define TW5864_INDIR_VIN_6_VACTIVE_XY_HI BIT(5)
1541 * HDELAY_XY This 10bit register defines the starting location of horizontal
1542 * active pixel for display / record path. A unit is 1 pixel. The default value
1545 * HACTIVE_XY This 10bit register defines the number of horizontal active pixel
1546 * for display / record path. A unit is 1 pixel. The default value is decimal
1549 * VDELAY_XY This 9bit register defines the starting location of vertical
1550 * active for display / record path. A unit is 1 line. The default value is
1553 * VACTIVE_XY This 9bit register defines the number of vertical active lines
1554 * for display / record path. A unit is 1 line. The default value is decimal
1559 * value from +36o (7Fh) to -36o (80h) with an increment of 2.8o. The 2 LSB has
1561 * purplish tone. The default value is 0o (00h). This is effective only on NTSC
1569 * This bit controls the center frequency of the peaking filter.
1572 * 1 center
1574 #define TW5864_INDIR_VIN_8_SCURVE BIT(7)
1575 /* CTI level selection. The default is 1.
1585 * output image. 1 through 15 provides sharpness enhancement with "F" being the
1586 * strongest. The default is 1.
1592 * gain of 1. The range adjustment is from 0% to 255% at 1% per step. The
1598 * These bits control the brightness. They have value of -128 to 127 in 2's
1624 /* Read-only */
1627 /* Macrovision color stripe detection may be un-reliable */
1628 #define TW5864_INDIR_VIN_D_CSBAD BIT(3)
1630 #define TW5864_INDIR_VIN_D_MCVSN BIT(2)
1632 #define TW5864_INDIR_VIN_D_CSTRIPE BIT(1)
1634 * This bit is valid only when color stripe protection is detected, i.e. if
1635 * CSTRIPE=1,
1636 * 1 Type 2 color stripe protection
1639 #define TW5864_INDIR_VIN_D_CTYPE2 BIT(0)
1641 /* Read-only */
1645 * Read-only.
1647 * 1 Detection in progress
1649 #define TW5864_INDIR_VIN_E_DETSTUS BIT(7)
1653 * 1 PAL (B, D, G, H, I)
1665 * 1 Disable the shadow registers
1669 #define TW5864_INDIR_VIN_E_ATREG BIT(3)
1673 * 1 PAL (B, D, G, H, I)
1686 * 1 Writing 1 to this bit will manually initiate the auto format detection
1687 * process. This bit is a self-clearing bit
1690 #define TW5864_INDIR_VIN_F_ATSTART BIT(7)
1692 #define TW5864_INDIR_VIN_F_PAL60EN BIT(6)
1694 #define TW5864_INDIR_VIN_F_PALCNEN BIT(5)
1696 #define TW5864_INDIR_VIN_F_PALMEN BIT(4)
1698 #define TW5864_INDIR_VIN_F_NTSC44EN BIT(3)
1700 #define TW5864_INDIR_VIN_F_SECAMEN BIT(2)
1702 #define TW5864_INDIR_VIN_F_PALBEN BIT(1)
1704 #define TW5864_INDIR_VIN_F_NTSCEN BIT(0)
1708 /* Use falling edge to sample VD1-VD4 from 54 MHz to 108 MHz */
1710 #define TW5864_INDIR_VD_108_POL_VD12 BIT(0)
1711 #define TW5864_INDIR_VD_108_POL_VD34 BIT(1)
1720 * 1 0.31
1736 /* [3:0] channel 0, [7:4] channel 1 */
1746 * LAWMD Select u-Law/A-Law/PCM/SB data output format on ADATR and ADATM pin.
1748 * 1 SB (Signed MSB bit in PCM data is inverted) output
1749 * 2 u-Law output
1750 * 3 A-Law output
1757 * 1 Apply nominal value for all audio commonly
1759 #define TW5864_INDIR_AIN_MIX_DERATIO BIT(5)
1762 * only for mixing. When n = 4, it enable the mute function of the playback
1763 * audio input. It effects only for single chip or the last stage chip
1765 * 1 Muted (default)
1774 * ADATP signal is coming from external ADPCM decoder, instead of on-chip ADPCM
1777 #define TW5864_INDIR_AIN_0x0E3_EXT_ADATP BIT(7)
1779 #define TW5864_INDIR_AIN_0x0E3_ACLKPPOLO BIT(6)
1783 * 1 Inversed
1785 #define TW5864_INDIR_AIN_0x0E3_ACLKRPOL BIT(5)
1789 * 1 Inversed
1791 #define TW5864_INDIR_AIN_0x0E3_ACLKPPOLI BIT(4)
1794 * This mode is only effective when ACLKRMASTER=1
1796 * 1 ACKI control is automatically set up by AFMD register values
1798 #define TW5864_INDIR_AIN_0x0E3_AFAUTO BIT(3)
1802 * 1 16kHz setting
1812 * 8bit I2S Record output mode.
1814 * 1 One continuous packed output equal to DSP output format.
1816 #define TW5864_INDIR_AIN_0x0E4_I2S8MODE BIT(7)
1820 * 1 Almost duty 50-50% clock output on ACLKR pin. If this mode is selected, two
1822 * AFAUTO=1, ACKI control is automatically set up even if MASCKMD=1.
1824 #define TW5864_INDIR_AIN_0x0E4_MASCKMD BIT(6)
1825 /* Playback ACLKP/ASYNP/ADATP input data MSB-LSB swapping */
1826 #define TW5864_INDIR_AIN_0x0E4_PBINSWAP BIT(5)
1830 * 1 Add one 27MHz period delay in ASYNR signal input
1832 #define TW5864_INDIR_AIN_0x0E4_ASYNRDLY BIT(4)
1836 * 1 add one 27MHz period delay in ASYNP signal input
1838 #define TW5864_INDIR_AIN_0x0E4_ASYNPDLY BIT(3)
1841 * 0 No delay (Default). This is for I2S type 1T delay input interface.
1842 * 1 Add 1 ACLKP clock delay in ADATP input data. This is for left-justified
1845 #define TW5864_INDIR_AIN_0x0E4_ADATPDLY BIT(2)
1847 * Select u-Law/A-Law/PCM/SB data input format on ADATP pin.
1849 * 1 SB (Signed MSB bit in PCM data is inverted) input
1850 * 2 u-Law input
1851 * 3 A-Law input
1882 * Interrupt status register from the front-end. Write "1" to each bit to clear
1912 * bit 0: interrupt occurs in 0x2d0 & 0x2d8
1913 * bit 1: interrupt occurs in 0x2d1 & 0x2d9
1914 * bit 2: interrupt occurs in 0x2d2 & 0x2da
1915 * bit 3: interrupt occurs in 0x2d3 & 0x2db
1916 * bit 4: interrupt occurs in 0x2d4 & 0x2dc
1917 * bit 5: interrupt occurs in 0x2d5 & 0x2dd
1918 * bit 6: interrupt occurs in 0x2d6 & 0x2de
1919 * bit 7: interrupt occurs in 0x2d7 & 0x2df
1920 * bit 8: interrupt occurs in 0x2e0 & 0x2e8
1921 * bit 9: interrupt occurs in 0x2e1 & 0x2e9
1922 * bit 10: interrupt occurs in 0x2e2 & 0x2ea
1923 * bit 11: interrupt occurs in 0x2e3 & 0x2eb
1934 * 1 Disable motion and blind detection
1936 #define TW5864_INDIR_DETECTION_CTL0_MD_DIS BIT(5)
1940 * 1 Request to start motion detection
1942 #define TW5864_INDIR_DETECTION_CTL0_MD_STRB BIT(3)
1946 * 1 Manual trigger mode for motion detection
1948 #define TW5864_INDIR_DETECTION_CTL0_MD_STRB_EN BIT(2)
1980 * 1 Update reference field according to MD_SPEED
1982 #define TW5864_INDIR_DETECTION_CTL2_MD_REFFLD BIT(7)
1985 * 0 Detecting motion for only odd field (default)
1986 * 1 Detecting motion for only even field
2003 * Define the threshold of sub-cell number for motion detection.
2004 * 0 Motion is detected if 1 sub-cell has motion (More sensitive) (default)
2005 * 1 Motion is detected if 2 sub-cells have motion
2006 * 2 Motion is detected if 3 sub-cells have motion
2007 * 3 Motion is detected if 4 sub-cells have motion (Less sensitive)
2014 * In MD_DUAL_EN = 1, MD_SPEED should be limited to 0 ~ 31.
2015 * 0 1 field intervals (default)
2016 * 1 2 field intervals
2072 /* [15:0] MD strobe has been performed at channel n (read only) */
2074 /* NO_VIDEO Detected from channel n (read only) */
2076 /* Motion Detected from channel n (read only) */
2078 /* Blind Detected from channel n (read only) */
2080 /* Night Detected from channel n (read only) */
2083 /* 192 bit motion flag of the channel specified by RGR_MOTION_SEL in 0x382 */
2097 /* 192 bit motion mask of the channel specified by MASK_CH_SEL in 0x3fe */
2118 #define TW5864_INDIR_RESET_VD BIT(7)
2119 #define TW5864_INDIR_RESET_DLL BIT(6)
2120 #define TW5864_INDIR_RESET_MUX_CORE BIT(5)
2123 #define TW5864_INDIR_PV_VD_CK_POL_PV(channel) BIT(channel)
2124 #define TW5864_INDIR_PV_VD_CK_POL_VD(channel) BIT(channel + 4)