aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cx18/cx18-gpio.c
diff options
context:
space:
mode:
authorSri Deevi <Srinivasa.Deevi@conexant.com>2008-06-21 10:06:44 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:11:13 -0400
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 b302833f6f9d..089bad6d85a0 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)
122 schedule_timeout_interruptible(msecs_to_jiffies(1)); 122 schedule_timeout_interruptible(msecs_to_jiffies(1));
123 return 0; 123 return 0;
124} 124}
125
126int cx18_gpio(struct cx18 *cx, unsigned int command, void *arg)
127{
128 struct v4l2_routing *route = arg;
129 u32 mask, data;
130
131 switch (command) {
132 case VIDIOC_INT_S_AUDIO_ROUTING:
133 if (route->input > 2)
134 return -EINVAL;
135 mask = cx->card->gpio_audio_input.mask;
136 switch (route->input) {
137 case 0:
138 data = cx->card->gpio_audio_input.tuner;
139 break;
140 case 1:
141 data = cx->card->gpio_audio_input.linein;
142 break;
143 case 2:
144 default:
145 data = cx->card->gpio_audio_input.radio;
146 break;
147 }
148 break;
149
150 default:
151 return -EINVAL;
152 }
153 if (mask) {
154 cx->gpio_val = (cx->gpio_val & ~mask) | (data & mask);
155 gpio_write(cx);
156 }
157 return 0;
158}