aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/tuner-xc2028.c
diff options
context:
space:
mode:
authorMauro Carvalho Chehab <mchehab@infradead.org>2008-04-22 13:46:11 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-04-24 13:07:53 -0400
commitb412ba781adcb484e8d9b19b30ae1d3a6b8c7d29 (patch)
tree02997fa52c69c3f63079e01d22ba53969e214d54 /drivers/media/video/tuner-xc2028.c
parent0be51b4671b3ae3ae544a0bb3d15b55478b55e72 (diff)
V4L/DVB (7399): Removes video_dev from tuner-xc2028 config struct
The video_dev parameter, on tuner-xc2028 were used to pass i2c private data to tuner_callback. Since the driver already have a pointer to i2c_adap->algo_data, uses this instead. This parameter were used also as a magic number to idenfity if two drivers are trying to register the same xc3028 tuner. This occurs with boards with DVB support, where both DVB and V4L drivers will share the same tuner. Instead of using the algo_data as a private number, after this patch, the driver will use i2c_adap->dev, with seems more consistent. Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/tuner-xc2028.c')
-rw-r--r--drivers/media/video/tuner-xc2028.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/drivers/media/video/tuner-xc2028.c b/drivers/media/video/tuner-xc2028.c
index a9caae1af49d..0b5ba67a4da5 100644
--- a/drivers/media/video/tuner-xc2028.c
+++ b/drivers/media/video/tuner-xc2028.c
@@ -1155,7 +1155,7 @@ struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
1155 if (debug) 1155 if (debug)
1156 printk(KERN_DEBUG "xc2028: Xcv2028/3028 init called!\n"); 1156 printk(KERN_DEBUG "xc2028: Xcv2028/3028 init called!\n");
1157 1157
1158 if (NULL == cfg || NULL == cfg->video_dev) 1158 if (NULL == cfg)
1159 return NULL; 1159 return NULL;
1160 1160
1161 if (!fe) { 1161 if (!fe) {
@@ -1163,13 +1163,19 @@ struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
1163 return NULL; 1163 return NULL;
1164 } 1164 }
1165 1165
1166 video_dev = cfg->video_dev; 1166 video_dev = cfg->i2c_adap->algo_data;
1167
1168 if (debug)
1169 printk(KERN_DEBUG "xc2028: video_dev =%p\n", video_dev);
1167 1170
1168 mutex_lock(&xc2028_list_mutex); 1171 mutex_lock(&xc2028_list_mutex);
1169 1172
1170 list_for_each_entry(priv, &xc2028_list, xc2028_list) { 1173 list_for_each_entry(priv, &xc2028_list, xc2028_list) {
1171 if (priv->video_dev == cfg->video_dev) { 1174 if (&priv->i2c_props.adap->dev == &cfg->i2c_adap->dev) {
1172 video_dev = NULL; 1175 video_dev = NULL;
1176 if (debug)
1177 printk(KERN_DEBUG "xc2028: reusing device\n");
1178
1173 break; 1179 break;
1174 } 1180 }
1175 } 1181 }
@@ -1197,6 +1203,9 @@ struct dvb_frontend *xc2028_attach(struct dvb_frontend *fe,
1197 fe->tuner_priv = priv; 1203 fe->tuner_priv = priv;
1198 priv->count++; 1204 priv->count++;
1199 1205
1206 if (debug)
1207 printk(KERN_DEBUG "xc2028: usage count is %i\n", priv->count);
1208
1200 memcpy(&fe->ops.tuner_ops, &xc2028_dvb_tuner_ops, 1209 memcpy(&fe->ops.tuner_ops, &xc2028_dvb_tuner_ops,
1201 sizeof(xc2028_dvb_tuner_ops)); 1210 sizeof(xc2028_dvb_tuner_ops));
1202 1211