aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/dvb/mantis
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/dvb/mantis')
-rw-r--r--drivers/media/dvb/mantis/Kconfig2
-rw-r--r--drivers/media/dvb/mantis/hopper_cards.c4
-rw-r--r--drivers/media/dvb/mantis/hopper_vp3028.c6
-rw-r--r--drivers/media/dvb/mantis/mantis_cards.c4
-rw-r--r--drivers/media/dvb/mantis/mantis_common.h4
-rw-r--r--drivers/media/dvb/mantis/mantis_core.c5
-rw-r--r--drivers/media/dvb/mantis/mantis_dvb.c17
-rw-r--r--drivers/media/dvb/mantis/mantis_evm.c2
-rw-r--r--drivers/media/dvb/mantis/mantis_i2c.c1
-rw-r--r--drivers/media/dvb/mantis/mantis_input.c76
-rw-r--r--drivers/media/dvb/mantis/mantis_ioc.c13
-rw-r--r--drivers/media/dvb/mantis/mantis_ioc.h2
-rw-r--r--drivers/media/dvb/mantis/mantis_pci.c6
-rw-r--r--drivers/media/dvb/mantis/mantis_uart.c3
-rw-r--r--drivers/media/dvb/mantis/mantis_vp1033.c4
-rw-r--r--drivers/media/dvb/mantis/mantis_vp1034.c10
-rw-r--r--drivers/media/dvb/mantis/mantis_vp1041.c6
-rw-r--r--drivers/media/dvb/mantis/mantis_vp2033.c4
-rw-r--r--drivers/media/dvb/mantis/mantis_vp2040.c4
-rw-r--r--drivers/media/dvb/mantis/mantis_vp3030.c8
20 files changed, 95 insertions, 86 deletions
diff --git a/drivers/media/dvb/mantis/Kconfig b/drivers/media/dvb/mantis/Kconfig
index fd0830ed10d8..a13a50503134 100644
--- a/drivers/media/dvb/mantis/Kconfig
+++ b/drivers/media/dvb/mantis/Kconfig
@@ -1,6 +1,6 @@
1config MANTIS_CORE 1config MANTIS_CORE
2 tristate "Mantis/Hopper PCI bridge based devices" 2 tristate "Mantis/Hopper PCI bridge based devices"
3 depends on PCI && I2C && INPUT && IR_CORE 3 depends on PCI && I2C && INPUT && RC_CORE
4 4
5 help 5 help
6 Support for PCI cards based on the Mantis and Hopper PCi bridge. 6 Support for PCI cards based on the Mantis and Hopper PCi bridge.
diff --git a/drivers/media/dvb/mantis/hopper_cards.c b/drivers/media/dvb/mantis/hopper_cards.c
index 09e9fc785189..1402062f2c89 100644
--- a/drivers/media/dvb/mantis/hopper_cards.c
+++ b/drivers/media/dvb/mantis/hopper_cards.c
@@ -44,7 +44,7 @@
44 44
45static unsigned int verbose; 45static unsigned int verbose;
46module_param(verbose, int, 0644); 46module_param(verbose, int, 0644);
47MODULE_PARM_DESC(verbose, "verbose startup messages, default is 1 (yes)"); 47MODULE_PARM_DESC(verbose, "verbose startup messages, default is 0 (no)");
48 48
49#define DRIVER_NAME "Hopper" 49#define DRIVER_NAME "Hopper"
50 50
@@ -251,6 +251,8 @@ static struct pci_device_id hopper_pci_table[] = {
251 { } 251 { }
252}; 252};
253 253
254MODULE_DEVICE_TABLE(pci, hopper_pci_table);
255
254static struct pci_driver hopper_pci_driver = { 256static struct pci_driver hopper_pci_driver = {
255 .name = DRIVER_NAME, 257 .name = DRIVER_NAME,
256 .id_table = hopper_pci_table, 258 .id_table = hopper_pci_table,
diff --git a/drivers/media/dvb/mantis/hopper_vp3028.c b/drivers/media/dvb/mantis/hopper_vp3028.c
index 96674c78e86b..68a29f8bdf73 100644
--- a/drivers/media/dvb/mantis/hopper_vp3028.c
+++ b/drivers/media/dvb/mantis/hopper_vp3028.c
@@ -47,17 +47,17 @@ static int vp3028_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *
47 struct mantis_hwconfig *config = mantis->hwconfig; 47 struct mantis_hwconfig *config = mantis->hwconfig;
48 int err = 0; 48 int err = 0;
49 49
50 gpio_set_bits(mantis, config->reset, 0); 50 mantis_gpio_set_bits(mantis, config->reset, 0);
51 msleep(100); 51 msleep(100);
52 err = mantis_frontend_power(mantis, POWER_ON); 52 err = mantis_frontend_power(mantis, POWER_ON);
53 msleep(100); 53 msleep(100);
54 gpio_set_bits(mantis, config->reset, 1); 54 mantis_gpio_set_bits(mantis, config->reset, 1);
55 55
56 err = mantis_frontend_power(mantis, POWER_ON); 56 err = mantis_frontend_power(mantis, POWER_ON);
57 if (err == 0) { 57 if (err == 0) {
58 msleep(250); 58 msleep(250);
59 dprintk(MANTIS_ERROR, 1, "Probing for 10353 (DVB-T)"); 59 dprintk(MANTIS_ERROR, 1, "Probing for 10353 (DVB-T)");
60 fe = zl10353_attach(&hopper_vp3028_config, adapter); 60 fe = dvb_attach(zl10353_attach, &hopper_vp3028_config, adapter);
61 61
62 if (!fe) 62 if (!fe)
63 return -1; 63 return -1;
diff --git a/drivers/media/dvb/mantis/mantis_cards.c b/drivers/media/dvb/mantis/mantis_cards.c
index cf4b39ffdaad..05cbb9d95727 100644
--- a/drivers/media/dvb/mantis/mantis_cards.c
+++ b/drivers/media/dvb/mantis/mantis_cards.c
@@ -52,7 +52,7 @@
52 52
53static unsigned int verbose; 53static unsigned int verbose;
54module_param(verbose, int, 0644); 54module_param(verbose, int, 0644);
55MODULE_PARM_DESC(verbose, "verbose startup messages, default is 1 (yes)"); 55MODULE_PARM_DESC(verbose, "verbose startup messages, default is 0 (no)");
56 56
57static int devs; 57static int devs;
58 58
@@ -281,6 +281,8 @@ static struct pci_device_id mantis_pci_table[] = {
281 { } 281 { }
282}; 282};
283 283
284MODULE_DEVICE_TABLE(pci, mantis_pci_table);
285
284static struct pci_driver mantis_pci_driver = { 286static struct pci_driver mantis_pci_driver = {
285 .name = DRIVER_NAME, 287 .name = DRIVER_NAME,
286 .id_table = mantis_pci_table, 288 .id_table = mantis_pci_table,
diff --git a/drivers/media/dvb/mantis/mantis_common.h b/drivers/media/dvb/mantis/mantis_common.h
index d0b645a483c9..bd400d21b81f 100644
--- a/drivers/media/dvb/mantis/mantis_common.h
+++ b/drivers/media/dvb/mantis/mantis_common.h
@@ -171,7 +171,9 @@ struct mantis_pci {
171 struct work_struct uart_work; 171 struct work_struct uart_work;
172 spinlock_t uart_lock; 172 spinlock_t uart_lock;
173 173
174 struct input_dev *rc; 174 struct rc_dev *rc;
175 char input_name[80];
176 char input_phys[80];
175}; 177};
176 178
177#define MANTIS_HIF_STATUS (mantis->gpio_status) 179#define MANTIS_HIF_STATUS (mantis->gpio_status)
diff --git a/drivers/media/dvb/mantis/mantis_core.c b/drivers/media/dvb/mantis/mantis_core.c
index 8113b23ce448..22524a8e6f61 100644
--- a/drivers/media/dvb/mantis/mantis_core.c
+++ b/drivers/media/dvb/mantis/mantis_core.c
@@ -91,10 +91,7 @@ static int get_mac_address(struct mantis_pci *mantis)
91 return err; 91 return err;
92 } 92 }
93 dprintk(verbose, MANTIS_ERROR, 0, 93 dprintk(verbose, MANTIS_ERROR, 0,
94 " MAC Address=[%02x:%02x:%02x:%02x:%02x:%02x]\n", 94 " MAC Address=[%pM]\n", mantis->mac_address);
95 mantis->mac_address[0], mantis->mac_address[1],
96 mantis->mac_address[2], mantis->mac_address[3],
97 mantis->mac_address[4], mantis->mac_address[5]);
98 95
99 return 0; 96 return 0;
100} 97}
diff --git a/drivers/media/dvb/mantis/mantis_dvb.c b/drivers/media/dvb/mantis/mantis_dvb.c
index 99d82eec3b03..e5180e45d310 100644
--- a/drivers/media/dvb/mantis/mantis_dvb.c
+++ b/drivers/media/dvb/mantis/mantis_dvb.c
@@ -47,15 +47,15 @@ int mantis_frontend_power(struct mantis_pci *mantis, enum mantis_power power)
47 switch (power) { 47 switch (power) {
48 case POWER_ON: 48 case POWER_ON:
49 dprintk(MANTIS_DEBUG, 1, "Power ON"); 49 dprintk(MANTIS_DEBUG, 1, "Power ON");
50 gpio_set_bits(mantis, config->power, POWER_ON); 50 mantis_gpio_set_bits(mantis, config->power, POWER_ON);
51 msleep(100); 51 msleep(100);
52 gpio_set_bits(mantis, config->power, POWER_ON); 52 mantis_gpio_set_bits(mantis, config->power, POWER_ON);
53 msleep(100); 53 msleep(100);
54 break; 54 break;
55 55
56 case POWER_OFF: 56 case POWER_OFF:
57 dprintk(MANTIS_DEBUG, 1, "Power OFF"); 57 dprintk(MANTIS_DEBUG, 1, "Power OFF");
58 gpio_set_bits(mantis, config->power, POWER_OFF); 58 mantis_gpio_set_bits(mantis, config->power, POWER_OFF);
59 msleep(100); 59 msleep(100);
60 break; 60 break;
61 61
@@ -73,13 +73,13 @@ void mantis_frontend_soft_reset(struct mantis_pci *mantis)
73 struct mantis_hwconfig *config = mantis->hwconfig; 73 struct mantis_hwconfig *config = mantis->hwconfig;
74 74
75 dprintk(MANTIS_DEBUG, 1, "Frontend RESET"); 75 dprintk(MANTIS_DEBUG, 1, "Frontend RESET");
76 gpio_set_bits(mantis, config->reset, 0); 76 mantis_gpio_set_bits(mantis, config->reset, 0);
77 msleep(100); 77 msleep(100);
78 gpio_set_bits(mantis, config->reset, 0); 78 mantis_gpio_set_bits(mantis, config->reset, 0);
79 msleep(100); 79 msleep(100);
80 gpio_set_bits(mantis, config->reset, 1); 80 mantis_gpio_set_bits(mantis, config->reset, 1);
81 msleep(100); 81 msleep(100);
82 gpio_set_bits(mantis, config->reset, 1); 82 mantis_gpio_set_bits(mantis, config->reset, 1);
83 msleep(100); 83 msleep(100);
84 84
85 return; 85 return;
@@ -117,6 +117,7 @@ static int mantis_dvb_start_feed(struct dvb_demux_feed *dvbdmxfeed)
117 if (mantis->feeds == 1) { 117 if (mantis->feeds == 1) {
118 dprintk(MANTIS_DEBUG, 1, "mantis start feed & dma"); 118 dprintk(MANTIS_DEBUG, 1, "mantis start feed & dma");
119 mantis_dma_start(mantis); 119 mantis_dma_start(mantis);
120 tasklet_enable(&mantis->tasklet);
120 } 121 }
121 122
122 return mantis->feeds; 123 return mantis->feeds;
@@ -136,6 +137,7 @@ static int mantis_dvb_stop_feed(struct dvb_demux_feed *dvbdmxfeed)
136 mantis->feeds--; 137 mantis->feeds--;
137 if (mantis->feeds == 0) { 138 if (mantis->feeds == 0) {
138 dprintk(MANTIS_DEBUG, 1, "mantis stop feed and dma"); 139 dprintk(MANTIS_DEBUG, 1, "mantis stop feed and dma");
140 tasklet_disable(&mantis->tasklet);
139 mantis_dma_stop(mantis); 141 mantis_dma_stop(mantis);
140 } 142 }
141 143
@@ -216,6 +218,7 @@ int __devinit mantis_dvb_init(struct mantis_pci *mantis)
216 218
217 dvb_net_init(&mantis->dvb_adapter, &mantis->dvbnet, &mantis->demux.dmx); 219 dvb_net_init(&mantis->dvb_adapter, &mantis->dvbnet, &mantis->demux.dmx);
218 tasklet_init(&mantis->tasklet, mantis_dma_xfer, (unsigned long) mantis); 220 tasklet_init(&mantis->tasklet, mantis_dma_xfer, (unsigned long) mantis);
221 tasklet_disable(&mantis->tasklet);
219 if (mantis->hwconfig) { 222 if (mantis->hwconfig) {
220 result = config->frontend_init(mantis, mantis->fe); 223 result = config->frontend_init(mantis, mantis->fe);
221 if (result < 0) { 224 if (result < 0) {
diff --git a/drivers/media/dvb/mantis/mantis_evm.c b/drivers/media/dvb/mantis/mantis_evm.c
index a7b369a439d6..9f73c2cfc9ea 100644
--- a/drivers/media/dvb/mantis/mantis_evm.c
+++ b/drivers/media/dvb/mantis/mantis_evm.c
@@ -111,7 +111,7 @@ void mantis_evmgr_exit(struct mantis_ca *ca)
111 struct mantis_pci *mantis = ca->ca_priv; 111 struct mantis_pci *mantis = ca->ca_priv;
112 112
113 dprintk(MANTIS_DEBUG, 1, "Mantis Host I/F Event manager exiting"); 113 dprintk(MANTIS_DEBUG, 1, "Mantis Host I/F Event manager exiting");
114 flush_scheduled_work(); 114 flush_work_sync(&ca->hif_evm_work);
115 mantis_hif_exit(ca); 115 mantis_hif_exit(ca);
116 mantis_pcmcia_exit(ca); 116 mantis_pcmcia_exit(ca);
117} 117}
diff --git a/drivers/media/dvb/mantis/mantis_i2c.c b/drivers/media/dvb/mantis/mantis_i2c.c
index 7870bcf9689a..e7794517fe26 100644
--- a/drivers/media/dvb/mantis/mantis_i2c.c
+++ b/drivers/media/dvb/mantis/mantis_i2c.c
@@ -229,7 +229,6 @@ int __devinit mantis_i2c_init(struct mantis_pci *mantis)
229 i2c_set_adapdata(i2c_adapter, mantis); 229 i2c_set_adapdata(i2c_adapter, mantis);
230 230
231 i2c_adapter->owner = THIS_MODULE; 231 i2c_adapter->owner = THIS_MODULE;
232 i2c_adapter->class = I2C_CLASS_TV_DIGITAL;
233 i2c_adapter->algo = &mantis_algo; 232 i2c_adapter->algo = &mantis_algo;
234 i2c_adapter->algo_data = NULL; 233 i2c_adapter->algo_data = NULL;
235 i2c_adapter->timeout = 500; 234 i2c_adapter->timeout = 500;
diff --git a/drivers/media/dvb/mantis/mantis_input.c b/drivers/media/dvb/mantis/mantis_input.c
index a99489b8418b..db6d54d3fec0 100644
--- a/drivers/media/dvb/mantis/mantis_input.c
+++ b/drivers/media/dvb/mantis/mantis_input.c
@@ -18,8 +18,7 @@
18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 18 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19*/ 19*/
20 20
21#include <linux/input.h> 21#include <media/rc-core.h>
22#include <media/ir-core.h>
23#include <linux/pci.h> 22#include <linux/pci.h>
24 23
25#include "dmxdev.h" 24#include "dmxdev.h"
@@ -33,8 +32,9 @@
33#include "mantis_uart.h" 32#include "mantis_uart.h"
34 33
35#define MODULE_NAME "mantis_core" 34#define MODULE_NAME "mantis_core"
35#define RC_MAP_MANTIS "rc-mantis"
36 36
37static struct ir_scancode mantis_ir_table[] = { 37static struct rc_map_table mantis_ir_table[] = {
38 { 0x29, KEY_POWER }, 38 { 0x29, KEY_POWER },
39 { 0x28, KEY_FAVORITES }, 39 { 0x28, KEY_FAVORITES },
40 { 0x30, KEY_TEXT }, 40 { 0x30, KEY_TEXT },
@@ -95,53 +95,65 @@ static struct ir_scancode mantis_ir_table[] = {
95 { 0x00, KEY_BLUE }, 95 { 0x00, KEY_BLUE },
96}; 96};
97 97
98struct ir_scancode_table ir_mantis = { 98static struct rc_map_list ir_mantis_map = {
99 .scan = mantis_ir_table, 99 .map = {
100 .size = ARRAY_SIZE(mantis_ir_table), 100 .scan = mantis_ir_table,
101 .size = ARRAY_SIZE(mantis_ir_table),
102 .rc_type = RC_TYPE_UNKNOWN,
103 .name = RC_MAP_MANTIS,
104 }
101}; 105};
102EXPORT_SYMBOL_GPL(ir_mantis);
103 106
104int mantis_input_init(struct mantis_pci *mantis) 107int mantis_input_init(struct mantis_pci *mantis)
105{ 108{
106 struct input_dev *rc; 109 struct rc_dev *dev;
107 char name[80], dev[80];
108 int err; 110 int err;
109 111
110 rc = input_allocate_device(); 112 err = rc_map_register(&ir_mantis_map);
111 if (!rc) { 113 if (err)
112 dprintk(MANTIS_ERROR, 1, "Input device allocate failed"); 114 goto out;
113 return -ENOMEM;
114 }
115 115
116 sprintf(name, "Mantis %s IR receiver", mantis->hwconfig->model_name); 116 dev = rc_allocate_device();
117 sprintf(dev, "pci-%s/ir0", pci_name(mantis->pdev)); 117 if (!dev) {
118 dprintk(MANTIS_ERROR, 1, "Remote device allocation failed");
119 err = -ENOMEM;
120 goto out_map;
121 }
118 122
119 rc->name = name; 123 sprintf(mantis->input_name, "Mantis %s IR receiver", mantis->hwconfig->model_name);
120 rc->phys = dev; 124 sprintf(mantis->input_phys, "pci-%s/ir0", pci_name(mantis->pdev));
121 125
122 rc->id.bustype = BUS_PCI; 126 dev->input_name = mantis->input_name;
123 rc->id.vendor = mantis->vendor_id; 127 dev->input_phys = mantis->input_phys;
124 rc->id.product = mantis->device_id; 128 dev->input_id.bustype = BUS_PCI;
125 rc->id.version = 1; 129 dev->input_id.vendor = mantis->vendor_id;
126 rc->dev = mantis->pdev->dev; 130 dev->input_id.product = mantis->device_id;
131 dev->input_id.version = 1;
132 dev->driver_name = MODULE_NAME;
133 dev->map_name = RC_MAP_MANTIS;
134 dev->dev.parent = &mantis->pdev->dev;
127 135
128 err = __ir_input_register(rc, &ir_mantis, NULL, MODULE_NAME); 136 err = rc_register_device(dev);
129 if (err) { 137 if (err) {
130 dprintk(MANTIS_ERROR, 1, "IR device registration failed, ret = %d", err); 138 dprintk(MANTIS_ERROR, 1, "IR device registration failed, ret = %d", err);
131 input_free_device(rc); 139 goto out_dev;
132 return -ENODEV;
133 } 140 }
134 141
135 mantis->rc = rc; 142 mantis->rc = dev;
136
137 return 0; 143 return 0;
144
145out_dev:
146 rc_free_device(dev);
147out_map:
148 rc_map_unregister(&ir_mantis_map);
149out:
150 return err;
138} 151}
139 152
140int mantis_exit(struct mantis_pci *mantis) 153int mantis_exit(struct mantis_pci *mantis)
141{ 154{
142 struct input_dev *rc = mantis->rc; 155 rc_unregister_device(mantis->rc);
143 156 rc_map_unregister(&ir_mantis_map);
144 ir_input_unregister(rc);
145
146 return 0; 157 return 0;
147} 158}
159
diff --git a/drivers/media/dvb/mantis/mantis_ioc.c b/drivers/media/dvb/mantis/mantis_ioc.c
index de148ded52d8..479086dbb9a8 100644
--- a/drivers/media/dvb/mantis/mantis_ioc.c
+++ b/drivers/media/dvb/mantis/mantis_ioc.c
@@ -68,21 +68,14 @@ int mantis_get_mac(struct mantis_pci *mantis)
68 return err; 68 return err;
69 } 69 }
70 70
71 dprintk(MANTIS_ERROR, 0, 71 dprintk(MANTIS_ERROR, 0, " MAC Address=[%pM]\n", mac_addr);
72 " MAC Address=[%02x:%02x:%02x:%02x:%02x:%02x]\n",
73 mac_addr[0],
74 mac_addr[1],
75 mac_addr[2],
76 mac_addr[3],
77 mac_addr[4],
78 mac_addr[5]);
79 72
80 return 0; 73 return 0;
81} 74}
82EXPORT_SYMBOL_GPL(mantis_get_mac); 75EXPORT_SYMBOL_GPL(mantis_get_mac);
83 76
84/* Turn the given bit on or off. */ 77/* Turn the given bit on or off. */
85void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value) 78void mantis_gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value)
86{ 79{
87 u32 cur; 80 u32 cur;
88 81
@@ -97,7 +90,7 @@ void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value)
97 mmwrite(mantis->gpio_status, MANTIS_GPIF_ADDR); 90 mmwrite(mantis->gpio_status, MANTIS_GPIF_ADDR);
98 mmwrite(0x00, MANTIS_GPIF_DOUT); 91 mmwrite(0x00, MANTIS_GPIF_DOUT);
99} 92}
100EXPORT_SYMBOL_GPL(gpio_set_bits); 93EXPORT_SYMBOL_GPL(mantis_gpio_set_bits);
101 94
102int mantis_stream_control(struct mantis_pci *mantis, enum mantis_stream_control stream_ctl) 95int mantis_stream_control(struct mantis_pci *mantis, enum mantis_stream_control stream_ctl)
103{ 96{
diff --git a/drivers/media/dvb/mantis/mantis_ioc.h b/drivers/media/dvb/mantis/mantis_ioc.h
index 188fe5a81614..d56e002b2955 100644
--- a/drivers/media/dvb/mantis/mantis_ioc.h
+++ b/drivers/media/dvb/mantis/mantis_ioc.h
@@ -44,7 +44,7 @@ enum mantis_stream_control {
44}; 44};
45 45
46extern int mantis_get_mac(struct mantis_pci *mantis); 46extern int mantis_get_mac(struct mantis_pci *mantis);
47extern void gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value); 47extern void mantis_gpio_set_bits(struct mantis_pci *mantis, u32 bitpos, u8 value);
48 48
49extern int mantis_stream_control(struct mantis_pci *mantis, enum mantis_stream_control stream_ctl); 49extern int mantis_stream_control(struct mantis_pci *mantis, enum mantis_stream_control stream_ctl);
50 50
diff --git a/drivers/media/dvb/mantis/mantis_pci.c b/drivers/media/dvb/mantis/mantis_pci.c
index 59feeb84aec7..371558af2d96 100644
--- a/drivers/media/dvb/mantis/mantis_pci.c
+++ b/drivers/media/dvb/mantis/mantis_pci.c
@@ -22,7 +22,6 @@
22#include <linux/moduleparam.h> 22#include <linux/moduleparam.h>
23#include <linux/kernel.h> 23#include <linux/kernel.h>
24#include <asm/io.h> 24#include <asm/io.h>
25#include <asm/pgtable.h>
26#include <asm/page.h> 25#include <asm/page.h>
27#include <linux/kmod.h> 26#include <linux/kmod.h>
28#include <linux/vmalloc.h> 27#include <linux/vmalloc.h>
@@ -49,7 +48,7 @@
49 48
50int __devinit mantis_pci_init(struct mantis_pci *mantis) 49int __devinit mantis_pci_init(struct mantis_pci *mantis)
51{ 50{
52 u8 revision, latency; 51 u8 latency;
53 struct mantis_hwconfig *config = mantis->hwconfig; 52 struct mantis_hwconfig *config = mantis->hwconfig;
54 struct pci_dev *pdev = mantis->pdev; 53 struct pci_dev *pdev = mantis->pdev;
55 int err, ret = 0; 54 int err, ret = 0;
@@ -96,9 +95,8 @@ int __devinit mantis_pci_init(struct mantis_pci *mantis)
96 } 95 }
97 96
98 pci_read_config_byte(pdev, PCI_LATENCY_TIMER, &latency); 97 pci_read_config_byte(pdev, PCI_LATENCY_TIMER, &latency);
99 pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision);
100 mantis->latency = latency; 98 mantis->latency = latency;
101 mantis->revision = revision; 99 mantis->revision = pdev->revision;
102 100
103 dprintk(MANTIS_ERROR, 0, " Mantis Rev %d [%04x:%04x], ", 101 dprintk(MANTIS_ERROR, 0, " Mantis Rev %d [%04x:%04x], ",
104 mantis->revision, 102 mantis->revision,
diff --git a/drivers/media/dvb/mantis/mantis_uart.c b/drivers/media/dvb/mantis/mantis_uart.c
index 7d2f2398fa8b..f807c8ba26e4 100644
--- a/drivers/media/dvb/mantis/mantis_uart.c
+++ b/drivers/media/dvb/mantis/mantis_uart.c
@@ -172,7 +172,7 @@ int mantis_uart_init(struct mantis_pci *mantis)
172 mmwrite(mmread(MANTIS_UART_CTL) | MANTIS_UART_RXINT, MANTIS_UART_CTL); 172 mmwrite(mmread(MANTIS_UART_CTL) | MANTIS_UART_RXINT, MANTIS_UART_CTL);
173 173
174 schedule_work(&mantis->uart_work); 174 schedule_work(&mantis->uart_work);
175 dprintk(MANTIS_DEBUG, 1, "UART succesfully initialized"); 175 dprintk(MANTIS_DEBUG, 1, "UART successfully initialized");
176 176
177 return 0; 177 return 0;
178} 178}
@@ -182,5 +182,6 @@ void mantis_uart_exit(struct mantis_pci *mantis)
182{ 182{
183 /* disable interrupt */ 183 /* disable interrupt */
184 mmwrite(mmread(MANTIS_UART_CTL) & 0xffef, MANTIS_UART_CTL); 184 mmwrite(mmread(MANTIS_UART_CTL) & 0xffef, MANTIS_UART_CTL);
185 flush_work_sync(&mantis->uart_work);
185} 186}
186EXPORT_SYMBOL_GPL(mantis_uart_exit); 187EXPORT_SYMBOL_GPL(mantis_uart_exit);
diff --git a/drivers/media/dvb/mantis/mantis_vp1033.c b/drivers/media/dvb/mantis/mantis_vp1033.c
index 4a723bda0031..2ae0afa7756b 100644
--- a/drivers/media/dvb/mantis/mantis_vp1033.c
+++ b/drivers/media/dvb/mantis/mantis_vp1033.c
@@ -37,7 +37,7 @@
37 37
38u8 lgtdqcs001f_inittab[] = { 38u8 lgtdqcs001f_inittab[] = {
39 0x01, 0x15, 39 0x01, 0x15,
40 0x02, 0x00, 40 0x02, 0x30,
41 0x03, 0x00, 41 0x03, 0x00,
42 0x04, 0x2a, 42 0x04, 0x2a,
43 0x05, 0x85, 43 0x05, 0x85,
@@ -173,7 +173,7 @@ static int vp1033_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *
173 msleep(250); 173 msleep(250);
174 174
175 dprintk(MANTIS_ERROR, 1, "Probing for STV0299 (DVB-S)"); 175 dprintk(MANTIS_ERROR, 1, "Probing for STV0299 (DVB-S)");
176 fe = stv0299_attach(&lgtdqcs001f_config, adapter); 176 fe = dvb_attach(stv0299_attach, &lgtdqcs001f_config, adapter);
177 177
178 if (fe) { 178 if (fe) {
179 fe->ops.tuner_ops.set_params = lgtdqcs001f_tuner_set; 179 fe->ops.tuner_ops.set_params = lgtdqcs001f_tuner_set;
diff --git a/drivers/media/dvb/mantis/mantis_vp1034.c b/drivers/media/dvb/mantis/mantis_vp1034.c
index 8e6ae558ee57..26bc0cbe84d4 100644
--- a/drivers/media/dvb/mantis/mantis_vp1034.c
+++ b/drivers/media/dvb/mantis/mantis_vp1034.c
@@ -50,13 +50,13 @@ int vp1034_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
50 switch (voltage) { 50 switch (voltage) {
51 case SEC_VOLTAGE_13: 51 case SEC_VOLTAGE_13:
52 dprintk(MANTIS_ERROR, 1, "Polarization=[13V]"); 52 dprintk(MANTIS_ERROR, 1, "Polarization=[13V]");
53 gpio_set_bits(mantis, 13, 1); 53 mantis_gpio_set_bits(mantis, 13, 1);
54 gpio_set_bits(mantis, 14, 0); 54 mantis_gpio_set_bits(mantis, 14, 0);
55 break; 55 break;
56 case SEC_VOLTAGE_18: 56 case SEC_VOLTAGE_18:
57 dprintk(MANTIS_ERROR, 1, "Polarization=[18V]"); 57 dprintk(MANTIS_ERROR, 1, "Polarization=[18V]");
58 gpio_set_bits(mantis, 13, 1); 58 mantis_gpio_set_bits(mantis, 13, 1);
59 gpio_set_bits(mantis, 14, 1); 59 mantis_gpio_set_bits(mantis, 14, 1);
60 break; 60 break;
61 case SEC_VOLTAGE_OFF: 61 case SEC_VOLTAGE_OFF:
62 dprintk(MANTIS_ERROR, 1, "Frontend (dummy) POWERDOWN"); 62 dprintk(MANTIS_ERROR, 1, "Frontend (dummy) POWERDOWN");
@@ -82,7 +82,7 @@ static int vp1034_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *
82 msleep(250); 82 msleep(250);
83 83
84 dprintk(MANTIS_ERROR, 1, "Probing for MB86A16 (DVB-S/DSS)"); 84 dprintk(MANTIS_ERROR, 1, "Probing for MB86A16 (DVB-S/DSS)");
85 fe = mb86a16_attach(&vp1034_mb86a16_config, adapter); 85 fe = dvb_attach(mb86a16_attach, &vp1034_mb86a16_config, adapter);
86 if (fe) { 86 if (fe) {
87 dprintk(MANTIS_ERROR, 1, 87 dprintk(MANTIS_ERROR, 1,
88 "found MB86A16 DVB-S/DSS frontend @0x%02x", 88 "found MB86A16 DVB-S/DSS frontend @0x%02x",
diff --git a/drivers/media/dvb/mantis/mantis_vp1041.c b/drivers/media/dvb/mantis/mantis_vp1041.c
index d1aa2bc0c155..38a436ca2fdf 100644
--- a/drivers/media/dvb/mantis/mantis_vp1041.c
+++ b/drivers/media/dvb/mantis/mantis_vp1041.c
@@ -316,14 +316,14 @@ static int vp1041_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *
316 if (err == 0) { 316 if (err == 0) {
317 mantis_frontend_soft_reset(mantis); 317 mantis_frontend_soft_reset(mantis);
318 msleep(250); 318 msleep(250);
319 mantis->fe = stb0899_attach(&vp1041_stb0899_config, adapter); 319 mantis->fe = dvb_attach(stb0899_attach, &vp1041_stb0899_config, adapter);
320 if (mantis->fe) { 320 if (mantis->fe) {
321 dprintk(MANTIS_ERROR, 1, 321 dprintk(MANTIS_ERROR, 1,
322 "found STB0899 DVB-S/DVB-S2 frontend @0x%02x", 322 "found STB0899 DVB-S/DVB-S2 frontend @0x%02x",
323 vp1041_stb0899_config.demod_address); 323 vp1041_stb0899_config.demod_address);
324 324
325 if (stb6100_attach(mantis->fe, &vp1041_stb6100_config, adapter)) { 325 if (dvb_attach(stb6100_attach, mantis->fe, &vp1041_stb6100_config, adapter)) {
326 if (!lnbp21_attach(mantis->fe, adapter, 0, 0)) 326 if (!dvb_attach(lnbp21_attach, mantis->fe, adapter, 0, 0))
327 dprintk(MANTIS_ERROR, 1, "No LNBP21 found!"); 327 dprintk(MANTIS_ERROR, 1, "No LNBP21 found!");
328 } 328 }
329 } else { 329 } else {
diff --git a/drivers/media/dvb/mantis/mantis_vp2033.c b/drivers/media/dvb/mantis/mantis_vp2033.c
index 10ce81790a8c..06da0ddf05a7 100644
--- a/drivers/media/dvb/mantis/mantis_vp2033.c
+++ b/drivers/media/dvb/mantis/mantis_vp2033.c
@@ -132,7 +132,7 @@ static int vp2033_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *
132 msleep(250); 132 msleep(250);
133 133
134 dprintk(MANTIS_ERROR, 1, "Probing for CU1216 (DVB-C)"); 134 dprintk(MANTIS_ERROR, 1, "Probing for CU1216 (DVB-C)");
135 fe = tda10021_attach(&vp2033_tda1002x_cu1216_config, 135 fe = dvb_attach(tda10021_attach, &vp2033_tda1002x_cu1216_config,
136 adapter, 136 adapter,
137 read_pwm(mantis)); 137 read_pwm(mantis));
138 138
@@ -141,7 +141,7 @@ static int vp2033_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *
141 "found Philips CU1216 DVB-C frontend (TDA10021) @ 0x%02x", 141 "found Philips CU1216 DVB-C frontend (TDA10021) @ 0x%02x",
142 vp2033_tda1002x_cu1216_config.demod_address); 142 vp2033_tda1002x_cu1216_config.demod_address);
143 } else { 143 } else {
144 fe = tda10023_attach(&vp2033_tda10023_cu1216_config, 144 fe = dvb_attach(tda10023_attach, &vp2033_tda10023_cu1216_config,
145 adapter, 145 adapter,
146 read_pwm(mantis)); 146 read_pwm(mantis));
147 147
diff --git a/drivers/media/dvb/mantis/mantis_vp2040.c b/drivers/media/dvb/mantis/mantis_vp2040.c
index a7ca233e800b..f72b137b7652 100644
--- a/drivers/media/dvb/mantis/mantis_vp2040.c
+++ b/drivers/media/dvb/mantis/mantis_vp2040.c
@@ -132,7 +132,7 @@ static int vp2040_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *
132 msleep(250); 132 msleep(250);
133 133
134 dprintk(MANTIS_ERROR, 1, "Probing for CU1216 (DVB-C)"); 134 dprintk(MANTIS_ERROR, 1, "Probing for CU1216 (DVB-C)");
135 fe = tda10021_attach(&vp2040_tda1002x_cu1216_config, 135 fe = dvb_attach(tda10021_attach, &vp2040_tda1002x_cu1216_config,
136 adapter, 136 adapter,
137 read_pwm(mantis)); 137 read_pwm(mantis));
138 138
@@ -141,7 +141,7 @@ static int vp2040_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *
141 "found Philips CU1216 DVB-C frontend (TDA10021) @ 0x%02x", 141 "found Philips CU1216 DVB-C frontend (TDA10021) @ 0x%02x",
142 vp2040_tda1002x_cu1216_config.demod_address); 142 vp2040_tda1002x_cu1216_config.demod_address);
143 } else { 143 } else {
144 fe = tda10023_attach(&vp2040_tda10023_cu1216_config, 144 fe = dvb_attach(tda10023_attach, &vp2040_tda10023_cu1216_config,
145 adapter, 145 adapter,
146 read_pwm(mantis)); 146 read_pwm(mantis));
147 147
diff --git a/drivers/media/dvb/mantis/mantis_vp3030.c b/drivers/media/dvb/mantis/mantis_vp3030.c
index 1f4334214953..c09308cd3ac6 100644
--- a/drivers/media/dvb/mantis/mantis_vp3030.c
+++ b/drivers/media/dvb/mantis/mantis_vp3030.c
@@ -59,21 +59,21 @@ static int vp3030_frontend_init(struct mantis_pci *mantis, struct dvb_frontend *
59 struct mantis_hwconfig *config = mantis->hwconfig; 59 struct mantis_hwconfig *config = mantis->hwconfig;
60 int err = 0; 60 int err = 0;
61 61
62 gpio_set_bits(mantis, config->reset, 0); 62 mantis_gpio_set_bits(mantis, config->reset, 0);
63 msleep(100); 63 msleep(100);
64 err = mantis_frontend_power(mantis, POWER_ON); 64 err = mantis_frontend_power(mantis, POWER_ON);
65 msleep(100); 65 msleep(100);
66 gpio_set_bits(mantis, config->reset, 1); 66 mantis_gpio_set_bits(mantis, config->reset, 1);
67 67
68 if (err == 0) { 68 if (err == 0) {
69 msleep(250); 69 msleep(250);
70 dprintk(MANTIS_ERROR, 1, "Probing for 10353 (DVB-T)"); 70 dprintk(MANTIS_ERROR, 1, "Probing for 10353 (DVB-T)");
71 fe = zl10353_attach(&mantis_vp3030_config, adapter); 71 fe = dvb_attach(zl10353_attach, &mantis_vp3030_config, adapter);
72 72
73 if (!fe) 73 if (!fe)
74 return -1; 74 return -1;
75 75
76 tda665x_attach(fe, &env57h12d5_config, adapter); 76 dvb_attach(tda665x_attach, fe, &env57h12d5_config, adapter);
77 } else { 77 } else {
78 dprintk(MANTIS_ERROR, 1, "Frontend on <%s> POWER ON failed! <%d>", 78 dprintk(MANTIS_ERROR, 1, "Frontend on <%s> POWER ON failed! <%d>",
79 adapter->name, 79 adapter->name,