diff options
author | Antti Palosaari <crope@iki.fi> | 2011-04-10 19:14:50 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-05-20 08:27:04 -0400 |
commit | 72ffd2b822b4ff589432df0f56e3d2cd60c10447 (patch) | |
tree | 10820fb138f9fd67497f47b0e869fa4006c69af5 /drivers/media/dvb | |
parent | 41f81f686a85af144ad9769a15ef8575b69eee38 (diff) |
[media] anysee: add support for TDA18212 based E30 Combo Plus
New models have new NXP TDA18212 silicon tuner.
Not tested yet due to lack of HW...
Signed-off-by: Antti Palosaari <crope@iki.fi>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/dvb')
-rw-r--r-- | drivers/media/dvb/dvb-usb/Kconfig | 1 | ||||
-rw-r--r-- | drivers/media/dvb/dvb-usb/anysee.c | 106 |
2 files changed, 102 insertions, 5 deletions
diff --git a/drivers/media/dvb/dvb-usb/Kconfig b/drivers/media/dvb/dvb-usb/Kconfig index c545039287ad..e624ff3ef070 100644 --- a/drivers/media/dvb/dvb-usb/Kconfig +++ b/drivers/media/dvb/dvb-usb/Kconfig | |||
@@ -292,6 +292,7 @@ config DVB_USB_ANYSEE | |||
292 | select DVB_MT352 if !DVB_FE_CUSTOMISE | 292 | select DVB_MT352 if !DVB_FE_CUSTOMISE |
293 | select DVB_ZL10353 if !DVB_FE_CUSTOMISE | 293 | select DVB_ZL10353 if !DVB_FE_CUSTOMISE |
294 | select DVB_TDA10023 if !DVB_FE_CUSTOMISE | 294 | select DVB_TDA10023 if !DVB_FE_CUSTOMISE |
295 | select MEDIA_TUNER_TDA18212 if !MEDIA_TUNER_CUSTOMISE | ||
295 | help | 296 | help |
296 | Say Y here to support the Anysee E30, Anysee E30 Plus or | 297 | Say Y here to support the Anysee E30, Anysee E30 Plus or |
297 | Anysee E30 C Plus DVB USB2.0 receiver. | 298 | Anysee E30 C Plus DVB USB2.0 receiver. |
diff --git a/drivers/media/dvb/dvb-usb/anysee.c b/drivers/media/dvb/dvb-usb/anysee.c index ff9226e1843d..3c8a3abae831 100644 --- a/drivers/media/dvb/dvb-usb/anysee.c +++ b/drivers/media/dvb/dvb-usb/anysee.c | |||
@@ -36,6 +36,7 @@ | |||
36 | #include "mt352.h" | 36 | #include "mt352.h" |
37 | #include "mt352_priv.h" | 37 | #include "mt352_priv.h" |
38 | #include "zl10353.h" | 38 | #include "zl10353.h" |
39 | #include "tda18212.h" | ||
39 | 40 | ||
40 | /* debug */ | 41 | /* debug */ |
41 | static int dvb_usb_anysee_debug; | 42 | static int dvb_usb_anysee_debug; |
@@ -265,6 +266,32 @@ static struct zl10353_config anysee_zl10353_config = { | |||
265 | .parallel_ts = 1, | 266 | .parallel_ts = 1, |
266 | }; | 267 | }; |
267 | 268 | ||
269 | static struct zl10353_config anysee_zl10353_tda18212_config = { | ||
270 | .demod_address = (0x18 >> 1), | ||
271 | .parallel_ts = 1, | ||
272 | .disable_i2c_gate_ctrl = 1, | ||
273 | .no_tuner = 1, | ||
274 | .if2 = 41500, | ||
275 | }; | ||
276 | |||
277 | static struct tda10023_config anysee_tda10023_tda18212_config = { | ||
278 | .demod_address = (0x1a >> 1), | ||
279 | .xtal = 16000000, | ||
280 | .pll_m = 12, | ||
281 | .pll_p = 3, | ||
282 | .pll_n = 1, | ||
283 | .output_mode = TDA10023_OUTPUT_MODE_PARALLEL_C, | ||
284 | .deltaf = 0xba02, | ||
285 | }; | ||
286 | |||
287 | static struct tda18212_config anysee_tda18212_config = { | ||
288 | .i2c_address = (0xc0 >> 1), | ||
289 | .if_dvbt_6 = 4150, | ||
290 | .if_dvbt_7 = 4150, | ||
291 | .if_dvbt_8 = 4150, | ||
292 | .if_dvbc = 5000, | ||
293 | }; | ||
294 | |||
268 | /* | 295 | /* |
269 | * New USB device strings: Mfr=1, Product=2, SerialNumber=0 | 296 | * New USB device strings: Mfr=1, Product=2, SerialNumber=0 |
270 | * Manufacturer: AMT.CO.KR | 297 | * Manufacturer: AMT.CO.KR |
@@ -316,6 +343,20 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap) | |||
316 | int ret; | 343 | int ret; |
317 | struct anysee_state *state = adap->dev->priv; | 344 | struct anysee_state *state = adap->dev->priv; |
318 | u8 hw_info[3]; | 345 | u8 hw_info[3]; |
346 | u8 tmp; | ||
347 | struct i2c_msg msg[2] = { | ||
348 | { | ||
349 | .addr = anysee_tda18212_config.i2c_address, | ||
350 | .flags = 0, | ||
351 | .len = 1, | ||
352 | .buf = "\x00", | ||
353 | }, { | ||
354 | .addr = anysee_tda18212_config.i2c_address, | ||
355 | .flags = I2C_M_RD, | ||
356 | .len = 1, | ||
357 | .buf = &tmp, | ||
358 | } | ||
359 | }; | ||
319 | 360 | ||
320 | /* Check which hardware we have. | 361 | /* Check which hardware we have. |
321 | * We must do this call two times to get reliable values (hw bug). | 362 | * We must do this call two times to get reliable values (hw bug). |
@@ -390,6 +431,24 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap) | |||
390 | /* E30 Combo Plus */ | 431 | /* E30 Combo Plus */ |
391 | /* E30 C Plus */ | 432 | /* E30 C Plus */ |
392 | 433 | ||
434 | /* enable tuner on IOE[4] */ | ||
435 | ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (1 << 4), 0x10); | ||
436 | if (ret) | ||
437 | goto error; | ||
438 | |||
439 | /* probe TDA18212 */ | ||
440 | tmp = 0; | ||
441 | ret = i2c_transfer(&adap->dev->i2c_adap, msg, 2); | ||
442 | if (ret == 2 && tmp == 0xc7) | ||
443 | deb_info("%s: TDA18212 found\n", __func__); | ||
444 | else | ||
445 | tmp = 0; | ||
446 | |||
447 | /* disable tuner on IOE[4] */ | ||
448 | ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (0 << 4), 0x10); | ||
449 | if (ret) | ||
450 | goto error; | ||
451 | |||
393 | if (dvb_usb_anysee_delsys) { | 452 | if (dvb_usb_anysee_delsys) { |
394 | /* disable DVB-C demod on IOD[5] */ | 453 | /* disable DVB-C demod on IOD[5] */ |
395 | ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (0 << 5), | 454 | ret = anysee_wr_reg_mask(adap->dev, REG_IOD, (0 << 5), |
@@ -404,8 +463,17 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap) | |||
404 | goto error; | 463 | goto error; |
405 | 464 | ||
406 | /* attach demod */ | 465 | /* attach demod */ |
407 | adap->fe = dvb_attach(zl10353_attach, | 466 | if (tmp == 0xc7) { |
408 | &anysee_zl10353_config, &adap->dev->i2c_adap); | 467 | /* TDA18212 config */ |
468 | adap->fe = dvb_attach(zl10353_attach, | ||
469 | &anysee_zl10353_tda18212_config, | ||
470 | &adap->dev->i2c_adap); | ||
471 | } else { | ||
472 | /* PLL config */ | ||
473 | adap->fe = dvb_attach(zl10353_attach, | ||
474 | &anysee_zl10353_config, | ||
475 | &adap->dev->i2c_adap); | ||
476 | } | ||
409 | if (adap->fe) | 477 | if (adap->fe) |
410 | break; | 478 | break; |
411 | } else { | 479 | } else { |
@@ -422,9 +490,17 @@ static int anysee_frontend_attach(struct dvb_usb_adapter *adap) | |||
422 | goto error; | 490 | goto error; |
423 | 491 | ||
424 | /* attach demod */ | 492 | /* attach demod */ |
425 | adap->fe = dvb_attach(tda10023_attach, | 493 | if (tmp == 0xc7) { |
426 | &anysee_tda10023_config, &adap->dev->i2c_adap, | 494 | /* TDA18212 config */ |
427 | 0x48); | 495 | adap->fe = dvb_attach(tda10023_attach, |
496 | &anysee_tda10023_tda18212_config, | ||
497 | &adap->dev->i2c_adap, 0x48); | ||
498 | } else { | ||
499 | /* PLL config */ | ||
500 | adap->fe = dvb_attach(tda10023_attach, | ||
501 | &anysee_tda10023_config, | ||
502 | &adap->dev->i2c_adap, 0x48); | ||
503 | } | ||
428 | if (adap->fe) | 504 | if (adap->fe) |
429 | break; | 505 | break; |
430 | } | 506 | } |
@@ -445,6 +521,7 @@ error: | |||
445 | static int anysee_tuner_attach(struct dvb_usb_adapter *adap) | 521 | static int anysee_tuner_attach(struct dvb_usb_adapter *adap) |
446 | { | 522 | { |
447 | struct anysee_state *state = adap->dev->priv; | 523 | struct anysee_state *state = adap->dev->priv; |
524 | struct dvb_frontend *fe; | ||
448 | int ret = 0; | 525 | int ret = 0; |
449 | deb_info("%s:\n", __func__); | 526 | deb_info("%s:\n", __func__); |
450 | 527 | ||
@@ -475,6 +552,25 @@ static int anysee_tuner_attach(struct dvb_usb_adapter *adap) | |||
475 | /* E30 Combo Plus */ | 552 | /* E30 Combo Plus */ |
476 | /* E30 C Plus */ | 553 | /* E30 C Plus */ |
477 | 554 | ||
555 | /* Try first attach TDA18212 silicon tuner on IOE[4], if that | ||
556 | * fails attach old simple PLL. */ | ||
557 | |||
558 | /* enable tuner on IOE[4] */ | ||
559 | ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (1 << 4), 0x10); | ||
560 | if (ret) | ||
561 | goto error; | ||
562 | |||
563 | /* attach tuner */ | ||
564 | fe = dvb_attach(tda18212_attach, adap->fe, &adap->dev->i2c_adap, | ||
565 | &anysee_tda18212_config); | ||
566 | if (fe) | ||
567 | break; | ||
568 | |||
569 | /* disable tuner on IOE[4] */ | ||
570 | ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (0 << 4), 0x10); | ||
571 | if (ret) | ||
572 | goto error; | ||
573 | |||
478 | if (dvb_usb_anysee_delsys) { | 574 | if (dvb_usb_anysee_delsys) { |
479 | /* enable DVB-T tuner on IOE[0] */ | 575 | /* enable DVB-T tuner on IOE[0] */ |
480 | ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (0 << 0), | 576 | ret = anysee_wr_reg_mask(adap->dev, REG_IOE, (0 << 0), |