summaryrefslogtreecommitdiff
path: root/drivers/media/usb/au0828
diff options
context:
space:
mode:
authorShuah Khan <shuahkh@osg.samsung.com>2016-02-19 03:28:48 +0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2016-03-03 17:35:31 +0300
commit050b6c98b42ff77894da2aad34fcf0d4e1fed8e7 (patch)
treeb6736ec9972951453a01fce52390ffa061a7b904 /drivers/media/usb/au0828
parent37a35ced62a1eaf9cc5be9476e655b762ca841f8 (diff)
downloadlinux-050b6c98b42ff77894da2aad34fcf0d4e1fed8e7.tar.xz
[media] media: au0828 enable the right media source when input changes
Change vidioc_s_input() to enable the media source for the newly selected input. v4l2-core enables source before calling au0828's vidioc_s_input() handler. Hence, when input selection changes, media source for the newly selected input needs to be enabled. Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
Diffstat (limited to 'drivers/media/usb/au0828')
-rw-r--r--drivers/media/usb/au0828/au0828-video.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
index 3832a1ceb02a..13f6dab9ccc2 100644
--- a/drivers/media/usb/au0828/au0828-video.c
+++ b/drivers/media/usb/au0828/au0828-video.c
@@ -1453,6 +1453,7 @@ static void au0828_s_input(struct au0828_dev *dev, int index)
static int vidioc_s_input(struct file *file, void *priv, unsigned int index)
{
struct au0828_dev *dev = video_drvdata(file);
+ struct video_device *vfd = video_devdata(file);
dprintk(1, "VIDIOC_S_INPUT in function %s, input=%d\n", __func__,
index);
@@ -1465,7 +1466,14 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int index)
return 0;
au0828_s_input(dev, index);
- return 0;
+
+ /*
+ * Input has been changed. Disable the media source
+ * associated with the old input and enable source
+ * for the newly set input
+ */
+ v4l_disable_media_source(vfd);
+ return v4l_enable_media_source(vfd);
}
static int vidioc_enumaudio(struct file *file, void *priv, struct v4l2_audio *a)