diff options
author | Mauro Carvalho Chehab <mchehab@brturbo.com.br> | 2005-08-02 00:11:38 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2005-08-02 00:37:59 -0400 |
commit | 001abc93bf83f95737cd455b6ec875e6412f7d53 (patch) | |
tree | 50c99726fa7ad9a450d083bd498a7ecac8f95808 | |
parent | 43f2f3d343f9d00a94a9242547a59d9dfb2338c4 (diff) |
[PATCH] v4l: bug fix to correct tea5767 autodetection
This patch does correct radio chip autodetection to avoid misdetecting
mt20xx microtune as tea5767 chip.
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/tea5767.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/media/video/tea5767.c b/drivers/media/video/tea5767.c index c8fd4204cd0a..cebcc1fa68d1 100644 --- a/drivers/media/video/tea5767.c +++ b/drivers/media/video/tea5767.c | |||
@@ -2,7 +2,7 @@ | |||
2 | * For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview | 2 | * For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview |
3 | * I2C address is allways 0xC0. | 3 | * I2C address is allways 0xC0. |
4 | * | 4 | * |
5 | * $Id: tea5767.c,v 1.26 2005/07/27 12:00:36 mkrufky Exp $ | 5 | * $Id: tea5767.c,v 1.27 2005/07/31 12:10:56 mchehab Exp $ |
6 | * | 6 | * |
7 | * Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@brturbo.com.br) | 7 | * Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@brturbo.com.br) |
8 | * This code is placed under the terms of the GNU General Public License | 8 | * This code is placed under the terms of the GNU General Public License |
@@ -296,7 +296,7 @@ int tea5767_autodetection(struct i2c_client *c) | |||
296 | int rc; | 296 | int rc; |
297 | struct tuner *t = i2c_get_clientdata(c); | 297 | struct tuner *t = i2c_get_clientdata(c); |
298 | 298 | ||
299 | if (5 != (rc = i2c_master_recv(c, buffer, 5))) { | 299 | if (7 != (rc = i2c_master_recv(c, buffer, 7))) { |
300 | tuner_warn("It is not a TEA5767. Received %i bytes.\n", rc); | 300 | tuner_warn("It is not a TEA5767. Received %i bytes.\n", rc); |
301 | return EINVAL; | 301 | return EINVAL; |
302 | } | 302 | } |
@@ -323,6 +323,12 @@ int tea5767_autodetection(struct i2c_client *c) | |||
323 | return EINVAL; | 323 | return EINVAL; |
324 | } | 324 | } |
325 | 325 | ||
326 | /* It seems that tea5767 returns 0xff after the 5th byte */ | ||
327 | if ((buffer[5] != 0xff) || (buffer[6] != 0xff)) { | ||
328 | tuner_warn("Returned more than 5 bytes. It is not a TEA5767\n"); | ||
329 | return EINVAL; | ||
330 | } | ||
331 | |||
326 | tuner_warn("TEA5767 detected.\n"); | 332 | tuner_warn("TEA5767 detected.\n"); |
327 | return 0; | 333 | return 0; |
328 | } | 334 | } |
@@ -331,7 +337,8 @@ int tea5767_tuner_init(struct i2c_client *c) | |||
331 | { | 337 | { |
332 | struct tuner *t = i2c_get_clientdata(c); | 338 | struct tuner *t = i2c_get_clientdata(c); |
333 | 339 | ||
334 | tuner_info("type set to %d (%s)\n", t->type, "Philips TEA5767HN FM Radio"); | 340 | tuner_info("type set to %d (%s)\n", t->type, |
341 | "Philips TEA5767HN FM Radio"); | ||
335 | strlcpy(c->name, "tea5767", sizeof(c->name)); | 342 | strlcpy(c->name, "tea5767", sizeof(c->name)); |
336 | 343 | ||
337 | t->tv_freq = set_tv_freq; | 344 | t->tv_freq = set_tv_freq; |