diff options
Diffstat (limited to 'drivers/media/video/cx18/cx18-gpio.c')
-rw-r--r-- | drivers/media/video/cx18/cx18-gpio.c | 34 |
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 | |||
126 | int 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 | } | ||