aboutsummaryrefslogtreecommitdiff
path: root/drivers/media/video/cx18/cx18-gpio.c
diff options
context:
space:
mode:
authorSri Deevi <Srinivasa.Deevi@conexant.com>2008-06-21 11:06:44 -0300
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 07:11:13 -0300
commit03c2808503b102971226007070c57410267d0b9d (patch)
treeaeb3858db3f6cf61c574181b23804250ad68bfb5 /drivers/media/video/cx18/cx18-gpio.c
parent464e9f3a0cabce9a7cf51f382f129d464483b0d0 (diff)
V4L/DVB (8089): cx18: add support for Conexant Raptor PAL/SECAM card
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> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/video/cx18/cx18-gpio.c')
-rw-r--r--drivers/media/video/cx18/cx18-gpio.c34
1 files changed, 34 insertions, 0 deletions
diff --git a/drivers/media/video/cx18/cx18-gpio.c b/drivers/media/video/cx18/cx18-gpio.c
index b302833f6f9..089bad6d85a 100644
--- a/drivers/media/video/cx18/cx18-gpio.c
+++ b/drivers/media/video/cx18/cx18-gpio.c
@@ -122,3 +122,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;
+}