summaryrefslogtreecommitdiff
path: root/drivers/media/video/cx88/cx88-i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cx88/cx88-i2c.c')
-rw-r--r--drivers/media/video/cx88/cx88-i2c.c30
1 files changed, 25 insertions, 5 deletions
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
index 0725b1288f4f..a628a55299c6 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -1,5 +1,5 @@
/*
- $Id: cx88-i2c.c,v 1.20 2005/02/15 15:59:35 kraxel Exp $
+ $Id: cx88-i2c.c,v 1.30 2005/07/25 05:10:13 mkrufky Exp $
cx88-i2c.c -- all the i2c code is here
@@ -91,15 +91,34 @@ static int cx8800_bit_getsda(void *data)
static int attach_inform(struct i2c_client *client)
{
+ struct tuner_setup tun_setup;
struct cx88_core *core = i2c_get_adapdata(client->adapter);
- dprintk(1, "i2c attach [addr=0x%x,client=%s]\n",
- client->addr, i2c_clientname(client));
+ dprintk(1, "%s i2c attach [addr=0x%x,client=%s]\n",
+ client->driver->name,client->addr,i2c_clientname(client));
if (!client->driver->command)
return 0;
- if (core->tuner_type != UNSET)
- client->driver->command(client, TUNER_SET_TYPE, &core->tuner_type);
+ if (core->radio_type != UNSET) {
+ if ((core->radio_addr==ADDR_UNSET)||(core->radio_addr==client->addr)) {
+ tun_setup.mode_mask = T_RADIO;
+ tun_setup.type = core->radio_type;
+ tun_setup.addr = core->radio_addr;
+
+ client->driver->command (client, TUNER_SET_TYPE_ADDR, &tun_setup);
+ }
+ }
+ if (core->tuner_type != UNSET) {
+ if ((core->tuner_addr==ADDR_UNSET)||(core->tuner_addr==client->addr)) {
+
+ tun_setup.mode_mask = T_ANALOG_TV;
+ tun_setup.type = core->tuner_type;
+ tun_setup.addr = core->tuner_addr;
+
+ client->driver->command (client,TUNER_SET_TYPE_ADDR, &tun_setup);
+ }
+ }
+
if (core->tda9887_conf)
client->driver->command(client, TDA9887_SET_CONFIG, &core->tda9887_conf);
return 0;
@@ -145,6 +164,7 @@ static struct i2c_client cx8800_i2c_client_template = {
};
static char *i2c_devs[128] = {
+ [ 0x1c >> 1 ] = "lgdt330x",
[ 0x86 >> 1 ] = "tda9887/cx22702",
[ 0xa0 >> 1 ] = "eeprom",
[ 0xc0 >> 1 ] = "tuner (analog)",