lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1455841728-7062-1-git-send-email-shuahkh@osg.samsung.com>
Date:	Thu, 18 Feb 2016 17:28:48 -0700
From:	Shuah Khan <shuahkh@....samsung.com>
To:	mchehab@....samsung.com, hans.verkuil@...co.com,
	inki.dae@...sung.com, sw0312.kim@...sung.com,
	jh1009.sung@...sung.com, chehabrafael@...il.com,
	prabhakar.csengg@...il.com
Cc:	Shuah Khan <shuahkh@....samsung.com>, linux-media@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: [PATCH] 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@....samsung.com>
---
 drivers/media/usb/au0828/au0828-video.c | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/media/usb/au0828/au0828-video.c b/drivers/media/usb/au0828/au0828-video.c
index 20696a4..678074d 100644
--- a/drivers/media/usb/au0828/au0828-video.c
+++ b/drivers/media/usb/au0828/au0828-video.c
@@ -1381,6 +1381,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);
@@ -1393,7 +1394,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)
-- 
2.5.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ