aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/bttv-i2c.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@brturbo.com.br>2005-11-09 00:38:23 -0500
committerLinus Torvalds <torvalds@g5.osdl.org>2005-11-09 10:56:27 -0500
commitf3b512fd42b4ed6ff47a8afb4f42ac3cc325ddad (patch)
tree5c3d79670b5823ad1f9bf8baf2ccec292522903e /drivers/media/video/bttv-i2c.c
parent50c8640725453f2487da9267844a962108c8418e (diff)
[PATCH] v4l: 875: some cleanups at i2c stuff and fixing when tuner addr is set
- Some cleanups at I2C stuff and fixing when tuner addr is set. Signed-off-by: Mauro Carvalho Chehab <mchehab@brturbo.com.br> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/media/video/bttv-i2c.c')
-rw-r--r--drivers/media/video/bttv-i2c.c20
1 files changed, 3 insertions, 17 deletions
diff --git a/drivers/media/video/bttv-i2c.c b/drivers/media/video/bttv-i2c.c
index 5ad335705e1f..aaabef26105a 100644
--- a/drivers/media/video/bttv-i2c.c
+++ b/drivers/media/video/bttv-i2c.c
@@ -291,14 +291,11 @@ static struct i2c_adapter bttv_i2c_adap_hw_template = {
291static int attach_inform(struct i2c_client *client) 291static int attach_inform(struct i2c_client *client)
292{ 292{
293 struct bttv *btv = i2c_get_adapdata(client->adapter); 293 struct bttv *btv = i2c_get_adapdata(client->adapter);
294 int radio_addr=ADDR_UNSET, addr=ADDR_UNSET; 294 int radio_addr=ADDR_UNSET;
295 295
296 if (ADDR_UNSET != bttv_tvcards[btv->c.type].radio_addr) 296 if (ADDR_UNSET != bttv_tvcards[btv->c.type].radio_addr)
297 radio_addr = bttv_tvcards[btv->c.type].radio_addr; 297 radio_addr = bttv_tvcards[btv->c.type].radio_addr;
298 298
299 if (ADDR_UNSET != bttv_tvcards[btv->c.type].tuner_addr)
300 addr = bttv_tvcards[btv->c.type].tuner_addr;
301
302 if (bttv_debug) 299 if (bttv_debug)
303 printk(KERN_DEBUG "bttv%d: %s i2c attach [addr=0x%x,client=%s]\n", 300 printk(KERN_DEBUG "bttv%d: %s i2c attach [addr=0x%x,client=%s]\n",
304 btv->c.nr,client->driver->name,client->addr, 301 btv->c.nr,client->driver->name,client->addr,
@@ -310,25 +307,14 @@ static int attach_inform(struct i2c_client *client)
310 struct tuner_setup tun_setup; 307 struct tuner_setup tun_setup;
311 struct tuner *t = i2c_get_clientdata(client); 308 struct tuner *t = i2c_get_clientdata(client);
312 309
313 if ((addr==ADDR_UNSET)||(addr==client->addr)) {
314 tun_setup.mode_mask = T_ANALOG_TV | T_DIGITAL_TV;
315 tun_setup.type = btv->tuner_type;
316 tun_setup.addr = ADDR_UNSET;
317
318 }
319
320 if (t->type != UNSET && t->mode_mask == T_RADIO) { 310 if (t->type != UNSET && t->mode_mask == T_RADIO) {
321 tun_setup.type = t->type; 311 tun_setup.type = t->type;
322 tun_setup.mode_mask = T_RADIO; 312 tun_setup.mode_mask = T_RADIO;
323 tun_setup.addr = ADDR_UNSET; 313 tun_setup.addr = radio_addr;
314 client->driver->command (client, TUNER_SET_TYPE_ADDR, &tun_setup);
324 } 315 }
325
326 client->driver->command (client, TUNER_SET_TYPE_ADDR, &tun_setup);
327 } 316 }
328 317
329 if (btv->pinnacle_id != UNSET)
330 client->driver->command(client,AUDC_CONFIG_PINNACLE,
331 &btv->pinnacle_id);
332 return 0; 318 return 0;
333} 319}
334 320