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