summaryrefslogtreecommitdiff
path: root/linux/drivers
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <devnull@localhost>2005-06-30 16:37:17 +0000
committerMauro Carvalho Chehab <devnull@localhost>2005-06-30 16:37:17 +0000
commit1d6b912020482abd6eb163baa0190a1da23b9f9e (patch)
tree5e41cca3a10483e9fa925a0bb174b0d7bd7e3773 /linux/drivers
parent29c59c47dfb646d340182b3500486b144ae7c1b7 (diff)
downloadmediapointer-dvb-s2-1d6b912020482abd6eb163baa0190a1da23b9f9e.tar.gz
mediapointer-dvb-s2-1d6b912020482abd6eb163baa0190a1da23b9f9e.tar.bz2
- Fixed bugs at TEA5767 autodetection code
- New debug code for identifying calls to set_type before I2C ok. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br>
Diffstat (limited to 'linux/drivers')
-rw-r--r--linux/drivers/media/video/tea5767.c6
-rw-r--r--linux/drivers/media/video/tuner-core.c7
2 files changed, 6 insertions, 7 deletions
diff --git a/linux/drivers/media/video/tea5767.c b/linux/drivers/media/video/tea5767.c
index e4a46ffc2..df2cb9ed9 100644
--- a/linux/drivers/media/video/tea5767.c
+++ b/linux/drivers/media/video/tea5767.c
@@ -2,7 +2,7 @@
* For Philips TEA5767 FM Chip used on some TV Cards like Prolink Pixelview
* I2C address is allways 0xC0.
*
- * $Id: tea5767.c,v 1.13 2005/06/30 09:45:18 mchehab Exp $
+ * $Id: tea5767.c,v 1.14 2005/06/30 16:37:17 mchehab Exp $
*
* Copyright (c) 2005 Mauro Carvalho Chehab (mchehab@brturbo.com.br)
* This code is placed under the terms of the GNU General Public License
@@ -305,7 +305,7 @@ static int tea5767_stereo(struct i2c_client *c)
return ((buffer[2] & TEA5767_STEREO_MASK) ? V4L2_TUNER_SUB_STEREO : 0);
}
-int tea_detection(struct i2c_client *c)
+int tea5767_autodetection(struct i2c_client *c)
{
unsigned char buffer[5] = { 0xff, 0xff, 0xff, 0xff, 0xff };
int rc;
@@ -341,7 +341,7 @@ int tea5767_tuner_init(struct i2c_client *c)
{
struct tuner *t = i2c_get_clientdata(c);
- if (tea_detection(c) == EINVAL)
+ if (tea5767_autodetection(c) == EINVAL)
return EINVAL;
tuner_info("type set to %d (%s)\n", t->type, TEA5767_TUNER_NAME);
diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c
index 74f216dd6..072252311 100644
--- a/linux/drivers/media/video/tuner-core.c
+++ b/linux/drivers/media/video/tuner-core.c
@@ -1,5 +1,5 @@
/*
- * $Id: tuner-core.c,v 1.32 2005/06/30 09:45:18 mchehab Exp $
+ * $Id: tuner-core.c,v 1.33 2005/06/30 16:37:17 mchehab Exp $
*
* i2c tv tuner chip device driver
* core core, i.e. kernel interfaces, registering and so on
@@ -152,8 +152,8 @@ static void set_type(struct i2c_client *c, unsigned int type,
return;
if (NULL == t->i2c.dev.driver) {
+ tuner_info("Trying to set type before initializing driver\n");
/* not registered yet */
- t->type = type;
return;
}
/* if ((t->admin_status==T_UNINITIALIZED) && (t->type == type))
@@ -312,8 +312,7 @@ static int tuner_attach(struct i2c_adapter *adap, int addr, int kind)
/* TEA5767 autodetection code - only for addr = 0xc0 */
if (addr == 0x60) {
- set_type(&t->i2c, TUNER_TEA5767, T_RADIO);
- if (t->type == TUNER_TEA5767) {
+ if (tea5767_autodetection(&t->i2c)!=EINVAL) {
t->type = TUNER_TEA5767;
t->admin_status = T_RADIO|T_STANDBY;
default_admin_status &= ~T_RADIO;