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