summaryrefslogtreecommitdiff
path: root/v4l_experimental/pvrusb2/pvrusb2-i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'v4l_experimental/pvrusb2/pvrusb2-i2c.c')
-rw-r--r--v4l_experimental/pvrusb2/pvrusb2-i2c.c26
1 files changed, 25 insertions, 1 deletions
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;