summaryrefslogtreecommitdiff
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
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>
-rw-r--r--linux/drivers/media/video/tea5767.c6
-rw-r--r--linux/drivers/media/video/tuner-core.c7
-rw-r--r--linux/include/media/tuner.h3
-rw-r--r--v4l/ChangeLog5
4 files changed, 13 insertions, 8 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;
diff --git a/linux/include/media/tuner.h b/linux/include/media/tuner.h
index a40ca4d48..bee807930 100644
--- a/linux/include/media/tuner.h
+++ b/linux/include/media/tuner.h
@@ -1,5 +1,5 @@
-/* $Id: tuner.h,v 1.35 2005/06/28 03:17:39 mchehab Exp $
+/* $Id: tuner.h,v 1.36 2005/06/30 16:37:17 mchehab Exp $
*
tuner.h - definition for different tuners
@@ -222,6 +222,7 @@ extern int microtune_init(struct i2c_client *c);
extern int tda8290_init(struct i2c_client *c);
extern int tea5767_tuner_init(struct i2c_client *c);
extern int default_tuner_init(struct i2c_client *c);
+extern int tea5767_autodetection(struct i2c_client *c);
#define tuner_warn(fmt, arg...) \
dev_printk(KERN_WARNING , &t->i2c.dev , fmt , ## arg)
diff --git a/v4l/ChangeLog b/v4l/ChangeLog
index 8835277e0..bcfe2cf16 100644
--- a/v4l/ChangeLog
+++ b/v4l/ChangeLog
@@ -1,3 +1,8 @@
+2005-06-29 16:37 mchehab
+ *tuner-core.c, tuner.h, tea5767.c:
+ - Fixed bugs at TEA5767 autodetection code
+ - New debug code for identifying calls to set_type before I2C ok.
+
2005-06-29 09:37 mchehab
* tuner-core.c:
- Idented according with Linux standards