summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--v4l/ChangeLog16
-rw-r--r--v4l_experimental/pvrusb2/pvrusb2-hdw-internal.h3
-rw-r--r--v4l_experimental/pvrusb2/pvrusb2-i2c.c26
-rw-r--r--v4l_experimental/pvrusb2/pvrusb2-i2c.h3
-rw-r--r--v4l_experimental/pvrusb2/pvrusb2-main.c3
-rw-r--r--v4l_experimental/pvrusb2/pvrusb2-tuner.c9
6 files changed, 55 insertions, 5 deletions
diff --git a/v4l/ChangeLog b/v4l/ChangeLog
index 93161a88c..1564a5b01 100644
--- a/v4l/ChangeLog
+++ b/v4l/ChangeLog
@@ -1,3 +1,19 @@
+2005-12-07 06:49 mcisely
+
+ * v4l_experimental/pvrusb2/pvrusb2-hdw-internal.h:
+ * v4l_experimental/pvrusb2/pvrusb2-i2c.c: (pvr2_i2c_attach_inform),
+ (pvr2_i2c_ifhandler_cmd), (pvr2_i2c_detach_inform):
+ * v4l_experimental/pvrusb2/pvrusb2-i2c.h:
+ * v4l_experimental/pvrusb2/pvrusb2-main.c: (pvr_init):
+ * v4l_experimental/pvrusb2/pvrusb2-tuner.c: (pvr2_tuner_set_freq),
+ (pvr2_tuner_set_standard):
+
+ - Support tda9887 in pvrusb2 driver. These changes become benign
+ if tda9887 is not needed by for a particular tuner type or if
+ tda9887 itself eventually goes away.
+
+ Signed-off-by: Mike Isely <isely@pobox.com>
+
2005-12-06 16:51 mkrufky
* linux/drivers/media/video/cx88/cx88-input.c: (cx88_ir_init):
diff --git a/v4l_experimental/pvrusb2/pvrusb2-hdw-internal.h b/v4l_experimental/pvrusb2/pvrusb2-hdw-internal.h
index 3051d6cc9..fb274daea 100644
--- a/v4l_experimental/pvrusb2/pvrusb2-hdw-internal.h
+++ b/v4l_experimental/pvrusb2/pvrusb2-hdw-internal.h
@@ -1,6 +1,6 @@
/*
*
- * $Id: pvrusb2-hdw-internal.h,v 1.2 2005/11/27 23:01:16 mcisely Exp $
+ * $Id: pvrusb2-hdw-internal.h,v 1.3 2005/12/07 06:53:52 mcisely Exp $
*
* Copyright (C) 2005 Mike Isely <isely@pobox.com>
*
@@ -80,6 +80,7 @@ struct pvr2_hdw {
struct i2c_algorithm i2c_algo;
int i2c_linked;
struct i2c_client *i2c_tuner_client;
+ struct i2c_client *i2c_ifhandler_client;
struct i2c_client *i2c_audio_client;
struct i2c_client *i2c_video_client;
struct i2c_client *i2c_tveeprom_client;
diff --git a/v4l_experimental/pvrusb2/pvrusb2-i2c.c b/v4l_experimental/pvrusb2/pvrusb2-i2c.c
index fe3ca04f5..a8830dcc8 100644
--- a/v4l_experimental/pvrusb2/pvrusb2-i2c.c
+++ b/v4l_experimental/pvrusb2/pvrusb2-i2c.c
@@ -1,6 +1,6 @@
/*
*
- * $Id: pvrusb2-i2c.c,v 1.2 2005/11/27 23:01:16 mcisely Exp $
+ * $Id: pvrusb2-i2c.c,v 1.3 2005/12/07 06:53:52 mcisely Exp $
*
* Copyright (C) 2005 Mike Isely <isely@pobox.com>
*
@@ -286,6 +286,18 @@ static int pvr2_i2c_attach_inform(struct i2c_client *client)
hdw->i2c_tuner_client = client;
pvr2_tuner_set_type(hdw);
}
+ if (!(hdw->i2c_ifhandler_client)) {
+ /* This is a really horrid way to identify the tda9887
+ driver, however (1) its assigned id is -1 which is
+ completely useless to us, and (2) I'm hoping that
+ tda9887 is going to disappear soon anyway. Once it
+ really goes away, then this silly thing here will just
+ become harmless. */
+ if (!strcmp(client->driver->name,"i2c tda9887 driver")) {
+ trace_i2c("attaching tda9887 I2C client");
+ hdw->i2c_ifhandler_client = client;
+ }
+ }
#ifdef PVR2_ENABLE_SAA7115
if (!(hdw->i2c_video_client) && (id == I2C_DRIVERID_SAA7115)) {
trace_i2c("attaching saa7115 I2C client");
@@ -326,6 +338,14 @@ int pvr2_i2c_tuner_cmd(struct pvr2_hdw *hdw,unsigned int cmd,void *arg)
return stat;
}
+int pvr2_i2c_ifhandler_cmd(struct pvr2_hdw *hdw,unsigned int cmd,void *arg)
+{
+ int stat = pvr2_i2c_cmd(hdw->i2c_ifhandler_client,cmd,arg);
+ if (stat < 0) trace_i2c("pvr2_i2c_ifhandler_cmd failed with status %d",
+ stat);
+ return stat;
+}
+
int pvr2_i2c_msp3400_cmd(struct pvr2_hdw *hdw,unsigned int cmd,void *arg)
{
int stat = pvr2_i2c_cmd(hdw->i2c_audio_client,cmd,arg);
@@ -357,6 +377,10 @@ static int pvr2_i2c_detach_inform(struct i2c_client *client)
trace_i2c("pvr2_i2c_detach [client=%s @ 0x%x]",
client->name,
client->addr);
+ if (hdw->i2c_ifhandler_client == client) {
+ trace_i2c("detaching tda9887 I2C client");
+ hdw->i2c_ifhandler_client = 0;
+ }
if (hdw->i2c_audio_client == client) {
trace_i2c("detaching msp3400 I2C client");
hdw->i2c_audio_client = 0;
diff --git a/v4l_experimental/pvrusb2/pvrusb2-i2c.h b/v4l_experimental/pvrusb2/pvrusb2-i2c.h
index 5379990b9..668baac81 100644
--- a/v4l_experimental/pvrusb2/pvrusb2-i2c.h
+++ b/v4l_experimental/pvrusb2/pvrusb2-i2c.h
@@ -1,6 +1,6 @@
/*
*
- * $Id: pvrusb2-i2c.h,v 1.1 2005/11/14 13:31:24 mchehab Exp $
+ * $Id: pvrusb2-i2c.h,v 1.2 2005/12/07 06:53:52 mcisely Exp $
*
* Copyright (C) 2005 Mike Isely <isely@pobox.com>
*
@@ -26,6 +26,7 @@ struct pvr2_hdw;
void pvr2_i2c_init(struct pvr2_hdw *);
void pvr2_i2c_done(struct pvr2_hdw *);
int pvr2_i2c_tuner_cmd(struct pvr2_hdw *,unsigned int,void *);
+int pvr2_i2c_ifhandler_cmd(struct pvr2_hdw *,unsigned int,void *);
int pvr2_i2c_msp3400_cmd(struct pvr2_hdw *,unsigned int,void *);
int pvr2_i2c_saa7115_cmd(struct pvr2_hdw *,unsigned int,void *);
int pvr2_i2c_tveeprom_cmd(struct pvr2_hdw *,unsigned int,void *);
diff --git a/v4l_experimental/pvrusb2/pvrusb2-main.c b/v4l_experimental/pvrusb2/pvrusb2-main.c
index 4ae24f6b8..2afc3de28 100644
--- a/v4l_experimental/pvrusb2/pvrusb2-main.c
+++ b/v4l_experimental/pvrusb2/pvrusb2-main.c
@@ -1,6 +1,6 @@
/*
*
- * $Id: pvrusb2-main.c,v 1.1 2005/11/14 13:31:24 mchehab Exp $
+ * $Id: pvrusb2-main.c,v 1.2 2005/12/07 06:53:52 mcisely Exp $
*
* Copyright (C) 2005 Mike Isely <isely@pobox.com>
* Copyright (C) 2004 Aurelien Alleaume <slts@free.fr>
@@ -135,6 +135,7 @@ static int __init pvr_init(void)
request_module("tveeprom");
request_module("msp3400");
request_module("saa7115");
+ request_module("tda9887");
class_ptr = pvr2_sysfs_class_create();
diff --git a/v4l_experimental/pvrusb2/pvrusb2-tuner.c b/v4l_experimental/pvrusb2/pvrusb2-tuner.c
index ff94c1da2..c84200ab6 100644
--- a/v4l_experimental/pvrusb2/pvrusb2-tuner.c
+++ b/v4l_experimental/pvrusb2/pvrusb2-tuner.c
@@ -1,6 +1,6 @@
/*
*
- * $Id: pvrusb2-tuner.c,v 1.5 2005/12/02 14:03:10 mcisely Exp $
+ * $Id: pvrusb2-tuner.c,v 1.6 2005/12/07 06:53:52 mcisely Exp $
*
* Copyright (C) 2005 Mike Isely <isely@pobox.com>
* Copyright (C) 2004 Aurelien Alleaume <slts@free.fr>
@@ -74,6 +74,10 @@ int pvr2_tuner_set_freq(struct pvr2_hdw *hdw)
/* This kicks the audio controller... */
stat = pvr2_i2c_msp3400_cmd(hdw,VIDIOCSFREQ,0);
if (stat < 0) return stat;
+ /* Smack around tda9887 as well, if it is lurking nearby */
+ if (hdw->i2c_ifhandler_client) {
+ pvr2_i2c_ifhandler_cmd(hdw,VIDIOC_S_FREQUENCY,&freq);
+ }
hdw->subsys_enabled_mask |= PVR2_SUBSYS_TUNER_CFG_FREQ;
return 0;
}
@@ -143,6 +147,9 @@ int pvr2_tuner_set_standard(struct pvr2_hdw *hdw)
break;
}
pvr2_i2c_tuner_cmd(hdw,VIDIOC_S_STD,&vs);
+ if (hdw->i2c_ifhandler_client) {
+ pvr2_i2c_ifhandler_cmd(hdw,VIDIOC_S_STD,&vs);
+ }
hdw->subsys_enabled_mask |= PVR2_SUBSYS_TUNER_CFG_STD;
return 0;