diff options
author | Hartmut Hackmann <hartmut.hackmann@t.online.de> | 2005-11-09 00:36:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-09 10:56:09 -0500 |
commit | 2cf36ac447308046d1c1d50b9f662bddbba56b33 (patch) | |
tree | a2fe21c91e8227d2fc6139bcedd51462d32341ef /drivers/media/video/saa7134/saa7134-dvb.c | |
parent | 93df3413f1b4c437b93c5b64562632f4f0e2b3ca (diff) |
[PATCH] v4l: 656: added support for the following cards
- Added support for the following cards:
- Philips EUROPA reference desigh
- Compro VideoMate DVB-T300
- Compro VideoMate DVB-T200 (initial)
Signed-off-by: Hartmut Hackmann <hartmut.hackmann@t.online.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-dvb.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-dvb.c | 152 |
1 files changed, 130 insertions, 22 deletions
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index 639ae51a052d..f8e01030fbc7 100644 --- a/drivers/media/video/saa7134/saa7134-dvb.c +++ b/drivers/media/video/saa7134/saa7134-dvb.c | |||
@@ -151,25 +151,12 @@ static struct mt352_config pinnacle_300i = { | |||
151 | /* ------------------------------------------------------------------ */ | 151 | /* ------------------------------------------------------------------ */ |
152 | 152 | ||
153 | #ifdef HAVE_TDA1004X | 153 | #ifdef HAVE_TDA1004X |
154 | static int philips_tu1216_pll_init(struct dvb_frontend *fe) | ||
155 | { | ||
156 | struct saa7134_dev *dev = fe->dvb->priv; | ||
157 | static u8 tu1216_init[] = { 0x0b, 0xf5, 0x85, 0xab }; | ||
158 | struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tu1216_init,.len = sizeof(tu1216_init) }; | ||
159 | |||
160 | /* setup PLL configuration */ | ||
161 | if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) | ||
162 | return -EIO; | ||
163 | msleep(1); | ||
164 | |||
165 | return 0; | ||
166 | } | ||
167 | 154 | ||
168 | static int philips_tu1216_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) | 155 | static int philips_tda6651_pll_set(u8 addr, struct dvb_frontend *fe, struct dvb_frontend_parameters *params) |
169 | { | 156 | { |
170 | struct saa7134_dev *dev = fe->dvb->priv; | 157 | struct saa7134_dev *dev = fe->dvb->priv; |
171 | u8 tuner_buf[4]; | 158 | u8 tuner_buf[4]; |
172 | struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tuner_buf,.len = | 159 | struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = tuner_buf,.len = |
173 | sizeof(tuner_buf) }; | 160 | sizeof(tuner_buf) }; |
174 | int tuner_frequency = 0; | 161 | int tuner_frequency = 0; |
175 | u8 band, cp, filter; | 162 | u8 band, cp, filter; |
@@ -242,11 +229,36 @@ static int philips_tu1216_pll_set(struct dvb_frontend *fe, struct dvb_frontend_p | |||
242 | 229 | ||
243 | if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) | 230 | if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) |
244 | return -EIO; | 231 | return -EIO; |
232 | msleep(1); | ||
233 | return 0; | ||
234 | } | ||
235 | |||
236 | static int philips_tda6651_pll_init(u8 addr, struct dvb_frontend *fe) | ||
237 | { | ||
238 | struct saa7134_dev *dev = fe->dvb->priv; | ||
239 | static u8 tu1216_init[] = { 0x0b, 0xf5, 0x85, 0xab }; | ||
240 | struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = tu1216_init,.len = sizeof(tu1216_init) }; | ||
245 | 241 | ||
242 | /* setup PLL configuration */ | ||
243 | if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) | ||
244 | return -EIO; | ||
246 | msleep(1); | 245 | msleep(1); |
246 | |||
247 | return 0; | 247 | return 0; |
248 | } | 248 | } |
249 | 249 | ||
250 | /* ------------------------------------------------------------------ */ | ||
251 | |||
252 | static int philips_tu1216_pll_60_init(struct dvb_frontend *fe) | ||
253 | { | ||
254 | return philips_tda6651_pll_init(0x60, fe); | ||
255 | } | ||
256 | |||
257 | static int philips_tu1216_pll_60_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) | ||
258 | { | ||
259 | return philips_tda6651_pll_set(0x60, fe, params); | ||
260 | } | ||
261 | |||
250 | static int philips_tu1216_request_firmware(struct dvb_frontend *fe, | 262 | static int philips_tu1216_request_firmware(struct dvb_frontend *fe, |
251 | const struct firmware **fw, char *name) | 263 | const struct firmware **fw, char *name) |
252 | { | 264 | { |
@@ -254,22 +266,108 @@ static int philips_tu1216_request_firmware(struct dvb_frontend *fe, | |||
254 | return request_firmware(fw, name, &dev->pci->dev); | 266 | return request_firmware(fw, name, &dev->pci->dev); |
255 | } | 267 | } |
256 | 268 | ||
257 | static struct tda1004x_config philips_tu1216_config = { | 269 | static struct tda1004x_config philips_tu1216_60_config = { |
258 | 270 | ||
259 | .demod_address = 0x8, | 271 | .demod_address = 0x8, |
260 | .invert = 1, | 272 | .invert = 1, |
261 | .invert_oclk = 1, | 273 | .invert_oclk = 0, |
262 | .xtal_freq = TDA10046_XTAL_4M, | 274 | .xtal_freq = TDA10046_XTAL_4M, |
263 | .agc_config = TDA10046_AGC_DEFAULT, | 275 | .agc_config = TDA10046_AGC_DEFAULT, |
264 | .if_freq = TDA10046_FREQ_3617, | 276 | .if_freq = TDA10046_FREQ_3617, |
265 | .pll_init = philips_tu1216_pll_init, | 277 | .pll_init = philips_tu1216_pll_60_init, |
266 | .pll_set = philips_tu1216_pll_set, | 278 | .pll_set = philips_tu1216_pll_60_set, |
267 | .pll_sleep = NULL, | 279 | .pll_sleep = NULL, |
268 | .request_firmware = philips_tu1216_request_firmware, | 280 | .request_firmware = philips_tu1216_request_firmware, |
269 | }; | 281 | }; |
270 | 282 | ||
271 | /* ------------------------------------------------------------------ */ | 283 | /* ------------------------------------------------------------------ */ |
272 | 284 | ||
285 | static int philips_tu1216_pll_61_init(struct dvb_frontend *fe) | ||
286 | { | ||
287 | return philips_tda6651_pll_init(0x61, fe); | ||
288 | } | ||
289 | |||
290 | static int philips_tu1216_pll_61_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) | ||
291 | { | ||
292 | return philips_tda6651_pll_set(0x61, fe, params); | ||
293 | } | ||
294 | |||
295 | static struct tda1004x_config philips_tu1216_61_config = { | ||
296 | |||
297 | .demod_address = 0x8, | ||
298 | .invert = 1, | ||
299 | .invert_oclk = 0, | ||
300 | .xtal_freq = TDA10046_XTAL_4M, | ||
301 | .agc_config = TDA10046_AGC_DEFAULT, | ||
302 | .if_freq = TDA10046_FREQ_3617, | ||
303 | .pll_init = philips_tu1216_pll_61_init, | ||
304 | .pll_set = philips_tu1216_pll_61_set, | ||
305 | .pll_sleep = NULL, | ||
306 | .request_firmware = philips_tu1216_request_firmware, | ||
307 | }; | ||
308 | |||
309 | /* ------------------------------------------------------------------ */ | ||
310 | |||
311 | static int philips_europa_pll_init(struct dvb_frontend *fe) | ||
312 | { | ||
313 | struct saa7134_dev *dev = fe->dvb->priv; | ||
314 | static u8 msg[] = { 0x0b, 0xf5, 0x86, 0xab }; | ||
315 | struct i2c_msg init_msg = {.addr = 0x61,.flags = 0,.buf = msg,.len = sizeof(msg) }; | ||
316 | |||
317 | /* setup PLL configuration */ | ||
318 | if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1) | ||
319 | return -EIO; | ||
320 | msleep(1); | ||
321 | |||
322 | /* switch the board to dvb mode */ | ||
323 | init_msg.addr = 0x43; | ||
324 | init_msg.len = 0x02; | ||
325 | msg[0] = 0x00; | ||
326 | msg[1] = 0x40; | ||
327 | if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1) | ||
328 | return -EIO; | ||
329 | |||
330 | return 0; | ||
331 | } | ||
332 | |||
333 | static int philips_td1316_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) | ||
334 | { | ||
335 | return philips_tda6651_pll_set(0x61, fe, params); | ||
336 | } | ||
337 | |||
338 | static void philips_europa_analog(struct dvb_frontend *fe) | ||
339 | { | ||
340 | struct saa7134_dev *dev = fe->dvb->priv; | ||
341 | /* this message actually turns the tuner back to analog mode */ | ||
342 | static u8 msg[] = { 0x0b, 0xdc, 0x86, 0xa4 }; | ||
343 | struct i2c_msg analog_msg = {.addr = 0x61,.flags = 0,.buf = msg,.len = sizeof(msg) }; | ||
344 | |||
345 | i2c_transfer(&dev->i2c_adap, &analog_msg, 1); | ||
346 | msleep(1); | ||
347 | |||
348 | /* switch the board to analog mode */ | ||
349 | analog_msg.addr = 0x43; | ||
350 | analog_msg.len = 0x02; | ||
351 | msg[0] = 0x00; | ||
352 | msg[1] = 0x14; | ||
353 | i2c_transfer(&dev->i2c_adap, &analog_msg, 1); | ||
354 | } | ||
355 | |||
356 | static struct tda1004x_config philips_europa_config = { | ||
357 | |||
358 | .demod_address = 0x8, | ||
359 | .invert = 0, | ||
360 | .invert_oclk = 0, | ||
361 | .xtal_freq = TDA10046_XTAL_4M, | ||
362 | .agc_config = TDA10046_AGC_IFO_AUTO_POS, | ||
363 | .if_freq = TDA10046_FREQ_052, | ||
364 | .pll_init = philips_europa_pll_init, | ||
365 | .pll_set = philips_td1316_pll_set, | ||
366 | .pll_sleep = philips_europa_analog, | ||
367 | .request_firmware = NULL, | ||
368 | }; | ||
369 | |||
370 | /* ------------------------------------------------------------------ */ | ||
273 | 371 | ||
274 | static int philips_fmd1216_pll_init(struct dvb_frontend *fe) | 372 | static int philips_fmd1216_pll_init(struct dvb_frontend *fe) |
275 | { | 373 | { |
@@ -382,7 +480,6 @@ static int philips_fmd1216_pll_set(struct dvb_frontend *fe, struct dvb_frontend_ | |||
382 | return 0; | 480 | return 0; |
383 | } | 481 | } |
384 | 482 | ||
385 | #ifdef HAVE_TDA1004X | ||
386 | static struct tda1004x_config medion_cardbus = { | 483 | static struct tda1004x_config medion_cardbus = { |
387 | .demod_address = 0x08, | 484 | .demod_address = 0x08, |
388 | .invert = 1, | 485 | .invert = 1, |
@@ -395,7 +492,6 @@ static struct tda1004x_config medion_cardbus = { | |||
395 | .pll_sleep = philips_fmd1216_analog, | 492 | .pll_sleep = philips_fmd1216_analog, |
396 | .request_firmware = NULL, | 493 | .request_firmware = NULL, |
397 | }; | 494 | }; |
398 | #endif | ||
399 | 495 | ||
400 | /* ------------------------------------------------------------------ */ | 496 | /* ------------------------------------------------------------------ */ |
401 | 497 | ||
@@ -558,7 +654,7 @@ static int dvb_init(struct saa7134_dev *dev) | |||
558 | &dev->i2c_adap); | 654 | &dev->i2c_adap); |
559 | break; | 655 | break; |
560 | case SAA7134_BOARD_PHILIPS_TOUGH: | 656 | case SAA7134_BOARD_PHILIPS_TOUGH: |
561 | dev->dvb.frontend = tda10046_attach(&philips_tu1216_config, | 657 | dev->dvb.frontend = tda10046_attach(&philips_tu1216_60_config, |
562 | &dev->i2c_adap); | 658 | &dev->i2c_adap); |
563 | break; | 659 | break; |
564 | case SAA7134_BOARD_FLYDVBTDUO: | 660 | case SAA7134_BOARD_FLYDVBTDUO: |
@@ -569,6 +665,18 @@ static int dvb_init(struct saa7134_dev *dev) | |||
569 | dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config, | 665 | dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config, |
570 | &dev->i2c_adap); | 666 | &dev->i2c_adap); |
571 | break; | 667 | break; |
668 | case SAA7134_BOARD_PHILIPS_EUROPA: | ||
669 | dev->dvb.frontend = tda10046_attach(&philips_europa_config, | ||
670 | &dev->i2c_adap); | ||
671 | break; | ||
672 | case SAA7134_BOARD_VIDEOMATE_DVBT_300: | ||
673 | dev->dvb.frontend = tda10046_attach(&philips_europa_config, | ||
674 | &dev->i2c_adap); | ||
675 | break; | ||
676 | case SAA7134_BOARD_VIDEOMATE_DVBT_200: | ||
677 | dev->dvb.frontend = tda10046_attach(&philips_tu1216_61_config, | ||
678 | &dev->i2c_adap); | ||
679 | break; | ||
572 | #endif | 680 | #endif |
573 | default: | 681 | default: |
574 | printk("%s: Huh? unknown DVB card?\n",dev->name); | 682 | printk("%s: Huh? unknown DVB card?\n",dev->name); |