summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx18/cx18-gpio.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-06-21 13:06:44 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2008-06-21 13:06:44 +0200
commit5491015f1dde09e8b89d5934d7b76d93f0ac1fe7 (patch)
tree325ebad7453e102612596e90dd0d6e461a5e7b03 /linux/drivers/media/video/cx18/cx18-gpio.c
parent3c5f3e5e6a7adfeecf82503f578547a69e7df19a (diff)
downloadmediapointer-dvb-s2-5491015f1dde09e8b89d5934d7b76d93f0ac1fe7.tar.gz
mediapointer-dvb-s2-5491015f1dde09e8b89d5934d7b76d93f0ac1fe7.tar.bz2
cx18: add support for Conexant Raptor PAL/SECAM card
From: Sri Deevi <Srinivasa.Deevi@conexant.com> Patch provided courtesy of Conexant http://www.conexant.com. Signed-off-by: Srinivasa Deevi <srinivasa.deevi@conexant.com> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video/cx18/cx18-gpio.c')
-rw-r--r--linux/drivers/media/video/cx18/cx18-gpio.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-gpio.c b/linux/drivers/media/video/cx18/cx18-gpio.c
index ceb63653c..6c0d9b5c6 100644
--- a/linux/drivers/media/video/cx18/cx18-gpio.c
+++ b/linux/drivers/media/video/cx18/cx18-gpio.c
@@ -98,3 +98,37 @@ int cx18_reset_tuner_gpio(void *dev, int cmd, int value)
schedule_timeout_interruptible(msecs_to_jiffies(1));
return 0;
}
+
+int cx18_gpio(struct cx18 *cx, unsigned int command, void *arg)
+{
+ struct v4l2_routing *route = arg;
+ u32 mask, data;
+
+ switch (command) {
+ case VIDIOC_INT_S_AUDIO_ROUTING:
+ if (route->input > 2)
+ return -EINVAL;
+ mask = cx->card->gpio_audio_input.mask;
+ switch (route->input) {
+ case 0:
+ data = cx->card->gpio_audio_input.tuner;
+ break;
+ case 1:
+ data = cx->card->gpio_audio_input.linein;
+ break;
+ case 2:
+ default:
+ data = cx->card->gpio_audio_input.radio;
+ break;
+ }
+ break;
+
+ default:
+ return -EINVAL;
+ }
+ if (mask) {
+ cx->gpio_val = (cx->gpio_val & ~mask) | (data & mask);
+ gpio_write(cx);
+ }
+ return 0;
+}