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 | * (c) 2004 Gerd Knorr <kraxel@bytesex.org> [SuSE Labs] |
| 4 | * |
Mauro Carvalho Chehab | 86ddd96 | 2005-07-12 13:58:47 -0700 | [diff] [blame] | 5 | * Extended 3 / 2005 by Hartmut Hackmann to support various |
| 6 | * cards with the tda10046 DVB-T channel decoder |
| 7 | * |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License |
| 19 | * along with this program; if not, write to the Free Software |
| 20 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
| 21 | */ |
| 22 | |
| 23 | #include <linux/init.h> |
| 24 | #include <linux/list.h> |
| 25 | #include <linux/module.h> |
| 26 | #include <linux/kernel.h> |
| 27 | #include <linux/slab.h> |
| 28 | #include <linux/delay.h> |
| 29 | #include <linux/kthread.h> |
| 30 | #include <linux/suspend.h> |
| 31 | |
| 32 | #include "saa7134-reg.h" |
| 33 | #include "saa7134.h" |
Michael Krufky | 5e453dc | 2006-01-09 15:32:31 -0200 | [diff] [blame] | 34 | #include <media/v4l2-common.h> |
Jose Alberto Reguero | a78d0bf | 2006-02-07 06:25:14 -0200 | [diff] [blame] | 35 | #include "dvb-pll.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 36 | |
Andrew de Quincey | 1f10c7a | 2006-08-08 09:10:09 -0300 | [diff] [blame] | 37 | #include "mt352.h" |
| 38 | #include "mt352_priv.h" /* FIXME */ |
| 39 | #include "tda1004x.h" |
| 40 | #include "nxt200x.h" |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 41 | |
Igor M. Liplianin | e2ac28f | 2006-08-08 09:10:10 -0300 | [diff] [blame] | 42 | #include "tda10086.h" |
| 43 | #include "tda826x.h" |
Michael Krufky | 8ce47da | 2007-04-27 12:31:14 -0300 | [diff] [blame] | 44 | #include "tda827x.h" |
Igor M. Liplianin | e2ac28f | 2006-08-08 09:10:10 -0300 | [diff] [blame] | 45 | #include "isl6421.h" |
Hartmut Hackmann | 4b1431c | 2008-04-22 14:42:09 -0300 | [diff] [blame^] | 46 | #include "isl6405.h" |
Michael Krufky | 8ce47da | 2007-04-27 12:31:14 -0300 | [diff] [blame] | 47 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); |
| 49 | MODULE_LICENSE("GPL"); |
| 50 | |
Douglas Schilling Landgraf | ff699e6 | 2008-04-22 14:41:48 -0300 | [diff] [blame] | 51 | static unsigned int antenna_pwr; |
Mauro Carvalho Chehab | 86ddd96 | 2005-07-12 13:58:47 -0700 | [diff] [blame] | 52 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 53 | module_param(antenna_pwr, int, 0444); |
| 54 | MODULE_PARM_DESC(antenna_pwr,"enable antenna power (Pinnacle 300i)"); |
| 55 | |
Douglas Schilling Landgraf | ff699e6 | 2008-04-22 14:41:48 -0300 | [diff] [blame] | 56 | static int use_frontend; |
Stephan Berberig | b331daa | 2006-12-20 09:37:05 -0300 | [diff] [blame] | 57 | module_param(use_frontend, int, 0644); |
| 58 | MODULE_PARM_DESC(use_frontend,"for cards with multiple frontends (0: terrestrial, 1: satellite)"); |
Nico Sabbi | 1f683cd | 2006-11-15 22:06:56 -0300 | [diff] [blame] | 59 | |
Douglas Schilling Landgraf | ff699e6 | 2008-04-22 14:41:48 -0300 | [diff] [blame] | 60 | static int debug; |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 61 | module_param(debug, int, 0644); |
| 62 | MODULE_PARM_DESC(debug, "Turn on/off module debugging (default:off)."); |
| 63 | |
Trent Piepho | cf3c34c | 2007-03-07 18:19:48 -0300 | [diff] [blame] | 64 | #define dprintk(fmt, arg...) do { if (debug) \ |
| 65 | printk(KERN_DEBUG "%s/dvb: " fmt, dev->name , ## arg); } while(0) |
| 66 | |
| 67 | /* Print a warning */ |
| 68 | #define wprintk(fmt, arg...) \ |
| 69 | printk(KERN_WARNING "%s/dvb: " fmt, dev->name, ## arg) |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 70 | |
| 71 | /* ------------------------------------------------------------------ |
| 72 | * mt352 based DVB-T cards |
| 73 | */ |
| 74 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 75 | static int pinnacle_antenna_pwr(struct saa7134_dev *dev, int on) |
| 76 | { |
| 77 | u32 ok; |
| 78 | |
| 79 | if (!on) { |
| 80 | saa_setl(SAA7134_GPIO_GPMODE0 >> 2, (1 << 26)); |
| 81 | saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 26)); |
| 82 | return 0; |
| 83 | } |
| 84 | |
| 85 | saa_setl(SAA7134_GPIO_GPMODE0 >> 2, (1 << 26)); |
| 86 | saa_setl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 26)); |
| 87 | udelay(10); |
| 88 | |
| 89 | saa_setl(SAA7134_GPIO_GPMODE0 >> 2, (1 << 28)); |
| 90 | saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 28)); |
| 91 | udelay(10); |
| 92 | saa_setl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 28)); |
| 93 | udelay(10); |
| 94 | ok = saa_readl(SAA7134_GPIO_GPSTATUS0) & (1 << 27); |
Trent Piepho | cf3c34c | 2007-03-07 18:19:48 -0300 | [diff] [blame] | 95 | dprintk("%s %s\n", __FUNCTION__, ok ? "on" : "off"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 96 | |
| 97 | if (!ok) |
| 98 | saa_clearl(SAA7134_GPIO_GPSTATUS0 >> 2, (1 << 26)); |
| 99 | return ok; |
| 100 | } |
| 101 | |
| 102 | static int mt352_pinnacle_init(struct dvb_frontend* fe) |
| 103 | { |
| 104 | static u8 clock_config [] = { CLOCK_CTL, 0x3d, 0x28 }; |
| 105 | static u8 reset [] = { RESET, 0x80 }; |
| 106 | static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 }; |
| 107 | static u8 agc_cfg [] = { AGC_TARGET, 0x28, 0xa0 }; |
| 108 | static u8 capt_range_cfg[] = { CAPT_RANGE, 0x31 }; |
| 109 | static u8 fsm_ctl_cfg[] = { 0x7b, 0x04 }; |
| 110 | static u8 gpp_ctl_cfg [] = { GPP_CTL, 0x0f }; |
| 111 | static u8 scan_ctl_cfg [] = { SCAN_CTL, 0x0d }; |
| 112 | static u8 irq_cfg [] = { INTERRUPT_EN_0, 0x00, 0x00, 0x00, 0x00 }; |
| 113 | struct saa7134_dev *dev= fe->dvb->priv; |
| 114 | |
Trent Piepho | cf3c34c | 2007-03-07 18:19:48 -0300 | [diff] [blame] | 115 | dprintk("%s called\n", __FUNCTION__); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 116 | |
| 117 | mt352_write(fe, clock_config, sizeof(clock_config)); |
| 118 | udelay(200); |
| 119 | mt352_write(fe, reset, sizeof(reset)); |
| 120 | mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg)); |
| 121 | mt352_write(fe, agc_cfg, sizeof(agc_cfg)); |
| 122 | mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg)); |
| 123 | mt352_write(fe, gpp_ctl_cfg, sizeof(gpp_ctl_cfg)); |
| 124 | |
| 125 | mt352_write(fe, fsm_ctl_cfg, sizeof(fsm_ctl_cfg)); |
| 126 | mt352_write(fe, scan_ctl_cfg, sizeof(scan_ctl_cfg)); |
| 127 | mt352_write(fe, irq_cfg, sizeof(irq_cfg)); |
Hartmut Hackmann | df8cf70 | 2006-03-03 12:09:26 -0300 | [diff] [blame] | 128 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 129 | return 0; |
| 130 | } |
| 131 | |
Jose Alberto Reguero | a78d0bf | 2006-02-07 06:25:14 -0200 | [diff] [blame] | 132 | static int mt352_aver777_init(struct dvb_frontend* fe) |
| 133 | { |
| 134 | static u8 clock_config [] = { CLOCK_CTL, 0x38, 0x2d }; |
| 135 | static u8 reset [] = { RESET, 0x80 }; |
| 136 | static u8 adc_ctl_1_cfg [] = { ADC_CTL_1, 0x40 }; |
| 137 | static u8 agc_cfg [] = { AGC_TARGET, 0x28, 0xa0 }; |
| 138 | static u8 capt_range_cfg[] = { CAPT_RANGE, 0x33 }; |
| 139 | |
| 140 | mt352_write(fe, clock_config, sizeof(clock_config)); |
| 141 | udelay(200); |
| 142 | mt352_write(fe, reset, sizeof(reset)); |
| 143 | mt352_write(fe, adc_ctl_1_cfg, sizeof(adc_ctl_1_cfg)); |
| 144 | mt352_write(fe, agc_cfg, sizeof(agc_cfg)); |
| 145 | mt352_write(fe, capt_range_cfg, sizeof(capt_range_cfg)); |
| 146 | |
| 147 | return 0; |
| 148 | } |
| 149 | |
Andrew de Quincey | 0463f12 | 2006-05-16 17:22:02 -0300 | [diff] [blame] | 150 | static int mt352_pinnacle_tuner_set_params(struct dvb_frontend* fe, |
| 151 | struct dvb_frontend_parameters* params) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 152 | { |
Hartmut Hackmann | df8cf70 | 2006-03-03 12:09:26 -0300 | [diff] [blame] | 153 | u8 off[] = { 0x00, 0xf1}; |
| 154 | u8 on[] = { 0x00, 0x71}; |
| 155 | struct i2c_msg msg = {.addr=0x43, .flags=0, .buf=off, .len = sizeof(off)}; |
| 156 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 157 | struct saa7134_dev *dev = fe->dvb->priv; |
| 158 | struct v4l2_frequency f; |
| 159 | |
| 160 | /* set frequency (mt2050) */ |
| 161 | f.tuner = 0; |
| 162 | f.type = V4L2_TUNER_DIGITAL_TV; |
| 163 | f.frequency = params->frequency / 1000 * 16 / 1000; |
Patrick Boettcher | dea7486 | 2006-05-14 05:01:31 -0300 | [diff] [blame] | 164 | if (fe->ops.i2c_gate_ctrl) |
| 165 | fe->ops.i2c_gate_ctrl(fe, 1); |
Hartmut Hackmann | df8cf70 | 2006-03-03 12:09:26 -0300 | [diff] [blame] | 166 | i2c_transfer(&dev->i2c_adap, &msg, 1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 167 | saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f); |
Hartmut Hackmann | df8cf70 | 2006-03-03 12:09:26 -0300 | [diff] [blame] | 168 | msg.buf = on; |
Patrick Boettcher | dea7486 | 2006-05-14 05:01:31 -0300 | [diff] [blame] | 169 | if (fe->ops.i2c_gate_ctrl) |
| 170 | fe->ops.i2c_gate_ctrl(fe, 1); |
Hartmut Hackmann | df8cf70 | 2006-03-03 12:09:26 -0300 | [diff] [blame] | 171 | i2c_transfer(&dev->i2c_adap, &msg, 1); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 172 | |
| 173 | pinnacle_antenna_pwr(dev, antenna_pwr); |
| 174 | |
| 175 | /* mt352 setup */ |
Andrew de Quincey | 0463f12 | 2006-05-16 17:22:02 -0300 | [diff] [blame] | 176 | return mt352_pinnacle_init(fe); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 177 | } |
| 178 | |
| 179 | static struct mt352_config pinnacle_300i = { |
| 180 | .demod_address = 0x3c >> 1, |
| 181 | .adc_clock = 20333, |
| 182 | .if2 = 36150, |
| 183 | .no_tuner = 1, |
| 184 | .demod_init = mt352_pinnacle_init, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | }; |
Jose Alberto Reguero | a78d0bf | 2006-02-07 06:25:14 -0200 | [diff] [blame] | 186 | |
| 187 | static struct mt352_config avermedia_777 = { |
| 188 | .demod_address = 0xf, |
| 189 | .demod_init = mt352_aver777_init, |
Jose Alberto Reguero | a78d0bf | 2006-02-07 06:25:14 -0200 | [diff] [blame] | 190 | }; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 191 | |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 192 | /* ================================================================== |
| 193 | * tda1004x based DVB-T cards, helper functions |
| 194 | */ |
| 195 | |
| 196 | static int philips_tda1004x_request_firmware(struct dvb_frontend *fe, |
| 197 | const struct firmware **fw, char *name) |
Mauro Carvalho Chehab | 86ddd96 | 2005-07-12 13:58:47 -0700 | [diff] [blame] | 198 | { |
| 199 | struct saa7134_dev *dev = fe->dvb->priv; |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 200 | return request_firmware(fw, name, &dev->pci->dev); |
| 201 | } |
| 202 | |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 203 | /* ------------------------------------------------------------------ |
| 204 | * these tuners are tu1216, td1316(a) |
| 205 | */ |
| 206 | |
| 207 | static int philips_tda6651_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) |
| 208 | { |
| 209 | struct saa7134_dev *dev = fe->dvb->priv; |
| 210 | struct tda1004x_state *state = fe->demodulator_priv; |
| 211 | u8 addr = state->config->tuner_address; |
Mauro Carvalho Chehab | 86ddd96 | 2005-07-12 13:58:47 -0700 | [diff] [blame] | 212 | u8 tuner_buf[4]; |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 213 | struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = tuner_buf,.len = |
Mauro Carvalho Chehab | 86ddd96 | 2005-07-12 13:58:47 -0700 | [diff] [blame] | 214 | sizeof(tuner_buf) }; |
| 215 | int tuner_frequency = 0; |
| 216 | u8 band, cp, filter; |
| 217 | |
| 218 | /* determine charge pump */ |
| 219 | tuner_frequency = params->frequency + 36166000; |
| 220 | if (tuner_frequency < 87000000) |
| 221 | return -EINVAL; |
| 222 | else if (tuner_frequency < 130000000) |
| 223 | cp = 3; |
| 224 | else if (tuner_frequency < 160000000) |
| 225 | cp = 5; |
| 226 | else if (tuner_frequency < 200000000) |
| 227 | cp = 6; |
| 228 | else if (tuner_frequency < 290000000) |
| 229 | cp = 3; |
| 230 | else if (tuner_frequency < 420000000) |
| 231 | cp = 5; |
| 232 | else if (tuner_frequency < 480000000) |
| 233 | cp = 6; |
| 234 | else if (tuner_frequency < 620000000) |
| 235 | cp = 3; |
| 236 | else if (tuner_frequency < 830000000) |
| 237 | cp = 5; |
| 238 | else if (tuner_frequency < 895000000) |
| 239 | cp = 7; |
| 240 | else |
| 241 | return -EINVAL; |
| 242 | |
| 243 | /* determine band */ |
| 244 | if (params->frequency < 49000000) |
| 245 | return -EINVAL; |
| 246 | else if (params->frequency < 161000000) |
| 247 | band = 1; |
| 248 | else if (params->frequency < 444000000) |
| 249 | band = 2; |
| 250 | else if (params->frequency < 861000000) |
| 251 | band = 4; |
| 252 | else |
| 253 | return -EINVAL; |
| 254 | |
| 255 | /* setup PLL filter */ |
| 256 | switch (params->u.ofdm.bandwidth) { |
| 257 | case BANDWIDTH_6_MHZ: |
| 258 | filter = 0; |
| 259 | break; |
| 260 | |
| 261 | case BANDWIDTH_7_MHZ: |
| 262 | filter = 0; |
| 263 | break; |
| 264 | |
| 265 | case BANDWIDTH_8_MHZ: |
| 266 | filter = 1; |
| 267 | break; |
| 268 | |
| 269 | default: |
| 270 | return -EINVAL; |
| 271 | } |
| 272 | |
| 273 | /* calculate divisor |
| 274 | * ((36166000+((1000000/6)/2)) + Finput)/(1000000/6) |
| 275 | */ |
| 276 | tuner_frequency = (((params->frequency / 1000) * 6) + 217496) / 1000; |
| 277 | |
| 278 | /* setup tuner buffer */ |
| 279 | tuner_buf[0] = (tuner_frequency >> 8) & 0x7f; |
| 280 | tuner_buf[1] = tuner_frequency & 0xff; |
| 281 | tuner_buf[2] = 0xca; |
| 282 | tuner_buf[3] = (cp << 5) | (filter << 3) | band; |
| 283 | |
Patrick Boettcher | dea7486 | 2006-05-14 05:01:31 -0300 | [diff] [blame] | 284 | if (fe->ops.i2c_gate_ctrl) |
| 285 | fe->ops.i2c_gate_ctrl(fe, 1); |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 286 | if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) { |
Trent Piepho | cf3c34c | 2007-03-07 18:19:48 -0300 | [diff] [blame] | 287 | wprintk("could not write to tuner at addr: 0x%02x\n", |
| 288 | addr << 1); |
Mauro Carvalho Chehab | 86ddd96 | 2005-07-12 13:58:47 -0700 | [diff] [blame] | 289 | return -EIO; |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 290 | } |
Mauro Carvalho Chehab | 86ddd96 | 2005-07-12 13:58:47 -0700 | [diff] [blame] | 291 | msleep(1); |
| 292 | return 0; |
| 293 | } |
| 294 | |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 295 | static int philips_tu1216_init(struct dvb_frontend *fe) |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 296 | { |
| 297 | struct saa7134_dev *dev = fe->dvb->priv; |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 298 | struct tda1004x_state *state = fe->demodulator_priv; |
| 299 | u8 addr = state->config->tuner_address; |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 300 | static u8 tu1216_init[] = { 0x0b, 0xf5, 0x85, 0xab }; |
| 301 | struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = tu1216_init,.len = sizeof(tu1216_init) }; |
| 302 | |
| 303 | /* setup PLL configuration */ |
Patrick Boettcher | dea7486 | 2006-05-14 05:01:31 -0300 | [diff] [blame] | 304 | if (fe->ops.i2c_gate_ctrl) |
| 305 | fe->ops.i2c_gate_ctrl(fe, 1); |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 306 | if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) |
| 307 | return -EIO; |
| 308 | msleep(1); |
| 309 | |
| 310 | return 0; |
| 311 | } |
| 312 | |
| 313 | /* ------------------------------------------------------------------ */ |
| 314 | |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 315 | static struct tda1004x_config philips_tu1216_60_config = { |
Mauro Carvalho Chehab | 86ddd96 | 2005-07-12 13:58:47 -0700 | [diff] [blame] | 316 | .demod_address = 0x8, |
| 317 | .invert = 1, |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 318 | .invert_oclk = 0, |
Mauro Carvalho Chehab | 86ddd96 | 2005-07-12 13:58:47 -0700 | [diff] [blame] | 319 | .xtal_freq = TDA10046_XTAL_4M, |
| 320 | .agc_config = TDA10046_AGC_DEFAULT, |
| 321 | .if_freq = TDA10046_FREQ_3617, |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 322 | .tuner_address = 0x60, |
| 323 | .request_firmware = philips_tda1004x_request_firmware |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 324 | }; |
| 325 | |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 326 | static struct tda1004x_config philips_tu1216_61_config = { |
| 327 | |
| 328 | .demod_address = 0x8, |
| 329 | .invert = 1, |
| 330 | .invert_oclk = 0, |
| 331 | .xtal_freq = TDA10046_XTAL_4M, |
| 332 | .agc_config = TDA10046_AGC_DEFAULT, |
| 333 | .if_freq = TDA10046_FREQ_3617, |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 334 | .tuner_address = 0x61, |
| 335 | .request_firmware = philips_tda1004x_request_firmware |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 336 | }; |
| 337 | |
| 338 | /* ------------------------------------------------------------------ */ |
| 339 | |
Hartmut Hackmann | cbb9452 | 2006-10-30 20:00:16 -0300 | [diff] [blame] | 340 | static int philips_td1316_tuner_init(struct dvb_frontend *fe) |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 341 | { |
| 342 | struct saa7134_dev *dev = fe->dvb->priv; |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 343 | struct tda1004x_state *state = fe->demodulator_priv; |
| 344 | u8 addr = state->config->tuner_address; |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 345 | static u8 msg[] = { 0x0b, 0xf5, 0x86, 0xab }; |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 346 | struct i2c_msg init_msg = {.addr = addr,.flags = 0,.buf = msg,.len = sizeof(msg) }; |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 347 | |
| 348 | /* setup PLL configuration */ |
Patrick Boettcher | dea7486 | 2006-05-14 05:01:31 -0300 | [diff] [blame] | 349 | if (fe->ops.i2c_gate_ctrl) |
| 350 | fe->ops.i2c_gate_ctrl(fe, 1); |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 351 | if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1) |
| 352 | return -EIO; |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 353 | return 0; |
| 354 | } |
| 355 | |
Andrew de Quincey | a79ddae | 2006-04-18 17:47:11 -0300 | [diff] [blame] | 356 | static int philips_td1316_tuner_set_params(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 357 | { |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 358 | return philips_tda6651_pll_set(fe, params); |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 359 | } |
| 360 | |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 361 | static int philips_td1316_tuner_sleep(struct dvb_frontend *fe) |
| 362 | { |
| 363 | struct saa7134_dev *dev = fe->dvb->priv; |
| 364 | struct tda1004x_state *state = fe->demodulator_priv; |
| 365 | u8 addr = state->config->tuner_address; |
| 366 | static u8 msg[] = { 0x0b, 0xdc, 0x86, 0xa4 }; |
| 367 | struct i2c_msg analog_msg = {.addr = addr,.flags = 0,.buf = msg,.len = sizeof(msg) }; |
| 368 | |
| 369 | /* switch the tuner to analog mode */ |
| 370 | if (fe->ops.i2c_gate_ctrl) |
| 371 | fe->ops.i2c_gate_ctrl(fe, 1); |
| 372 | if (i2c_transfer(&dev->i2c_adap, &analog_msg, 1) != 1) |
| 373 | return -EIO; |
| 374 | return 0; |
| 375 | } |
| 376 | |
| 377 | /* ------------------------------------------------------------------ */ |
| 378 | |
Hartmut Hackmann | cbb9452 | 2006-10-30 20:00:16 -0300 | [diff] [blame] | 379 | static int philips_europa_tuner_init(struct dvb_frontend *fe) |
| 380 | { |
| 381 | struct saa7134_dev *dev = fe->dvb->priv; |
| 382 | static u8 msg[] = { 0x00, 0x40}; |
| 383 | struct i2c_msg init_msg = {.addr = 0x43,.flags = 0,.buf = msg,.len = sizeof(msg) }; |
| 384 | |
| 385 | |
| 386 | if (philips_td1316_tuner_init(fe)) |
| 387 | return -EIO; |
| 388 | msleep(1); |
| 389 | if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1) |
| 390 | return -EIO; |
| 391 | |
| 392 | return 0; |
| 393 | } |
| 394 | |
Andrew de Quincey | a79ddae | 2006-04-18 17:47:11 -0300 | [diff] [blame] | 395 | static int philips_europa_tuner_sleep(struct dvb_frontend *fe) |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 396 | { |
| 397 | struct saa7134_dev *dev = fe->dvb->priv; |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 398 | |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 399 | static u8 msg[] = { 0x00, 0x14 }; |
| 400 | struct i2c_msg analog_msg = {.addr = 0x43,.flags = 0,.buf = msg,.len = sizeof(msg) }; |
| 401 | |
| 402 | if (philips_td1316_tuner_sleep(fe)) |
| 403 | return -EIO; |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 404 | |
| 405 | /* switch the board to analog mode */ |
Patrick Boettcher | dea7486 | 2006-05-14 05:01:31 -0300 | [diff] [blame] | 406 | if (fe->ops.i2c_gate_ctrl) |
| 407 | fe->ops.i2c_gate_ctrl(fe, 1); |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 408 | i2c_transfer(&dev->i2c_adap, &analog_msg, 1); |
Andrew de Quincey | a79ddae | 2006-04-18 17:47:11 -0300 | [diff] [blame] | 409 | return 0; |
| 410 | } |
| 411 | |
| 412 | static int philips_europa_demod_sleep(struct dvb_frontend *fe) |
| 413 | { |
| 414 | struct saa7134_dev *dev = fe->dvb->priv; |
| 415 | |
| 416 | if (dev->original_demod_sleep) |
| 417 | dev->original_demod_sleep(fe); |
Patrick Boettcher | dea7486 | 2006-05-14 05:01:31 -0300 | [diff] [blame] | 418 | fe->ops.i2c_gate_ctrl(fe, 1); |
Andrew de Quincey | a79ddae | 2006-04-18 17:47:11 -0300 | [diff] [blame] | 419 | return 0; |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 420 | } |
| 421 | |
| 422 | static struct tda1004x_config philips_europa_config = { |
| 423 | |
| 424 | .demod_address = 0x8, |
| 425 | .invert = 0, |
| 426 | .invert_oclk = 0, |
| 427 | .xtal_freq = TDA10046_XTAL_4M, |
| 428 | .agc_config = TDA10046_AGC_IFO_AUTO_POS, |
| 429 | .if_freq = TDA10046_FREQ_052, |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 430 | .tuner_address = 0x61, |
| 431 | .request_firmware = philips_tda1004x_request_firmware |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 432 | }; |
| 433 | |
| 434 | /* ------------------------------------------------------------------ */ |
Mauro Carvalho Chehab | 86ddd96 | 2005-07-12 13:58:47 -0700 | [diff] [blame] | 435 | |
Mauro Carvalho Chehab | 86ddd96 | 2005-07-12 13:58:47 -0700 | [diff] [blame] | 436 | static struct tda1004x_config medion_cardbus = { |
| 437 | .demod_address = 0x08, |
| 438 | .invert = 1, |
| 439 | .invert_oclk = 0, |
| 440 | .xtal_freq = TDA10046_XTAL_16M, |
| 441 | .agc_config = TDA10046_AGC_IFO_AUTO_NEG, |
| 442 | .if_freq = TDA10046_FREQ_3613, |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 443 | .tuner_address = 0x61, |
| 444 | .request_firmware = philips_tda1004x_request_firmware |
Mauro Carvalho Chehab | 86ddd96 | 2005-07-12 13:58:47 -0700 | [diff] [blame] | 445 | }; |
| 446 | |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 447 | /* ------------------------------------------------------------------ |
| 448 | * tda 1004x based cards with philips silicon tuner |
| 449 | */ |
| 450 | |
| 451 | static void philips_tda827x_lna_gain(struct dvb_frontend *fe, int high) |
| 452 | { |
| 453 | struct saa7134_dev *dev = fe->dvb->priv; |
| 454 | struct tda1004x_state *state = fe->demodulator_priv; |
| 455 | u8 addr = state->config->i2c_gate; |
| 456 | u8 config = state->config->tuner_config; |
| 457 | u8 GP00_CF[] = {0x20, 0x01}; |
| 458 | u8 GP00_LEV[] = {0x22, 0x00}; |
| 459 | |
| 460 | struct i2c_msg msg = {.addr = addr,.flags = 0,.buf = GP00_CF, .len = 2}; |
| 461 | if (config) { |
| 462 | if (high) { |
| 463 | dprintk("setting LNA to high gain\n"); |
| 464 | } else { |
| 465 | dprintk("setting LNA to low gain\n"); |
| 466 | } |
| 467 | } |
| 468 | switch (config) { |
| 469 | case 0: /* no LNA */ |
| 470 | break; |
| 471 | case 1: /* switch is GPIO 0 of tda8290 */ |
| 472 | case 2: |
| 473 | /* turn Vsync off */ |
| 474 | saa7134_set_gpio(dev, 22, 0); |
| 475 | GP00_LEV[1] = high ? 0 : 1; |
| 476 | if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) { |
Trent Piepho | cf3c34c | 2007-03-07 18:19:48 -0300 | [diff] [blame] | 477 | wprintk("could not access tda8290 at addr: 0x%02x\n", |
| 478 | addr << 1); |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 479 | return; |
| 480 | } |
| 481 | msg.buf = GP00_LEV; |
| 482 | if (config == 2) |
| 483 | GP00_LEV[1] = high ? 1 : 0; |
| 484 | i2c_transfer(&dev->i2c_adap, &msg, 1); |
| 485 | break; |
| 486 | case 3: /* switch with GPIO of saa713x */ |
| 487 | saa7134_set_gpio(dev, 22, high); |
| 488 | break; |
| 489 | } |
| 490 | } |
| 491 | |
| 492 | static int tda8290_i2c_gate_ctrl( struct dvb_frontend* fe, int enable) |
| 493 | { |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 494 | struct tda1004x_state *state = fe->demodulator_priv; |
| 495 | |
| 496 | u8 addr = state->config->i2c_gate; |
| 497 | static u8 tda8290_close[] = { 0x21, 0xc0}; |
| 498 | static u8 tda8290_open[] = { 0x21, 0x80}; |
| 499 | struct i2c_msg tda8290_msg = {.addr = addr,.flags = 0, .len = 2}; |
| 500 | if (enable) { |
| 501 | tda8290_msg.buf = tda8290_close; |
| 502 | } else { |
| 503 | tda8290_msg.buf = tda8290_open; |
| 504 | } |
Hartmut Hackmann | 06be303 | 2007-04-27 12:31:15 -0300 | [diff] [blame] | 505 | if (i2c_transfer(state->i2c, &tda8290_msg, 1) != 1) { |
Trent Piepho | cf3c34c | 2007-03-07 18:19:48 -0300 | [diff] [blame] | 506 | struct saa7134_dev *dev = fe->dvb->priv; |
| 507 | wprintk("could not access tda8290 I2C gate\n"); |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 508 | return -EIO; |
| 509 | } |
| 510 | msleep(20); |
| 511 | return 0; |
| 512 | } |
| 513 | |
Mauro Carvalho Chehab | 86ddd96 | 2005-07-12 13:58:47 -0700 | [diff] [blame] | 514 | /* ------------------------------------------------------------------ */ |
| 515 | |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 516 | static int philips_tda827x_tuner_init(struct dvb_frontend *fe) |
Hartmut Hackmann | 587d2fd | 2006-10-06 19:13:50 -0300 | [diff] [blame] | 517 | { |
| 518 | struct saa7134_dev *dev = fe->dvb->priv; |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 519 | struct tda1004x_state *state = fe->demodulator_priv; |
Michael Krufky | 8ce47da | 2007-04-27 12:31:14 -0300 | [diff] [blame] | 520 | |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 521 | switch (state->config->antenna_switch) { |
| 522 | case 0: break; |
| 523 | case 1: dprintk("setting GPIO21 to 0 (TV antenna?)\n"); |
| 524 | saa7134_set_gpio(dev, 21, 0); |
| 525 | break; |
| 526 | case 2: dprintk("setting GPIO21 to 1 (Radio antenna?)\n"); |
| 527 | saa7134_set_gpio(dev, 21, 1); |
| 528 | break; |
| 529 | } |
Andrew de Quincey | a79ddae | 2006-04-18 17:47:11 -0300 | [diff] [blame] | 530 | return 0; |
Hartmut Hackmann | 90e9df7 | 2005-11-08 21:38:42 -0800 | [diff] [blame] | 531 | } |
| 532 | |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 533 | static int philips_tda827x_tuner_sleep(struct dvb_frontend *fe) |
| 534 | { |
| 535 | struct saa7134_dev *dev = fe->dvb->priv; |
| 536 | struct tda1004x_state *state = fe->demodulator_priv; |
Michael Krufky | 8ce47da | 2007-04-27 12:31:14 -0300 | [diff] [blame] | 537 | |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 538 | switch (state->config->antenna_switch) { |
| 539 | case 0: break; |
| 540 | case 1: dprintk("setting GPIO21 to 1 (Radio antenna?)\n"); |
| 541 | saa7134_set_gpio(dev, 21, 1); |
| 542 | break; |
| 543 | case 2: dprintk("setting GPIO21 to 0 (TV antenna?)\n"); |
| 544 | saa7134_set_gpio(dev, 21, 0); |
| 545 | break; |
| 546 | } |
| 547 | return 0; |
| 548 | } |
| 549 | |
Michael Krufky | 8ce47da | 2007-04-27 12:31:14 -0300 | [diff] [blame] | 550 | static struct tda827x_config tda827x_cfg = { |
| 551 | .lna_gain = philips_tda827x_lna_gain, |
| 552 | .init = philips_tda827x_tuner_init, |
| 553 | .sleep = philips_tda827x_tuner_sleep |
| 554 | }; |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 555 | |
Hartmut Hackmann | b8bc76d | 2007-04-27 12:31:16 -0300 | [diff] [blame] | 556 | static void configure_tda827x_fe(struct saa7134_dev *dev, struct tda1004x_config *tda_conf) |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 557 | { |
| 558 | dev->dvb.frontend = dvb_attach(tda10046_attach, tda_conf, &dev->i2c_adap); |
| 559 | if (dev->dvb.frontend) { |
| 560 | if (tda_conf->i2c_gate) |
| 561 | dev->dvb.frontend->ops.i2c_gate_ctrl = tda8290_i2c_gate_ctrl; |
Hartmut Hackmann | ede2200 | 2007-04-27 12:31:32 -0300 | [diff] [blame] | 562 | if (dvb_attach(tda827x_attach, dev->dvb.frontend, tda_conf->tuner_address, |
| 563 | &dev->i2c_adap,&tda827x_cfg) == NULL) { |
Trent Piepho | cf3c34c | 2007-03-07 18:19:48 -0300 | [diff] [blame] | 564 | wprintk("no tda827x tuner found at addr: %02x\n", |
Hartmut Hackmann | ede2200 | 2007-04-27 12:31:32 -0300 | [diff] [blame] | 565 | tda_conf->tuner_address); |
| 566 | } |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 567 | } |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 568 | } |
| 569 | |
Hartmut Hackmann | 90e9df7 | 2005-11-08 21:38:42 -0800 | [diff] [blame] | 570 | /* ------------------------------------------------------------------ */ |
Edgar Simo | 261f508 | 2007-08-20 14:06:00 -0300 | [diff] [blame] | 571 | |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 572 | static struct tda1004x_config tda827x_lifeview_config = { |
| 573 | .demod_address = 0x08, |
| 574 | .invert = 1, |
| 575 | .invert_oclk = 0, |
| 576 | .xtal_freq = TDA10046_XTAL_16M, |
| 577 | .agc_config = TDA10046_AGC_TDA827X, |
| 578 | .gpio_config = TDA10046_GP11_I, |
| 579 | .if_freq = TDA10046_FREQ_045, |
| 580 | .tuner_address = 0x60, |
| 581 | .request_firmware = philips_tda1004x_request_firmware |
| 582 | }; |
Hartmut Hackmann | 90e9df7 | 2005-11-08 21:38:42 -0800 | [diff] [blame] | 583 | |
| 584 | static struct tda1004x_config philips_tiger_config = { |
| 585 | .demod_address = 0x08, |
| 586 | .invert = 1, |
| 587 | .invert_oclk = 0, |
| 588 | .xtal_freq = TDA10046_XTAL_16M, |
Hartmut Hackmann | 1bb0e86 | 2007-04-27 12:31:10 -0300 | [diff] [blame] | 589 | .agc_config = TDA10046_AGC_TDA827X, |
| 590 | .gpio_config = TDA10046_GP11_I, |
Hartmut Hackmann | 550a9a5 | 2006-11-15 21:31:54 -0300 | [diff] [blame] | 591 | .if_freq = TDA10046_FREQ_045, |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 592 | .i2c_gate = 0x4b, |
| 593 | .tuner_address = 0x61, |
| 594 | .tuner_config = 0, |
| 595 | .antenna_switch= 1, |
| 596 | .request_firmware = philips_tda1004x_request_firmware |
Hartmut Hackmann | 550a9a5 | 2006-11-15 21:31:54 -0300 | [diff] [blame] | 597 | }; |
Hartmut Hackmann | 550a9a5 | 2006-11-15 21:31:54 -0300 | [diff] [blame] | 598 | |
| 599 | static struct tda1004x_config cinergy_ht_config = { |
| 600 | .demod_address = 0x08, |
| 601 | .invert = 1, |
| 602 | .invert_oclk = 0, |
| 603 | .xtal_freq = TDA10046_XTAL_16M, |
Hartmut Hackmann | 1bb0e86 | 2007-04-27 12:31:10 -0300 | [diff] [blame] | 604 | .agc_config = TDA10046_AGC_TDA827X, |
| 605 | .gpio_config = TDA10046_GP01_I, |
Hartmut Hackmann | 90e9df7 | 2005-11-08 21:38:42 -0800 | [diff] [blame] | 606 | .if_freq = TDA10046_FREQ_045, |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 607 | .i2c_gate = 0x4b, |
| 608 | .tuner_address = 0x61, |
| 609 | .tuner_config = 0, |
| 610 | .request_firmware = philips_tda1004x_request_firmware |
Hartmut Hackmann | 90e9df7 | 2005-11-08 21:38:42 -0800 | [diff] [blame] | 611 | }; |
| 612 | |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 613 | static struct tda1004x_config cinergy_ht_pci_config = { |
| 614 | .demod_address = 0x08, |
| 615 | .invert = 1, |
| 616 | .invert_oclk = 0, |
| 617 | .xtal_freq = TDA10046_XTAL_16M, |
| 618 | .agc_config = TDA10046_AGC_TDA827X, |
| 619 | .gpio_config = TDA10046_GP01_I, |
| 620 | .if_freq = TDA10046_FREQ_045, |
| 621 | .i2c_gate = 0x4b, |
| 622 | .tuner_address = 0x60, |
| 623 | .tuner_config = 0, |
| 624 | .request_firmware = philips_tda1004x_request_firmware |
| 625 | }; |
| 626 | |
| 627 | static struct tda1004x_config philips_tiger_s_config = { |
| 628 | .demod_address = 0x08, |
| 629 | .invert = 1, |
| 630 | .invert_oclk = 0, |
| 631 | .xtal_freq = TDA10046_XTAL_16M, |
| 632 | .agc_config = TDA10046_AGC_TDA827X, |
| 633 | .gpio_config = TDA10046_GP01_I, |
| 634 | .if_freq = TDA10046_FREQ_045, |
| 635 | .i2c_gate = 0x4b, |
| 636 | .tuner_address = 0x61, |
| 637 | .tuner_config = 2, |
| 638 | .antenna_switch= 1, |
| 639 | .request_firmware = philips_tda1004x_request_firmware |
| 640 | }; |
Hartmut Hackmann | df42eaf | 2006-02-07 06:49:10 -0200 | [diff] [blame] | 641 | |
Hartmut Hackmann | 587d2fd | 2006-10-06 19:13:50 -0300 | [diff] [blame] | 642 | static struct tda1004x_config pinnacle_pctv_310i_config = { |
| 643 | .demod_address = 0x08, |
| 644 | .invert = 1, |
| 645 | .invert_oclk = 0, |
| 646 | .xtal_freq = TDA10046_XTAL_16M, |
Hartmut Hackmann | 1bb0e86 | 2007-04-27 12:31:10 -0300 | [diff] [blame] | 647 | .agc_config = TDA10046_AGC_TDA827X, |
| 648 | .gpio_config = TDA10046_GP11_I, |
Hartmut Hackmann | 587d2fd | 2006-10-06 19:13:50 -0300 | [diff] [blame] | 649 | .if_freq = TDA10046_FREQ_045, |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 650 | .i2c_gate = 0x4b, |
| 651 | .tuner_address = 0x61, |
| 652 | .tuner_config = 1, |
| 653 | .request_firmware = philips_tda1004x_request_firmware |
Hartmut Hackmann | 587d2fd | 2006-10-06 19:13:50 -0300 | [diff] [blame] | 654 | }; |
| 655 | |
Thomas Genty | c6e53da | 2006-11-05 14:17:30 -0300 | [diff] [blame] | 656 | static struct tda1004x_config hauppauge_hvr_1110_config = { |
| 657 | .demod_address = 0x08, |
| 658 | .invert = 1, |
| 659 | .invert_oclk = 0, |
| 660 | .xtal_freq = TDA10046_XTAL_16M, |
Hartmut Hackmann | 1bb0e86 | 2007-04-27 12:31:10 -0300 | [diff] [blame] | 661 | .agc_config = TDA10046_AGC_TDA827X, |
| 662 | .gpio_config = TDA10046_GP11_I, |
Thomas Genty | c6e53da | 2006-11-05 14:17:30 -0300 | [diff] [blame] | 663 | .if_freq = TDA10046_FREQ_045, |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 664 | .i2c_gate = 0x4b, |
| 665 | .tuner_address = 0x61, |
Benoit Istin | bc54837 | 2007-12-07 02:00:04 -0300 | [diff] [blame] | 666 | .tuner_config = 1, |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 667 | .request_firmware = philips_tda1004x_request_firmware |
Thomas Genty | c6e53da | 2006-11-05 14:17:30 -0300 | [diff] [blame] | 668 | }; |
| 669 | |
Hartmut Hackmann | 8364681 | 2006-10-12 20:38:51 -0300 | [diff] [blame] | 670 | static struct tda1004x_config asus_p7131_dual_config = { |
| 671 | .demod_address = 0x08, |
| 672 | .invert = 1, |
| 673 | .invert_oclk = 0, |
| 674 | .xtal_freq = TDA10046_XTAL_16M, |
Hartmut Hackmann | 1bb0e86 | 2007-04-27 12:31:10 -0300 | [diff] [blame] | 675 | .agc_config = TDA10046_AGC_TDA827X, |
| 676 | .gpio_config = TDA10046_GP11_I, |
Hartmut Hackmann | 8364681 | 2006-10-12 20:38:51 -0300 | [diff] [blame] | 677 | .if_freq = TDA10046_FREQ_045, |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 678 | .i2c_gate = 0x4b, |
| 679 | .tuner_address = 0x61, |
| 680 | .tuner_config = 0, |
| 681 | .antenna_switch= 2, |
| 682 | .request_firmware = philips_tda1004x_request_firmware |
Hartmut Hackmann | 8364681 | 2006-10-12 20:38:51 -0300 | [diff] [blame] | 683 | }; |
| 684 | |
Nico Sabbi | 420f32f | 2006-03-03 12:11:28 -0300 | [diff] [blame] | 685 | static struct tda1004x_config lifeview_trio_config = { |
| 686 | .demod_address = 0x09, |
| 687 | .invert = 1, |
| 688 | .invert_oclk = 0, |
| 689 | .xtal_freq = TDA10046_XTAL_16M, |
Hartmut Hackmann | 1bb0e86 | 2007-04-27 12:31:10 -0300 | [diff] [blame] | 690 | .agc_config = TDA10046_AGC_TDA827X, |
| 691 | .gpio_config = TDA10046_GP00_I, |
Nico Sabbi | 420f32f | 2006-03-03 12:11:28 -0300 | [diff] [blame] | 692 | .if_freq = TDA10046_FREQ_045, |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 693 | .tuner_address = 0x60, |
| 694 | .request_firmware = philips_tda1004x_request_firmware |
Nico Sabbi | 420f32f | 2006-03-03 12:11:28 -0300 | [diff] [blame] | 695 | }; |
| 696 | |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 697 | static struct tda1004x_config tevion_dvbt220rf_config = { |
| 698 | .demod_address = 0x08, |
| 699 | .invert = 1, |
| 700 | .invert_oclk = 0, |
| 701 | .xtal_freq = TDA10046_XTAL_16M, |
| 702 | .agc_config = TDA10046_AGC_TDA827X, |
| 703 | .gpio_config = TDA10046_GP11_I, |
| 704 | .if_freq = TDA10046_FREQ_045, |
| 705 | .tuner_address = 0x60, |
| 706 | .request_firmware = philips_tda1004x_request_firmware |
| 707 | }; |
Nico Sabbi | 420f32f | 2006-03-03 12:11:28 -0300 | [diff] [blame] | 708 | |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 709 | static struct tda1004x_config md8800_dvbt_config = { |
| 710 | .demod_address = 0x08, |
| 711 | .invert = 1, |
| 712 | .invert_oclk = 0, |
| 713 | .xtal_freq = TDA10046_XTAL_16M, |
| 714 | .agc_config = TDA10046_AGC_TDA827X, |
| 715 | .gpio_config = TDA10046_GP01_I, |
| 716 | .if_freq = TDA10046_FREQ_045, |
| 717 | .i2c_gate = 0x4b, |
| 718 | .tuner_address = 0x60, |
| 719 | .tuner_config = 0, |
| 720 | .request_firmware = philips_tda1004x_request_firmware |
| 721 | }; |
Hartmut Hackmann | df42eaf | 2006-02-07 06:49:10 -0200 | [diff] [blame] | 722 | |
Hartmut Hackmann | e06cea4 | 2007-03-13 20:58:29 -0300 | [diff] [blame] | 723 | static struct tda1004x_config asus_p7131_4871_config = { |
| 724 | .demod_address = 0x08, |
| 725 | .invert = 1, |
| 726 | .invert_oclk = 0, |
| 727 | .xtal_freq = TDA10046_XTAL_16M, |
| 728 | .agc_config = TDA10046_AGC_TDA827X, |
| 729 | .gpio_config = TDA10046_GP01_I, |
| 730 | .if_freq = TDA10046_FREQ_045, |
| 731 | .i2c_gate = 0x4b, |
| 732 | .tuner_address = 0x61, |
| 733 | .tuner_config = 2, |
| 734 | .antenna_switch= 2, |
| 735 | .request_firmware = philips_tda1004x_request_firmware |
| 736 | }; |
| 737 | |
Hartmut Hackmann | f3eec0c0 | 2007-03-14 20:33:55 -0300 | [diff] [blame] | 738 | static struct tda1004x_config asus_p7131_hybrid_lna_config = { |
Hartmut Hackmann | e06cea4 | 2007-03-13 20:58:29 -0300 | [diff] [blame] | 739 | .demod_address = 0x08, |
| 740 | .invert = 1, |
| 741 | .invert_oclk = 0, |
| 742 | .xtal_freq = TDA10046_XTAL_16M, |
| 743 | .agc_config = TDA10046_AGC_TDA827X, |
| 744 | .gpio_config = TDA10046_GP11_I, |
| 745 | .if_freq = TDA10046_FREQ_045, |
| 746 | .i2c_gate = 0x4b, |
| 747 | .tuner_address = 0x61, |
| 748 | .tuner_config = 2, |
| 749 | .antenna_switch= 2, |
| 750 | .request_firmware = philips_tda1004x_request_firmware |
| 751 | }; |
Edgar Simo | 261f508 | 2007-08-20 14:06:00 -0300 | [diff] [blame] | 752 | |
Simon Farnsworth | b39423a | 2007-05-01 10:01:20 -0300 | [diff] [blame] | 753 | static struct tda1004x_config kworld_dvb_t_210_config = { |
| 754 | .demod_address = 0x08, |
| 755 | .invert = 1, |
| 756 | .invert_oclk = 0, |
| 757 | .xtal_freq = TDA10046_XTAL_16M, |
| 758 | .agc_config = TDA10046_AGC_TDA827X, |
| 759 | .gpio_config = TDA10046_GP11_I, |
| 760 | .if_freq = TDA10046_FREQ_045, |
| 761 | .i2c_gate = 0x4b, |
| 762 | .tuner_address = 0x61, |
| 763 | .tuner_config = 2, |
| 764 | .antenna_switch= 1, |
| 765 | .request_firmware = philips_tda1004x_request_firmware |
| 766 | }; |
Edgar Simo | 261f508 | 2007-08-20 14:06:00 -0300 | [diff] [blame] | 767 | |
Edgar Simo | d90d9f5 | 2007-08-20 14:14:50 -0300 | [diff] [blame] | 768 | static struct tda1004x_config avermedia_super_007_config = { |
| 769 | .demod_address = 0x08, |
| 770 | .invert = 1, |
| 771 | .invert_oclk = 0, |
| 772 | .xtal_freq = TDA10046_XTAL_16M, |
| 773 | .agc_config = TDA10046_AGC_TDA827X, |
| 774 | .gpio_config = TDA10046_GP01_I, |
| 775 | .if_freq = TDA10046_FREQ_045, |
| 776 | .i2c_gate = 0x4b, |
| 777 | .tuner_address = 0x60, |
| 778 | .tuner_config = 0, |
| 779 | .antenna_switch= 1, |
| 780 | .request_firmware = philips_tda1004x_request_firmware |
| 781 | }; |
| 782 | |
Hermann Pitton | 4ba2437 | 2008-01-20 19:27:51 -0300 | [diff] [blame] | 783 | static struct tda1004x_config twinhan_dtv_dvb_3056_config = { |
| 784 | .demod_address = 0x08, |
| 785 | .invert = 1, |
| 786 | .invert_oclk = 0, |
| 787 | .xtal_freq = TDA10046_XTAL_16M, |
| 788 | .agc_config = TDA10046_AGC_TDA827X, |
| 789 | .gpio_config = TDA10046_GP01_I, |
| 790 | .if_freq = TDA10046_FREQ_045, |
| 791 | .i2c_gate = 0x42, |
| 792 | .tuner_address = 0x61, |
| 793 | .tuner_config = 2, |
| 794 | .antenna_switch = 1, |
| 795 | .request_firmware = philips_tda1004x_request_firmware |
| 796 | }; |
| 797 | |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 798 | /* ------------------------------------------------------------------ |
| 799 | * special case: this card uses saa713x GPIO22 for the mode switch |
| 800 | */ |
Hartmut Hackmann | df42eaf | 2006-02-07 06:49:10 -0200 | [diff] [blame] | 801 | |
Andrew de Quincey | a79ddae | 2006-04-18 17:47:11 -0300 | [diff] [blame] | 802 | static int ads_duo_tuner_init(struct dvb_frontend *fe) |
Hartmut Hackmann | df42eaf | 2006-02-07 06:49:10 -0200 | [diff] [blame] | 803 | { |
| 804 | struct saa7134_dev *dev = fe->dvb->priv; |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 805 | philips_tda827x_tuner_init(fe); |
Hartmut Hackmann | df42eaf | 2006-02-07 06:49:10 -0200 | [diff] [blame] | 806 | /* route TDA8275a AGC input to the channel decoder */ |
Hartmut Hackmann | 06be303 | 2007-04-27 12:31:15 -0300 | [diff] [blame] | 807 | saa7134_set_gpio(dev, 22, 1); |
Hartmut Hackmann | df42eaf | 2006-02-07 06:49:10 -0200 | [diff] [blame] | 808 | return 0; |
| 809 | } |
| 810 | |
Andrew de Quincey | a79ddae | 2006-04-18 17:47:11 -0300 | [diff] [blame] | 811 | static int ads_duo_tuner_sleep(struct dvb_frontend *fe) |
Hartmut Hackmann | df42eaf | 2006-02-07 06:49:10 -0200 | [diff] [blame] | 812 | { |
| 813 | struct saa7134_dev *dev = fe->dvb->priv; |
| 814 | /* route TDA8275a AGC input to the analog IF chip*/ |
Hartmut Hackmann | 06be303 | 2007-04-27 12:31:15 -0300 | [diff] [blame] | 815 | saa7134_set_gpio(dev, 22, 0); |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 816 | philips_tda827x_tuner_sleep(fe); |
Andrew de Quincey | a79ddae | 2006-04-18 17:47:11 -0300 | [diff] [blame] | 817 | return 0; |
Hartmut Hackmann | df42eaf | 2006-02-07 06:49:10 -0200 | [diff] [blame] | 818 | } |
| 819 | |
Michael Krufky | 8ce47da | 2007-04-27 12:31:14 -0300 | [diff] [blame] | 820 | static struct tda827x_config ads_duo_cfg = { |
| 821 | .lna_gain = philips_tda827x_lna_gain, |
| 822 | .init = ads_duo_tuner_init, |
| 823 | .sleep = ads_duo_tuner_sleep |
| 824 | }; |
| 825 | |
Hartmut Hackmann | df42eaf | 2006-02-07 06:49:10 -0200 | [diff] [blame] | 826 | static struct tda1004x_config ads_tech_duo_config = { |
| 827 | .demod_address = 0x08, |
| 828 | .invert = 1, |
| 829 | .invert_oclk = 0, |
| 830 | .xtal_freq = TDA10046_XTAL_16M, |
Hartmut Hackmann | 1bb0e86 | 2007-04-27 12:31:10 -0300 | [diff] [blame] | 831 | .agc_config = TDA10046_AGC_TDA827X, |
| 832 | .gpio_config = TDA10046_GP00_I, |
Hartmut Hackmann | df42eaf | 2006-02-07 06:49:10 -0200 | [diff] [blame] | 833 | .if_freq = TDA10046_FREQ_045, |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 834 | .tuner_address = 0x61, |
| 835 | .request_firmware = philips_tda1004x_request_firmware |
Hartmut Hackmann | df42eaf | 2006-02-07 06:49:10 -0200 | [diff] [blame] | 836 | }; |
| 837 | |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 838 | /* ================================================================== |
| 839 | * tda10086 based DVB-S cards, helper functions |
| 840 | */ |
Hartmut Hackmann | 5eda227 | 2006-08-07 14:03:32 -0300 | [diff] [blame] | 841 | |
Igor M. Liplianin | e2ac28f | 2006-08-08 09:10:10 -0300 | [diff] [blame] | 842 | static struct tda10086_config flydvbs = { |
| 843 | .demod_address = 0x0e, |
| 844 | .invert = 0, |
Hartmut Hackmann | ea75baf | 2008-02-09 23:54:24 -0300 | [diff] [blame] | 845 | .diseqc_tone = 0, |
Igor M. Liplianin | e2ac28f | 2006-08-08 09:10:10 -0300 | [diff] [blame] | 846 | }; |
| 847 | |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 848 | /* ================================================================== |
| 849 | * nxt200x based ATSC cards, helper functions |
| 850 | */ |
Hartmut Hackmann | 90e9df7 | 2005-11-08 21:38:42 -0800 | [diff] [blame] | 851 | |
Michael Krufky | 3b64e8e | 2005-11-08 21:38:20 -0800 | [diff] [blame] | 852 | static struct nxt200x_config avertvhda180 = { |
| 853 | .demod_address = 0x0a, |
Michael Krufky | 3b64e8e | 2005-11-08 21:38:20 -0800 | [diff] [blame] | 854 | }; |
Andrew Burri | 3e1410a | 2006-02-27 00:08:23 -0300 | [diff] [blame] | 855 | |
| 856 | static struct nxt200x_config kworldatsc110 = { |
| 857 | .demod_address = 0x0a, |
Andrew Burri | 3e1410a | 2006-02-27 00:08:23 -0300 | [diff] [blame] | 858 | }; |
Michael Krufky | 3b64e8e | 2005-11-08 21:38:20 -0800 | [diff] [blame] | 859 | |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 860 | /* ================================================================== |
| 861 | * Core code |
| 862 | */ |
Mauro Carvalho Chehab | 86ddd96 | 2005-07-12 13:58:47 -0700 | [diff] [blame] | 863 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 864 | static int dvb_init(struct saa7134_dev *dev) |
| 865 | { |
Hartmut Hackmann | 1c4f76a | 2007-04-27 12:31:16 -0300 | [diff] [blame] | 866 | int ret; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 867 | /* init struct videobuf_dvb */ |
| 868 | dev->ts.nr_bufs = 32; |
| 869 | dev->ts.nr_packets = 32*4; |
| 870 | dev->dvb.name = dev->name; |
Mauro Carvalho Chehab | c1accaa | 2007-08-23 16:37:49 -0300 | [diff] [blame] | 871 | videobuf_queue_pci_init(&dev->dvb.dvbq, &saa7134_ts_qops, |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 872 | dev->pci, &dev->slock, |
| 873 | V4L2_BUF_TYPE_VIDEO_CAPTURE, |
| 874 | V4L2_FIELD_ALTERNATE, |
| 875 | sizeof(struct saa7134_buf), |
| 876 | dev); |
| 877 | |
| 878 | switch (dev->board) { |
| 879 | case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL: |
Trent Piepho | cf3c34c | 2007-03-07 18:19:48 -0300 | [diff] [blame] | 880 | dprintk("pinnacle 300i dvb setup\n"); |
Andrew de Quincey | 2bfe031 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 881 | dev->dvb.frontend = dvb_attach(mt352_attach, &pinnacle_300i, |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 882 | &dev->i2c_adap); |
Andrew de Quincey | 6b3ccab | 2006-04-20 12:01:47 -0300 | [diff] [blame] | 883 | if (dev->dvb.frontend) { |
Patrick Boettcher | dea7486 | 2006-05-14 05:01:31 -0300 | [diff] [blame] | 884 | dev->dvb.frontend->ops.tuner_ops.set_params = mt352_pinnacle_tuner_set_params; |
Andrew de Quincey | 6b3ccab | 2006-04-20 12:01:47 -0300 | [diff] [blame] | 885 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 886 | break; |
Jose Alberto Reguero | a78d0bf | 2006-02-07 06:25:14 -0200 | [diff] [blame] | 887 | case SAA7134_BOARD_AVERMEDIA_777: |
Petr Baudis | 515c208 | 2006-09-26 16:53:53 -0300 | [diff] [blame] | 888 | case SAA7134_BOARD_AVERMEDIA_A16AR: |
Trent Piepho | cf3c34c | 2007-03-07 18:19:48 -0300 | [diff] [blame] | 889 | dprintk("avertv 777 dvb setup\n"); |
Andrew de Quincey | 2bfe031 | 2006-08-08 09:10:08 -0300 | [diff] [blame] | 890 | dev->dvb.frontend = dvb_attach(mt352_attach, &avermedia_777, |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 891 | &dev->i2c_adap); |
Andrew de Quincey | 6b3ccab | 2006-04-20 12:01:47 -0300 | [diff] [blame] | 892 | if (dev->dvb.frontend) { |
Michael Krufky | 8511df9 | 2007-05-07 01:34:36 -0300 | [diff] [blame] | 893 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
Michael Krufky | 47a9991 | 2007-06-12 16:10:51 -0300 | [diff] [blame] | 894 | NULL, DVB_PLL_PHILIPS_TD1316); |
Andrew de Quincey | 6b3ccab | 2006-04-20 12:01:47 -0300 | [diff] [blame] | 895 | } |
Jose Alberto Reguero | a78d0bf | 2006-02-07 06:25:14 -0200 | [diff] [blame] | 896 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 897 | case SAA7134_BOARD_MD7134: |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 898 | dev->dvb.frontend = dvb_attach(tda10046_attach, |
| 899 | &medion_cardbus, |
| 900 | &dev->i2c_adap); |
Andrew de Quincey | 6b3ccab | 2006-04-20 12:01:47 -0300 | [diff] [blame] | 901 | if (dev->dvb.frontend) { |
Trent Piepho | b7754d7 | 2007-05-08 18:05:16 -0300 | [diff] [blame] | 902 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, medion_cardbus.tuner_address, |
Michael Krufky | 47a9991 | 2007-06-12 16:10:51 -0300 | [diff] [blame] | 903 | &dev->i2c_adap, DVB_PLL_FMD1216ME); |
Andrew de Quincey | 6b3ccab | 2006-04-20 12:01:47 -0300 | [diff] [blame] | 904 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 905 | break; |
Mauro Carvalho Chehab | 86ddd96 | 2005-07-12 13:58:47 -0700 | [diff] [blame] | 906 | case SAA7134_BOARD_PHILIPS_TOUGH: |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 907 | dev->dvb.frontend = dvb_attach(tda10046_attach, |
| 908 | &philips_tu1216_60_config, |
| 909 | &dev->i2c_adap); |
Andrew de Quincey | 6b3ccab | 2006-04-20 12:01:47 -0300 | [diff] [blame] | 910 | if (dev->dvb.frontend) { |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 911 | dev->dvb.frontend->ops.tuner_ops.init = philips_tu1216_init; |
| 912 | dev->dvb.frontend->ops.tuner_ops.set_params = philips_tda6651_pll_set; |
Andrew de Quincey | 6b3ccab | 2006-04-20 12:01:47 -0300 | [diff] [blame] | 913 | } |
Mauro Carvalho Chehab | 86ddd96 | 2005-07-12 13:58:47 -0700 | [diff] [blame] | 914 | break; |
| 915 | case SAA7134_BOARD_FLYDVBTDUO: |
Peter Missel | 10b7a90 | 2006-01-23 17:11:06 -0200 | [diff] [blame] | 916 | case SAA7134_BOARD_FLYDVBT_DUO_CARDBUS: |
Hartmut Hackmann | b8bc76d | 2007-04-27 12:31:16 -0300 | [diff] [blame] | 917 | configure_tda827x_fe(dev, &tda827x_lifeview_config); |
Mauro Carvalho Chehab | 86ddd96 | 2005-07-12 13:58:47 -0700 | [diff] [blame] | 918 | break; |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 919 | case SAA7134_BOARD_PHILIPS_EUROPA: |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 920 | case SAA7134_BOARD_VIDEOMATE_DVBT_300: |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 921 | dev->dvb.frontend = dvb_attach(tda10046_attach, |
| 922 | &philips_europa_config, |
| 923 | &dev->i2c_adap); |
Andrew de Quincey | 6b3ccab | 2006-04-20 12:01:47 -0300 | [diff] [blame] | 924 | if (dev->dvb.frontend) { |
Hartmut Hackmann | 588f983 | 2006-10-18 17:30:42 -0300 | [diff] [blame] | 925 | dev->original_demod_sleep = dev->dvb.frontend->ops.sleep; |
| 926 | dev->dvb.frontend->ops.sleep = philips_europa_demod_sleep; |
Patrick Boettcher | dea7486 | 2006-05-14 05:01:31 -0300 | [diff] [blame] | 927 | dev->dvb.frontend->ops.tuner_ops.init = philips_europa_tuner_init; |
| 928 | dev->dvb.frontend->ops.tuner_ops.sleep = philips_europa_tuner_sleep; |
| 929 | dev->dvb.frontend->ops.tuner_ops.set_params = philips_td1316_tuner_set_params; |
Andrew de Quincey | 6b3ccab | 2006-04-20 12:01:47 -0300 | [diff] [blame] | 930 | } |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 931 | break; |
| 932 | case SAA7134_BOARD_VIDEOMATE_DVBT_200: |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 933 | dev->dvb.frontend = dvb_attach(tda10046_attach, |
| 934 | &philips_tu1216_61_config, |
| 935 | &dev->i2c_adap); |
Andrew de Quincey | 6b3ccab | 2006-04-20 12:01:47 -0300 | [diff] [blame] | 936 | if (dev->dvb.frontend) { |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 937 | dev->dvb.frontend->ops.tuner_ops.init = philips_tu1216_init; |
| 938 | dev->dvb.frontend->ops.tuner_ops.set_params = philips_tda6651_pll_set; |
Andrew de Quincey | 6b3ccab | 2006-04-20 12:01:47 -0300 | [diff] [blame] | 939 | } |
Hartmut Hackmann | 2cf36ac | 2005-11-08 21:36:32 -0800 | [diff] [blame] | 940 | break; |
Simon Farnsworth | b39423a | 2007-05-01 10:01:20 -0300 | [diff] [blame] | 941 | case SAA7134_BOARD_KWORLD_DVBT_210: |
| 942 | configure_tda827x_fe(dev, &kworld_dvb_t_210_config); |
| 943 | break; |
Hartmut Hackmann | 90e9df7 | 2005-11-08 21:38:42 -0800 | [diff] [blame] | 944 | case SAA7134_BOARD_PHILIPS_TIGER: |
Hartmut Hackmann | b8bc76d | 2007-04-27 12:31:16 -0300 | [diff] [blame] | 945 | configure_tda827x_fe(dev, &philips_tiger_config); |
Hartmut Hackmann | 587d2fd | 2006-10-06 19:13:50 -0300 | [diff] [blame] | 946 | break; |
| 947 | case SAA7134_BOARD_PINNACLE_PCTV_310i: |
Hartmut Hackmann | b8bc76d | 2007-04-27 12:31:16 -0300 | [diff] [blame] | 948 | configure_tda827x_fe(dev, &pinnacle_pctv_310i_config); |
Hartmut Hackmann | 90e9df7 | 2005-11-08 21:38:42 -0800 | [diff] [blame] | 949 | break; |
Thomas Genty | c6e53da | 2006-11-05 14:17:30 -0300 | [diff] [blame] | 950 | case SAA7134_BOARD_HAUPPAUGE_HVR1110: |
Hartmut Hackmann | b8bc76d | 2007-04-27 12:31:16 -0300 | [diff] [blame] | 951 | configure_tda827x_fe(dev, &hauppauge_hvr_1110_config); |
Thomas Genty | c6e53da | 2006-11-05 14:17:30 -0300 | [diff] [blame] | 952 | break; |
Hartmut Hackmann | d4b0aba | 2005-11-08 21:38:44 -0800 | [diff] [blame] | 953 | case SAA7134_BOARD_ASUSTeK_P7131_DUAL: |
Hartmut Hackmann | b8bc76d | 2007-04-27 12:31:16 -0300 | [diff] [blame] | 954 | configure_tda827x_fe(dev, &asus_p7131_dual_config); |
Hartmut Hackmann | d4b0aba | 2005-11-08 21:38:44 -0800 | [diff] [blame] | 955 | break; |
Giampiero Giancipoli | 3d8466e | 2006-02-07 06:49:09 -0200 | [diff] [blame] | 956 | case SAA7134_BOARD_FLYDVBT_LR301: |
Hartmut Hackmann | b8bc76d | 2007-04-27 12:31:16 -0300 | [diff] [blame] | 957 | configure_tda827x_fe(dev, &tda827x_lifeview_config); |
Giampiero Giancipoli | 3d8466e | 2006-02-07 06:49:09 -0200 | [diff] [blame] | 958 | break; |
Nico Sabbi | 420f32f | 2006-03-03 12:11:28 -0300 | [diff] [blame] | 959 | case SAA7134_BOARD_FLYDVB_TRIO: |
Hartmut Hackmann | ea75baf | 2008-02-09 23:54:24 -0300 | [diff] [blame] | 960 | if(! use_frontend) { /* terrestrial */ |
Hartmut Hackmann | b8bc76d | 2007-04-27 12:31:16 -0300 | [diff] [blame] | 961 | configure_tda827x_fe(dev, &lifeview_trio_config); |
Hartmut Hackmann | ea75baf | 2008-02-09 23:54:24 -0300 | [diff] [blame] | 962 | } else { /* satellite */ |
Nico Sabbi | 1f683cd | 2006-11-15 22:06:56 -0300 | [diff] [blame] | 963 | dev->dvb.frontend = dvb_attach(tda10086_attach, &flydvbs, &dev->i2c_adap); |
| 964 | if (dev->dvb.frontend) { |
| 965 | if (dvb_attach(tda826x_attach, dev->dvb.frontend, 0x63, |
| 966 | &dev->i2c_adap, 0) == NULL) { |
Trent Piepho | cf3c34c | 2007-03-07 18:19:48 -0300 | [diff] [blame] | 967 | wprintk("%s: Lifeview Trio, No tda826x found!\n", __FUNCTION__); |
Nico Sabbi | 1f683cd | 2006-11-15 22:06:56 -0300 | [diff] [blame] | 968 | } |
| 969 | if (dvb_attach(isl6421_attach, dev->dvb.frontend, &dev->i2c_adap, |
| 970 | 0x08, 0, 0) == NULL) { |
Trent Piepho | cf3c34c | 2007-03-07 18:19:48 -0300 | [diff] [blame] | 971 | wprintk("%s: Lifeview Trio, No ISL6421 found!\n", __FUNCTION__); |
Nico Sabbi | 1f683cd | 2006-11-15 22:06:56 -0300 | [diff] [blame] | 972 | } |
| 973 | } |
Andrew de Quincey | 6b3ccab | 2006-04-20 12:01:47 -0300 | [diff] [blame] | 974 | } |
Nico Sabbi | 420f32f | 2006-03-03 12:11:28 -0300 | [diff] [blame] | 975 | break; |
Hartmut Hackmann | df42eaf | 2006-02-07 06:49:10 -0200 | [diff] [blame] | 976 | case SAA7134_BOARD_ADS_DUO_CARDBUS_PTV331: |
Hartmut Hackmann | d95b894 | 2006-03-27 19:39:30 -0300 | [diff] [blame] | 977 | case SAA7134_BOARD_FLYDVBT_HYBRID_CARDBUS: |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 978 | dev->dvb.frontend = dvb_attach(tda10046_attach, |
| 979 | &ads_tech_duo_config, |
| 980 | &dev->i2c_adap); |
Andrew de Quincey | 6b3ccab | 2006-04-20 12:01:47 -0300 | [diff] [blame] | 981 | if (dev->dvb.frontend) { |
Hartmut Hackmann | ede2200 | 2007-04-27 12:31:32 -0300 | [diff] [blame] | 982 | if (dvb_attach(tda827x_attach,dev->dvb.frontend, |
Michael Krufky | 8ce47da | 2007-04-27 12:31:14 -0300 | [diff] [blame] | 983 | ads_tech_duo_config.tuner_address, |
Hartmut Hackmann | ede2200 | 2007-04-27 12:31:32 -0300 | [diff] [blame] | 984 | &dev->i2c_adap,&ads_duo_cfg) == NULL) { |
Trent Piepho | cf3c34c | 2007-03-07 18:19:48 -0300 | [diff] [blame] | 985 | wprintk("no tda827x tuner found at addr: %02x\n", |
Hartmut Hackmann | ede2200 | 2007-04-27 12:31:32 -0300 | [diff] [blame] | 986 | ads_tech_duo_config.tuner_address); |
| 987 | } |
Andrew de Quincey | 6b3ccab | 2006-04-20 12:01:47 -0300 | [diff] [blame] | 988 | } |
Hartmut Hackmann | d95b894 | 2006-03-27 19:39:30 -0300 | [diff] [blame] | 989 | break; |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 990 | case SAA7134_BOARD_TEVION_DVBT_220RF: |
Hartmut Hackmann | b8bc76d | 2007-04-27 12:31:16 -0300 | [diff] [blame] | 991 | configure_tda827x_fe(dev, &tevion_dvbt220rf_config); |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 992 | break; |
Hartmut Hackmann | 5eda227 | 2006-08-07 14:03:32 -0300 | [diff] [blame] | 993 | case SAA7134_BOARD_MEDION_MD8800_QUADRO: |
Hartmut Hackmann | 4b1431c | 2008-04-22 14:42:09 -0300 | [diff] [blame^] | 994 | if (!use_frontend) { /* terrestrial */ |
| 995 | configure_tda827x_fe(dev, &md8800_dvbt_config); |
| 996 | } else { /* satellite */ |
| 997 | dev->dvb.frontend = dvb_attach(tda10086_attach, |
| 998 | &flydvbs, &dev->i2c_adap); |
| 999 | if (dev->dvb.frontend) { |
| 1000 | if (dvb_attach(tda826x_attach, dev->dvb.frontend, |
| 1001 | 0x60, &dev->i2c_adap, 0) == NULL) |
| 1002 | wprintk("%s: Medion Quadro, no tda826x " |
| 1003 | "found !\n", __FUNCTION__); |
| 1004 | if (dvb_attach(isl6405_attach, dev->dvb.frontend, |
| 1005 | &dev->i2c_adap, 0x08, 0, 0) == NULL) |
| 1006 | wprintk("%s: Medion Quadro, no ISL6405 " |
| 1007 | "found !\n", __FUNCTION__); |
| 1008 | } |
| 1009 | } |
Hartmut Hackmann | 5eda227 | 2006-08-07 14:03:32 -0300 | [diff] [blame] | 1010 | break; |
Michael Krufky | 3b64e8e | 2005-11-08 21:38:20 -0800 | [diff] [blame] | 1011 | case SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180: |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 1012 | dev->dvb.frontend = dvb_attach(nxt200x_attach, &avertvhda180, |
| 1013 | &dev->i2c_adap); |
Andrew de Quincey | a79ddae | 2006-04-18 17:47:11 -0300 | [diff] [blame] | 1014 | if (dev->dvb.frontend) { |
Michael Krufky | 4ad8eee5 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 1015 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
Michael Krufky | 47a9991 | 2007-06-12 16:10:51 -0300 | [diff] [blame] | 1016 | NULL, DVB_PLL_TDHU2); |
Andrew de Quincey | a79ddae | 2006-04-18 17:47:11 -0300 | [diff] [blame] | 1017 | } |
Michael Krufky | 3b64e8e | 2005-11-08 21:38:20 -0800 | [diff] [blame] | 1018 | break; |
Andrew Burri | 3e1410a | 2006-02-27 00:08:23 -0300 | [diff] [blame] | 1019 | case SAA7134_BOARD_KWORLD_ATSC110: |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 1020 | dev->dvb.frontend = dvb_attach(nxt200x_attach, &kworldatsc110, |
| 1021 | &dev->i2c_adap); |
Andrew de Quincey | a79ddae | 2006-04-18 17:47:11 -0300 | [diff] [blame] | 1022 | if (dev->dvb.frontend) { |
Michael Krufky | 4ad8eee5 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 1023 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, 0x61, |
Michael Krufky | 47a9991 | 2007-06-12 16:10:51 -0300 | [diff] [blame] | 1024 | NULL, DVB_PLL_TUV1236D); |
Andrew de Quincey | a79ddae | 2006-04-18 17:47:11 -0300 | [diff] [blame] | 1025 | } |
Andrew Burri | 3e1410a | 2006-02-27 00:08:23 -0300 | [diff] [blame] | 1026 | break; |
Igor M. Liplianin | e2ac28f | 2006-08-08 09:10:10 -0300 | [diff] [blame] | 1027 | case SAA7134_BOARD_FLYDVBS_LR300: |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 1028 | dev->dvb.frontend = dvb_attach(tda10086_attach, &flydvbs, |
| 1029 | &dev->i2c_adap); |
Igor M. Liplianin | e2ac28f | 2006-08-08 09:10:10 -0300 | [diff] [blame] | 1030 | if (dev->dvb.frontend) { |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 1031 | if (dvb_attach(tda826x_attach, dev->dvb.frontend, 0x60, |
| 1032 | &dev->i2c_adap, 0) == NULL) { |
Trent Piepho | cf3c34c | 2007-03-07 18:19:48 -0300 | [diff] [blame] | 1033 | wprintk("%s: No tda826x found!\n", __FUNCTION__); |
Igor M. Liplianin | e2ac28f | 2006-08-08 09:10:10 -0300 | [diff] [blame] | 1034 | } |
Michael Krufky | f7b54b1 | 2006-08-08 15:48:08 -0300 | [diff] [blame] | 1035 | if (dvb_attach(isl6421_attach, dev->dvb.frontend, |
| 1036 | &dev->i2c_adap, 0x08, 0, 0) == NULL) { |
Trent Piepho | cf3c34c | 2007-03-07 18:19:48 -0300 | [diff] [blame] | 1037 | wprintk("%s: No ISL6421 found!\n", __FUNCTION__); |
Igor M. Liplianin | e2ac28f | 2006-08-08 09:10:10 -0300 | [diff] [blame] | 1038 | } |
| 1039 | } |
| 1040 | break; |
Hartmut Hackmann | cf146ca | 2006-10-02 20:49:24 -0300 | [diff] [blame] | 1041 | case SAA7134_BOARD_ASUS_EUROPA2_HYBRID: |
Matthias Schwarzott | 0e8f4cc | 2008-01-28 12:01:11 -0300 | [diff] [blame] | 1042 | dev->dvb.frontend = dvb_attach(tda10046_attach, |
| 1043 | &medion_cardbus, |
| 1044 | &dev->i2c_adap); |
Hartmut Hackmann | cf146ca | 2006-10-02 20:49:24 -0300 | [diff] [blame] | 1045 | if (dev->dvb.frontend) { |
| 1046 | dev->original_demod_sleep = dev->dvb.frontend->ops.sleep; |
| 1047 | dev->dvb.frontend->ops.sleep = philips_europa_demod_sleep; |
Trent Piepho | b7754d7 | 2007-05-08 18:05:16 -0300 | [diff] [blame] | 1048 | |
| 1049 | dvb_attach(dvb_pll_attach, dev->dvb.frontend, medion_cardbus.tuner_address, |
Michael Krufky | 47a9991 | 2007-06-12 16:10:51 -0300 | [diff] [blame] | 1050 | &dev->i2c_adap, DVB_PLL_FMD1216ME); |
Hartmut Hackmann | cf146ca | 2006-10-02 20:49:24 -0300 | [diff] [blame] | 1051 | } |
| 1052 | break; |
Hartmut Hackmann | cbb9452 | 2006-10-30 20:00:16 -0300 | [diff] [blame] | 1053 | case SAA7134_BOARD_VIDEOMATE_DVBT_200A: |
| 1054 | dev->dvb.frontend = dvb_attach(tda10046_attach, |
| 1055 | &philips_europa_config, |
| 1056 | &dev->i2c_adap); |
| 1057 | if (dev->dvb.frontend) { |
| 1058 | dev->dvb.frontend->ops.tuner_ops.init = philips_td1316_tuner_init; |
| 1059 | dev->dvb.frontend->ops.tuner_ops.set_params = philips_td1316_tuner_set_params; |
| 1060 | } |
| 1061 | break; |
Hartmut Hackmann | 550a9a5 | 2006-11-15 21:31:54 -0300 | [diff] [blame] | 1062 | case SAA7134_BOARD_CINERGY_HT_PCMCIA: |
Hartmut Hackmann | b8bc76d | 2007-04-27 12:31:16 -0300 | [diff] [blame] | 1063 | configure_tda827x_fe(dev, &cinergy_ht_config); |
Hartmut Hackmann | 550a9a5 | 2006-11-15 21:31:54 -0300 | [diff] [blame] | 1064 | break; |
Michael Krufky | 9de271e | 2007-01-16 18:36:40 -0300 | [diff] [blame] | 1065 | case SAA7134_BOARD_CINERGY_HT_PCI: |
Hartmut Hackmann | b8bc76d | 2007-04-27 12:31:16 -0300 | [diff] [blame] | 1066 | configure_tda827x_fe(dev, &cinergy_ht_pci_config); |
Hartmut Hackmann | 58ef4f9 | 2007-04-27 12:31:12 -0300 | [diff] [blame] | 1067 | break; |
| 1068 | case SAA7134_BOARD_PHILIPS_TIGER_S: |
Hartmut Hackmann | b8bc76d | 2007-04-27 12:31:16 -0300 | [diff] [blame] | 1069 | configure_tda827x_fe(dev, &philips_tiger_s_config); |
Michael Krufky | 9de271e | 2007-01-16 18:36:40 -0300 | [diff] [blame] | 1070 | break; |
Hartmut Hackmann | e06cea4 | 2007-03-13 20:58:29 -0300 | [diff] [blame] | 1071 | case SAA7134_BOARD_ASUS_P7131_4871: |
| 1072 | configure_tda827x_fe(dev, &asus_p7131_4871_config); |
| 1073 | break; |
Hartmut Hackmann | f3eec0c0 | 2007-03-14 20:33:55 -0300 | [diff] [blame] | 1074 | case SAA7134_BOARD_ASUSTeK_P7131_HYBRID_LNA: |
| 1075 | configure_tda827x_fe(dev, &asus_p7131_hybrid_lna_config); |
Hartmut Hackmann | e06cea4 | 2007-03-13 20:58:29 -0300 | [diff] [blame] | 1076 | break; |
Edgar Simo | d90d9f5 | 2007-08-20 14:14:50 -0300 | [diff] [blame] | 1077 | case SAA7134_BOARD_AVERMEDIA_SUPER_007: |
| 1078 | configure_tda827x_fe(dev, &avermedia_super_007_config); |
| 1079 | break; |
Hermann Pitton | 4ba2437 | 2008-01-20 19:27:51 -0300 | [diff] [blame] | 1080 | case SAA7134_BOARD_TWINHAN_DTV_DVB_3056: |
| 1081 | configure_tda827x_fe(dev, &twinhan_dtv_dvb_3056_config); |
| 1082 | break; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1083 | default: |
Trent Piepho | cf3c34c | 2007-03-07 18:19:48 -0300 | [diff] [blame] | 1084 | wprintk("Huh? unknown DVB card?\n"); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1085 | break; |
| 1086 | } |
| 1087 | |
| 1088 | if (NULL == dev->dvb.frontend) { |
Trent Piepho | cf3c34c | 2007-03-07 18:19:48 -0300 | [diff] [blame] | 1089 | printk(KERN_ERR "%s/dvb: frontend initialization failed\n", dev->name); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1090 | return -1; |
| 1091 | } |
| 1092 | |
| 1093 | /* register everything else */ |
Hartmut Hackmann | 1c4f76a | 2007-04-27 12:31:16 -0300 | [diff] [blame] | 1094 | ret = videobuf_dvb_register(&dev->dvb, THIS_MODULE, dev, &dev->pci->dev); |
| 1095 | |
| 1096 | /* this sequence is necessary to make the tda1004x load its firmware |
| 1097 | * and to enter analog mode of hybrid boards |
| 1098 | */ |
| 1099 | if (!ret) { |
| 1100 | if (dev->dvb.frontend->ops.init) |
| 1101 | dev->dvb.frontend->ops.init(dev->dvb.frontend); |
| 1102 | if (dev->dvb.frontend->ops.sleep) |
| 1103 | dev->dvb.frontend->ops.sleep(dev->dvb.frontend); |
Hartmut Hackmann | 9971f4f | 2007-03-23 21:00:07 -0300 | [diff] [blame] | 1104 | if (dev->dvb.frontend->ops.tuner_ops.sleep) |
| 1105 | dev->dvb.frontend->ops.tuner_ops.sleep(dev->dvb.frontend); |
Hartmut Hackmann | 1c4f76a | 2007-04-27 12:31:16 -0300 | [diff] [blame] | 1106 | } |
| 1107 | return ret; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1108 | } |
| 1109 | |
| 1110 | static int dvb_fini(struct saa7134_dev *dev) |
| 1111 | { |
Mauro Carvalho Chehab | 7f17112 | 2007-10-18 19:56:47 -0300 | [diff] [blame] | 1112 | /* FIXME: I suspect that this code is bogus, since the entry for |
| 1113 | Pinnacle 300I DVB-T PAL already defines the proper init to allow |
| 1114 | the detection of mt2032 (TDA9887_PORT2_INACTIVE) |
| 1115 | */ |
| 1116 | if (dev->board == SAA7134_BOARD_PINNACLE_300I_DVBT_PAL) { |
| 1117 | struct v4l2_priv_tun_config tda9887_cfg; |
| 1118 | static int on = TDA9887_PRESENT | TDA9887_PORT2_INACTIVE; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1119 | |
Mauro Carvalho Chehab | 7f17112 | 2007-10-18 19:56:47 -0300 | [diff] [blame] | 1120 | tda9887_cfg.tuner = TUNER_TDA9887; |
| 1121 | tda9887_cfg.priv = &on; |
| 1122 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1123 | /* otherwise we don't detect the tuner on next insmod */ |
Mauro Carvalho Chehab | 7f17112 | 2007-10-18 19:56:47 -0300 | [diff] [blame] | 1124 | saa7134_i2c_call_clients(dev, TUNER_SET_CONFIG, &tda9887_cfg); |
| 1125 | } |
| 1126 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1127 | videobuf_dvb_unregister(&dev->dvb); |
| 1128 | return 0; |
| 1129 | } |
| 1130 | |
| 1131 | static struct saa7134_mpeg_ops dvb_ops = { |
| 1132 | .type = SAA7134_MPEG_DVB, |
| 1133 | .init = dvb_init, |
| 1134 | .fini = dvb_fini, |
| 1135 | }; |
| 1136 | |
| 1137 | static int __init dvb_register(void) |
| 1138 | { |
| 1139 | return saa7134_ts_register(&dvb_ops); |
| 1140 | } |
| 1141 | |
| 1142 | static void __exit dvb_unregister(void) |
| 1143 | { |
| 1144 | saa7134_ts_unregister(&dvb_ops); |
| 1145 | } |
| 1146 | |
| 1147 | module_init(dvb_register); |
| 1148 | module_exit(dvb_unregister); |
| 1149 | |
| 1150 | /* ------------------------------------------------------------------ */ |
| 1151 | /* |
| 1152 | * Local variables: |
| 1153 | * c-basic-offset: 8 |
| 1154 | * End: |
| 1155 | */ |