@@ -122,9 +122,12 @@ static ssize_t video_source_store(struct device *dev,
if (loopin_old && loopin_cnt(loopin_old) == 1)
mgb4_mask_reg(&mgbdev->video, loopin_old->config->regs.config,
0x2, 0x0);
- if (loopin_new)
+ if (loopin_new) {
mgb4_mask_reg(&mgbdev->video, loopin_new->config->regs.config,
0x2, 0x2);
+ mgb4_write_reg(&mgbdev->video, voutdev->config->regs.padding,
+ loopin_new->padding);
+ }
if (val == voutdev->config->id + MGB4_VIN_DEVICES)
mgb4_write_reg(&mgbdev->video, voutdev->config->regs.config,
@@ -331,27 +331,10 @@ static int fh_open(struct file *file)
return rv;
}
-static int fh_release(struct file *file)
-{
- struct mgb4_vin_dev *vindev = video_drvdata(file);
- int rv;
-
- mutex_lock(&vindev->lock);
-
- if (v4l2_fh_is_singular_file(file))
- set_loopback_padding(vindev, 0);
-
- rv = _vb2_fop_release(file, NULL);
-
- mutex_unlock(&vindev->lock);
-
- return rv;
-}
-
static const struct v4l2_file_operations video_fops = {
.owner = THIS_MODULE,
.open = fh_open,
- .release = fh_release,
+ .release = vb2_fop_release,
.unlocked_ioctl = video_ioctl2,
.read = vb2_fop_read,
.mmap = vb2_fop_mmap,