Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-or-later */
0002 /*
0003     bt878.h - Bt878 audio module (register offsets)
0004 
0005     Copyright (C) 2002 Peter Hettkamp <peter.hettkamp@htp-tel.de>
0006 
0007 */
0008 
0009 #ifndef _BT878_H_
0010 #define _BT878_H_
0011 
0012 #include <linux/interrupt.h>
0013 #include <linux/pci.h>
0014 #include <linux/sched.h>
0015 #include <linux/spinlock.h>
0016 #include <linux/mutex.h>
0017 
0018 #include "bt848.h"
0019 #include "bttv.h"
0020 
0021 #define BT878_VERSION_CODE 0x000000
0022 
0023 #define BT878_AINT_STAT     0x100
0024 #define BT878_ARISCS        (0xf<<28)
0025 #define BT878_ARISC_EN      (1<<27)
0026 #define BT878_ASCERR        (1<<19)
0027 #define BT878_AOCERR        (1<<18)
0028 #define BT878_APABORT       (1<<17)
0029 #define BT878_ARIPERR       (1<<16)
0030 #define BT878_APPERR        (1<<15)
0031 #define BT878_AFDSR     (1<<14)
0032 #define BT878_AFTRGT        (1<<13)
0033 #define BT878_AFBUS     (1<<12)
0034 #define BT878_ARISCI        (1<<11)
0035 #define BT878_AOFLOW        (1<<3)
0036 
0037 #define BT878_AINT_MASK     0x104
0038 
0039 #define BT878_AGPIO_DMA_CTL 0x10c
0040 #define BT878_A_GAIN        (0xf<<28)
0041 #define BT878_A_G2X     (1<<27)
0042 #define BT878_A_PWRDN       (1<<26)
0043 #define BT878_A_SEL     (3<<24)
0044 #define BT878_DA_SCE        (1<<23)
0045 #define BT878_DA_LRI        (1<<22)
0046 #define BT878_DA_MLB        (1<<21)
0047 #define BT878_DA_LRD        (0x1f<<16)
0048 #define BT878_DA_DPM        (1<<15)
0049 #define BT878_DA_SBR        (1<<14)
0050 #define BT878_DA_ES2        (1<<13)
0051 #define BT878_DA_LMT        (1<<12)
0052 #define BT878_DA_SDR        (0xf<<8)
0053 #define BT878_DA_IOM        (3<<6)
0054 #define BT878_DA_APP        (1<<5)
0055 #define BT878_ACAP_EN       (1<<4)
0056 #define BT878_PKTP      (3<<2)
0057 #define BT878_RISC_EN       (1<<1)
0058 #define BT878_FIFO_EN       1
0059 
0060 #define BT878_APACK_LEN     0x110
0061 #define BT878_AFP_LEN       (0xff<<16)
0062 #define BT878_ALP_LEN       0xfff
0063 
0064 #define BT878_ARISC_START   0x114
0065 
0066 #define BT878_ARISC_PC      0x120
0067 
0068 /* BT878 FUNCTION 0 REGISTERS */
0069 #define BT878_GPIO_DMA_CTL  0x10c
0070 
0071 /* Interrupt register */
0072 #define BT878_INT_STAT      0x100
0073 #define BT878_INT_MASK      0x104
0074 #define BT878_I2CRACK       (1<<25)
0075 #define BT878_I2CDONE       (1<<8)
0076 
0077 #define BT878_MAX 4
0078 
0079 #define BT878_RISC_SYNC_MASK    (1 << 15)
0080 
0081 
0082 #define BTTV_BOARD_UNKNOWN                 0x00
0083 #define BTTV_BOARD_PINNACLESAT             0x5e
0084 #define BTTV_BOARD_NEBULA_DIGITV           0x68
0085 #define BTTV_BOARD_PC_HDTV                 0x70
0086 #define BTTV_BOARD_TWINHAN_DST             0x71
0087 #define BTTV_BOARD_AVDVBT_771              0x7b
0088 #define BTTV_BOARD_AVDVBT_761              0x7c
0089 #define BTTV_BOARD_DVICO_DVBT_LITE         0x80
0090 #define BTTV_BOARD_DVICO_FUSIONHDTV_5_LITE 0x87
0091 
0092 extern int bt878_num;
0093 
0094 struct bt878 {
0095     struct mutex gpio_lock;
0096     unsigned int nr;
0097     unsigned int bttv_nr;
0098     struct i2c_adapter *adapter;
0099     struct pci_dev *dev;
0100     unsigned int id;
0101     unsigned int TS_Size;
0102     unsigned char revision;
0103     unsigned int irq;
0104     unsigned long bt878_adr;
0105     volatile void __iomem *bt878_mem; /* function 1 */
0106 
0107     volatile u32 finished_block;
0108     volatile u32 last_block;
0109     u32 block_count;
0110     u32 block_bytes;
0111     u32 line_bytes;
0112     u32 line_count;
0113 
0114     u32 buf_size;
0115     u8 *buf_cpu;
0116     dma_addr_t buf_dma;
0117 
0118     u32 risc_size;
0119     __le32 *risc_cpu;
0120     dma_addr_t risc_dma;
0121     u32 risc_pos;
0122 
0123     struct tasklet_struct tasklet;
0124     int shutdown;
0125 };
0126 
0127 extern struct bt878 bt878[BT878_MAX];
0128 
0129 void bt878_start(struct bt878 *bt, u32 controlreg, u32 op_sync_orin,
0130         u32 irq_err_ignore);
0131 void bt878_stop(struct bt878 *bt);
0132 
0133 #define bmtwrite(dat,adr)  writel((dat), (adr))
0134 #define bmtread(adr)       readl(adr)
0135 
0136 #endif