summaryrefslogtreecommitdiff
path: root/drivers/media/video/tda8290.c
diff options
context:
space:
mode:
authorHartmut Hackmann <hartmut.hackmann@t.online.de>2005-11-09 08:38:00 +0300
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-09 18:56:23 +0300
commit95736034df751631657140aebe677e67d7522867 (patch)
treec588da09b52a20411562bbe41b590fe3318bfe60 /drivers/media/video/tda8290.c
parent48c425965ecbd3472133adb857c2fe0608c053a0 (diff)
downloadlinux-95736034df751631657140aebe677e67d7522867.tar.xz
[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/tda8290.c')
-rw-r--r--drivers/media/video/tda8290.c30
1 files changed, 27 insertions, 3 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)
i2c_transfer(c->adapter, &msg, 1);
reg2[0] = 0x60;
- reg2[1] = 0x7f;
+ reg2[1] = 0x3f;
i2c_transfer(c->adapter, &msg, 1);
reg2[0] = 0x80;
@@ -534,8 +534,8 @@ int tda8290_init(struct i2c_client *c)
}
if (tuner_addrs == 0) {
tuner_addrs = 0x61;
- tuner_info ("Could not clearly identify tda8290/8275 tuner address.\n");
- return -1;
+ tuner_info ("could not clearly identify tuner address, defaulting to %x\n",
+ tuner_addrs);
} else {
tuner_addrs = tuner_addrs & 0xff;
tuner_info ("setting tuner address to %x\n", tuner_addrs);
@@ -567,6 +567,30 @@ int tda8290_init(struct i2c_client *c)
return 0;
}
+int tda8290_probe(struct i2c_client *c)
+{
+ unsigned char soft_reset[] = { 0x00, 0x00 };
+ unsigned char easy_mode_b[] = { 0x01, 0x02 };
+ unsigned char easy_mode_g[] = { 0x01, 0x04 };
+ unsigned char addr_dto_lsb = 0x07;
+ unsigned char data;
+
+ i2c_master_send(c, easy_mode_b, 2);
+ i2c_master_send(c, soft_reset, 2);
+ i2c_master_send(c, &addr_dto_lsb, 1);
+ i2c_master_recv(c, &data, 1);
+ if (data == 0) {
+ i2c_master_send(c, easy_mode_g, 2);
+ i2c_master_send(c, soft_reset, 2);
+ i2c_master_send(c, &addr_dto_lsb, 1);
+ i2c_master_recv(c, &data, 1);
+ if (data == 0x7b) {
+ return 0;
+ }
+ }
+ return -1;
+}
+
/*
* Overrides for Emacs so that we follow Linus's tabbing style.
* ---------------------------------------------------------------------------