diff options
author | James Bottomley <jejb@titanic.(none)> | 2005-11-10 09:29:07 -0500 |
---|---|---|
committer | James Bottomley <jejb@titanic.(none)> | 2005-11-10 09:29:07 -0500 |
commit | 8a87a0b6313109d2fea87b1271d497c954ce2ca8 (patch) | |
tree | 1b7ae51ff681e27118590e9cab4bf0ce38f5d80e /drivers/media/video/saa7134/saa7134-dvb.c | |
parent | e6a04466ba965875a6132700fabb2f2c0249c41a (diff) | |
parent | 3b44f137b9a846c5452d9e6e1271b79b1dbcc942 (diff) |
Merge by hand (whitespace conflicts in libata.h)
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-dvb.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-dvb.c | 370 |
1 files changed, 345 insertions, 25 deletions
diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index 639ae51a052d..e016480c3468 100644 --- a/drivers/media/video/saa7134/saa7134-dvb.c +++ b/drivers/media/video/saa7134/saa7134-dvb.c | |||
@@ -29,7 +29,6 @@ | |||
29 | #include <linux/kthread.h> | 29 | #include <linux/kthread.h> |
30 | #include <linux/suspend.h> | 30 | #include <linux/suspend.h> |
31 | 31 | ||
32 | |||
33 | #include "saa7134-reg.h" | 32 | #include "saa7134-reg.h" |
34 | #include "saa7134.h" | 33 | #include "saa7134.h" |
35 | 34 | ||
@@ -40,6 +39,10 @@ | |||
40 | #ifdef HAVE_TDA1004X | 39 | #ifdef HAVE_TDA1004X |
41 | # include "tda1004x.h" | 40 | # include "tda1004x.h" |
42 | #endif | 41 | #endif |
42 | #ifdef HAVE_NXT200X | ||
43 | # include "nxt200x.h" | ||
44 | # include "dvb-pll.h" | ||
45 | #endif | ||
43 | 46 | ||
44 | MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); | 47 | MODULE_AUTHOR("Gerd Knorr <kraxel@bytesex.org> [SuSE Labs]"); |
45 | MODULE_LICENSE("GPL"); | 48 | MODULE_LICENSE("GPL"); |
@@ -151,25 +154,12 @@ static struct mt352_config pinnacle_300i = { | |||
151 | /* ------------------------------------------------------------------ */ | 154 | /* ------------------------------------------------------------------ */ |
152 | 155 | ||
153 | #ifdef HAVE_TDA1004X | 156 | #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 | 157 | ||
165 | return 0; | 158 | static int philips_tda6651_pll_set(u8 addr, struct dvb_frontend *fe, struct dvb_frontend_parameters *params) |
166 | } | ||
167 | |||
168 | static int philips_tu1216_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) | ||
169 | { | 159 | { |
170 | struct saa7134_dev *dev = fe->dvb->priv; | 160 | struct saa7134_dev *dev = fe->dvb->priv; |
171 | u8 tuner_buf[4]; | 161 | u8 tuner_buf[4]; |
172 | struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tuner_buf,.len = | 162 | struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = tuner_buf,.len = |
173 | sizeof(tuner_buf) }; | 163 | sizeof(tuner_buf) }; |
174 | int tuner_frequency = 0; | 164 | int tuner_frequency = 0; |
175 | u8 band, cp, filter; | 165 | u8 band, cp, filter; |
@@ -242,11 +232,36 @@ static int philips_tu1216_pll_set(struct dvb_frontend *fe, struct dvb_frontend_p | |||
242 | 232 | ||
243 | if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) | 233 | if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) |
244 | return -EIO; | 234 | return -EIO; |
235 | msleep(1); | ||
236 | return 0; | ||
237 | } | ||
245 | 238 | ||
239 | static int philips_tda6651_pll_init(u8 addr, struct dvb_frontend *fe) | ||
240 | { | ||
241 | struct saa7134_dev *dev = fe->dvb->priv; | ||
242 | static u8 tu1216_init[] = { 0x0b, 0xf5, 0x85, 0xab }; | ||
243 | struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = tu1216_init,.len = sizeof(tu1216_init) }; | ||
244 | |||
245 | /* setup PLL configuration */ | ||
246 | if (i2c_transfer(&dev->i2c_adap, &tuner_msg, 1) != 1) | ||
247 | return -EIO; | ||
246 | msleep(1); | 248 | msleep(1); |
249 | |||
247 | return 0; | 250 | return 0; |
248 | } | 251 | } |
249 | 252 | ||
253 | /* ------------------------------------------------------------------ */ | ||
254 | |||
255 | static int philips_tu1216_pll_60_init(struct dvb_frontend *fe) | ||
256 | { | ||
257 | return philips_tda6651_pll_init(0x60, fe); | ||
258 | } | ||
259 | |||
260 | static int philips_tu1216_pll_60_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) | ||
261 | { | ||
262 | return philips_tda6651_pll_set(0x60, fe, params); | ||
263 | } | ||
264 | |||
250 | static int philips_tu1216_request_firmware(struct dvb_frontend *fe, | 265 | static int philips_tu1216_request_firmware(struct dvb_frontend *fe, |
251 | const struct firmware **fw, char *name) | 266 | const struct firmware **fw, char *name) |
252 | { | 267 | { |
@@ -254,22 +269,108 @@ static int philips_tu1216_request_firmware(struct dvb_frontend *fe, | |||
254 | return request_firmware(fw, name, &dev->pci->dev); | 269 | return request_firmware(fw, name, &dev->pci->dev); |
255 | } | 270 | } |
256 | 271 | ||
257 | static struct tda1004x_config philips_tu1216_config = { | 272 | static struct tda1004x_config philips_tu1216_60_config = { |
273 | |||
274 | .demod_address = 0x8, | ||
275 | .invert = 1, | ||
276 | .invert_oclk = 0, | ||
277 | .xtal_freq = TDA10046_XTAL_4M, | ||
278 | .agc_config = TDA10046_AGC_DEFAULT, | ||
279 | .if_freq = TDA10046_FREQ_3617, | ||
280 | .pll_init = philips_tu1216_pll_60_init, | ||
281 | .pll_set = philips_tu1216_pll_60_set, | ||
282 | .pll_sleep = NULL, | ||
283 | .request_firmware = philips_tu1216_request_firmware, | ||
284 | }; | ||
285 | |||
286 | /* ------------------------------------------------------------------ */ | ||
287 | |||
288 | static int philips_tu1216_pll_61_init(struct dvb_frontend *fe) | ||
289 | { | ||
290 | return philips_tda6651_pll_init(0x61, fe); | ||
291 | } | ||
292 | |||
293 | static int philips_tu1216_pll_61_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) | ||
294 | { | ||
295 | return philips_tda6651_pll_set(0x61, fe, params); | ||
296 | } | ||
297 | |||
298 | static struct tda1004x_config philips_tu1216_61_config = { | ||
258 | 299 | ||
259 | .demod_address = 0x8, | 300 | .demod_address = 0x8, |
260 | .invert = 1, | 301 | .invert = 1, |
261 | .invert_oclk = 1, | 302 | .invert_oclk = 0, |
262 | .xtal_freq = TDA10046_XTAL_4M, | 303 | .xtal_freq = TDA10046_XTAL_4M, |
263 | .agc_config = TDA10046_AGC_DEFAULT, | 304 | .agc_config = TDA10046_AGC_DEFAULT, |
264 | .if_freq = TDA10046_FREQ_3617, | 305 | .if_freq = TDA10046_FREQ_3617, |
265 | .pll_init = philips_tu1216_pll_init, | 306 | .pll_init = philips_tu1216_pll_61_init, |
266 | .pll_set = philips_tu1216_pll_set, | 307 | .pll_set = philips_tu1216_pll_61_set, |
267 | .pll_sleep = NULL, | 308 | .pll_sleep = NULL, |
268 | .request_firmware = philips_tu1216_request_firmware, | 309 | .request_firmware = philips_tu1216_request_firmware, |
269 | }; | 310 | }; |
270 | 311 | ||
271 | /* ------------------------------------------------------------------ */ | 312 | /* ------------------------------------------------------------------ */ |
272 | 313 | ||
314 | static int philips_europa_pll_init(struct dvb_frontend *fe) | ||
315 | { | ||
316 | struct saa7134_dev *dev = fe->dvb->priv; | ||
317 | static u8 msg[] = { 0x0b, 0xf5, 0x86, 0xab }; | ||
318 | struct i2c_msg init_msg = {.addr = 0x61,.flags = 0,.buf = msg,.len = sizeof(msg) }; | ||
319 | |||
320 | /* setup PLL configuration */ | ||
321 | if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1) | ||
322 | return -EIO; | ||
323 | msleep(1); | ||
324 | |||
325 | /* switch the board to dvb mode */ | ||
326 | init_msg.addr = 0x43; | ||
327 | init_msg.len = 0x02; | ||
328 | msg[0] = 0x00; | ||
329 | msg[1] = 0x40; | ||
330 | if (i2c_transfer(&dev->i2c_adap, &init_msg, 1) != 1) | ||
331 | return -EIO; | ||
332 | |||
333 | return 0; | ||
334 | } | ||
335 | |||
336 | static int philips_td1316_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) | ||
337 | { | ||
338 | return philips_tda6651_pll_set(0x61, fe, params); | ||
339 | } | ||
340 | |||
341 | static void philips_europa_analog(struct dvb_frontend *fe) | ||
342 | { | ||
343 | struct saa7134_dev *dev = fe->dvb->priv; | ||
344 | /* this message actually turns the tuner back to analog mode */ | ||
345 | static u8 msg[] = { 0x0b, 0xdc, 0x86, 0xa4 }; | ||
346 | struct i2c_msg analog_msg = {.addr = 0x61,.flags = 0,.buf = msg,.len = sizeof(msg) }; | ||
347 | |||
348 | i2c_transfer(&dev->i2c_adap, &analog_msg, 1); | ||
349 | msleep(1); | ||
350 | |||
351 | /* switch the board to analog mode */ | ||
352 | analog_msg.addr = 0x43; | ||
353 | analog_msg.len = 0x02; | ||
354 | msg[0] = 0x00; | ||
355 | msg[1] = 0x14; | ||
356 | i2c_transfer(&dev->i2c_adap, &analog_msg, 1); | ||
357 | } | ||
358 | |||
359 | static struct tda1004x_config philips_europa_config = { | ||
360 | |||
361 | .demod_address = 0x8, | ||
362 | .invert = 0, | ||
363 | .invert_oclk = 0, | ||
364 | .xtal_freq = TDA10046_XTAL_4M, | ||
365 | .agc_config = TDA10046_AGC_IFO_AUTO_POS, | ||
366 | .if_freq = TDA10046_FREQ_052, | ||
367 | .pll_init = philips_europa_pll_init, | ||
368 | .pll_set = philips_td1316_pll_set, | ||
369 | .pll_sleep = philips_europa_analog, | ||
370 | .request_firmware = NULL, | ||
371 | }; | ||
372 | |||
373 | /* ------------------------------------------------------------------ */ | ||
273 | 374 | ||
274 | static int philips_fmd1216_pll_init(struct dvb_frontend *fe) | 375 | static int philips_fmd1216_pll_init(struct dvb_frontend *fe) |
275 | { | 376 | { |
@@ -382,7 +483,6 @@ static int philips_fmd1216_pll_set(struct dvb_frontend *fe, struct dvb_frontend_ | |||
382 | return 0; | 483 | return 0; |
383 | } | 484 | } |
384 | 485 | ||
385 | #ifdef HAVE_TDA1004X | ||
386 | static struct tda1004x_config medion_cardbus = { | 486 | static struct tda1004x_config medion_cardbus = { |
387 | .demod_address = 0x08, | 487 | .demod_address = 0x08, |
388 | .invert = 1, | 488 | .invert = 1, |
@@ -395,7 +495,6 @@ static struct tda1004x_config medion_cardbus = { | |||
395 | .pll_sleep = philips_fmd1216_analog, | 495 | .pll_sleep = philips_fmd1216_analog, |
396 | .request_firmware = NULL, | 496 | .request_firmware = NULL, |
397 | }; | 497 | }; |
398 | #endif | ||
399 | 498 | ||
400 | /* ------------------------------------------------------------------ */ | 499 | /* ------------------------------------------------------------------ */ |
401 | 500 | ||
@@ -452,7 +551,7 @@ static int philips_tda827x_pll_set(struct dvb_frontend *fe, struct dvb_frontend_ | |||
452 | u8 tuner_buf[14]; | 551 | u8 tuner_buf[14]; |
453 | 552 | ||
454 | struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tuner_buf, | 553 | struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tuner_buf, |
455 | .len = sizeof(tuner_buf) }; | 554 | .len = sizeof(tuner_buf) }; |
456 | int i, tuner_freq, if_freq; | 555 | int i, tuner_freq, if_freq; |
457 | u32 N; | 556 | u32 N; |
458 | switch (params->u.ofdm.bandwidth) { | 557 | switch (params->u.ofdm.bandwidth) { |
@@ -511,7 +610,7 @@ static void philips_tda827x_pll_sleep(struct dvb_frontend *fe) | |||
511 | struct saa7134_dev *dev = fe->dvb->priv; | 610 | struct saa7134_dev *dev = fe->dvb->priv; |
512 | static u8 tda827x_sleep[] = { 0x30, 0xd0}; | 611 | static u8 tda827x_sleep[] = { 0x30, 0xd0}; |
513 | struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tda827x_sleep, | 612 | struct i2c_msg tuner_msg = {.addr = 0x60,.flags = 0,.buf = tda827x_sleep, |
514 | .len = sizeof(tda827x_sleep) }; | 613 | .len = sizeof(tda827x_sleep) }; |
515 | i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); | 614 | i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); |
516 | } | 615 | } |
517 | 616 | ||
@@ -527,6 +626,202 @@ static struct tda1004x_config tda827x_lifeview_config = { | |||
527 | .pll_sleep = philips_tda827x_pll_sleep, | 626 | .pll_sleep = philips_tda827x_pll_sleep, |
528 | .request_firmware = NULL, | 627 | .request_firmware = NULL, |
529 | }; | 628 | }; |
629 | |||
630 | /* ------------------------------------------------------------------ */ | ||
631 | |||
632 | struct tda827xa_data { | ||
633 | u32 lomax; | ||
634 | u8 svco; | ||
635 | u8 spd; | ||
636 | u8 scr; | ||
637 | u8 sbs; | ||
638 | u8 gc3; | ||
639 | }; | ||
640 | |||
641 | static struct tda827xa_data tda827xa_dvbt[] = { | ||
642 | { .lomax = 56875000, .svco = 3, .spd = 4, .scr = 0, .sbs = 0, .gc3 = 1}, | ||
643 | { .lomax = 67250000, .svco = 0, .spd = 3, .scr = 0, .sbs = 0, .gc3 = 1}, | ||
644 | { .lomax = 81250000, .svco = 1, .spd = 3, .scr = 0, .sbs = 0, .gc3 = 1}, | ||
645 | { .lomax = 97500000, .svco = 2, .spd = 3, .scr = 0, .sbs = 0, .gc3 = 1}, | ||
646 | { .lomax = 113750000, .svco = 3, .spd = 3, .scr = 0, .sbs = 1, .gc3 = 1}, | ||
647 | { .lomax = 134500000, .svco = 0, .spd = 2, .scr = 0, .sbs = 1, .gc3 = 1}, | ||
648 | { .lomax = 154000000, .svco = 1, .spd = 2, .scr = 0, .sbs = 1, .gc3 = 1}, | ||
649 | { .lomax = 162500000, .svco = 1, .spd = 2, .scr = 0, .sbs = 1, .gc3 = 1}, | ||
650 | { .lomax = 183000000, .svco = 2, .spd = 2, .scr = 0, .sbs = 1, .gc3 = 1}, | ||
651 | { .lomax = 195000000, .svco = 2, .spd = 2, .scr = 0, .sbs = 2, .gc3 = 1}, | ||
652 | { .lomax = 227500000, .svco = 3, .spd = 2, .scr = 0, .sbs = 2, .gc3 = 1}, | ||
653 | { .lomax = 269000000, .svco = 0, .spd = 1, .scr = 0, .sbs = 2, .gc3 = 1}, | ||
654 | { .lomax = 290000000, .svco = 1, .spd = 1, .scr = 0, .sbs = 2, .gc3 = 1}, | ||
655 | { .lomax = 325000000, .svco = 1, .spd = 1, .scr = 0, .sbs = 3, .gc3 = 1}, | ||
656 | { .lomax = 390000000, .svco = 2, .spd = 1, .scr = 0, .sbs = 3, .gc3 = 1}, | ||
657 | { .lomax = 455000000, .svco = 3, .spd = 1, .scr = 0, .sbs = 3, .gc3 = 1}, | ||
658 | { .lomax = 520000000, .svco = 0, .spd = 0, .scr = 0, .sbs = 3, .gc3 = 1}, | ||
659 | { .lomax = 538000000, .svco = 0, .spd = 0, .scr = 1, .sbs = 3, .gc3 = 1}, | ||
660 | { .lomax = 550000000, .svco = 1, .spd = 0, .scr = 0, .sbs = 3, .gc3 = 1}, | ||
661 | { .lomax = 620000000, .svco = 1, .spd = 0, .scr = 0, .sbs = 4, .gc3 = 0}, | ||
662 | { .lomax = 650000000, .svco = 1, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 0}, | ||
663 | { .lomax = 700000000, .svco = 2, .spd = 0, .scr = 0, .sbs = 4, .gc3 = 0}, | ||
664 | { .lomax = 780000000, .svco = 2, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 0}, | ||
665 | { .lomax = 820000000, .svco = 3, .spd = 0, .scr = 0, .sbs = 4, .gc3 = 0}, | ||
666 | { .lomax = 870000000, .svco = 3, .spd = 0, .scr = 1, .sbs = 4, .gc3 = 0}, | ||
667 | { .lomax = 911000000, .svco = 3, .spd = 0, .scr = 2, .sbs = 4, .gc3 = 0}, | ||
668 | { .lomax = 0, .svco = 0, .spd = 0, .scr = 0, .sbs = 0, .gc3 = 0}}; | ||
669 | |||
670 | |||
671 | static int philips_tda827xa_pll_set(u8 addr, struct dvb_frontend *fe, struct dvb_frontend_parameters *params) | ||
672 | { | ||
673 | struct saa7134_dev *dev = fe->dvb->priv; | ||
674 | u8 tuner_buf[14]; | ||
675 | unsigned char reg2[2]; | ||
676 | |||
677 | struct i2c_msg msg = {.addr = addr,.flags = 0,.buf = tuner_buf}; | ||
678 | int i, tuner_freq, if_freq; | ||
679 | u32 N; | ||
680 | |||
681 | switch (params->u.ofdm.bandwidth) { | ||
682 | case BANDWIDTH_6_MHZ: | ||
683 | if_freq = 4000000; | ||
684 | break; | ||
685 | case BANDWIDTH_7_MHZ: | ||
686 | if_freq = 4500000; | ||
687 | break; | ||
688 | default: /* 8 MHz or Auto */ | ||
689 | if_freq = 5000000; | ||
690 | break; | ||
691 | } | ||
692 | tuner_freq = params->frequency + if_freq; | ||
693 | |||
694 | i = 0; | ||
695 | while (tda827xa_dvbt[i].lomax < tuner_freq) { | ||
696 | if(tda827xa_dvbt[i + 1].lomax == 0) | ||
697 | break; | ||
698 | i++; | ||
699 | } | ||
700 | |||
701 | N = ((tuner_freq + 31250) / 62500) << tda827xa_dvbt[i].spd; | ||
702 | tuner_buf[0] = 0; // subaddress | ||
703 | tuner_buf[1] = N >> 8; | ||
704 | tuner_buf[2] = N & 0xff; | ||
705 | tuner_buf[3] = 0; | ||
706 | tuner_buf[4] = 0x16; | ||
707 | tuner_buf[5] = (tda827xa_dvbt[i].spd << 5) + (tda827xa_dvbt[i].svco << 3) + | ||
708 | tda827xa_dvbt[i].sbs; | ||
709 | tuner_buf[6] = 0x4b + (tda827xa_dvbt[i].gc3 << 4); | ||
710 | tuner_buf[7] = 0x0c; | ||
711 | tuner_buf[8] = 0x06; | ||
712 | tuner_buf[9] = 0x24; | ||
713 | tuner_buf[10] = 0xff; | ||
714 | tuner_buf[11] = 0x60; | ||
715 | tuner_buf[12] = 0x00; | ||
716 | tuner_buf[13] = 0x39; // lpsel | ||
717 | msg.len = 14; | ||
718 | if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) | ||
719 | return -EIO; | ||
720 | |||
721 | msg.buf= reg2; | ||
722 | msg.len = 2; | ||
723 | reg2[0] = 0x60; | ||
724 | reg2[1] = 0x3c; | ||
725 | i2c_transfer(&dev->i2c_adap, &msg, 1); | ||
726 | |||
727 | reg2[0] = 0xa0; | ||
728 | reg2[1] = 0x40; | ||
729 | i2c_transfer(&dev->i2c_adap, &msg, 1); | ||
730 | |||
731 | msleep(2); | ||
732 | /* correct CP value */ | ||
733 | reg2[0] = 0x30; | ||
734 | reg2[1] = 0x10 + tda827xa_dvbt[i].scr; | ||
735 | msg.len = 2; | ||
736 | i2c_transfer(&dev->i2c_adap, &msg, 1); | ||
737 | |||
738 | msleep(550); | ||
739 | reg2[0] = 0x50; | ||
740 | reg2[1] = 0x4f + (tda827xa_dvbt[i].gc3 << 4); | ||
741 | i2c_transfer(&dev->i2c_adap, &msg, 1); | ||
742 | |||
743 | return 0; | ||
744 | |||
745 | } | ||
746 | |||
747 | static void philips_tda827xa_pll_sleep(u8 addr, struct dvb_frontend *fe) | ||
748 | { | ||
749 | struct saa7134_dev *dev = fe->dvb->priv; | ||
750 | static u8 tda827xa_sleep[] = { 0x30, 0x90}; | ||
751 | struct i2c_msg tuner_msg = {.addr = addr,.flags = 0,.buf = tda827xa_sleep, | ||
752 | .len = sizeof(tda827xa_sleep) }; | ||
753 | i2c_transfer(&dev->i2c_adap, &tuner_msg, 1); | ||
754 | |||
755 | } | ||
756 | |||
757 | /* ------------------------------------------------------------------ */ | ||
758 | |||
759 | static int philips_tiger_pll_set(struct dvb_frontend *fe, struct dvb_frontend_parameters *params) | ||
760 | { | ||
761 | int ret; | ||
762 | struct saa7134_dev *dev = fe->dvb->priv; | ||
763 | static u8 tda8290_close[] = { 0x21, 0xc0}; | ||
764 | static u8 tda8290_open[] = { 0x21, 0x80}; | ||
765 | struct i2c_msg tda8290_msg = {.addr = 0x4b,.flags = 0, .len = 2}; | ||
766 | /* close tda8290 i2c bridge */ | ||
767 | tda8290_msg.buf = tda8290_close; | ||
768 | ret = i2c_transfer(&dev->i2c_adap, &tda8290_msg, 1); | ||
769 | if (ret != 1) | ||
770 | return -EIO; | ||
771 | msleep(20); | ||
772 | ret = philips_tda827xa_pll_set(0x61, fe, params); | ||
773 | if (ret != 0) | ||
774 | return ret; | ||
775 | /* open tda8290 i2c bridge */ | ||
776 | tda8290_msg.buf = tda8290_open; | ||
777 | i2c_transfer(&dev->i2c_adap, &tda8290_msg, 1); | ||
778 | return ret; | ||
779 | }; | ||
780 | |||
781 | static int philips_tiger_dvb_mode(struct dvb_frontend *fe) | ||
782 | { | ||
783 | struct saa7134_dev *dev = fe->dvb->priv; | ||
784 | static u8 data[] = { 0x3c, 0x33, 0x6a}; | ||
785 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; | ||
786 | |||
787 | if (i2c_transfer(&dev->i2c_adap, &msg, 1) != 1) | ||
788 | return -EIO; | ||
789 | return 0; | ||
790 | } | ||
791 | |||
792 | static void philips_tiger_analog_mode(struct dvb_frontend *fe) | ||
793 | { | ||
794 | struct saa7134_dev *dev = fe->dvb->priv; | ||
795 | static u8 data[] = { 0x3c, 0x33, 0x68}; | ||
796 | struct i2c_msg msg = {.addr=0x08, .flags=0, .buf=data, .len = sizeof(data)}; | ||
797 | |||
798 | i2c_transfer(&dev->i2c_adap, &msg, 1); | ||
799 | philips_tda827xa_pll_sleep( 0x61, fe); | ||
800 | } | ||
801 | |||
802 | static struct tda1004x_config philips_tiger_config = { | ||
803 | .demod_address = 0x08, | ||
804 | .invert = 1, | ||
805 | .invert_oclk = 0, | ||
806 | .xtal_freq = TDA10046_XTAL_16M, | ||
807 | .agc_config = TDA10046_AGC_TDA827X, | ||
808 | .if_freq = TDA10046_FREQ_045, | ||
809 | .pll_init = philips_tiger_dvb_mode, | ||
810 | .pll_set = philips_tiger_pll_set, | ||
811 | .pll_sleep = philips_tiger_analog_mode, | ||
812 | .request_firmware = NULL, | ||
813 | }; | ||
814 | |||
815 | #endif | ||
816 | |||
817 | /* ------------------------------------------------------------------ */ | ||
818 | |||
819 | #ifdef HAVE_NXT200X | ||
820 | static struct nxt200x_config avertvhda180 = { | ||
821 | .demod_address = 0x0a, | ||
822 | .pll_address = 0x61, | ||
823 | .pll_desc = &dvb_pll_tdhu2, | ||
824 | }; | ||
530 | #endif | 825 | #endif |
531 | 826 | ||
532 | /* ------------------------------------------------------------------ */ | 827 | /* ------------------------------------------------------------------ */ |
@@ -558,7 +853,7 @@ static int dvb_init(struct saa7134_dev *dev) | |||
558 | &dev->i2c_adap); | 853 | &dev->i2c_adap); |
559 | break; | 854 | break; |
560 | case SAA7134_BOARD_PHILIPS_TOUGH: | 855 | case SAA7134_BOARD_PHILIPS_TOUGH: |
561 | dev->dvb.frontend = tda10046_attach(&philips_tu1216_config, | 856 | dev->dvb.frontend = tda10046_attach(&philips_tu1216_60_config, |
562 | &dev->i2c_adap); | 857 | &dev->i2c_adap); |
563 | break; | 858 | break; |
564 | case SAA7134_BOARD_FLYDVBTDUO: | 859 | case SAA7134_BOARD_FLYDVBTDUO: |
@@ -569,6 +864,31 @@ static int dvb_init(struct saa7134_dev *dev) | |||
569 | dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config, | 864 | dev->dvb.frontend = tda10046_attach(&tda827x_lifeview_config, |
570 | &dev->i2c_adap); | 865 | &dev->i2c_adap); |
571 | break; | 866 | break; |
867 | case SAA7134_BOARD_PHILIPS_EUROPA: | ||
868 | dev->dvb.frontend = tda10046_attach(&philips_europa_config, | ||
869 | &dev->i2c_adap); | ||
870 | break; | ||
871 | case SAA7134_BOARD_VIDEOMATE_DVBT_300: | ||
872 | dev->dvb.frontend = tda10046_attach(&philips_europa_config, | ||
873 | &dev->i2c_adap); | ||
874 | break; | ||
875 | case SAA7134_BOARD_VIDEOMATE_DVBT_200: | ||
876 | dev->dvb.frontend = tda10046_attach(&philips_tu1216_61_config, | ||
877 | &dev->i2c_adap); | ||
878 | break; | ||
879 | case SAA7134_BOARD_PHILIPS_TIGER: | ||
880 | dev->dvb.frontend = tda10046_attach(&philips_tiger_config, | ||
881 | &dev->i2c_adap); | ||
882 | break; | ||
883 | case SAA7134_BOARD_ASUSTeK_P7131_DUAL: | ||
884 | dev->dvb.frontend = tda10046_attach(&philips_tiger_config, | ||
885 | &dev->i2c_adap); | ||
886 | break; | ||
887 | #endif | ||
888 | #ifdef HAVE_NXT200X | ||
889 | case SAA7134_BOARD_AVERMEDIA_AVERTVHD_A180: | ||
890 | dev->dvb.frontend = nxt200x_attach(&avertvhda180, &dev->i2c_adap); | ||
891 | break; | ||
572 | #endif | 892 | #endif |
573 | default: | 893 | default: |
574 | printk("%s: Huh? unknown DVB card?\n",dev->name); | 894 | printk("%s: Huh? unknown DVB card?\n",dev->name); |