summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNickolay V. Shmyrev <devnull@localhost>2005-07-02 15:24:11 +0000
committerNickolay V. Shmyrev <devnull@localhost>2005-07-02 15:24:11 +0000
commita3a954f470bc6f2ce8de3296cae025627f5b0c6a (patch)
tree058624cf74c66ede5d28f5bf4f865d3746ac891d
parentec7f541e384c249c0f5a2c415b95c900bb272c44 (diff)
downloadmediapointer-dvb-s2-a3a954f470bc6f2ce8de3296cae025627f5b0c6a.tar.gz
mediapointer-dvb-s2-a3a954f470bc6f2ce8de3296cae025627f5b0c6a.tar.bz2
* bttv-cards.c, bttv-i2c.c, cx88-i2c.c, cx88-video.c:
* saa7134-cards.c, saa7134-core.c, saa7134-i2c.c: * tuner-core.c, tuner.h: Rename v4l2_tuner field in tun_addr structure. Cleanup tuner private calls.
-rw-r--r--linux/drivers/media/video/bttv-cards.c16
-rw-r--r--linux/drivers/media/video/bttv-i2c.c14
-rw-r--r--linux/drivers/media/video/cx88/cx88-i2c.c8
-rw-r--r--linux/drivers/media/video/cx88/cx88-video.c7
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-cards.c14
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-core.c33
-rw-r--r--linux/drivers/media/video/saa7134/saa7134-i2c.c13
-rw-r--r--linux/drivers/media/video/tuner-core.c12
-rw-r--r--linux/include/media/tuner.h12
-rw-r--r--v4l/ChangeLog11
10 files changed, 90 insertions, 50 deletions
diff --git a/linux/drivers/media/video/bttv-cards.c b/linux/drivers/media/video/bttv-cards.c
index a2f8920e8..8f4215c35 100644
--- a/linux/drivers/media/video/bttv-cards.c
+++ b/linux/drivers/media/video/bttv-cards.c
@@ -1,5 +1,5 @@
/*
- $Id: bttv-cards.c,v 1.50 2005/06/22 22:58:04 mchehab Exp $
+ $Id: bttv-cards.c,v 1.51 2005/07/02 15:24:11 nsh Exp $
bttv-cards.c
@@ -2823,10 +2823,18 @@ void __devinit bttv_init_card2(struct bttv *btv)
btv->tuner_type = tuner[btv->c.nr];
printk("bttv%d: using tuner=%d\n",btv->c.nr,btv->tuner_type);
if (btv->pinnacle_id != UNSET)
- bttv_call_i2c_clients(btv,AUDC_CONFIG_PINNACLE,
+ bttv_call_i2c_clients(btv, AUDC_CONFIG_PINNACLE,
&btv->pinnacle_id);
- if (btv->tuner_type != UNSET)
- bttv_call_i2c_clients(btv,TUNER_SET_TYPE,&btv->tuner_type);
+ if (btv->tuner_type != UNSET) {
+ struct tuner_addr tun_addr;
+
+ tun_addr.state = T_RADIO | T_ANALOG_TV | T_DIGITAL_TV;
+ tun_addr.type = btv->tuner_type;
+ tun_addr.addr = ADDR_UNSET;
+
+ bttv_call_i2c_clients(btv, TUNER_SET_TYPE_ADDR, &tun_addr);
+ }
+
btv->svhs = bttv_tvcards[btv->c.type].svhs;
if (svhs[btv->c.nr] != UNSET)
btv->svhs = svhs[btv->c.nr];
diff --git a/linux/drivers/media/video/bttv-i2c.c b/linux/drivers/media/video/bttv-i2c.c
index 7d0d95ff8..111c091a8 100644
--- a/linux/drivers/media/video/bttv-i2c.c
+++ b/linux/drivers/media/video/bttv-i2c.c
@@ -1,5 +1,5 @@
/*
- $Id: bttv-i2c.c,v 1.21 2005/06/10 17:20:24 mchehab Exp $
+ $Id: bttv-i2c.c,v 1.22 2005/07/02 15:24:11 nsh Exp $
bttv-i2c.c -- all the i2c code is here
@@ -295,8 +295,16 @@ static int attach_inform(struct i2c_client *client)
{
struct bttv *btv = i2c_get_adapdata(client->adapter);
- if (btv->tuner_type != UNSET)
- bttv_call_i2c_clients(btv,TUNER_SET_TYPE,&btv->tuner_type);
+ if (btv->tuner_type != UNSET) {
+ struct tuner_addr tun_addr;
+
+ tun_addr.state = T_RADIO | T_ANALOG_TV | T_DIGITAL_TV;
+ tun_addr.type = btv->tuner_type;
+ tun_addr.addr = ADDR_UNSET;
+
+ bttv_call_i2c_clients(btv,TUNER_SET_TYPE_ADDR, &tun_addr);
+ }
+
if (btv->pinnacle_id != UNSET)
bttv_call_i2c_clients(btv,AUDC_CONFIG_PINNACLE,
&btv->pinnacle_id);
diff --git a/linux/drivers/media/video/cx88/cx88-i2c.c b/linux/drivers/media/video/cx88/cx88-i2c.c
index 1da2b872f..e88e9aaeb 100644
--- a/linux/drivers/media/video/cx88/cx88-i2c.c
+++ b/linux/drivers/media/video/cx88/cx88-i2c.c
@@ -1,5 +1,5 @@
/*
- $Id: cx88-i2c.c,v 1.25 2005/06/28 03:17:39 mchehab Exp $
+ $Id: cx88-i2c.c,v 1.26 2005/07/02 15:24:11 nsh Exp $
cx88-i2c.c -- all the i2c code is here
@@ -100,17 +100,19 @@ static int attach_inform(struct i2c_client *client)
return 0;
if (core->radio_type != UNSET) {
- tun_addr.v4l2_tuner = T_RADIO;
+ tun_addr.state = T_RADIO;
tun_addr.type = core->radio_type;
tun_addr.addr = core->radio_addr;
+
client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_addr);
}
if (core->tuner_type != UNSET) {
- tun_addr.v4l2_tuner = T_ANALOG_TV;
+ tun_addr.state = T_ANALOG_TV;
tun_addr.type = core->tuner_type;
tun_addr.addr = core->tuner_addr;
+
client->driver->command(client,TUNER_SET_TYPE_ADDR, &tun_addr);
}
diff --git a/linux/drivers/media/video/cx88/cx88-video.c b/linux/drivers/media/video/cx88/cx88-video.c
index 7d14c996f..38609f609 100644
--- a/linux/drivers/media/video/cx88/cx88-video.c
+++ b/linux/drivers/media/video/cx88/cx88-video.c
@@ -1,5 +1,5 @@
/*
- * $Id: cx88-video.c,v 1.72 2005/06/29 16:28:17 mchehab Exp $
+ * $Id: cx88-video.c,v 1.73 2005/07/02 15:24:11 nsh Exp $
*
* device driver for Conexant 2388x based TV cards
* video4linux video interface
@@ -2095,16 +2095,17 @@ static int __devinit cx8800_initdev(struct pci_dev *pci_dev,
if (core->tda9887_conf)
request_module("tda9887");
if (core->radio_type != UNSET) {
- tun_addr.v4l2_tuner = T_RADIO;
+ tun_addr.state = T_RADIO;
tun_addr.type = core->radio_type;
tun_addr.addr = core->radio_addr;
cx88_call_i2c_clients(dev->core,TUNER_SET_TYPE_ADDR, &tun_addr);
}
if (core->tuner_type != UNSET) {
- tun_addr.v4l2_tuner = T_ANALOG_TV;
+ tun_addr.state = T_ANALOG_TV;
tun_addr.type = core->tuner_type;
tun_addr.addr = core->tuner_addr;
+
cx88_call_i2c_clients(dev->core,TUNER_SET_TYPE_ADDR, &tun_addr);
}
diff --git a/linux/drivers/media/video/saa7134/saa7134-cards.c b/linux/drivers/media/video/saa7134/saa7134-cards.c
index 63d3e36e0..6d4c793ef 100644
--- a/linux/drivers/media/video/saa7134/saa7134-cards.c
+++ b/linux/drivers/media/video/saa7134/saa7134-cards.c
@@ -1,5 +1,5 @@
/*
- * $Id: saa7134-cards.c,v 1.76 2005/07/01 08:22:24 nsh Exp $
+ * $Id: saa7134-cards.c,v 1.77 2005/07/02 15:24:11 nsh Exp $
*
* device driver for philips saa7134 based TV cards
* card-specific stuff.
@@ -2525,8 +2525,16 @@ int saa7134_board_init2(struct saa7134_dev *dev)
printk("%s: board type fixup: %s\n", dev->name,
saa7134_boards[dev->board].name);
dev->tuner_type = saa7134_boards[dev->board].tuner_type;
- if (TUNER_ABSENT != dev->tuner_type)
- saa7134_i2c_call_clients(dev,TUNER_SET_TYPE,&dev->tuner_type);
+
+ if (TUNER_ABSENT != dev->tuner_type) {
+ struct tuner_addr tun_addr;
+
+ tun_addr.state = T_RADIO | T_ANALOG_TV | T_DIGITAL_TV;
+ tun_addr.type = dev->tuner_type;
+ tun_addr.addr = ADDR_UNSET;
+
+ saa7134_i2c_call_clients(dev, TUNER_SET_TYPE_ADDR, &tun_addr);
+ }
break;
}
return 0;
diff --git a/linux/drivers/media/video/saa7134/saa7134-core.c b/linux/drivers/media/video/saa7134/saa7134-core.c
index 2309f2275..14a812907 100644
--- a/linux/drivers/media/video/saa7134/saa7134-core.c
+++ b/linux/drivers/media/video/saa7134/saa7134-core.c
@@ -1,5 +1,5 @@
/*
- * $Id: saa7134-core.c,v 1.36 2005/07/01 08:24:18 nsh Exp $
+ * $Id: saa7134-core.c,v 1.37 2005/07/02 15:24:11 nsh Exp $
*
* device driver for philips saa7134 based TV cards
* driver core
@@ -1000,12 +1000,14 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
and patch the data structures if necessary
*/
if (dev->board == SAA7134_BOARD_MD7134) {
+ struct tuner_addr tun_addr;
u8 subaddr;
- u8 data[3];
+ u8 data[3];
int ret, tuner_t;
+
struct i2c_msg msg[] = {{.addr=0x50, .flags=0, .buf=&subaddr, .len = 1},
{.addr=0x50, .flags=I2C_M_RD, .buf=data, .len = 3}};
- subaddr= 0x14;
+ subaddr= 0x14;
tuner_t = 0;
ret = i2c_transfer(&dev->i2c_adap, msg, 2);
if (ret != 2) {
@@ -1013,7 +1015,7 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
} else {
if ((data[0] != 0) && (data[0] != 0xff)) {
/* Hac: old config structure */
- subaddr = data[0] + 2;
+ subaddr = data[0] + 2;
msg[1].len = 2;
i2c_transfer(&dev->i2c_adap, msg, 2);
tuner_t = (data[0] << 8) + data[1];
@@ -1024,16 +1026,16 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
case 0x010C:
dev->tuner_type = TUNER_PHILIPS_FM1216ME_MK3;
break;
- default:
+ default:
printk(KERN_ERR "%s Cant determine tuner type %x from EEPROM\n", dev->name, tuner_t);
- }
+ }
} else {
if ((data[1] != 0) && (data[1] != 0xff)) {
/* Hac: new config structure */
- subaddr = data[1] + 1;
+ subaddr = data[1] + 1;
msg[1].len = 1;
i2c_transfer(&dev->i2c_adap, msg, 2);
- subaddr = data[0] + 1;
+ subaddr = data[0] + 1;
msg[1].len = 2;
i2c_transfer(&dev->i2c_adap, msg, 2);
tuner_t = (data[1] << 8) + data[0];
@@ -1043,24 +1045,29 @@ static int __devinit saa7134_initdev(struct pci_dev *pci_dev,
break;
case 0x001d:
dev->tuner_type = TUNER_PHILIPS_FMD1216ME_MK3;
- printk(KERN_INFO "%s Board has DVB-T\n", dev->name);
+ printk(KERN_INFO "%s Board has DVB-T\n", dev->name);
break;
- default:
+ default:
printk(KERN_ERR "%s Cant determine tuner type %x from EEPROM\n", dev->name, tuner_t);
}
} else {
printk(KERN_ERR "%s unexpected config structure\n", dev->name);
}
- }
+ }
}
- printk(KERN_INFO "%s Tuner type is %d\n", dev->name, dev->tuner_type);
+ printk(KERN_INFO "%s Tuner type is %d\n", dev->name, dev->tuner_type);
saa7134_boards[SAA7134_BOARD_MD7134].tuner_type = dev->tuner_type;
if (dev->tuner_type == TUNER_PHILIPS_FMD1216ME_MK3) {
dev->tda9887_conf = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE | TDA9887_PORT2_ACTIVE;
saa7134_boards[SAA7134_BOARD_MD7134].tda9887_conf = dev->tda9887_conf;
saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG, &dev->tda9887_conf);
}
- saa7134_i2c_call_clients(dev,TUNER_SET_TYPE,&dev->tuner_type);
+
+ tun_addr.state = T_RADIO | T_ANALOG_TV | T_DIGITAL_TV;
+ tun_addr.type = dev->tuner_type;
+ tun_addr.addr = ADDR_UNSET;
+
+ saa7134_i2c_call_clients(dev,TUNER_SET_TYPE_ADDR,&tun_addr);
}
/* initialize hardware #2 */
diff --git a/linux/drivers/media/video/saa7134/saa7134-i2c.c b/linux/drivers/media/video/saa7134/saa7134-i2c.c
index abb8a75fd..587f6cc06 100644
--- a/linux/drivers/media/video/saa7134/saa7134-i2c.c
+++ b/linux/drivers/media/video/saa7134/saa7134-i2c.c
@@ -1,5 +1,5 @@
/*
- * $Id: saa7134-i2c.c,v 1.14 2005/06/28 23:41:47 mkrufky Exp $
+ * $Id: saa7134-i2c.c,v 1.15 2005/07/02 15:24:11 nsh Exp $
*
* device driver for philips saa7134 based TV cards
* i2c interface support
@@ -338,21 +338,18 @@ static int attach_inform(struct i2c_client *client)
tun_addr.type = saa7134_boards[dev->board].radio_type;
if (tun_addr.type != UNSET) {
- tun_addr.v4l2_tuner = T_RADIO;
+ tun_addr.state = T_RADIO;
tun_addr.addr = saa7134_boards[dev->board].radio_addr;
saa7134_i2c_call_clients(dev,TUNER_SET_TYPE_ADDR,&tun_addr);
}
- tun_addr.v4l2_tuner = T_ANALOG_TV;
+ tun_addr.state = T_ANALOG_TV;
tun_addr.type = saa7134_boards[dev->board].tuner_type;
tun_addr.addr = saa7134_boards[dev->board].tuner_addr;
- if (tun_addr.addr != ADDR_UNSET)
- saa7134_i2c_call_clients(dev,TUNER_SET_TYPE_ADDR,&tun_addr);
- else
- saa7134_i2c_call_clients(dev,TUNER_SET_TYPE,&tuner);
-
+ saa7134_i2c_call_clients(dev,TUNER_SET_TYPE_ADDR, &tun_addr);
saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&conf);
+
return 0;
}
diff --git a/linux/drivers/media/video/tuner-core.c b/linux/drivers/media/video/tuner-core.c
index 13e78f56c..7e0b452c0 100644
--- a/linux/drivers/media/video/tuner-core.c
+++ b/linux/drivers/media/video/tuner-core.c
@@ -1,5 +1,5 @@
/*
- * $Id: tuner-core.c,v 1.42 2005/07/02 14:53:02 nsh Exp $
+ * $Id: tuner-core.c,v 1.43 2005/07/02 15:24:11 nsh Exp $
*
* i2c tv tuner chip device driver
* core core, i.e. kernel interfaces, registering and so on
@@ -86,7 +86,7 @@ static void set_tv_freq(struct i2c_client *c, unsigned int freq)
return;
}
if (freq < tv_range[0] * 16 || freq > tv_range[1] * 16) {
- tuner_info("TV freq (%d.%02d) out of range (%d-%d)\n",
+ tuner_dbg ("TV freq (%d.%02d) out of range (%d-%d)\n",
freq / 16, freq % 16 * 100 / 16, tv_range[0],
tv_range[1]);
}
@@ -214,10 +214,10 @@ static void set_addr(struct i2c_client *c, struct tuner_addr *tun_addr)
struct tuner *t = i2c_get_clientdata(c);
if (tun_addr->addr == ADDR_UNSET) {
- if (t->admin_status & tun_addr->v4l2_tuner)
- set_type(c, tun_addr->type, tun_addr->v4l2_tuner);
+ if (t->admin_status & tun_addr->state)
+ set_type(c, tun_addr->type, tun_addr->state);
} else if (tun_addr->addr == c->addr) {
- set_type(c, tun_addr->type, tun_addr->v4l2_tuner);
+ set_type(c, tun_addr->type, tun_addr->state);
}
}
@@ -441,7 +441,7 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg)
tuner_dbg ("Calling set_type_addr for type=%d, addr=0x%02x, mode=0x%02x\n",
((struct tuner_addr *)arg)->type,
((struct tuner_addr *)arg)->addr,
- ((struct tuner_addr *)arg)->v4l2_tuner);
+ ((struct tuner_addr *)arg)->state);
set_addr(client, (struct tuner_addr *)arg);
break;
diff --git a/linux/include/media/tuner.h b/linux/include/media/tuner.h
index db62bae07..d16e65fab 100644
--- a/linux/include/media/tuner.h
+++ b/linux/include/media/tuner.h
@@ -1,5 +1,5 @@
-/* $Id: tuner.h,v 1.38 2005/07/02 14:53:02 nsh Exp $
+/* $Id: tuner.h,v 1.39 2005/07/02 15:24:11 nsh Exp $
*
tuner.h - definition for different tuners
@@ -161,14 +161,14 @@
enum tuner_admin_state {
T_UNINITIALIZED = 0,
- T_RADIO = 1<<V4L2_TUNER_RADIO,
- T_ANALOG_TV = 1<<V4L2_TUNER_ANALOG_TV,
- T_DIGITAL_TV = 1<<V4L2_TUNER_DIGITAL_TV,
- T_STANDBY = 1<<31
+ T_RADIO = 1 << V4L2_TUNER_RADIO,
+ T_ANALOG_TV = 1 << V4L2_TUNER_ANALOG_TV,
+ T_DIGITAL_TV = 1 << V4L2_TUNER_DIGITAL_TV,
+ T_STANDBY = 1 << 31
};
struct tuner_addr {
- enum tuner_admin_state v4l2_tuner;
+ enum tuner_admin_state state;
unsigned int type;
unsigned short addr;
};
diff --git a/v4l/ChangeLog b/v4l/ChangeLog
index cb534476f..5f6631e42 100644
--- a/v4l/ChangeLog
+++ b/v4l/ChangeLog
@@ -1,4 +1,13 @@
-2005-07-02 nshmyrev
+2005-07-02 19:20 nshmyrev
+
+ * bttv-cards.c, bttv-i2c.c, cx88-i2c.c, cx88-video.c:
+ * saa7134-cards.c, saa7134-core.c, saa7134-i2c.c:
+ * tuner-core.c, tuner.h:
+
+ Rename v4l2_tuner field in tun_addr structure. Cleanup
+ tuner private calls.
+
+2005-07-02 19:17 nshmyrev
* Make.config:
- Fix check for newer kernel to compile dvb modules.