diff options
author | Hartmut Hackmann <hartmut.hackmann@t.online.de> | 2005-11-09 00:38:38 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-09 10:56:29 -0500 |
commit | 4ac95af9a0bdc33f18e6a7532ac5319b2d4ab8c2 (patch) | |
tree | 28075f54576996e728a25860a027e4ab895c8a81 | |
parent | 22ae2550f65bc322e6bdeff9d3948bbb5e0a9b67 (diff) |
[PATCH] V4L: 896: fixed tda8290 secam l
Fixed tda8290 SECAM-L
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>
-rw-r--r-- | drivers/media/video/tda8290.c | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c index 0dde6af251dd..b2dfe07e9f9d 100644 --- a/drivers/media/video/tda8290.c +++ b/drivers/media/video/tda8290.c | |||
@@ -323,6 +323,7 @@ static int tda8290_tune(struct i2c_client *c, u16 ifc, unsigned int freq) | |||
323 | i2c_master_send(c, soft_reset, 2); | 323 | i2c_master_send(c, soft_reset, 2); |
324 | msleep(1); | 324 | msleep(1); |
325 | 325 | ||
326 | expert_mode[1] = t->tda8290_easy_mode + 0x80; | ||
326 | i2c_master_send(c, expert_mode, 2); | 327 | i2c_master_send(c, expert_mode, 2); |
327 | i2c_master_send(c, gainset_off, 2); | 328 | i2c_master_send(c, gainset_off, 2); |
328 | i2c_master_send(c, if_agc_spd, 2); | 329 | i2c_master_send(c, if_agc_spd, 2); |
@@ -348,8 +349,9 @@ static int tda8290_tune(struct i2c_client *c, u16 ifc, unsigned int freq) | |||
348 | tuner_dbg("tda8290 is locked, AGC: %d\n", agc_stat); | 349 | tuner_dbg("tda8290 is locked, AGC: %d\n", agc_stat); |
349 | else | 350 | else |
350 | tuner_dbg("tda8290 not locked, no signal?\n"); | 351 | tuner_dbg("tda8290 not locked, no signal?\n"); |
351 | if ((agc_stat > 115) || (!(pll_stat & 0x80) && (adc_sat <20))) { | 352 | if ((agc_stat > 115) || (!(pll_stat & 0x80) && (adc_sat < 20))) { |
352 | tuner_dbg("adjust gain, step 1. Agc: %d\n", agc_stat); | 353 | tuner_dbg("adjust gain, step 1. Agc: %d, ADC stat: %d, lock: %d\n", |
354 | agc_stat, adc_sat, pll_stat & 0x80); | ||
353 | i2c_master_send(c, gainset_2, 2); | 355 | i2c_master_send(c, gainset_2, 2); |
354 | msleep(100); | 356 | msleep(100); |
355 | i2c_master_send(c, &addr_agc_stat, 1); | 357 | i2c_master_send(c, &addr_agc_stat, 1); |
@@ -357,7 +359,8 @@ static int tda8290_tune(struct i2c_client *c, u16 ifc, unsigned int freq) | |||
357 | i2c_master_send(c, &addr_pll_stat, 1); | 359 | i2c_master_send(c, &addr_pll_stat, 1); |
358 | i2c_master_recv(c, &pll_stat, 1); | 360 | i2c_master_recv(c, &pll_stat, 1); |
359 | if ((agc_stat > 115) || !(pll_stat & 0x80)) { | 361 | if ((agc_stat > 115) || !(pll_stat & 0x80)) { |
360 | tuner_dbg("adjust gain, step 2. Agc: %d\n", agc_stat); | 362 | tuner_dbg("adjust gain, step 2. Agc: %d, lock: %d\n", |
363 | agc_stat, pll_stat & 0x80); | ||
361 | if (t->tda827x_ver != 0) | 364 | if (t->tda827x_ver != 0) |
362 | tda827xa_agcf(c); | 365 | tda827xa_agcf(c); |
363 | else | 366 | else |
@@ -383,6 +386,7 @@ static int tda8290_tune(struct i2c_client *c, u16 ifc, unsigned int freq) | |||
383 | i2c_master_send(c, &addr_pll_stat, 1); | 386 | i2c_master_send(c, &addr_pll_stat, 1); |
384 | i2c_master_recv(c, &pll_stat, 1); | 387 | i2c_master_recv(c, &pll_stat, 1); |
385 | if ((adc_sat > 20) || !(pll_stat & 0x80)) { | 388 | if ((adc_sat > 20) || !(pll_stat & 0x80)) { |
389 | tuner_dbg("trying to resolve SECAM L deadlock\n"); | ||
386 | i2c_master_send(c, agc_rst_on, 2); | 390 | i2c_master_send(c, agc_rst_on, 2); |
387 | msleep(40); | 391 | msleep(40); |
388 | i2c_master_send(c, agc_rst_off, 2); | 392 | i2c_master_send(c, agc_rst_off, 2); |
@@ -404,28 +408,37 @@ static int tda8290_tune(struct i2c_client *c, u16 ifc, unsigned int freq) | |||
404 | 408 | ||
405 | static void set_audio(struct tuner *t) | 409 | static void set_audio(struct tuner *t) |
406 | { | 410 | { |
407 | t->tda827x_lpsel = 0; | 411 | char* mode; |
408 | 412 | ||
413 | t->tda827x_lpsel = 0; | ||
414 | mode = "xx"; | ||
409 | if (t->std & V4L2_STD_MN) { | 415 | if (t->std & V4L2_STD_MN) { |
410 | t->sgIF = 92; | 416 | t->sgIF = 92; |
411 | t->tda8290_easy_mode = 0x01; | 417 | t->tda8290_easy_mode = 0x01; |
412 | t->tda827x_lpsel = 1; | 418 | t->tda827x_lpsel = 1; |
419 | mode = "MN"; | ||
413 | } else if (t->std & V4L2_STD_B) { | 420 | } else if (t->std & V4L2_STD_B) { |
414 | t->sgIF = 108; | 421 | t->sgIF = 108; |
415 | t->tda8290_easy_mode = 0x02; | 422 | t->tda8290_easy_mode = 0x02; |
423 | mode = "B"; | ||
416 | } else if (t->std & V4L2_STD_GH) { | 424 | } else if (t->std & V4L2_STD_GH) { |
417 | t->sgIF = 124; | 425 | t->sgIF = 124; |
418 | t->tda8290_easy_mode = 0x04; | 426 | t->tda8290_easy_mode = 0x04; |
427 | mode = "GH"; | ||
419 | } else if (t->std & V4L2_STD_PAL_I) { | 428 | } else if (t->std & V4L2_STD_PAL_I) { |
420 | t->sgIF = 124; | 429 | t->sgIF = 124; |
421 | t->tda8290_easy_mode = 0x08; | 430 | t->tda8290_easy_mode = 0x08; |
431 | mode = "I"; | ||
422 | } else if (t->std & V4L2_STD_DK) { | 432 | } else if (t->std & V4L2_STD_DK) { |
423 | t->sgIF = 124; | 433 | t->sgIF = 124; |
424 | t->tda8290_easy_mode = 0x10; | 434 | t->tda8290_easy_mode = 0x10; |
435 | mode = "DK"; | ||
425 | } else if (t->std & V4L2_STD_SECAM_L) { | 436 | } else if (t->std & V4L2_STD_SECAM_L) { |
426 | t->sgIF = 124; | 437 | t->sgIF = 124; |
427 | t->tda8290_easy_mode = 0x20; | 438 | t->tda8290_easy_mode = 0x20; |
439 | mode = "L"; | ||
428 | } | 440 | } |
441 | tuner_dbg("setting tda8290 to system %s\n", mode); | ||
429 | } | 442 | } |
430 | 443 | ||
431 | static void set_tv_freq(struct i2c_client *c, unsigned int freq) | 444 | static void set_tv_freq(struct i2c_client *c, unsigned int freq) |