2 Mantis PCI bridge driver
4 Copyright (C) Manu Abraham (abraham.manu@gmail.com)
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.
21 #ifndef __MANTIS_COMMON_H
22 #define __MANTIS_COMMON_H
24 #include <linux/interrupt.h>
25 #include <linux/mutex.h>
26 #include <linux/workqueue.h>
28 #include "mantis_uart.h"
30 #include "mantis_link.h"
32 #define MANTIS_ERROR 0
33 #define MANTIS_NOTICE 1
35 #define MANTIS_DEBUG 3
38 #define dprintk(y, z, format, arg...) do { \
40 if ((mantis->verbose > MANTIS_ERROR) && (mantis->verbose > y)) \
41 printk(KERN_ERR "%s (%d): " format "\n" , __func__ , mantis->num , ##arg); \
42 else if ((mantis->verbose > MANTIS_NOTICE) && (mantis->verbose > y)) \
43 printk(KERN_NOTICE "%s (%d): " format "\n" , __func__ , mantis->num , ##arg); \
44 else if ((mantis->verbose > MANTIS_INFO) && (mantis->verbose > y)) \
45 printk(KERN_INFO "%s (%d): " format "\n" , __func__ , mantis->num , ##arg); \
46 else if ((mantis->verbose > MANTIS_DEBUG) && (mantis->verbose > y)) \
47 printk(KERN_DEBUG "%s (%d): " format "\n" , __func__ , mantis->num , ##arg); \
48 else if ((mantis->verbose > MANTIS_TMG) && (mantis->verbose > y)) \
49 printk(KERN_DEBUG "%s (%d): " format "\n" , __func__ , mantis->num , ##arg); \
51 if (mantis->verbose > y) \
52 printk(format , ##arg); \
56 #define mwrite(dat, addr) writel((dat), addr)
57 #define mread(addr) readl(addr)
59 #define mmwrite(dat, addr) mwrite((dat), (mantis->mmio + (addr)))
60 #define mmread(addr) mread(mantis->mmio + (addr))
62 #define MANTIS_TS_188 0
63 #define MANTIS_TS_204 1
65 #define TWINHAN_TECHNOLOGIES 0x1822
68 #define TECHNISAT 0x1ae4
69 #define TERRATEC 0x153b
71 #define MAKE_ENTRY(__subven, __subdev, __configptr) { \
72 .vendor = TWINHAN_TECHNOLOGIES, \
74 .subvendor = (__subven), \
75 .subdevice = (__subdev), \
76 .driver_data = (unsigned long) (__configptr) \
79 enum mantis_i2c_mode
{
86 struct mantis_hwconfig
{
91 enum mantis_baud baud_rate
;
92 enum mantis_parity parity
;
95 irqreturn_t (*irq_handler
)(int irq
, void *dev_id
);
96 int (*frontend_init
)(struct mantis_pci
*mantis
, struct dvb_frontend
*fe
);
101 enum mantis_i2c_mode i2c_mode
;
105 unsigned int verbose
;
110 u16 subsystem_vendor
;
111 u16 subsystem_device
;
115 struct pci_dev
*pdev
;
117 unsigned long mantis_addr
;
133 struct tasklet_struct tasklet
;
135 struct i2c_adapter adapter
;
137 wait_queue_head_t i2c_wq
;
138 struct mutex i2c_lock
;
141 struct dvb_adapter dvb_adapter
;
142 struct dvb_frontend
*fe
;
143 struct dvb_demux demux
;
144 struct dmxdev dmxdev
;
145 struct dmx_frontend fe_hw
;
146 struct dmx_frontend fe_mem
;
147 struct dvb_net dvbnet
;
151 struct mantis_hwconfig
*hwconfig
;
166 struct mantis_ca
*mantis_ca
;
168 wait_queue_head_t uart_wq
;
169 struct work_struct uart_work
;
170 spinlock_t uart_lock
;
177 #define MANTIS_HIF_STATUS (mantis->gpio_status)
179 #endif /* __MANTIS_COMMON_H */