aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/mantis/mantis_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/mantis/mantis_common.h')
-rw-r--r--drivers/media/dvb/mantis/mantis_common.h68
1 files changed, 32 insertions, 36 deletions
diff --git a/drivers/media/dvb/mantis/mantis_common.h b/drivers/media/dvb/mantis/mantis_common.h
index 6a02adf1ab4d..e912c5962e3a 100644
--- a/drivers/media/dvb/mantis/mantis_common.h
+++ b/drivers/media/dvb/mantis/mantis_common.h
@@ -21,20 +21,9 @@
21#ifndef __MANTIS_COMMON_H 21#ifndef __MANTIS_COMMON_H
22#define __MANTIS_COMMON_H 22#define __MANTIS_COMMON_H
23 23
24#include <linux/module.h>
25#include <linux/moduleparam.h>
26#include <linux/kernel.h>
27#include <linux/pci.h>
28#include <linux/mutex.h> 24#include <linux/mutex.h>
29#include <linux/workqueue.h> 25#include <linux/workqueue.h>
30 26
31#include "dvbdev.h"
32#include "dvb_demux.h"
33#include "dmxdev.h"
34#include "dvb_frontend.h"
35#include "dvb_net.h"
36#include <linux/i2c.h>
37#include "mantis_reg.h"
38#include "mantis_uart.h" 27#include "mantis_uart.h"
39 28
40#include "mantis_link.h" 29#include "mantis_link.h"
@@ -44,18 +33,18 @@
44#define MANTIS_INFO 2 33#define MANTIS_INFO 2
45#define MANTIS_DEBUG 3 34#define MANTIS_DEBUG 3
46 35
47#define dprintk(x, y, z, format, arg...) do { \ 36#define dprintk(y, z, format, arg...) do { \
48 if (z) { \ 37 if (z) { \
49 if ((x > MANTIS_ERROR) && (x > y)) \ 38 if ((mantis->verbose > MANTIS_ERROR) && (mantis->verbose > y)) \
50 printk(KERN_ERR "%s (%d): " format "\n" , __func__ , mantis->num , ##arg); \ 39 printk(KERN_ERR "%s (%d): " format "\n" , __func__ , mantis->num , ##arg); \
51 else if ((x > MANTIS_NOTICE) && (x > y)) \ 40 else if ((mantis->verbose > MANTIS_NOTICE) && (mantis->verbose > y)) \
52 printk(KERN_NOTICE "%s (%d): " format "\n" , __func__ , mantis->num , ##arg); \ 41 printk(KERN_NOTICE "%s (%d): " format "\n" , __func__ , mantis->num , ##arg); \
53 else if ((x > MANTIS_INFO) && (x > y)) \ 42 else if ((mantis->verbose > MANTIS_INFO) && (mantis->verbose > y)) \
54 printk(KERN_INFO "%s (%d): " format "\n" , __func__ , mantis->num , ##arg); \ 43 printk(KERN_INFO "%s (%d): " format "\n" , __func__ , mantis->num , ##arg); \
55 else if ((x > MANTIS_DEBUG) && (x > y)) \ 44 else if ((mantis->verbose > MANTIS_DEBUG) && (mantis->verbose > y)) \
56 printk(KERN_DEBUG "%s (%d): " format "\n" , __func__ , mantis->num , ##arg); \ 45 printk(KERN_DEBUG "%s (%d): " format "\n" , __func__ , mantis->num , ##arg); \
57 } else { \ 46 } else { \
58 if (x > y) \ 47 if (mantis->verbose > y) \
59 printk(format , ##arg); \ 48 printk(format , ##arg); \
60 } \ 49 } \
61} while(0) 50} while(0)
@@ -63,8 +52,8 @@
63#define mwrite(dat, addr) writel((dat), addr) 52#define mwrite(dat, addr) writel((dat), addr)
64#define mread(addr) readl(addr) 53#define mread(addr) readl(addr)
65 54
66#define mmwrite(dat, addr) mwrite((dat), (mantis->mantis_mmio + (addr))) 55#define mmwrite(dat, addr) mwrite((dat), (mantis->mmio + (addr)))
67#define mmread(addr) mread(mantis->mantis_mmio + (addr)) 56#define mmread(addr) mread(mantis->mmio + (addr))
68#define mmand(dat, addr) mmwrite((dat) & mmread(addr), addr) 57#define mmand(dat, addr) mmwrite((dat) & mmread(addr), addr)
69#define mmor(dat, addr) mmwrite((dat) | mmread(addr), addr) 58#define mmor(dat, addr) mmwrite((dat) | mmread(addr), addr)
70#define mmaor(dat, addr) mmwrite((dat) | ((mask) & mmread(addr)), addr) 59#define mmaor(dat, addr) mmwrite((dat) | ((mask) & mmread(addr)), addr)
@@ -72,6 +61,22 @@
72#define MANTIS_TS_188 0 61#define MANTIS_TS_188 0
73#define MANTIS_TS_204 1 62#define MANTIS_TS_204 1
74 63
64#define TWINHAN_TECHNOLOGIES 0x1822
65#define MANTIS 0x4e35
66
67#define TECHNISAT 0x1ae4
68#define TERRATEC 0x153b
69
70#define MAKE_ENTRY(__subven, __subdev, __configptr) { \
71 .vendor = TWINHAN_TECHNOLOGIES, \
72 .device = MANTIS, \
73 .subvendor = (__subven), \
74 .subdevice = (__subdev), \
75 .driver_data = (unsigned long) (__configptr) \
76}
77
78struct mantis_pci;
79
75struct mantis_hwconfig { 80struct mantis_hwconfig {
76 char *model_name; 81 char *model_name;
77 char *dev_type; 82 char *dev_type;
@@ -80,6 +85,12 @@ struct mantis_hwconfig {
80 enum mantis_baud baud_rate; 85 enum mantis_baud baud_rate;
81 enum mantis_parity parity; 86 enum mantis_parity parity;
82 u32 bytes; 87 u32 bytes;
88
89 irqreturn_t (*irq_handler)(int irq, void *dev_id);
90 int (*frontend_init)(struct mantis_pci *mantis, struct dvb_frontend *fe);
91
92 u8 power;
93 u8 reset;
83}; 94};
84 95
85struct mantis_pci { 96struct mantis_pci {
@@ -96,7 +107,7 @@ struct mantis_pci {
96 struct pci_dev *pdev; 107 struct pci_dev *pdev;
97 108
98 unsigned long mantis_addr; 109 unsigned long mantis_addr;
99 volatile void __iomem *mantis_mmio; 110 void __iomem *mmio;
100 111
101 u8 irq; 112 u8 irq;
102 u8 revision; 113 u8 revision;
@@ -156,19 +167,4 @@ struct mantis_pci {
156 167
157#define MANTIS_HIF_STATUS (mantis->gpio_status) 168#define MANTIS_HIF_STATUS (mantis->gpio_status)
158 169
159extern unsigned int verbose; 170#endif /* __MANTIS_COMMON_H */
160extern unsigned int devs;
161extern unsigned int i2c;
162extern int mantis_dvb_init(struct mantis_pci *mantis);
163extern int mantis_frontend_init(struct mantis_pci *mantis);
164extern int mantis_dvb_exit(struct mantis_pci *mantis);
165extern void mantis_dma_xfer(unsigned long data);
166extern void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value);
167
168extern void mantis_set_direction(struct mantis_pci *mantis, int direction);
169
170extern int mantis_ca_init(struct mantis_pci *mantis);
171extern void mantis_ca_exit(struct mantis_pci *mantis);
172
173
174#endif //__MANTIS_COMMON_H