aboutsummaryrefslogtreecommitdiffstats
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.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/drivers/media/video/cx88/cx88-i2c.c b/drivers/media/video/cx88/cx88-i2c.c
index b5342234b305..8403c4e95050 100644
--- a/drivers/media/video/cx88/cx88-i2c.c
+++ b/drivers/media/video/cx88/cx88-i2c.c
@@ -1,5 +1,5 @@
1/* 1/*
2 $Id: cx88-i2c.c,v 1.24 2005/06/17 18:46:23 mkrufky Exp $ 2 $Id: cx88-i2c.c,v 1.28 2005/07/05 17:37:35 nsh Exp $
3 3
4 cx88-i2c.c -- all the i2c code is here 4 cx88-i2c.c -- all the i2c code is here
5 5
@@ -91,25 +91,32 @@ static int cx8800_bit_getsda(void *data)
91 91
92static int attach_inform(struct i2c_client *client) 92static int attach_inform(struct i2c_client *client)
93{ 93{
94 struct tuner_addr tun_addr; 94 struct tuner_setup tun_setup;
95 struct cx88_core *core = i2c_get_adapdata(client->adapter); 95 struct cx88_core *core = i2c_get_adapdata(client->adapter);
96 96
97 dprintk(1, "i2c attach [addr=0x%x,client=%s]\n", 97 dprintk(1, "%s i2c attach [addr=0x%x,client=%s]\n",
98 client->addr, i2c_clientname(client)); 98 client->driver->name,client->addr,i2c_clientname(client));
99 if (!client->driver->command) 99 if (!client->driver->command)
100 return 0; 100 return 0;
101 101
102 if (core->radio_type != UNSET) { 102 if (core->radio_type != UNSET) {
103 tun_addr.v4l2_tuner = V4L2_TUNER_RADIO; 103 if ((core->radio_addr==ADDR_UNSET)||(core->radio_addr==client->addr)) {
104 tun_addr.type = core->radio_type; 104 tun_setup.mode_mask = T_RADIO;
105 tun_addr.addr = core->radio_addr; 105 tun_setup.type = core->radio_type;
106 client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_addr); 106 tun_setup.addr = core->radio_addr;
107
108 client->driver->command (client, TUNER_SET_TYPE_ADDR, &tun_setup);
109 }
107 } 110 }
108 if (core->tuner_type != UNSET) { 111 if (core->tuner_type != UNSET) {
109 tun_addr.v4l2_tuner = V4L2_TUNER_ANALOG_TV; 112 if ((core->tuner_addr==ADDR_UNSET)||(core->tuner_addr==client->addr)) {
110 tun_addr.type = core->tuner_type; 113
111 tun_addr.addr = core->tuner_addr; 114 tun_setup.mode_mask = T_ANALOG_TV;
112 client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_addr); 115 tun_setup.type = core->tuner_type;
116 tun_setup.addr = core->tuner_addr;
117
118 client->driver->command (client,TUNER_SET_TYPE_ADDR, &tun_setup);
119 }
113 } 120 }
114 121
115 if (core->tda9887_conf) 122 if (core->tda9887_conf)