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/mutex.h>
25 #include <linux/workqueue.h>
27 #include "mantis_uart.h"
29 #include "mantis_link.h"
31 #define MANTIS_ERROR 0
32 #define MANTIS_NOTICE 1
34 #define MANTIS_DEBUG 3
37 #define dprintk(y, z, format, arg...) do { \
39 if ((mantis->verbose > MANTIS_ERROR) && (mantis->verbose > y)) \
40 printk(KERN_ERR "%s (%d): " format "\n" , __func__ , mantis->num , ##arg); \
41 else if ((mantis->verbose > MANTIS_NOTICE) && (mantis->verbose > y)) \
42 printk(KERN_NOTICE "%s (%d): " format "\n" , __func__ , mantis->num , ##arg); \
43 else if ((mantis->verbose > MANTIS_INFO) && (mantis->verbose > y)) \
44 printk(KERN_INFO "%s (%d): " format "\n" , __func__ , mantis->num , ##arg); \
45 else if ((mantis->verbose > MANTIS_DEBUG) && (mantis->verbose > y)) \
46 printk(KERN_DEBUG "%s (%d): " format "\n" , __func__ , mantis->num , ##arg); \
47 else if ((mantis->verbose > MANTIS_TMG) && (mantis->verbose > y)) \
48 printk(KERN_DEBUG "%s (%d): " format "\n" , __func__ , mantis->num , ##arg); \
50 if (mantis->verbose > y) \
51 printk(format , ##arg); \
55 #define mwrite(dat, addr) writel((dat), addr)
56 #define mread(addr) readl(addr)
58 #define mmwrite(dat, addr) mwrite((dat), (mantis->mmio + (addr)))
59 #define mmread(addr) mread(mantis->mmio + (addr))
61 #define MANTIS_TS_188 0
62 #define MANTIS_TS_204 1
64 #define TWINHAN_TECHNOLOGIES 0x1822
67 #define TECHNISAT 0x1ae4
68 #define TERRATEC 0x153b
70 #define MAKE_ENTRY(__subven, __subdev, __configptr) { \
71 .vendor = TWINHAN_TECHNOLOGIES, \
73 .subvendor = (__subven), \
74 .subdevice = (__subdev), \
75 .driver_data = (unsigned long) (__configptr) \
78 enum mantis_i2c_mode
{
85 struct mantis_hwconfig
{
90 enum mantis_baud baud_rate
;
91 enum mantis_parity parity
;
94 irqreturn_t (*irq_handler
)(int irq
, void *dev_id
);
95 int (*frontend_init
)(struct mantis_pci
*mantis
, struct dvb_frontend
*fe
);
100 enum mantis_i2c_mode i2c_mode
;
104 unsigned int verbose
;
109 u16 subsystem_vendor
;
110 u16 subsystem_device
;
114 struct pci_dev
*pdev
;
116 unsigned long mantis_addr
;
135 struct tasklet_struct tasklet
;
137 struct i2c_adapter adapter
;
139 wait_queue_head_t i2c_wq
;
140 struct mutex i2c_lock
;
143 struct dvb_adapter dvb_adapter
;
144 struct dvb_frontend
*fe
;
145 struct dvb_demux demux
;
146 struct dmxdev dmxdev
;
147 struct dmx_frontend fe_hw
;
148 struct dmx_frontend fe_mem
;
149 struct dvb_net dvbnet
;
153 struct mantis_hwconfig
*hwconfig
;
168 struct mantis_ca
*mantis_ca
;
170 wait_queue_head_t uart_wq
;
171 struct work_struct uart_work
;
172 spinlock_t uart_lock
;
174 struct input_dev
*rc
;
177 #define MANTIS_HIF_STATUS (mantis->gpio_status)
179 #endif /* __MANTIS_COMMON_H */