Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 2 | * |
| 3 | * device driver for Conexant 2388x based TV cards |
| 4 | * MPEG Transport Stream (DVB) routines |
| 5 | * |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 6 | * (c) 2004, 2005 Chris Pascoe <c.pascoe@itee.uq.edu.au> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 7 | * (c) 2004 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License as published by |
| 11 | * the Free Software Foundation; either version 2 of the License, or |
| 12 | * (at your option) any later version. |
| 13 | * |
| 14 | * This program is distributed in the hope that it will be useful, |
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 17 | * GNU General Public License for more details. |
| 18 | * |
| 19 | * You should have received a copy of the GNU General Public License |
| 20 | * along with this program; if not, write to the Free Software |
| 21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 22 | */ |
| 23 | |
| 24 | #include <linux/module.h> |
| 25 | #include <linux/init.h> |
| 26 | #include <linux/device.h> |
| 27 | #include <linux/fs.h> |
| 28 | #include <linux/kthread.h> |
| 29 | #include <linux/file.h> |
| 30 | #include <linux/suspend.h> |
| 31 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | #include "cx88.h" |
| 33 | #include "dvb-pll.h" |
Michael Krufky | 5e453dc | 2006-01-09 15:32:31 -0200 | [diff] [blame] | 34 | #include <media/v4l2-common.h> |
Mauro Carvalho Chehab | 41ef7c1 | 2005-07-12 13:58:44 -0700 | [diff] [blame] | 35 | |
Andrew de Quincey | 1f10c7a | 2006-08-08 09:10:09 -0300 | [diff] [blame] | 36 | #include "mt352.h" |
| 37 | #include "mt352_priv.h" |
Trent Piepho | ecf854d | 2007-05-05 20:11:32 -0300 | [diff] [blame^] | 38 | #include "cx88-vp3054-i2c.h" |
Andrew de Quincey | 1f10c7a | 2006-08-08 09:10:09 -0300 | [diff] [blame] | 39 | #include "zl10353.h" |
| 40 | #include "cx22702.h" |
| 41 | #include "or51132.h" |
| 42 | #include "lgdt330x.h" |
Andrew de Quincey | 1f10c7a | 2006-08-08 09:10:09 -0300 | [diff] [blame] | 43 | #include "nxt200x.h" |
| 44 | #include "cx24123.h" |
Andrew de Quincey | cd20ca9 | 2006-05-12 20:31:51 -0300 | [diff] [blame] | 45 | #include "isl6421.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 46 | |
| 47 | MODULE_DESCRIPTION("driver for cx2388x based DVB cards"); |
| 48 | MODULE_AUTHOR("Chris Pascoe <c.pascoe@itee.uq.edu.au>"); |
| 49 | MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); |
| 50 | MODULE_LICENSE("GPL"); |
| 51 | |
| 52 | static unsigned int debug = 0; |
| 53 | module_param(debug, int, 0644); |
| 54 | MODULE_PARM_DESC(debug,"enable debug messages [dvb]"); |
| 55 | |
| 56 | #define dprintk(level,fmt, arg...) if (debug >= level) \ |
Steven Toth | 6c5be74 | 2006-12-02 21:15:51 -0200 | [diff] [blame] | 57 | printk(KERN_DEBUG "%s/2-dvb: " fmt, core->name, ## arg) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | |
| 59 | /* ------------------------------------------------------------------ */ |
| 60 | |
| 61 | static int dvb_buf_setup(struct videobuf_queue *q, |
| 62 | unsigned int *count, unsigned int *size) |
| 63 | { |
| 64 | struct cx8802_dev *dev = q->priv_data; |
| 65 | |
| 66 | dev->ts_packet_size = 188 * 4; |
| 67 | dev->ts_packet_count = 32; |
| 68 | |
| 69 | *size = dev->ts_packet_size * dev->ts_packet_count; |
| 70 | *count = 32; |
| 71 | return 0; |
| 72 | } |
| 73 | |
Michael Krufky | 4a39055 | 2006-12-05 02:00:53 -0300 | [diff] [blame] | 74 | static int dvb_buf_prepare(struct videobuf_queue *q, |
| 75 | struct videobuf_buffer *vb, enum v4l2_field field) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 76 | { |
| 77 | struct cx8802_dev *dev = q->priv_data; |
Mauro Carvalho Chehab | c7b0ac0 | 2006-03-10 12:29:15 -0300 | [diff] [blame] | 78 | return cx8802_buf_prepare(q, dev, (struct cx88_buffer*)vb,field); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 79 | } |
| 80 | |
| 81 | static void dvb_buf_queue(struct videobuf_queue *q, struct videobuf_buffer *vb) |
| 82 | { |
| 83 | struct cx8802_dev *dev = q->priv_data; |
| 84 | cx8802_buf_queue(dev, (struct cx88_buffer*)vb); |
| 85 | } |
| 86 | |
Michael Krufky | 4a39055 | 2006-12-05 02:00:53 -0300 | [diff] [blame] | 87 | static void dvb_buf_release(struct videobuf_queue *q, |
| 88 | struct videobuf_buffer *vb) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 89 | { |
Mauro Carvalho Chehab | c7b0ac0 | 2006-03-10 12:29:15 -0300 | [diff] [blame] | 90 | cx88_free_buffer(q, (struct cx88_buffer*)vb); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 91 | } |
| 92 | |
Adrian Bunk | 408b664 | 2005-05-01 08:59:29 -0700 | [diff] [blame] | 93 | static struct videobuf_queue_ops dvb_qops = { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 94 | .buf_setup = dvb_buf_setup, |
| 95 | .buf_prepare = dvb_buf_prepare, |
| 96 | .buf_queue = dvb_buf_queue, |
| 97 | .buf_release = dvb_buf_release, |
| 98 | }; |
| 99 | |
| 100 | /* ------------------------------------------------------------------ */ |
Michael Krufky | 22f3f17 | 2006-12-05 01:38:58 -0300 | [diff] [blame] | 101 | |
| 102 | static int cx88_dvb_bus_ctrl(struct dvb_frontend* fe, int acquire) |
| 103 | { |
| 104 | struct cx8802_dev *dev= fe->dvb->priv; |
| 105 | struct cx8802_driver *drv = NULL; |
| 106 | int ret = 0; |
| 107 | |
| 108 | drv = cx8802_get_driver(dev, CX88_MPEG_DVB); |
| 109 | if (drv) { |
Michael Krufky | 4a39055 | 2006-12-05 02:00:53 -0300 | [diff] [blame] | 110 | if (acquire) |
Michael Krufky | 22f3f17 | 2006-12-05 01:38:58 -0300 | [diff] [blame] | 111 | ret = drv->request_acquire(drv); |
| 112 | else |
| 113 | ret = drv->request_release(drv); |
| 114 | } |
| 115 | |
| 116 | return ret; |
| 117 | } |
| 118 | |
| 119 | /* ------------------------------------------------------------------ */ |
| 120 | |
Chris Pascoe | 3d7d027 | 2006-01-09 18:21:31 -0200 | [diff] [blame] | 121 | static int dvico_fusionhdtv_demod_init(struct dvb_frontend* fe) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 122 | { |
| 123 | static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x39 }; |
| 124 | static u8 reset [] = { RESET, 0x80 }; |
| 125 | static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 }; |
| 126 | static u8 agc_cfg [] = { AGC_TARGET, 0x24, 0x20 }; |
| 127 | static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 }; |
| 128 | static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 }; |
| 129 | |
| 130 | mt352_write(fe, clock_config, sizeof(clock_config)); |
| 131 | udelay(200); |
| 132 | mt352_write(fe, reset, sizeof(reset)); |
| 133 | mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg)); |
| 134 | |
| 135 | mt352_write(fe, agc_cfg, sizeof(agc_cfg)); |
| 136 | mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg)); |
| 137 | mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg)); |
| 138 | return 0; |
| 139 | } |
| 140 | |
Chris Pascoe | 43eabb4 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 141 | static int dvico_dual_demod_init(struct dvb_frontend *fe) |
| 142 | { |
| 143 | static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x38 }; |
| 144 | static u8 reset [] = { RESET, 0x80 }; |
| 145 | static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 }; |
| 146 | static u8 agc_cfg [] = { AGC_TARGET, 0x28, 0x20 }; |
| 147 | static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x33 }; |
| 148 | static u8 capt_range_cfg[] = { CAPT_RANGE, 0x32 }; |
| 149 | |
| 150 | mt352_write(fe, clock_config, sizeof(clock_config)); |
| 151 | udelay(200); |
| 152 | mt352_write(fe, reset, sizeof(reset)); |
| 153 | mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg)); |
| 154 | |
| 155 | mt352_write(fe, agc_cfg, sizeof(agc_cfg)); |
| 156 | mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg)); |
| 157 | mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg)); |
| 158 | |
| 159 | return 0; |
| 160 | } |
| 161 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 162 | static int dntv_live_dvbt_demod_init(struct dvb_frontend* fe) |
| 163 | { |
| 164 | static u8 clock_config [] = { 0x89, 0x38, 0x39 }; |
| 165 | static u8 reset [] = { 0x50, 0x80 }; |
| 166 | static u8 adc_ctl_1_cfg [] = { 0x8E, 0x40 }; |
| 167 | static u8 agc_cfg [] = { 0x67, 0x10, 0x23, 0x00, 0xFF, 0xFF, |
Mauro Carvalho Chehab | f2421ca | 2005-11-08 21:37:45 -0800 | [diff] [blame] | 168 | 0x00, 0xFF, 0x00, 0x40, 0x40 }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 169 | static u8 dntv_extra[] = { 0xB5, 0x7A }; |
| 170 | static u8 capt_range_cfg[] = { 0x75, 0x32 }; |
| 171 | |
| 172 | mt352_write(fe, clock_config, sizeof(clock_config)); |
| 173 | udelay(2000); |
| 174 | mt352_write(fe, reset, sizeof(reset)); |
| 175 | mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg)); |
| 176 | |
| 177 | mt352_write(fe, agc_cfg, sizeof(agc_cfg)); |
| 178 | udelay(2000); |
| 179 | mt352_write(fe, dntv_extra, sizeof(dntv_extra)); |
| 180 | mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg)); |
| 181 | |
| 182 | return 0; |
| 183 | } |
| 184 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | static struct mt352_config dvico_fusionhdtv = { |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 186 | .demod_address = 0x0f, |
Chris Pascoe | 3d7d027 | 2006-01-09 18:21:31 -0200 | [diff] [blame] | 187 | .demod_init = dvico_fusionhdtv_demod_init, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 188 | }; |
| 189 | |
| 190 | static struct mt352_config dntv_live_dvbt_config = { |
| 191 | .demod_address = 0x0f, |
| 192 | .demod_init = dntv_live_dvbt_demod_init, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 193 | }; |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 194 | |
Chris Pascoe | 43eabb4 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 195 | static struct mt352_config dvico_fusionhdtv_dual = { |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 196 | .demod_address = 0x0f, |
Chris Pascoe | 43eabb4 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 197 | .demod_init = dvico_dual_demod_init, |
Chris Pascoe | 43eabb4 | 2006-01-09 18:21:28 -0200 | [diff] [blame] | 198 | }; |
| 199 | |
Trent Piepho | ecf854d | 2007-05-05 20:11:32 -0300 | [diff] [blame^] | 200 | #if defined(CONFIG_VIDEO_CX88_VP3054) || (defined(CONFIG_VIDEO_CX88_VP3054_MODULE) && defined(MODULE)) |
Chris Pascoe | 3d7d027 | 2006-01-09 18:21:31 -0200 | [diff] [blame] | 201 | static int dntv_live_dvbt_pro_demod_init(struct dvb_frontend* fe) |
| 202 | { |
| 203 | static u8 clock_config [] = { 0x89, 0x38, 0x38 }; |
| 204 | static u8 reset [] = { 0x50, 0x80 }; |
| 205 | static u8 adc_ctl_1_cfg [] = { 0x8E, 0x40 }; |
| 206 | static u8 agc_cfg [] = { 0x67, 0x10, 0x20, 0x00, 0xFF, 0xFF, |
| 207 | 0x00, 0xFF, 0x00, 0x40, 0x40 }; |
| 208 | static u8 dntv_extra[] = { 0xB5, 0x7A }; |
| 209 | static u8 capt_range_cfg[] = { 0x75, 0x32 }; |
| 210 | |
| 211 | mt352_write(fe, clock_config, sizeof(clock_config)); |
| 212 | udelay(2000); |
| 213 | mt352_write(fe, reset, sizeof(reset)); |
| 214 | mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg)); |
| 215 | |
| 216 | mt352_write(fe, agc_cfg, sizeof(agc_cfg)); |
| 217 | udelay(2000); |
| 218 | mt352_write(fe, dntv_extra, sizeof(dntv_extra)); |
| 219 | mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg)); |
| 220 | |
| 221 | return 0; |
| 222 | } |
| 223 | |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 224 | static int philips_fmd1216_pll_init(struct dvb_frontend *fe) |
| 225 | { |
| 226 | struct cx8802_dev *dev= fe->dvb->priv; |
| 227 | |
| 228 | /* this message is to set up ATC and ALC */ |
| 229 | static u8 fmd1216_init[] = { 0x0b, 0xdc, 0x9c, 0xa0 }; |
| 230 | struct i2c_msg msg = |
| 231 | { .addr = dev->core->pll_addr, .flags = 0, |
| 232 | .buf = fmd1216_init, .len = sizeof(fmd1216_init) }; |
| 233 | int err; |
| 234 | |
Patrick Boettcher | dea7486 | 2006-05-14 05:01:31 -0300 | [diff] [blame] | 235 | if (fe->ops.i2c_gate_ctrl) |
| 236 | fe->ops.i2c_gate_ctrl(fe, 1); |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 237 | if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) { |
| 238 | if (err < 0) |
| 239 | return err; |
| 240 | else |
| 241 | return -EREMOTEIO; |
| 242 | } |
| 243 | |
| 244 | return 0; |
| 245 | } |
| 246 | |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 247 | static int dntv_live_dvbt_pro_tuner_set_params(struct dvb_frontend* fe, |
| 248 | struct dvb_frontend_parameters* params) |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 249 | { |
| 250 | struct cx8802_dev *dev= fe->dvb->priv; |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 251 | u8 buf[4]; |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 252 | struct i2c_msg msg = |
| 253 | { .addr = dev->core->pll_addr, .flags = 0, |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 254 | .buf = buf, .len = 4 }; |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 255 | int err; |
| 256 | |
| 257 | /* Switch PLL to DVB mode */ |
| 258 | err = philips_fmd1216_pll_init(fe); |
| 259 | if (err) |
| 260 | return err; |
| 261 | |
| 262 | /* Tune PLL */ |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 263 | dvb_pll_configure(dev->core->pll_desc, buf, |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 264 | params->frequency, |
| 265 | params->u.ofdm.bandwidth); |
Patrick Boettcher | dea7486 | 2006-05-14 05:01:31 -0300 | [diff] [blame] | 266 | if (fe->ops.i2c_gate_ctrl) |
| 267 | fe->ops.i2c_gate_ctrl(fe, 1); |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 268 | if ((err = i2c_transfer(&dev->core->i2c_adap, &msg, 1)) != 1) { |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 269 | |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 270 | printk(KERN_WARNING "cx88-dvb: %s error " |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 271 | "(addr %02x <- %02x, err = %i)\n", |
| 272 | __FUNCTION__, dev->core->pll_addr, buf[0], err); |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 273 | if (err < 0) |
| 274 | return err; |
| 275 | else |
| 276 | return -EREMOTEIO; |
| 277 | } |
| 278 | |
| 279 | return 0; |
| 280 | } |
| 281 | |
| 282 | static struct mt352_config dntv_live_dvbt_pro_config = { |
| 283 | .demod_address = 0x0f, |
| 284 | .no_tuner = 1, |
Chris Pascoe | 3d7d027 | 2006-01-09 18:21:31 -0200 | [diff] [blame] | 285 | .demod_init = dntv_live_dvbt_pro_demod_init, |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 286 | }; |
| 287 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 288 | |
Chris Pascoe | 780dfef | 2006-02-28 08:34:59 -0300 | [diff] [blame] | 289 | static struct zl10353_config dvico_fusionhdtv_hybrid = { |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 290 | .demod_address = 0x0f, |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 291 | .no_tuner = 1, |
Chris Pascoe | 780dfef | 2006-02-28 08:34:59 -0300 | [diff] [blame] | 292 | }; |
| 293 | |
| 294 | static struct zl10353_config dvico_fusionhdtv_plus_v1_1 = { |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 295 | .demod_address = 0x0f, |
Chris Pascoe | 780dfef | 2006-02-28 08:34:59 -0300 | [diff] [blame] | 296 | }; |
Chris Pascoe | 780dfef | 2006-02-28 08:34:59 -0300 | [diff] [blame] | 297 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 298 | static struct cx22702_config connexant_refboard_config = { |
| 299 | .demod_address = 0x43, |
Patrick Boettcher | 38d84c3 | 2005-07-15 12:20:26 -0700 | [diff] [blame] | 300 | .output_mode = CX22702_SERIAL_OUTPUT, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 301 | }; |
| 302 | |
Michael Krufky | ed355260 | 2006-12-05 01:34:56 -0300 | [diff] [blame] | 303 | static struct cx22702_config hauppauge_hvr_config = { |
Steven Toth | aa481a6 | 2006-09-14 15:41:13 -0300 | [diff] [blame] | 304 | .demod_address = 0x63, |
| 305 | .output_mode = CX22702_SERIAL_OUTPUT, |
| 306 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 307 | |
Michael Krufky | 4a39055 | 2006-12-05 02:00:53 -0300 | [diff] [blame] | 308 | static int or51132_set_ts_param(struct dvb_frontend* fe, int is_punctured) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 309 | { |
| 310 | struct cx8802_dev *dev= fe->dvb->priv; |
| 311 | dev->ts_gen_cntrl = is_punctured ? 0x04 : 0x00; |
| 312 | return 0; |
| 313 | } |
| 314 | |
Adrian Bunk | 408b664 | 2005-05-01 08:59:29 -0700 | [diff] [blame] | 315 | static struct or51132_config pchdtv_hd3000 = { |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 316 | .demod_address = 0x15, |
| 317 | .set_ts_params = or51132_set_ts_param, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 318 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 319 | |
Michael Krufky | 6ddcc91 | 2005-07-27 11:46:00 -0700 | [diff] [blame] | 320 | static int lgdt330x_pll_rf_set(struct dvb_frontend* fe, int index) |
Michael Krufky | 0ccef6d | 2005-07-27 11:45:55 -0700 | [diff] [blame] | 321 | { |
| 322 | struct cx8802_dev *dev= fe->dvb->priv; |
| 323 | struct cx88_core *core = dev->core; |
| 324 | |
| 325 | dprintk(1, "%s: index = %d\n", __FUNCTION__, index); |
| 326 | if (index == 0) |
| 327 | cx_clear(MO_GP0_IO, 8); |
| 328 | else |
| 329 | cx_set(MO_GP0_IO, 8); |
| 330 | return 0; |
| 331 | } |
| 332 | |
Michael Krufky | 6ddcc91 | 2005-07-27 11:46:00 -0700 | [diff] [blame] | 333 | static int lgdt330x_set_ts_param(struct dvb_frontend* fe, int is_punctured) |
Michael Krufky | f179849 | 2005-07-07 17:58:39 -0700 | [diff] [blame] | 334 | { |
| 335 | struct cx8802_dev *dev= fe->dvb->priv; |
| 336 | if (is_punctured) |
| 337 | dev->ts_gen_cntrl |= 0x04; |
| 338 | else |
| 339 | dev->ts_gen_cntrl &= ~0x04; |
| 340 | return 0; |
| 341 | } |
| 342 | |
Michael Krufky | 6ddcc91 | 2005-07-27 11:46:00 -0700 | [diff] [blame] | 343 | static struct lgdt330x_config fusionhdtv_3_gold = { |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 344 | .demod_address = 0x0e, |
| 345 | .demod_chip = LGDT3302, |
| 346 | .serial_mpeg = 0x04, /* TPSERIAL for 3302 in TOP_CONTROL */ |
| 347 | .set_ts_params = lgdt330x_set_ts_param, |
Michael Krufky | 0d723c0 | 2005-07-07 17:58:42 -0700 | [diff] [blame] | 348 | }; |
Mauro Carvalho Chehab | e52e98a | 2005-09-09 13:03:41 -0700 | [diff] [blame] | 349 | |
| 350 | static struct lgdt330x_config fusionhdtv_5_gold = { |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 351 | .demod_address = 0x0e, |
| 352 | .demod_chip = LGDT3303, |
| 353 | .serial_mpeg = 0x40, /* TPSERIAL for 3303 in TOP_CONTROL */ |
| 354 | .set_ts_params = lgdt330x_set_ts_param, |
Mauro Carvalho Chehab | e52e98a | 2005-09-09 13:03:41 -0700 | [diff] [blame] | 355 | }; |
Rusty Scott | da215d2 | 2006-04-07 02:21:31 -0300 | [diff] [blame] | 356 | |
| 357 | static struct lgdt330x_config pchdtv_hd5500 = { |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 358 | .demod_address = 0x59, |
| 359 | .demod_chip = LGDT3303, |
| 360 | .serial_mpeg = 0x40, /* TPSERIAL for 3303 in TOP_CONTROL */ |
| 361 | .set_ts_params = lgdt330x_set_ts_param, |
Rusty Scott | da215d2 | 2006-04-07 02:21:31 -0300 | [diff] [blame] | 362 | }; |
Michael Krufky | f179849 | 2005-07-07 17:58:39 -0700 | [diff] [blame] | 363 | |
Michael Krufky | 4a39055 | 2006-12-05 02:00:53 -0300 | [diff] [blame] | 364 | static int nxt200x_set_ts_param(struct dvb_frontend* fe, int is_punctured) |
Kirk Lapray | fde6d31 | 2005-11-08 21:38:18 -0800 | [diff] [blame] | 365 | { |
| 366 | struct cx8802_dev *dev= fe->dvb->priv; |
| 367 | dev->ts_gen_cntrl = is_punctured ? 0x04 : 0x00; |
| 368 | return 0; |
| 369 | } |
| 370 | |
Kirk Lapray | d4c34aa | 2005-11-08 21:38:40 -0800 | [diff] [blame] | 371 | static int nxt200x_set_pll_input(u8* buf, int input) |
| 372 | { |
| 373 | if (input) |
| 374 | buf[3] |= 0x08; |
| 375 | else |
| 376 | buf[3] &= ~0x08; |
| 377 | return 0; |
| 378 | } |
| 379 | |
Kirk Lapray | fde6d31 | 2005-11-08 21:38:18 -0800 | [diff] [blame] | 380 | static struct nxt200x_config ati_hdtvwonder = { |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 381 | .demod_address = 0x0a, |
| 382 | .set_pll_input = nxt200x_set_pll_input, |
| 383 | .set_ts_params = nxt200x_set_ts_param, |
Kirk Lapray | fde6d31 | 2005-11-08 21:38:18 -0800 | [diff] [blame] | 384 | }; |
Kirk Lapray | fde6d31 | 2005-11-08 21:38:18 -0800 | [diff] [blame] | 385 | |
Steven Toth | 0fa14aa | 2006-01-09 15:25:02 -0200 | [diff] [blame] | 386 | static int cx24123_set_ts_param(struct dvb_frontend* fe, |
| 387 | int is_punctured) |
| 388 | { |
| 389 | struct cx8802_dev *dev= fe->dvb->priv; |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 390 | dev->ts_gen_cntrl = 0x02; |
Steven Toth | 0fa14aa | 2006-01-09 15:25:02 -0200 | [diff] [blame] | 391 | return 0; |
| 392 | } |
| 393 | |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 394 | static int kworld_dvbs_100_set_voltage(struct dvb_frontend* fe, |
| 395 | fe_sec_voltage_t voltage) |
Vadim Catana | 0e0351e | 2006-01-09 15:25:02 -0200 | [diff] [blame] | 396 | { |
| 397 | struct cx8802_dev *dev= fe->dvb->priv; |
| 398 | struct cx88_core *core = dev->core; |
| 399 | |
Michael Krufky | 4a39055 | 2006-12-05 02:00:53 -0300 | [diff] [blame] | 400 | if (voltage == SEC_VOLTAGE_OFF) |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 401 | cx_write(MO_GP0_IO, 0x000006fb); |
Michael Krufky | 4a39055 | 2006-12-05 02:00:53 -0300 | [diff] [blame] | 402 | else |
Andrew de Quincey | cd20ca9 | 2006-05-12 20:31:51 -0300 | [diff] [blame] | 403 | cx_write(MO_GP0_IO, 0x000006f9); |
Andrew de Quincey | cd20ca9 | 2006-05-12 20:31:51 -0300 | [diff] [blame] | 404 | |
| 405 | if (core->prev_set_voltage) |
| 406 | return core->prev_set_voltage(fe, voltage); |
| 407 | return 0; |
Vadim Catana | 0e0351e | 2006-01-09 15:25:02 -0200 | [diff] [blame] | 408 | } |
| 409 | |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 410 | static int geniatech_dvbs_set_voltage(struct dvb_frontend *fe, |
| 411 | fe_sec_voltage_t voltage) |
Saqeb Akhter | c02a34f | 2006-06-29 20:29:33 -0300 | [diff] [blame] | 412 | { |
| 413 | struct cx8802_dev *dev= fe->dvb->priv; |
| 414 | struct cx88_core *core = dev->core; |
| 415 | |
| 416 | if (voltage == SEC_VOLTAGE_OFF) { |
| 417 | dprintk(1,"LNB Voltage OFF\n"); |
| 418 | cx_write(MO_GP0_IO, 0x0000efff); |
| 419 | } |
| 420 | |
| 421 | if (core->prev_set_voltage) |
| 422 | return core->prev_set_voltage(fe, voltage); |
| 423 | return 0; |
| 424 | } |
| 425 | |
| 426 | static struct cx24123_config geniatech_dvbs_config = { |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 427 | .demod_address = 0x55, |
| 428 | .set_ts_params = cx24123_set_ts_param, |
Saqeb Akhter | c02a34f | 2006-06-29 20:29:33 -0300 | [diff] [blame] | 429 | }; |
| 430 | |
Steven Toth | 0fa14aa | 2006-01-09 15:25:02 -0200 | [diff] [blame] | 431 | static struct cx24123_config hauppauge_novas_config = { |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 432 | .demod_address = 0x55, |
| 433 | .set_ts_params = cx24123_set_ts_param, |
Vadim Catana | 0e0351e | 2006-01-09 15:25:02 -0200 | [diff] [blame] | 434 | }; |
| 435 | |
| 436 | static struct cx24123_config kworld_dvbs_100_config = { |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 437 | .demod_address = 0x15, |
| 438 | .set_ts_params = cx24123_set_ts_param, |
Yeasah Pell | ef76856 | 2006-09-26 12:30:14 -0300 | [diff] [blame] | 439 | .lnb_polarity = 1, |
Steven Toth | 0fa14aa | 2006-01-09 15:25:02 -0200 | [diff] [blame] | 440 | }; |
Steven Toth | 0fa14aa | 2006-01-09 15:25:02 -0200 | [diff] [blame] | 441 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 442 | static int dvb_register(struct cx8802_dev *dev) |
| 443 | { |
| 444 | /* init struct videobuf_dvb */ |
| 445 | dev->dvb.name = dev->core->name; |
| 446 | dev->ts_gen_cntrl = 0x0c; |
| 447 | |
| 448 | /* init frontend */ |
| 449 | switch (dev->core->board) { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 450 | case CX88_BOARD_HAUPPAUGE_DVB_T1: |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 451 | dev->dvb.frontend = dvb_attach(cx22702_attach, |
Michael Krufky | ed355260 | 2006-12-05 01:34:56 -0300 | [diff] [blame] | 452 | &connexant_refboard_config, |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 453 | &dev->core->i2c_adap); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 454 | if (dev->dvb.frontend != NULL) { |
Andrew de Quincey | 2bfe031 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 455 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 456 | &dev->core->i2c_adap, |
| 457 | &dvb_pll_thomson_dtt759x); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 458 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 459 | break; |
Michael Krufky | e057ee1 | 2005-07-07 17:58:40 -0700 | [diff] [blame] | 460 | case CX88_BOARD_TERRATEC_CINERGY_1400_DVB_T1: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 461 | case CX88_BOARD_CONEXANT_DVB_T1: |
Manenti Marco | f39624f | 2006-01-09 15:32:45 -0200 | [diff] [blame] | 462 | case CX88_BOARD_KWORLD_DVB_T_CX22702: |
David Shirley | 2b5200a | 2005-11-08 21:37:22 -0800 | [diff] [blame] | 463 | case CX88_BOARD_WINFAST_DTV1000: |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 464 | dev->dvb.frontend = dvb_attach(cx22702_attach, |
| 465 | &connexant_refboard_config, |
| 466 | &dev->core->i2c_adap); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 467 | if (dev->dvb.frontend != NULL) { |
Andrew de Quincey | 2bfe031 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 468 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x60, |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 469 | &dev->core->i2c_adap, |
| 470 | &dvb_pll_thomson_dtt7579); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 471 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 472 | break; |
Malcolm Valentine | 4bd6e9d | 2006-05-29 13:51:59 -0300 | [diff] [blame] | 473 | case CX88_BOARD_WINFAST_DTV2000H: |
Steven Toth | 611900c | 2006-01-09 15:25:12 -0200 | [diff] [blame] | 474 | case CX88_BOARD_HAUPPAUGE_HVR1100: |
| 475 | case CX88_BOARD_HAUPPAUGE_HVR1100LP: |
Trent Piepho | a5a2ecf | 2007-03-09 15:07:07 -0300 | [diff] [blame] | 476 | case CX88_BOARD_HAUPPAUGE_HVR1300: |
| 477 | case CX88_BOARD_HAUPPAUGE_HVR3000: |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 478 | dev->dvb.frontend = dvb_attach(cx22702_attach, |
Michael Krufky | ed355260 | 2006-12-05 01:34:56 -0300 | [diff] [blame] | 479 | &hauppauge_hvr_config, |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 480 | &dev->core->i2c_adap); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 481 | if (dev->dvb.frontend != NULL) { |
Andrew de Quincey | 2bfe031 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 482 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
Michael Krufky | 4a39055 | 2006-12-05 02:00:53 -0300 | [diff] [blame] | 483 | &dev->core->i2c_adap, &dvb_pll_fmd1216me); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 484 | } |
Steven Toth | 611900c | 2006-01-09 15:25:12 -0200 | [diff] [blame] | 485 | break; |
Chris Pascoe | 780dfef | 2006-02-28 08:34:59 -0300 | [diff] [blame] | 486 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_PLUS: |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 487 | dev->dvb.frontend = dvb_attach(mt352_attach, |
| 488 | &dvico_fusionhdtv, |
| 489 | &dev->core->i2c_adap); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 490 | if (dev->dvb.frontend != NULL) { |
Andrew de Quincey | 2bfe031 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 491 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x60, |
Chris Pascoe | c162dff | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 492 | NULL, &dvb_pll_thomson_dtt7579); |
Chris Pascoe | 780dfef | 2006-02-28 08:34:59 -0300 | [diff] [blame] | 493 | break; |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 494 | } |
Chris Pascoe | 780dfef | 2006-02-28 08:34:59 -0300 | [diff] [blame] | 495 | /* ZL10353 replaces MT352 on later cards */ |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 496 | dev->dvb.frontend = dvb_attach(zl10353_attach, |
| 497 | &dvico_fusionhdtv_plus_v1_1, |
| 498 | &dev->core->i2c_adap); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 499 | if (dev->dvb.frontend != NULL) { |
Andrew de Quincey | 2bfe031 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 500 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x60, |
Chris Pascoe | c162dff | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 501 | NULL, &dvb_pll_thomson_dtt7579); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 502 | } |
Chris Pascoe | 780dfef | 2006-02-28 08:34:59 -0300 | [diff] [blame] | 503 | break; |
Michael Krufky | c2af3cd | 2006-06-12 14:06:22 -0300 | [diff] [blame] | 504 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_DUAL: |
Michael Krufky | c2af3cd | 2006-06-12 14:06:22 -0300 | [diff] [blame] | 505 | /* The tin box says DEE1601, but it seems to be DTT7579 |
| 506 | * compatible, with a slightly different MT352 AGC gain. */ |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 507 | dev->dvb.frontend = dvb_attach(mt352_attach, |
| 508 | &dvico_fusionhdtv_dual, |
| 509 | &dev->core->i2c_adap); |
Michael Krufky | c2af3cd | 2006-06-12 14:06:22 -0300 | [diff] [blame] | 510 | if (dev->dvb.frontend != NULL) { |
Andrew de Quincey | 2bfe031 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 511 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
Chris Pascoe | c162dff | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 512 | NULL, &dvb_pll_thomson_dtt7579); |
Michael Krufky | c2af3cd | 2006-06-12 14:06:22 -0300 | [diff] [blame] | 513 | break; |
| 514 | } |
Michael Krufky | c2af3cd | 2006-06-12 14:06:22 -0300 | [diff] [blame] | 515 | /* ZL10353 replaces MT352 on later cards */ |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 516 | dev->dvb.frontend = dvb_attach(zl10353_attach, |
| 517 | &dvico_fusionhdtv_plus_v1_1, |
| 518 | &dev->core->i2c_adap); |
Michael Krufky | c2af3cd | 2006-06-12 14:06:22 -0300 | [diff] [blame] | 519 | if (dev->dvb.frontend != NULL) { |
Andrew de Quincey | 2bfe031 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 520 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
Chris Pascoe | c162dff | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 521 | NULL, &dvb_pll_thomson_dtt7579); |
Michael Krufky | c2af3cd | 2006-06-12 14:06:22 -0300 | [diff] [blame] | 522 | } |
Michael Krufky | c2af3cd | 2006-06-12 14:06:22 -0300 | [diff] [blame] | 523 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 524 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T1: |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 525 | dev->dvb.frontend = dvb_attach(mt352_attach, |
| 526 | &dvico_fusionhdtv, |
| 527 | &dev->core->i2c_adap); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 528 | if (dev->dvb.frontend != NULL) { |
Andrew de Quincey | 2bfe031 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 529 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
Chris Pascoe | c162dff | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 530 | NULL, &dvb_pll_lg_z201); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 531 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 532 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 533 | case CX88_BOARD_KWORLD_DVB_T: |
| 534 | case CX88_BOARD_DNTV_LIVE_DVB_T: |
Mauro Carvalho Chehab | a82decf | 2005-07-07 17:58:36 -0700 | [diff] [blame] | 535 | case CX88_BOARD_ADSTECH_DVB_T_PCI: |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 536 | dev->dvb.frontend = dvb_attach(mt352_attach, |
| 537 | &dntv_live_dvbt_config, |
| 538 | &dev->core->i2c_adap); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 539 | if (dev->dvb.frontend != NULL) { |
Andrew de Quincey | 2bfe031 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 540 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
Chris Pascoe | c162dff | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 541 | NULL, &dvb_pll_unknown_1); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 542 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 543 | break; |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 544 | case CX88_BOARD_DNTV_LIVE_DVB_T_PRO: |
Trent Piepho | ecf854d | 2007-05-05 20:11:32 -0300 | [diff] [blame^] | 545 | #if defined(CONFIG_VIDEO_CX88_VP3054) || (defined(CONFIG_VIDEO_CX88_VP3054_MODULE) && defined(MODULE)) |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 546 | dev->core->pll_addr = 0x61; |
| 547 | dev->core->pll_desc = &dvb_pll_fmd1216me; |
Andrew de Quincey | 2bfe031 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 548 | dev->dvb.frontend = dvb_attach(mt352_attach, &dntv_live_dvbt_pro_config, |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 549 | &((struct vp3054_i2c_state *)dev->card_priv)->adap); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 550 | if (dev->dvb.frontend != NULL) { |
Patrick Boettcher | dea7486 | 2006-05-14 05:01:31 -0300 | [diff] [blame] | 551 | dev->dvb.frontend->ops.tuner_ops.set_params = dntv_live_dvbt_pro_tuner_set_params; |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 552 | } |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 553 | #else |
| 554 | printk("%s: built without vp3054 support\n", dev->core->name); |
| 555 | #endif |
| 556 | break; |
Chris Pascoe | 780dfef | 2006-02-28 08:34:59 -0300 | [diff] [blame] | 557 | case CX88_BOARD_DVICO_FUSIONHDTV_DVB_T_HYBRID: |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 558 | dev->dvb.frontend = dvb_attach(zl10353_attach, |
| 559 | &dvico_fusionhdtv_hybrid, |
| 560 | &dev->core->i2c_adap); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 561 | if (dev->dvb.frontend != NULL) { |
Michael Krufky | 5786a34 | 2006-12-05 01:21:19 -0300 | [diff] [blame] | 562 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
| 563 | &dev->core->i2c_adap, |
| 564 | &dvb_pll_thomson_fe6600); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 565 | } |
Chris Pascoe | 780dfef | 2006-02-28 08:34:59 -0300 | [diff] [blame] | 566 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 567 | case CX88_BOARD_PCHDTV_HD3000: |
Michael Krufky | 4a39055 | 2006-12-05 02:00:53 -0300 | [diff] [blame] | 568 | dev->dvb.frontend = dvb_attach(or51132_attach, &pchdtv_hd3000, |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 569 | &dev->core->i2c_adap); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 570 | if (dev->dvb.frontend != NULL) { |
Andrew de Quincey | 2bfe031 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 571 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 572 | &dev->core->i2c_adap, |
| 573 | &dvb_pll_thomson_dtt761x); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 574 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 575 | break; |
Michael Krufky | f179849 | 2005-07-07 17:58:39 -0700 | [diff] [blame] | 576 | case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_Q: |
| 577 | dev->ts_gen_cntrl = 0x08; |
| 578 | { |
| 579 | /* Do a hardware reset of chip before using it. */ |
| 580 | struct cx88_core *core = dev->core; |
| 581 | |
| 582 | cx_clear(MO_GP0_IO, 1); |
| 583 | mdelay(100); |
Michael Krufky | 0ccef6d | 2005-07-27 11:45:55 -0700 | [diff] [blame] | 584 | cx_set(MO_GP0_IO, 1); |
Michael Krufky | f179849 | 2005-07-07 17:58:39 -0700 | [diff] [blame] | 585 | mdelay(200); |
Michael Krufky | 0ccef6d | 2005-07-27 11:45:55 -0700 | [diff] [blame] | 586 | |
| 587 | /* Select RF connector callback */ |
Michael Krufky | 6ddcc91 | 2005-07-27 11:46:00 -0700 | [diff] [blame] | 588 | fusionhdtv_3_gold.pll_rf_set = lgdt330x_pll_rf_set; |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 589 | dev->dvb.frontend = dvb_attach(lgdt330x_attach, |
| 590 | &fusionhdtv_3_gold, |
| 591 | &dev->core->i2c_adap); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 592 | if (dev->dvb.frontend != NULL) { |
Michael Krufky | 1d4bb7d | 2006-12-05 01:01:39 -0300 | [diff] [blame] | 593 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
| 594 | &dev->core->i2c_adap, |
| 595 | &dvb_pll_microtune_4042); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 596 | } |
Michael Krufky | f179849 | 2005-07-07 17:58:39 -0700 | [diff] [blame] | 597 | } |
| 598 | break; |
Michael Krufky | 0d723c0 | 2005-07-07 17:58:42 -0700 | [diff] [blame] | 599 | case CX88_BOARD_DVICO_FUSIONHDTV_3_GOLD_T: |
| 600 | dev->ts_gen_cntrl = 0x08; |
| 601 | { |
| 602 | /* Do a hardware reset of chip before using it. */ |
| 603 | struct cx88_core *core = dev->core; |
| 604 | |
| 605 | cx_clear(MO_GP0_IO, 1); |
| 606 | mdelay(100); |
Michael Krufky | d975872 | 2005-07-27 11:45:56 -0700 | [diff] [blame] | 607 | cx_set(MO_GP0_IO, 9); |
Michael Krufky | 0d723c0 | 2005-07-07 17:58:42 -0700 | [diff] [blame] | 608 | mdelay(200); |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 609 | dev->dvb.frontend = dvb_attach(lgdt330x_attach, |
| 610 | &fusionhdtv_3_gold, |
| 611 | &dev->core->i2c_adap); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 612 | if (dev->dvb.frontend != NULL) { |
Michael Krufky | 1d4bb7d | 2006-12-05 01:01:39 -0300 | [diff] [blame] | 613 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
| 614 | &dev->core->i2c_adap, |
| 615 | &dvb_pll_thomson_dtt761x); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 616 | } |
Michael Krufky | 0d723c0 | 2005-07-07 17:58:42 -0700 | [diff] [blame] | 617 | } |
| 618 | break; |
Mauro Carvalho Chehab | e52e98a | 2005-09-09 13:03:41 -0700 | [diff] [blame] | 619 | case CX88_BOARD_DVICO_FUSIONHDTV_5_GOLD: |
| 620 | dev->ts_gen_cntrl = 0x08; |
| 621 | { |
| 622 | /* Do a hardware reset of chip before using it. */ |
| 623 | struct cx88_core *core = dev->core; |
| 624 | |
| 625 | cx_clear(MO_GP0_IO, 1); |
| 626 | mdelay(100); |
| 627 | cx_set(MO_GP0_IO, 1); |
| 628 | mdelay(200); |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 629 | dev->dvb.frontend = dvb_attach(lgdt330x_attach, |
| 630 | &fusionhdtv_5_gold, |
| 631 | &dev->core->i2c_adap); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 632 | if (dev->dvb.frontend != NULL) { |
Trent Piepho | 6bdcc6e | 2007-04-27 12:31:30 -0300 | [diff] [blame] | 633 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
| 634 | &dev->core->i2c_adap, |
| 635 | &dvb_pll_lg_tdvs_h06xf); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 636 | } |
Mauro Carvalho Chehab | e52e98a | 2005-09-09 13:03:41 -0700 | [diff] [blame] | 637 | } |
| 638 | break; |
Rusty Scott | da215d2 | 2006-04-07 02:21:31 -0300 | [diff] [blame] | 639 | case CX88_BOARD_PCHDTV_HD5500: |
| 640 | dev->ts_gen_cntrl = 0x08; |
| 641 | { |
| 642 | /* Do a hardware reset of chip before using it. */ |
| 643 | struct cx88_core *core = dev->core; |
| 644 | |
| 645 | cx_clear(MO_GP0_IO, 1); |
| 646 | mdelay(100); |
| 647 | cx_set(MO_GP0_IO, 1); |
| 648 | mdelay(200); |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 649 | dev->dvb.frontend = dvb_attach(lgdt330x_attach, |
| 650 | &pchdtv_hd5500, |
| 651 | &dev->core->i2c_adap); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 652 | if (dev->dvb.frontend != NULL) { |
Trent Piepho | 6bdcc6e | 2007-04-27 12:31:30 -0300 | [diff] [blame] | 653 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
| 654 | &dev->core->i2c_adap, |
| 655 | &dvb_pll_lg_tdvs_h06xf); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 656 | } |
Rusty Scott | da215d2 | 2006-04-07 02:21:31 -0300 | [diff] [blame] | 657 | } |
| 658 | break; |
Kirk Lapray | fde6d31 | 2005-11-08 21:38:18 -0800 | [diff] [blame] | 659 | case CX88_BOARD_ATI_HDTVWONDER: |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 660 | dev->dvb.frontend = dvb_attach(nxt200x_attach, |
| 661 | &ati_hdtvwonder, |
| 662 | &dev->core->i2c_adap); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 663 | if (dev->dvb.frontend != NULL) { |
Andrew de Quincey | 2bfe031 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 664 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
Michael Krufky | 4ad8eee5 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 665 | NULL, &dvb_pll_tuv1236d); |
Andrew de Quincey | f54376e | 2006-04-18 17:56:10 -0300 | [diff] [blame] | 666 | } |
Kirk Lapray | fde6d31 | 2005-11-08 21:38:18 -0800 | [diff] [blame] | 667 | break; |
Steven Toth | 0fa14aa | 2006-01-09 15:25:02 -0200 | [diff] [blame] | 668 | case CX88_BOARD_HAUPPAUGE_NOVASPLUS_S1: |
| 669 | case CX88_BOARD_HAUPPAUGE_NOVASE2_S1: |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 670 | dev->dvb.frontend = dvb_attach(cx24123_attach, |
| 671 | &hauppauge_novas_config, |
| 672 | &dev->core->i2c_adap); |
Andrew de Quincey | cd20ca9 | 2006-05-12 20:31:51 -0300 | [diff] [blame] | 673 | if (dev->dvb.frontend) { |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 674 | dvb_attach(isl6421_attach, dev->dvb.frontend, |
| 675 | &dev->core->i2c_adap, 0x08, 0x00, 0x00); |
Andrew de Quincey | cd20ca9 | 2006-05-12 20:31:51 -0300 | [diff] [blame] | 676 | } |
Steven Toth | 0fa14aa | 2006-01-09 15:25:02 -0200 | [diff] [blame] | 677 | break; |
Vadim Catana | 0e0351e | 2006-01-09 15:25:02 -0200 | [diff] [blame] | 678 | case CX88_BOARD_KWORLD_DVBS_100: |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 679 | dev->dvb.frontend = dvb_attach(cx24123_attach, |
| 680 | &kworld_dvbs_100_config, |
| 681 | &dev->core->i2c_adap); |
Andrew de Quincey | cd20ca9 | 2006-05-12 20:31:51 -0300 | [diff] [blame] | 682 | if (dev->dvb.frontend) { |
Patrick Boettcher | dea7486 | 2006-05-14 05:01:31 -0300 | [diff] [blame] | 683 | dev->core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage; |
| 684 | dev->dvb.frontend->ops.set_voltage = kworld_dvbs_100_set_voltage; |
Andrew de Quincey | cd20ca9 | 2006-05-12 20:31:51 -0300 | [diff] [blame] | 685 | } |
Vadim Catana | 0e0351e | 2006-01-09 15:25:02 -0200 | [diff] [blame] | 686 | break; |
Saqeb Akhter | c02a34f | 2006-06-29 20:29:33 -0300 | [diff] [blame] | 687 | case CX88_BOARD_GENIATECH_DVBS: |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 688 | dev->dvb.frontend = dvb_attach(cx24123_attach, |
| 689 | &geniatech_dvbs_config, |
| 690 | &dev->core->i2c_adap); |
Saqeb Akhter | c02a34f | 2006-06-29 20:29:33 -0300 | [diff] [blame] | 691 | if (dev->dvb.frontend) { |
| 692 | dev->core->prev_set_voltage = dev->dvb.frontend->ops.set_voltage; |
| 693 | dev->dvb.frontend->ops.set_voltage = geniatech_dvbs_set_voltage; |
| 694 | } |
| 695 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 696 | default: |
Gerd Knorr | 1622c3f | 2005-05-01 08:59:19 -0700 | [diff] [blame] | 697 | printk("%s: The frontend of your DVB/ATSC card isn't supported yet\n", |
| 698 | dev->core->name); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 699 | break; |
| 700 | } |
| 701 | if (NULL == dev->dvb.frontend) { |
| 702 | printk("%s: frontend initialization failed\n",dev->core->name); |
| 703 | return -1; |
| 704 | } |
| 705 | |
| 706 | if (dev->core->pll_desc) { |
Patrick Boettcher | dea7486 | 2006-05-14 05:01:31 -0300 | [diff] [blame] | 707 | dev->dvb.frontend->ops.info.frequency_min = dev->core->pll_desc->min; |
| 708 | dev->dvb.frontend->ops.info.frequency_max = dev->core->pll_desc->max; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 709 | } |
Steven Toth | 6c5be74 | 2006-12-02 21:15:51 -0200 | [diff] [blame] | 710 | /* Ensure all frontends negotiate bus access */ |
| 711 | dev->dvb.frontend->ops.ts_bus_ctrl = cx88_dvb_bus_ctrl; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 712 | |
Mauro Carvalho Chehab | 93352f5 | 2005-09-13 01:25:42 -0700 | [diff] [blame] | 713 | /* Put the analog decoder in standby to keep it quiet */ |
| 714 | cx88_call_i2c_clients (dev->core, TUNER_SET_STANDBY, NULL); |
| 715 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 716 | /* register everything */ |
Andrew de Quincey | d09dbf9 | 2006-04-10 09:27:37 -0300 | [diff] [blame] | 717 | return videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 718 | } |
| 719 | |
| 720 | /* ----------------------------------------------------------- */ |
| 721 | |
Steven Toth | 6c5be74 | 2006-12-02 21:15:51 -0200 | [diff] [blame] | 722 | /* CX8802 MPEG -> mini driver - We have been given the hardware */ |
| 723 | static int cx8802_dvb_advise_acquire(struct cx8802_driver *drv) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 724 | { |
Steven Toth | 6c5be74 | 2006-12-02 21:15:51 -0200 | [diff] [blame] | 725 | struct cx88_core *core = drv->core; |
| 726 | int err = 0; |
| 727 | dprintk( 1, "%s\n", __FUNCTION__); |
| 728 | |
| 729 | switch (core->board) { |
| 730 | case CX88_BOARD_HAUPPAUGE_HVR1300: |
| 731 | /* We arrive here with either the cx23416 or the cx22702 |
| 732 | * on the bus. Take the bus from the cx23416 and enable the |
| 733 | * cx22702 demod |
| 734 | */ |
| 735 | cx_set(MO_GP0_IO, 0x00000080); /* cx22702 out of reset and enable */ |
| 736 | cx_clear(MO_GP0_IO, 0x00000004); |
| 737 | udelay(1000); |
| 738 | break; |
| 739 | default: |
| 740 | err = -ENODEV; |
| 741 | } |
| 742 | return err; |
| 743 | } |
| 744 | |
| 745 | /* CX8802 MPEG -> mini driver - We no longer have the hardware */ |
| 746 | static int cx8802_dvb_advise_release(struct cx8802_driver *drv) |
| 747 | { |
| 748 | struct cx88_core *core = drv->core; |
| 749 | int err = 0; |
| 750 | dprintk( 1, "%s\n", __FUNCTION__); |
| 751 | |
| 752 | switch (core->board) { |
| 753 | case CX88_BOARD_HAUPPAUGE_HVR1300: |
| 754 | /* Do Nothing, leave the cx22702 on the bus. */ |
| 755 | break; |
| 756 | default: |
| 757 | err = -ENODEV; |
| 758 | } |
| 759 | return err; |
| 760 | } |
| 761 | |
| 762 | static int cx8802_dvb_probe(struct cx8802_driver *drv) |
| 763 | { |
| 764 | struct cx88_core *core = drv->core; |
| 765 | struct cx8802_dev *dev = drv->core->dvbdev; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 766 | int err; |
| 767 | |
Steven Toth | 6c5be74 | 2006-12-02 21:15:51 -0200 | [diff] [blame] | 768 | dprintk( 1, "%s\n", __FUNCTION__); |
| 769 | dprintk( 1, " ->being probed by Card=%d Name=%s, PCI %02x:%02x\n", |
| 770 | core->board, |
| 771 | core->name, |
| 772 | core->pci_bus, |
| 773 | core->pci_slot); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 774 | |
| 775 | err = -ENODEV; |
Michael Krufky | 48d5e80 | 2006-09-25 14:09:10 -0300 | [diff] [blame] | 776 | if (!(cx88_boards[core->board].mpeg & CX88_MPEG_DVB)) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 777 | goto fail_core; |
| 778 | |
Trent Piepho | ecf854d | 2007-05-05 20:11:32 -0300 | [diff] [blame^] | 779 | /* If vp3054 isn't enabled, a stub will just return 0 */ |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 780 | err = vp3054_i2c_probe(dev); |
| 781 | if (0 != err) |
Steven Toth | 6c5be74 | 2006-12-02 21:15:51 -0200 | [diff] [blame] | 782 | goto fail_core; |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 783 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 784 | /* dvb stuff */ |
| 785 | printk("%s/2: cx2388x based dvb card\n", core->name); |
| 786 | videobuf_queue_init(&dev->dvb.dvbq, &dvb_qops, |
| 787 | dev->pci, &dev->slock, |
| 788 | V4L2_BUF_TYPE_VIDEO_CAPTURE, |
| 789 | V4L2_FIELD_TOP, |
| 790 | sizeof(struct cx88_buffer), |
| 791 | dev); |
| 792 | err = dvb_register(dev); |
Steven Toth | 6c5be74 | 2006-12-02 21:15:51 -0200 | [diff] [blame] | 793 | if (err != 0) |
| 794 | printk("%s dvb_register failed err = %d\n", __FUNCTION__, err); |
Steven Toth | 611900c | 2006-01-09 15:25:12 -0200 | [diff] [blame] | 795 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 796 | fail_core: |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 797 | return err; |
| 798 | } |
| 799 | |
Steven Toth | 6c5be74 | 2006-12-02 21:15:51 -0200 | [diff] [blame] | 800 | static int cx8802_dvb_remove(struct cx8802_driver *drv) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 801 | { |
Steven Toth | 6c5be74 | 2006-12-02 21:15:51 -0200 | [diff] [blame] | 802 | struct cx8802_dev *dev = drv->core->dvbdev; |
Steven Toth | 611900c | 2006-01-09 15:25:12 -0200 | [diff] [blame] | 803 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 804 | /* dvb */ |
| 805 | videobuf_dvb_unregister(&dev->dvb); |
| 806 | |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 807 | vp3054_i2c_remove(dev); |
Chris Pascoe | fc40b26 | 2006-01-09 15:25:35 -0200 | [diff] [blame] | 808 | |
Steven Toth | 6c5be74 | 2006-12-02 21:15:51 -0200 | [diff] [blame] | 809 | return 0; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 810 | } |
| 811 | |
Steven Toth | 6c5be74 | 2006-12-02 21:15:51 -0200 | [diff] [blame] | 812 | static struct cx8802_driver cx8802_dvb_driver = { |
| 813 | .type_id = CX88_MPEG_DVB, |
| 814 | .hw_access = CX8802_DRVCTL_SHARED, |
| 815 | .probe = cx8802_dvb_probe, |
| 816 | .remove = cx8802_dvb_remove, |
| 817 | .advise_acquire = cx8802_dvb_advise_acquire, |
| 818 | .advise_release = cx8802_dvb_advise_release, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 819 | }; |
| 820 | |
| 821 | static int dvb_init(void) |
| 822 | { |
| 823 | printk(KERN_INFO "cx2388x dvb driver version %d.%d.%d loaded\n", |
| 824 | (CX88_VERSION_CODE >> 16) & 0xff, |
| 825 | (CX88_VERSION_CODE >> 8) & 0xff, |
| 826 | CX88_VERSION_CODE & 0xff); |
| 827 | #ifdef SNAPSHOT |
| 828 | printk(KERN_INFO "cx2388x: snapshot date %04d-%02d-%02d\n", |
| 829 | SNAPSHOT/10000, (SNAPSHOT/100)%100, SNAPSHOT%100); |
| 830 | #endif |
Steven Toth | 6c5be74 | 2006-12-02 21:15:51 -0200 | [diff] [blame] | 831 | return cx8802_register_driver(&cx8802_dvb_driver); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 832 | } |
| 833 | |
| 834 | static void dvb_fini(void) |
| 835 | { |
Steven Toth | 6c5be74 | 2006-12-02 21:15:51 -0200 | [diff] [blame] | 836 | cx8802_unregister_driver(&cx8802_dvb_driver); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 837 | } |
| 838 | |
| 839 | module_init(dvb_init); |
| 840 | module_exit(dvb_fini); |
| 841 | |
| 842 | /* |
| 843 | * Local variables: |
| 844 | * c-basic-offset: 8 |
| 845 | * compile-command: "make DVB=1" |
| 846 | * End: |
| 847 | */ |