aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/saa7134/saa7134-empress.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-empress.c')
-rw-r--r--drivers/media/video/saa7134/saa7134-empress.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c
index 1d972edb3be6..65d044086ce9 100644
--- a/drivers/media/video/saa7134/saa7134-empress.c
+++ b/drivers/media/video/saa7134/saa7134-empress.c
@@ -64,8 +64,10 @@ static void ts_reset_encoder(struct saa7134_dev* dev)
64 64
65static int ts_init_encoder(struct saa7134_dev* dev) 65static int ts_init_encoder(struct saa7134_dev* dev)
66{ 66{
67 struct v4l2_ext_controls ctrls = { V4L2_CTRL_CLASS_MPEG, 0 };
68
67 ts_reset_encoder(dev); 69 ts_reset_encoder(dev);
68 saa7134_i2c_call_clients(dev, VIDIOC_S_MPEGCOMP, NULL); 70 saa7134_i2c_call_clients(dev, VIDIOC_S_EXT_CTRLS, &ctrls);
69 dev->empress_started = 1; 71 dev->empress_started = 1;
70 return 0; 72 return 0;
71} 73}
@@ -162,6 +164,7 @@ static int ts_do_ioctl(struct inode *inode, struct file *file,
162 unsigned int cmd, void *arg) 164 unsigned int cmd, void *arg)
163{ 165{
164 struct saa7134_dev *dev = file->private_data; 166 struct saa7134_dev *dev = file->private_data;
167 struct v4l2_ext_controls *ctrls = arg;
165 168
166 if (debug > 1) 169 if (debug > 1)
167 v4l_print_ioctl(dev->name,cmd); 170 v4l_print_ioctl(dev->name,cmd);
@@ -278,12 +281,31 @@ static int ts_do_ioctl(struct inode *inode, struct file *file,
278 return saa7134_common_ioctl(dev, cmd, arg); 281 return saa7134_common_ioctl(dev, cmd, arg);
279 282
280 case VIDIOC_S_MPEGCOMP: 283 case VIDIOC_S_MPEGCOMP:
284 printk(KERN_WARNING "VIDIOC_S_MPEGCOMP is obsolete. "
285 "Replace with VIDIOC_S_EXT_CTRLS!");
281 saa7134_i2c_call_clients(dev, VIDIOC_S_MPEGCOMP, arg); 286 saa7134_i2c_call_clients(dev, VIDIOC_S_MPEGCOMP, arg);
282 ts_init_encoder(dev); 287 ts_init_encoder(dev);
283 return 0; 288 return 0;
284 case VIDIOC_G_MPEGCOMP: 289 case VIDIOC_G_MPEGCOMP:
290 printk(KERN_WARNING "VIDIOC_G_MPEGCOMP is obsolete. "
291 "Replace with VIDIOC_G_EXT_CTRLS!");
285 saa7134_i2c_call_clients(dev, VIDIOC_G_MPEGCOMP, arg); 292 saa7134_i2c_call_clients(dev, VIDIOC_G_MPEGCOMP, arg);
286 return 0; 293 return 0;
294 case VIDIOC_S_EXT_CTRLS:
295 /* count == 0 is abused in saa6752hs.c, so that special
296 case is handled here explicitly. */
297 if (ctrls->count == 0)
298 return 0;
299 if (ctrls->ctrl_class != V4L2_CTRL_CLASS_MPEG)
300 return -EINVAL;
301 saa7134_i2c_call_clients(dev, VIDIOC_S_EXT_CTRLS, arg);
302 ts_init_encoder(dev);
303 return 0;
304 case VIDIOC_G_EXT_CTRLS:
305 if (ctrls->ctrl_class != V4L2_CTRL_CLASS_MPEG)
306 return -EINVAL;
307 saa7134_i2c_call_clients(dev, VIDIOC_G_EXT_CTRLS, arg);
308 return 0;
287 309
288 default: 310 default:
289 return -ENOIOCTLCMD; 311 return -ENOIOCTLCMD;