xref: /openbmc/linux/drivers/media/pci/bt8xx/bt848.h (revision b7ec3212)
174ba9207SThomas Gleixner /* SPDX-License-Identifier: GPL-2.0-or-later */
268de959fSMauro Carvalho Chehab /*
368de959fSMauro Carvalho Chehab     bt848.h - Bt848 register offsets
468de959fSMauro Carvalho Chehab 
568de959fSMauro Carvalho Chehab     Copyright (C) 1996,97,98 Ralph Metzler (rjkm@thp.uni-koeln.de)
668de959fSMauro Carvalho Chehab 
768de959fSMauro Carvalho Chehab */
868de959fSMauro Carvalho Chehab 
968de959fSMauro Carvalho Chehab #ifndef _BT848_H_
1068de959fSMauro Carvalho Chehab #define _BT848_H_
1168de959fSMauro Carvalho Chehab 
1268de959fSMauro Carvalho Chehab #ifndef PCI_VENDOR_ID_BROOKTREE
1368de959fSMauro Carvalho Chehab #define PCI_VENDOR_ID_BROOKTREE 0x109e
1468de959fSMauro Carvalho Chehab #endif
1568de959fSMauro Carvalho Chehab #ifndef PCI_DEVICE_ID_BT848
1668de959fSMauro Carvalho Chehab #define PCI_DEVICE_ID_BT848     0x350
1768de959fSMauro Carvalho Chehab #endif
1868de959fSMauro Carvalho Chehab #ifndef PCI_DEVICE_ID_BT849
1968de959fSMauro Carvalho Chehab #define PCI_DEVICE_ID_BT849     0x351
2068de959fSMauro Carvalho Chehab #endif
2168de959fSMauro Carvalho Chehab #ifndef PCI_DEVICE_ID_FUSION879
2268de959fSMauro Carvalho Chehab #define PCI_DEVICE_ID_FUSION879	0x36c
2368de959fSMauro Carvalho Chehab #endif
2468de959fSMauro Carvalho Chehab 
2568de959fSMauro Carvalho Chehab #ifndef PCI_DEVICE_ID_BT878
2668de959fSMauro Carvalho Chehab #define PCI_DEVICE_ID_BT878     0x36e
2768de959fSMauro Carvalho Chehab #endif
2868de959fSMauro Carvalho Chehab #ifndef PCI_DEVICE_ID_BT879
2968de959fSMauro Carvalho Chehab #define PCI_DEVICE_ID_BT879     0x36f
3068de959fSMauro Carvalho Chehab #endif
3168de959fSMauro Carvalho Chehab 
3268de959fSMauro Carvalho Chehab /* Brooktree 848 registers */
3368de959fSMauro Carvalho Chehab 
3468de959fSMauro Carvalho Chehab #define BT848_DSTATUS          0x000
3568de959fSMauro Carvalho Chehab #define BT848_DSTATUS_PRES     (1<<7)
3668de959fSMauro Carvalho Chehab #define BT848_DSTATUS_HLOC     (1<<6)
3768de959fSMauro Carvalho Chehab #define BT848_DSTATUS_FIELD    (1<<5)
3868de959fSMauro Carvalho Chehab #define BT848_DSTATUS_NUML     (1<<4)
3968de959fSMauro Carvalho Chehab #define BT848_DSTATUS_CSEL     (1<<3)
4068de959fSMauro Carvalho Chehab #define BT848_DSTATUS_PLOCK    (1<<2)
4168de959fSMauro Carvalho Chehab #define BT848_DSTATUS_LOF      (1<<1)
4268de959fSMauro Carvalho Chehab #define BT848_DSTATUS_COF      (1<<0)
4368de959fSMauro Carvalho Chehab 
4468de959fSMauro Carvalho Chehab #define BT848_IFORM            0x004
4568de959fSMauro Carvalho Chehab #define BT848_IFORM_HACTIVE    (1<<7)
4668de959fSMauro Carvalho Chehab #define BT848_IFORM_MUXSEL     (3<<5)
4768de959fSMauro Carvalho Chehab #define BT848_IFORM_MUX0       (2<<5)
4868de959fSMauro Carvalho Chehab #define BT848_IFORM_MUX1       (3<<5)
4968de959fSMauro Carvalho Chehab #define BT848_IFORM_MUX2       (1<<5)
5068de959fSMauro Carvalho Chehab #define BT848_IFORM_XTSEL      (3<<3)
5168de959fSMauro Carvalho Chehab #define BT848_IFORM_XT0        (1<<3)
5268de959fSMauro Carvalho Chehab #define BT848_IFORM_XT1        (2<<3)
5368de959fSMauro Carvalho Chehab #define BT848_IFORM_XTAUTO     (3<<3)
5468de959fSMauro Carvalho Chehab #define BT848_IFORM_XTBOTH     (3<<3)
5568de959fSMauro Carvalho Chehab #define BT848_IFORM_NTSC       1
5668de959fSMauro Carvalho Chehab #define BT848_IFORM_NTSC_J     2
5768de959fSMauro Carvalho Chehab #define BT848_IFORM_PAL_BDGHI  3
5868de959fSMauro Carvalho Chehab #define BT848_IFORM_PAL_M      4
5968de959fSMauro Carvalho Chehab #define BT848_IFORM_PAL_N      5
6068de959fSMauro Carvalho Chehab #define BT848_IFORM_SECAM      6
6168de959fSMauro Carvalho Chehab #define BT848_IFORM_PAL_NC     7
6268de959fSMauro Carvalho Chehab #define BT848_IFORM_AUTO       0
6368de959fSMauro Carvalho Chehab #define BT848_IFORM_NORM       7
6468de959fSMauro Carvalho Chehab 
6568de959fSMauro Carvalho Chehab #define BT848_TDEC             0x008
6668de959fSMauro Carvalho Chehab #define BT848_TDEC_DEC_FIELD   (1<<7)
6768de959fSMauro Carvalho Chehab #define BT848_TDEC_FLDALIGN    (1<<6)
6868de959fSMauro Carvalho Chehab #define BT848_TDEC_DEC_RAT     (0x1f)
6968de959fSMauro Carvalho Chehab 
7068de959fSMauro Carvalho Chehab #define BT848_E_CROP           0x00C
7168de959fSMauro Carvalho Chehab #define BT848_O_CROP           0x08C
7268de959fSMauro Carvalho Chehab 
7368de959fSMauro Carvalho Chehab #define BT848_E_VDELAY_LO      0x010
7468de959fSMauro Carvalho Chehab #define BT848_O_VDELAY_LO      0x090
7568de959fSMauro Carvalho Chehab 
7668de959fSMauro Carvalho Chehab #define BT848_E_VACTIVE_LO     0x014
7768de959fSMauro Carvalho Chehab #define BT848_O_VACTIVE_LO     0x094
7868de959fSMauro Carvalho Chehab 
7968de959fSMauro Carvalho Chehab #define BT848_E_HDELAY_LO      0x018
8068de959fSMauro Carvalho Chehab #define BT848_O_HDELAY_LO      0x098
8168de959fSMauro Carvalho Chehab 
8268de959fSMauro Carvalho Chehab #define BT848_E_HACTIVE_LO     0x01C
8368de959fSMauro Carvalho Chehab #define BT848_O_HACTIVE_LO     0x09C
8468de959fSMauro Carvalho Chehab 
8568de959fSMauro Carvalho Chehab #define BT848_E_HSCALE_HI      0x020
8668de959fSMauro Carvalho Chehab #define BT848_O_HSCALE_HI      0x0A0
8768de959fSMauro Carvalho Chehab 
8868de959fSMauro Carvalho Chehab #define BT848_E_HSCALE_LO      0x024
8968de959fSMauro Carvalho Chehab #define BT848_O_HSCALE_LO      0x0A4
9068de959fSMauro Carvalho Chehab 
9168de959fSMauro Carvalho Chehab #define BT848_BRIGHT           0x028
9268de959fSMauro Carvalho Chehab 
9368de959fSMauro Carvalho Chehab #define BT848_E_CONTROL        0x02C
9468de959fSMauro Carvalho Chehab #define BT848_O_CONTROL        0x0AC
9568de959fSMauro Carvalho Chehab #define BT848_CONTROL_LNOTCH    (1<<7)
9668de959fSMauro Carvalho Chehab #define BT848_CONTROL_COMP      (1<<6)
9768de959fSMauro Carvalho Chehab #define BT848_CONTROL_LDEC      (1<<5)
9868de959fSMauro Carvalho Chehab #define BT848_CONTROL_CBSENSE   (1<<4)
9968de959fSMauro Carvalho Chehab #define BT848_CONTROL_CON_MSB   (1<<2)
10068de959fSMauro Carvalho Chehab #define BT848_CONTROL_SAT_U_MSB (1<<1)
10168de959fSMauro Carvalho Chehab #define BT848_CONTROL_SAT_V_MSB (1<<0)
10268de959fSMauro Carvalho Chehab 
10368de959fSMauro Carvalho Chehab #define BT848_CONTRAST_LO      0x030
10468de959fSMauro Carvalho Chehab #define BT848_SAT_U_LO         0x034
10568de959fSMauro Carvalho Chehab #define BT848_SAT_V_LO         0x038
10668de959fSMauro Carvalho Chehab #define BT848_HUE              0x03C
10768de959fSMauro Carvalho Chehab 
10868de959fSMauro Carvalho Chehab #define BT848_E_SCLOOP         0x040
10968de959fSMauro Carvalho Chehab #define BT848_O_SCLOOP         0x0C0
11068de959fSMauro Carvalho Chehab #define BT848_SCLOOP_CAGC       (1<<6)
11168de959fSMauro Carvalho Chehab #define BT848_SCLOOP_CKILL      (1<<5)
11268de959fSMauro Carvalho Chehab #define BT848_SCLOOP_HFILT_AUTO (0<<3)
11368de959fSMauro Carvalho Chehab #define BT848_SCLOOP_HFILT_CIF  (1<<3)
11468de959fSMauro Carvalho Chehab #define BT848_SCLOOP_HFILT_QCIF (2<<3)
11568de959fSMauro Carvalho Chehab #define BT848_SCLOOP_HFILT_ICON (3<<3)
11668de959fSMauro Carvalho Chehab 
11768de959fSMauro Carvalho Chehab #define BT848_SCLOOP_PEAK       (1<<7)
11868de959fSMauro Carvalho Chehab #define BT848_SCLOOP_HFILT_MINP (1<<3)
11968de959fSMauro Carvalho Chehab #define BT848_SCLOOP_HFILT_MEDP (2<<3)
12068de959fSMauro Carvalho Chehab #define BT848_SCLOOP_HFILT_MAXP (3<<3)
12168de959fSMauro Carvalho Chehab 
12268de959fSMauro Carvalho Chehab 
12368de959fSMauro Carvalho Chehab #define BT848_OFORM            0x048
12468de959fSMauro Carvalho Chehab #define BT848_OFORM_RANGE      (1<<7)
12568de959fSMauro Carvalho Chehab #define BT848_OFORM_CORE0      (0<<5)
12668de959fSMauro Carvalho Chehab #define BT848_OFORM_CORE8      (1<<5)
12768de959fSMauro Carvalho Chehab #define BT848_OFORM_CORE16     (2<<5)
12868de959fSMauro Carvalho Chehab #define BT848_OFORM_CORE32     (3<<5)
12968de959fSMauro Carvalho Chehab 
13068de959fSMauro Carvalho Chehab #define BT848_E_VSCALE_HI      0x04C
13168de959fSMauro Carvalho Chehab #define BT848_O_VSCALE_HI      0x0CC
13268de959fSMauro Carvalho Chehab #define BT848_VSCALE_YCOMB     (1<<7)
13368de959fSMauro Carvalho Chehab #define BT848_VSCALE_COMB      (1<<6)
13468de959fSMauro Carvalho Chehab #define BT848_VSCALE_INT       (1<<5)
13568de959fSMauro Carvalho Chehab #define BT848_VSCALE_HI        15
13668de959fSMauro Carvalho Chehab 
13768de959fSMauro Carvalho Chehab #define BT848_E_VSCALE_LO      0x050
13868de959fSMauro Carvalho Chehab #define BT848_O_VSCALE_LO      0x0D0
13968de959fSMauro Carvalho Chehab #define BT848_TEST             0x054
14068de959fSMauro Carvalho Chehab #define BT848_ADELAY           0x060
14168de959fSMauro Carvalho Chehab #define BT848_BDELAY           0x064
14268de959fSMauro Carvalho Chehab 
14368de959fSMauro Carvalho Chehab #define BT848_ADC              0x068
14468de959fSMauro Carvalho Chehab #define BT848_ADC_RESERVED     (2<<6)
14568de959fSMauro Carvalho Chehab #define BT848_ADC_SYNC_T       (1<<5)
14668de959fSMauro Carvalho Chehab #define BT848_ADC_AGC_EN       (1<<4)
14768de959fSMauro Carvalho Chehab #define BT848_ADC_CLK_SLEEP    (1<<3)
14868de959fSMauro Carvalho Chehab #define BT848_ADC_Y_SLEEP      (1<<2)
14968de959fSMauro Carvalho Chehab #define BT848_ADC_C_SLEEP      (1<<1)
15068de959fSMauro Carvalho Chehab #define BT848_ADC_CRUSH        (1<<0)
15168de959fSMauro Carvalho Chehab 
15268de959fSMauro Carvalho Chehab #define BT848_WC_UP            0x044
15368de959fSMauro Carvalho Chehab #define BT848_WC_DOWN          0x078
15468de959fSMauro Carvalho Chehab 
15568de959fSMauro Carvalho Chehab #define BT848_E_VTC            0x06C
15668de959fSMauro Carvalho Chehab #define BT848_O_VTC            0x0EC
15768de959fSMauro Carvalho Chehab #define BT848_VTC_HSFMT        (1<<7)
15868de959fSMauro Carvalho Chehab #define BT848_VTC_VFILT_2TAP   0
15968de959fSMauro Carvalho Chehab #define BT848_VTC_VFILT_3TAP   1
16068de959fSMauro Carvalho Chehab #define BT848_VTC_VFILT_4TAP   2
16168de959fSMauro Carvalho Chehab #define BT848_VTC_VFILT_5TAP   3
16268de959fSMauro Carvalho Chehab 
16368de959fSMauro Carvalho Chehab #define BT848_SRESET           0x07C
16468de959fSMauro Carvalho Chehab 
16568de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT             0x0D4
16668de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_O_RGB32     (0<<4)
16768de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_O_RGB24     (1<<4)
16868de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_O_RGB16     (2<<4)
16968de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_O_RGB15     (3<<4)
17068de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_O_YUY2      (4<<4)
17168de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_O_BtYUV     (5<<4)
17268de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_O_Y8        (6<<4)
17368de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_O_RGB8      (7<<4)
17468de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_O_YCrCb422  (8<<4)
17568de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_O_YCrCb411  (9<<4)
17668de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_O_RAW       (14<<4)
17768de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_E_RGB32     0
17868de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_E_RGB24     1
17968de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_E_RGB16     2
18068de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_E_RGB15     3
18168de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_E_YUY2      4
18268de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_E_BtYUV     5
18368de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_E_Y8        6
18468de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_E_RGB8      7
18568de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_E_YCrCb422  8
18668de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_E_YCrCb411  9
18768de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_E_RAW       14
18868de959fSMauro Carvalho Chehab 
18968de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_RGB32       0x00
19068de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_RGB24       0x11
19168de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_RGB16       0x22
19268de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_RGB15       0x33
19368de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_YUY2        0x44
19468de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_BtYUV       0x55
19568de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_Y8          0x66
19668de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_RGB8        0x77
19768de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_YCrCb422    0x88
19868de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_YCrCb411    0x99
19968de959fSMauro Carvalho Chehab #define BT848_COLOR_FMT_RAW         0xee
20068de959fSMauro Carvalho Chehab 
20168de959fSMauro Carvalho Chehab #define BT848_VTOTAL_LO             0xB0
20268de959fSMauro Carvalho Chehab #define BT848_VTOTAL_HI             0xB4
20368de959fSMauro Carvalho Chehab 
20468de959fSMauro Carvalho Chehab #define BT848_COLOR_CTL                0x0D8
20568de959fSMauro Carvalho Chehab #define BT848_COLOR_CTL_EXT_FRMRATE    (1<<7)
20668de959fSMauro Carvalho Chehab #define BT848_COLOR_CTL_COLOR_BARS     (1<<6)
20768de959fSMauro Carvalho Chehab #define BT848_COLOR_CTL_RGB_DED        (1<<5)
20868de959fSMauro Carvalho Chehab #define BT848_COLOR_CTL_GAMMA          (1<<4)
20968de959fSMauro Carvalho Chehab #define BT848_COLOR_CTL_WSWAP_ODD      (1<<3)
21068de959fSMauro Carvalho Chehab #define BT848_COLOR_CTL_WSWAP_EVEN     (1<<2)
21168de959fSMauro Carvalho Chehab #define BT848_COLOR_CTL_BSWAP_ODD      (1<<1)
21268de959fSMauro Carvalho Chehab #define BT848_COLOR_CTL_BSWAP_EVEN     (1<<0)
21368de959fSMauro Carvalho Chehab 
21468de959fSMauro Carvalho Chehab #define BT848_CAP_CTL                  0x0DC
21568de959fSMauro Carvalho Chehab #define BT848_CAP_CTL_DITH_FRAME       (1<<4)
21668de959fSMauro Carvalho Chehab #define BT848_CAP_CTL_CAPTURE_VBI_ODD  (1<<3)
21768de959fSMauro Carvalho Chehab #define BT848_CAP_CTL_CAPTURE_VBI_EVEN (1<<2)
21868de959fSMauro Carvalho Chehab #define BT848_CAP_CTL_CAPTURE_ODD      (1<<1)
21968de959fSMauro Carvalho Chehab #define BT848_CAP_CTL_CAPTURE_EVEN     (1<<0)
22068de959fSMauro Carvalho Chehab 
22168de959fSMauro Carvalho Chehab #define BT848_VBI_PACK_SIZE    0x0E0
22268de959fSMauro Carvalho Chehab 
22368de959fSMauro Carvalho Chehab #define BT848_VBI_PACK_DEL     0x0E4
22468de959fSMauro Carvalho Chehab #define BT848_VBI_PACK_DEL_VBI_HDELAY 0xfc
22568de959fSMauro Carvalho Chehab #define BT848_VBI_PACK_DEL_EXT_FRAME  2
22668de959fSMauro Carvalho Chehab #define BT848_VBI_PACK_DEL_VBI_PKT_HI 1
22768de959fSMauro Carvalho Chehab 
22868de959fSMauro Carvalho Chehab 
22968de959fSMauro Carvalho Chehab #define BT848_INT_STAT         0x100
23068de959fSMauro Carvalho Chehab #define BT848_INT_MASK         0x104
23168de959fSMauro Carvalho Chehab 
23268de959fSMauro Carvalho Chehab #define BT848_INT_ETBF         (1<<23)
23368de959fSMauro Carvalho Chehab 
234*b7ec3212SDeborah Brouwer #define BT848_RISC_VIDEO 1
235*b7ec3212SDeborah Brouwer #define BT848_RISC_TOP 2
236*b7ec3212SDeborah Brouwer #define BT848_RISC_VBI 4
237*b7ec3212SDeborah Brouwer 
23868de959fSMauro Carvalho Chehab #define BT848_INT_RISCS   (0xf<<28)
239*b7ec3212SDeborah Brouwer #define BT848_INT_RISCS_VIDEO   (BT848_RISC_VIDEO << 28)
240*b7ec3212SDeborah Brouwer #define BT848_INT_RISCS_TOP   (BT848_RISC_TOP << 28)
241*b7ec3212SDeborah Brouwer #define BT848_INT_RISCS_VBI   (BT848_RISC_VBI << 28)
242*b7ec3212SDeborah Brouwer 
24368de959fSMauro Carvalho Chehab #define BT848_INT_RISC_EN (1<<27)
24468de959fSMauro Carvalho Chehab #define BT848_INT_RACK    (1<<25)
24568de959fSMauro Carvalho Chehab #define BT848_INT_FIELD   (1<<24)
24668de959fSMauro Carvalho Chehab #define BT848_INT_SCERR   (1<<19)
24768de959fSMauro Carvalho Chehab #define BT848_INT_OCERR   (1<<18)
24868de959fSMauro Carvalho Chehab #define BT848_INT_PABORT  (1<<17)
24968de959fSMauro Carvalho Chehab #define BT848_INT_RIPERR  (1<<16)
25068de959fSMauro Carvalho Chehab #define BT848_INT_PPERR   (1<<15)
25168de959fSMauro Carvalho Chehab #define BT848_INT_FDSR    (1<<14)
25268de959fSMauro Carvalho Chehab #define BT848_INT_FTRGT   (1<<13)
25368de959fSMauro Carvalho Chehab #define BT848_INT_FBUS    (1<<12)
25468de959fSMauro Carvalho Chehab #define BT848_INT_RISCI   (1<<11)
25568de959fSMauro Carvalho Chehab #define BT848_INT_GPINT   (1<<9)
25668de959fSMauro Carvalho Chehab #define BT848_INT_I2CDONE (1<<8)
25768de959fSMauro Carvalho Chehab #define BT848_INT_VPRES   (1<<5)
25868de959fSMauro Carvalho Chehab #define BT848_INT_HLOCK   (1<<4)
25968de959fSMauro Carvalho Chehab #define BT848_INT_OFLOW   (1<<3)
26068de959fSMauro Carvalho Chehab #define BT848_INT_HSYNC   (1<<2)
26168de959fSMauro Carvalho Chehab #define BT848_INT_VSYNC   (1<<1)
26268de959fSMauro Carvalho Chehab #define BT848_INT_FMTCHG  (1<<0)
26368de959fSMauro Carvalho Chehab 
26468de959fSMauro Carvalho Chehab 
26568de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL             0x10C
26668de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL_GPINTC      (1<<15)
26768de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL_GPINTI      (1<<14)
26868de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL_GPWEC       (1<<13)
26968de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL_GPIOMODE    (3<<11)
27068de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL_GPCLKMODE   (1<<10)
27168de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL_PLTP23_4    (0<<6)
27268de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL_PLTP23_8    (1<<6)
27368de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL_PLTP23_16   (2<<6)
27468de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL_PLTP23_32   (3<<6)
27568de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL_PLTP1_4     (0<<4)
27668de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL_PLTP1_8     (1<<4)
27768de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL_PLTP1_16    (2<<4)
27868de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL_PLTP1_32    (3<<4)
27968de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL_PKTP_4      (0<<2)
28068de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL_PKTP_8      (1<<2)
28168de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL_PKTP_16     (2<<2)
28268de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL_PKTP_32     (3<<2)
28368de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL_RISC_ENABLE (1<<1)
28468de959fSMauro Carvalho Chehab #define BT848_GPIO_DMA_CTL_FIFO_ENABLE (1<<0)
28568de959fSMauro Carvalho Chehab 
28668de959fSMauro Carvalho Chehab #define BT848_I2C              0x110
28768de959fSMauro Carvalho Chehab #define BT878_I2C_MODE         (1<<7)
28868de959fSMauro Carvalho Chehab #define BT878_I2C_RATE         (1<<6)
28968de959fSMauro Carvalho Chehab #define BT878_I2C_NOSTOP       (1<<5)
29068de959fSMauro Carvalho Chehab #define BT878_I2C_NOSTART      (1<<4)
29168de959fSMauro Carvalho Chehab #define BT848_I2C_DIV          (0xf<<4)
29268de959fSMauro Carvalho Chehab #define BT848_I2C_SYNC         (1<<3)
29368de959fSMauro Carvalho Chehab #define BT848_I2C_W3B	       (1<<2)
29468de959fSMauro Carvalho Chehab #define BT848_I2C_SCL          (1<<1)
29568de959fSMauro Carvalho Chehab #define BT848_I2C_SDA          (1<<0)
29668de959fSMauro Carvalho Chehab 
29768de959fSMauro Carvalho Chehab #define BT848_RISC_STRT_ADD    0x114
29868de959fSMauro Carvalho Chehab #define BT848_GPIO_OUT_EN      0x118
29968de959fSMauro Carvalho Chehab #define BT848_GPIO_REG_INP     0x11C
30068de959fSMauro Carvalho Chehab #define BT848_RISC_COUNT       0x120
30168de959fSMauro Carvalho Chehab #define BT848_GPIO_DATA        0x200
30268de959fSMauro Carvalho Chehab 
30368de959fSMauro Carvalho Chehab 
30468de959fSMauro Carvalho Chehab /* Bt848 RISC commands */
30568de959fSMauro Carvalho Chehab 
30668de959fSMauro Carvalho Chehab /* only for the SYNC RISC command */
30768de959fSMauro Carvalho Chehab #define BT848_FIFO_STATUS_FM1  0x06
30868de959fSMauro Carvalho Chehab #define BT848_FIFO_STATUS_FM3  0x0e
30968de959fSMauro Carvalho Chehab #define BT848_FIFO_STATUS_SOL  0x02
31068de959fSMauro Carvalho Chehab #define BT848_FIFO_STATUS_EOL4 0x01
31168de959fSMauro Carvalho Chehab #define BT848_FIFO_STATUS_EOL3 0x0d
31268de959fSMauro Carvalho Chehab #define BT848_FIFO_STATUS_EOL2 0x09
31368de959fSMauro Carvalho Chehab #define BT848_FIFO_STATUS_EOL1 0x05
31468de959fSMauro Carvalho Chehab #define BT848_FIFO_STATUS_VRE  0x04
31568de959fSMauro Carvalho Chehab #define BT848_FIFO_STATUS_VRO  0x0c
31668de959fSMauro Carvalho Chehab #define BT848_FIFO_STATUS_PXV  0x00
31768de959fSMauro Carvalho Chehab 
31868de959fSMauro Carvalho Chehab #define BT848_RISC_RESYNC      (1<<15)
31968de959fSMauro Carvalho Chehab 
32068de959fSMauro Carvalho Chehab /* WRITE and SKIP */
32168de959fSMauro Carvalho Chehab /* disable which bytes of each DWORD */
32268de959fSMauro Carvalho Chehab #define BT848_RISC_BYTE0       (1U<<12)
32368de959fSMauro Carvalho Chehab #define BT848_RISC_BYTE1       (1U<<13)
32468de959fSMauro Carvalho Chehab #define BT848_RISC_BYTE2       (1U<<14)
32568de959fSMauro Carvalho Chehab #define BT848_RISC_BYTE3       (1U<<15)
32668de959fSMauro Carvalho Chehab #define BT848_RISC_BYTE_ALL    (0x0fU<<12)
32768de959fSMauro Carvalho Chehab #define BT848_RISC_BYTE_NONE   0
32868de959fSMauro Carvalho Chehab /* cause RISCI */
32968de959fSMauro Carvalho Chehab #define BT848_RISC_IRQ         (1U<<24)
33068de959fSMauro Carvalho Chehab /* RISC command is last one in this line */
33168de959fSMauro Carvalho Chehab #define BT848_RISC_EOL         (1U<<26)
33268de959fSMauro Carvalho Chehab /* RISC command is first one in this line */
33368de959fSMauro Carvalho Chehab #define BT848_RISC_SOL         (1U<<27)
33468de959fSMauro Carvalho Chehab 
33568de959fSMauro Carvalho Chehab #define BT848_RISC_WRITE       (0x01U<<28)
33668de959fSMauro Carvalho Chehab #define BT848_RISC_SKIP        (0x02U<<28)
33768de959fSMauro Carvalho Chehab #define BT848_RISC_WRITEC      (0x05U<<28)
33868de959fSMauro Carvalho Chehab #define BT848_RISC_JUMP        (0x07U<<28)
33968de959fSMauro Carvalho Chehab #define BT848_RISC_SYNC        (0x08U<<28)
34068de959fSMauro Carvalho Chehab 
34168de959fSMauro Carvalho Chehab #define BT848_RISC_WRITE123    (0x09U<<28)
34268de959fSMauro Carvalho Chehab #define BT848_RISC_SKIP123     (0x0aU<<28)
34368de959fSMauro Carvalho Chehab #define BT848_RISC_WRITE1S23   (0x0bU<<28)
34468de959fSMauro Carvalho Chehab 
34568de959fSMauro Carvalho Chehab 
34668de959fSMauro Carvalho Chehab /* Bt848A and higher only !! */
34768de959fSMauro Carvalho Chehab #define BT848_TGLB             0x080
34868de959fSMauro Carvalho Chehab #define BT848_TGCTRL           0x084
34968de959fSMauro Carvalho Chehab #define BT848_FCAP             0x0E8
35068de959fSMauro Carvalho Chehab #define BT848_PLL_F_LO         0x0F0
35168de959fSMauro Carvalho Chehab #define BT848_PLL_F_HI         0x0F4
35268de959fSMauro Carvalho Chehab 
35368de959fSMauro Carvalho Chehab #define BT848_PLL_XCI          0x0F8
35468de959fSMauro Carvalho Chehab #define BT848_PLL_X            (1<<7)
35568de959fSMauro Carvalho Chehab #define BT848_PLL_C            (1<<6)
35668de959fSMauro Carvalho Chehab 
35768de959fSMauro Carvalho Chehab #define BT848_DVSIF            0x0FC
35868de959fSMauro Carvalho Chehab 
35968de959fSMauro Carvalho Chehab /* Bt878 register */
36068de959fSMauro Carvalho Chehab 
36168de959fSMauro Carvalho Chehab #define BT878_DEVCTRL 0x40
36268de959fSMauro Carvalho Chehab #define BT878_EN_TBFX 0x02
36368de959fSMauro Carvalho Chehab #define BT878_EN_VSFX 0x04
36468de959fSMauro Carvalho Chehab 
36568de959fSMauro Carvalho Chehab #endif
366