aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/em28xx
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/em28xx')
-rw-r--r--drivers/media/video/em28xx/em28xx-video.c31
1 files changed, 4 insertions, 27 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c
index dfba33d0fa61..daa2ac2e6b90 100644
--- a/drivers/media/video/em28xx/em28xx-video.c
+++ b/drivers/media/video/em28xx/em28xx-video.c
@@ -1141,26 +1141,16 @@ static int em28xx_do_ioctl(struct inode *inode, struct file *filp,
1141 case VIDIOC_G_TUNER: 1141 case VIDIOC_G_TUNER:
1142 { 1142 {
1143 struct v4l2_tuner *t = arg; 1143 struct v4l2_tuner *t = arg;
1144 int status = 0;
1145 1144
1146 if (0 != t->index) 1145 if (0 != t->index)
1147 return -EINVAL; 1146 return -EINVAL;
1148 1147
1149 memset(t, 0, sizeof(*t)); 1148 memset(t, 0, sizeof(*t));
1150 strcpy(t->name, "Tuner"); 1149 strcpy(t->name, "Tuner");
1151 t->type = V4L2_TUNER_ANALOG_TV;
1152 t->capability = V4L2_TUNER_CAP_NORM;
1153 t->rangehigh = 0xffffffffUL; /* FIXME: set correct range */
1154/* t->signal = 0xffff;*/
1155/* em28xx_i2c_call_clients(dev,VIDIOC_G_TUNER,t);*/
1156 /* No way to get signal strength? */
1157 mutex_lock(&dev->lock); 1150 mutex_lock(&dev->lock);
1158 em28xx_i2c_call_clients(dev, DECODER_GET_STATUS, 1151 /* let clients fill in the remainder of this struct */
1159 &status); 1152 em28xx_i2c_call_clients(dev, cmd, t);
1160 mutex_unlock(&dev->lock); 1153 mutex_unlock(&dev->lock);
1161 t->signal =
1162 (status & DECODER_STATUS_GOOD) != 0 ? 0xffff : 0;
1163
1164 em28xx_videodbg("VIDIO_G_TUNER: signal=%x, afc=%x\n", t->signal, 1154 em28xx_videodbg("VIDIO_G_TUNER: signal=%x, afc=%x\n", t->signal,
1165 t->afc); 1155 t->afc);
1166 return 0; 1156 return 0;
@@ -1168,26 +1158,13 @@ static int em28xx_do_ioctl(struct inode *inode, struct file *filp,
1168 case VIDIOC_S_TUNER: 1158 case VIDIOC_S_TUNER:
1169 { 1159 {
1170 struct v4l2_tuner *t = arg; 1160 struct v4l2_tuner *t = arg;
1171 int status = 0;
1172 1161
1173 if (0 != t->index) 1162 if (0 != t->index)
1174 return -EINVAL; 1163 return -EINVAL;
1175 memset(t, 0, sizeof(*t));
1176 strcpy(t->name, "Tuner");
1177 t->type = V4L2_TUNER_ANALOG_TV;
1178 t->capability = V4L2_TUNER_CAP_NORM;
1179 t->rangehigh = 0xffffffffUL; /* FIXME: set correct range */
1180/* t->signal = 0xffff; */
1181 /* No way to get signal strength? */
1182 mutex_lock(&dev->lock); 1164 mutex_lock(&dev->lock);
1183 em28xx_i2c_call_clients(dev, DECODER_GET_STATUS, 1165 /* let clients handle this */
1184 &status); 1166 em28xx_i2c_call_clients(dev, cmd, t);
1185 mutex_unlock(&dev->lock); 1167 mutex_unlock(&dev->lock);
1186 t->signal =
1187 (status & DECODER_STATUS_GOOD) != 0 ? 0xffff : 0;
1188
1189 em28xx_videodbg("VIDIO_S_TUNER: signal=%x, afc=%x\n",
1190 t->signal, t->afc);
1191 return 0; 1168 return 0;
1192 } 1169 }
1193 case VIDIOC_G_FREQUENCY: 1170 case VIDIOC_G_FREQUENCY: