diff options
Diffstat (limited to 'drivers/media/video/saa7134/saa7134-empress.c')
-rw-r--r-- | drivers/media/video/saa7134/saa7134-empress.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/drivers/media/video/saa7134/saa7134-empress.c b/drivers/media/video/saa7134/saa7134-empress.c index 1d972edb3be6..bc743b9253fd 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 | ||
65 | static int ts_init_encoder(struct saa7134_dev* dev) | 65 | static 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); |
@@ -284,6 +287,21 @@ static int ts_do_ioctl(struct inode *inode, struct file *file, | |||
284 | case VIDIOC_G_MPEGCOMP: | 287 | case VIDIOC_G_MPEGCOMP: |
285 | saa7134_i2c_call_clients(dev, VIDIOC_G_MPEGCOMP, arg); | 288 | saa7134_i2c_call_clients(dev, VIDIOC_G_MPEGCOMP, arg); |
286 | return 0; | 289 | return 0; |
290 | case VIDIOC_S_EXT_CTRLS: | ||
291 | /* count == 0 is abused in saa6752hs.c, so that special | ||
292 | case is handled here explicitly. */ | ||
293 | if (ctrls->count == 0) | ||
294 | return 0; | ||
295 | if (ctrls->ctrl_class != V4L2_CTRL_CLASS_MPEG) | ||
296 | return -EINVAL; | ||
297 | saa7134_i2c_call_clients(dev, VIDIOC_S_EXT_CTRLS, arg); | ||
298 | ts_init_encoder(dev); | ||
299 | return 0; | ||
300 | case VIDIOC_G_EXT_CTRLS: | ||
301 | if (ctrls->ctrl_class != V4L2_CTRL_CLASS_MPEG) | ||
302 | return -EINVAL; | ||
303 | saa7134_i2c_call_clients(dev, VIDIOC_G_EXT_CTRLS, arg); | ||
304 | return 0; | ||
287 | 305 | ||
288 | default: | 306 | default: |
289 | return -ENOIOCTLCMD; | 307 | return -ENOIOCTLCMD; |