diff options
author | Hartmut Hackmann <hartmut.hackmann@t.online.de> | 2005-11-09 00:38:00 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-11-09 10:56:23 -0500 |
commit | 95736034df751631657140aebe677e67d7522867 (patch) | |
tree | c588da09b52a20411562bbe41b590fe3318bfe60 /drivers/media/video | |
parent | 48c425965ecbd3472133adb857c2fe0608c053a0 (diff) |
[PATCH] v4l: 823: corrected probing code for tda8290
- Corrected probing code for tda8290
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')
-rw-r--r-- | drivers/media/video/tda8290.c | 30 | ||||
-rw-r--r-- | drivers/media/video/tuner-core.c | 4 |
2 files changed, 29 insertions, 5 deletions
diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c index abad3d5b04f6..2aeae864edc7 100644 --- a/drivers/media/video/tda8290.c +++ b/drivers/media/video/tda8290.c | |||
@@ -135,7 +135,7 @@ static void tda827x_tune(struct i2c_client *c, u16 ifc, unsigned int freq) | |||
135 | i2c_transfer(c->adapter, &msg, 1); | 135 | i2c_transfer(c->adapter, &msg, 1); |
136 | 136 | ||
137 | reg2[0] = 0x60; | 137 | reg2[0] = 0x60; |
138 | reg2[1] = 0x7f; | 138 | reg2[1] = 0x3f; |
139 | i2c_transfer(c->adapter, &msg, 1); | 139 | i2c_transfer(c->adapter, &msg, 1); |
140 | 140 | ||
141 | reg2[0] = 0x80; | 141 | reg2[0] = 0x80; |
@@ -534,8 +534,8 @@ int tda8290_init(struct i2c_client *c) | |||
534 | } | 534 | } |
535 | if (tuner_addrs == 0) { | 535 | if (tuner_addrs == 0) { |
536 | tuner_addrs = 0x61; | 536 | tuner_addrs = 0x61; |
537 | tuner_info ("Could not clearly identify tda8290/8275 tuner address.\n"); | 537 | tuner_info ("could not clearly identify tuner address, defaulting to %x\n", |
538 | return -1; | 538 | tuner_addrs); |
539 | } else { | 539 | } else { |
540 | tuner_addrs = tuner_addrs & 0xff; | 540 | tuner_addrs = tuner_addrs & 0xff; |
541 | tuner_info ("setting tuner address to %x\n", tuner_addrs); | 541 | tuner_info ("setting tuner address to %x\n", tuner_addrs); |
@@ -567,6 +567,30 @@ int tda8290_init(struct i2c_client *c) | |||
567 | return 0; | 567 | return 0; |
568 | } | 568 | } |
569 | 569 | ||
570 | int tda8290_probe(struct i2c_client *c) | ||
571 | { | ||
572 | unsigned char soft_reset[] = { 0x00, 0x00 }; | ||
573 | unsigned char easy_mode_b[] = { 0x01, 0x02 }; | ||
574 | unsigned char easy_mode_g[] = { 0x01, 0x04 }; | ||
575 | unsigned char addr_dto_lsb = 0x07; | ||
576 | unsigned char data; | ||
577 | |||
578 | i2c_master_send(c, easy_mode_b, 2); | ||
579 | i2c_master_send(c, soft_reset, 2); | ||
580 | i2c_master_send(c, &addr_dto_lsb, 1); | ||
581 | i2c_master_recv(c, &data, 1); | ||
582 | if (data == 0) { | ||
583 | i2c_master_send(c, easy_mode_g, 2); | ||
584 | i2c_master_send(c, soft_reset, 2); | ||
585 | i2c_master_send(c, &addr_dto_lsb, 1); | ||
586 | i2c_master_recv(c, &data, 1); | ||
587 | if (data == 0x7b) { | ||
588 | return 0; | ||
589 | } | ||
590 | } | ||
591 | return -1; | ||
592 | } | ||
593 | |||
570 | /* | 594 | /* |
571 | * Overrides for Emacs so that we follow Linus's tabbing style. | 595 | * Overrides for Emacs so that we follow Linus's tabbing style. |
572 | * --------------------------------------------------------------------------- | 596 | * --------------------------------------------------------------------------- |
diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index d4786b331467..ee83deb389d7 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c | |||
@@ -380,8 +380,8 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind) | |||
380 | case 0x42: | 380 | case 0x42: |
381 | case 0x43: | 381 | case 0x43: |
382 | case 0x4a: | 382 | case 0x4a: |
383 | case 0x44: | 383 | case 0x4b: |
384 | if (tda8290_init(&t->i2c)<0) { | 384 | if (tda8290_probe(&t->i2c) != 0) { |
385 | kfree(t); | 385 | kfree(t); |
386 | return 0; | 386 | return 0; |
387 | } | 387 | } |