2 bt878.h - Bt878 audio module (register offsets)
4 Copyright (C) 2002 Peter Hettkamp <peter.hettkamp@t-online.de>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 #include <linux/interrupt.h>
25 #include <linux/pci.h>
26 #include <linux/sched.h>
27 #include <linux/spinlock.h>
30 #define BT878_VERSION_CODE 0x000000
32 #define BT878_AINT_STAT 0x100
33 #define BT878_ARISCS (0xf<<28)
34 #define BT878_ARISC_EN (1<<27)
35 #define BT878_ASCERR (1<<19)
36 #define BT878_AOCERR (1<<18)
37 #define BT878_APABORT (1<<17)
38 #define BT878_ARIPERR (1<<16)
39 #define BT878_APPERR (1<<15)
40 #define BT878_AFDSR (1<<14)
41 #define BT878_AFTRGT (1<<13)
42 #define BT878_AFBUS (1<<12)
43 #define BT878_ARISCI (1<<11)
44 #define BT878_AOFLOW (1<<3)
46 #define BT878_AINT_MASK 0x104
48 #define BT878_AGPIO_DMA_CTL 0x10c
49 #define BT878_A_GAIN (0xf<<28)
50 #define BT878_A_G2X (1<<27)
51 #define BT878_A_PWRDN (1<<26)
52 #define BT878_A_SEL (3<<24)
53 #define BT878_DA_SCE (1<<23)
54 #define BT878_DA_LRI (1<<22)
55 #define BT878_DA_MLB (1<<21)
56 #define BT878_DA_LRD (0x1f<<16)
57 #define BT878_DA_DPM (1<<15)
58 #define BT878_DA_SBR (1<<14)
59 #define BT878_DA_ES2 (1<<13)
60 #define BT878_DA_LMT (1<<12)
61 #define BT878_DA_SDR (0xf<<8)
62 #define BT878_DA_IOM (3<<6)
63 #define BT878_DA_APP (1<<5)
64 #define BT878_ACAP_EN (1<<4)
65 #define BT878_PKTP (3<<2)
66 #define BT878_RISC_EN (1<<1)
67 #define BT878_FIFO_EN 1
69 #define BT878_APACK_LEN 0x110
70 #define BT878_AFP_LEN (0xff<<16)
71 #define BT878_ALP_LEN 0xfff
73 #define BT878_ARISC_START 0x114
75 #define BT878_ARISC_PC 0x120
77 /* BT878 FUNCTION 0 REGISTERS */
78 #define BT878_GPIO_DMA_CTL 0x10c
80 /* Interrupt register */
81 #define BT878_INT_STAT 0x100
82 #define BT878_INT_MASK 0x104
83 #define BT878_I2CRACK (1<<25)
84 #define BT878_I2CDONE (1<<8)
88 #define BT878_RISC_SYNC_MASK (1 << 15)
91 extern struct bt878 bt878[BT878_MAX];
94 struct semaphore gpio_lock;
97 struct dvb_adapter *adap_ptr;
100 unsigned int TS_Size;
101 unsigned char revision;
103 unsigned long bt878_adr;
104 unsigned char *bt878_mem; /* function 1 */
106 volatile u32 finished_block;
107 volatile u32 last_block;
122 struct tasklet_struct tasklet;
126 void bt878_start(struct bt878 *bt, u32 controlreg, u32 op_sync_orin,
128 void bt878_stop(struct bt878 *bt);
130 #if defined(__powerpc__) /* big-endian */
131 extern __inline__ void io_st_le32(volatile unsigned *addr, unsigned val)
133 __asm__ __volatile__("stwbrx %1,0,%2":"=m"(*addr):"r"(val),
135 __asm__ __volatile__("eieio":::"memory");
138 #define bmtwrite(dat,adr) io_st_le32((unsigned *)(adr),(dat))
139 #define bmtread(adr) ld_le32((unsigned *)(adr))
141 #define bmtwrite(dat,adr) writel((dat), (char *) (adr))
142 #define bmtread(adr) readl(adr)