diff options
author | Douglas Landgraf <dougsland@gmail.com> | 2007-04-20 05:37:36 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2007-04-27 14:45:44 -0400 |
commit | 8b811cf0c618915b286b5f829a77349a200b814c (patch) | |
tree | a888dd182be40279342cd0ecce36e90eaef4933a /drivers/media/radio | |
parent | ec709bb801a98dcac0a95c060c431eda73e31587 (diff) |
V4L/DVB (5539): Radio-rtrack2.c Added VIDIOC_[GS]_AUDIO and VIDIOC_[S|G]_INPUT
Implements VIDIOC_[GS]_AUDIO and VIDIOC_[S|G]_INPUT on radio-rtrack2
Signed-off-by: Douglas Schilling Landgraf <dougsland@gmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media/radio')
-rw-r--r-- | drivers/media/radio/radio-rtrack2.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/media/radio/radio-rtrack2.c b/drivers/media/radio/radio-rtrack2.c index 4239a7f3f7e5..9b493b3298cd 100644 --- a/drivers/media/radio/radio-rtrack2.c +++ b/drivers/media/radio/radio-rtrack2.c | |||
@@ -249,6 +249,38 @@ static int vidioc_s_ctrl(struct file *file, void *priv, | |||
249 | return -EINVAL; | 249 | return -EINVAL; |
250 | } | 250 | } |
251 | 251 | ||
252 | static int vidioc_g_audio(struct file *file, void *priv, | ||
253 | struct v4l2_audio *a) | ||
254 | { | ||
255 | if (a->index > 1) | ||
256 | return -EINVAL; | ||
257 | |||
258 | strcpy(a->name, "Radio"); | ||
259 | a->capability = V4L2_AUDCAP_STEREO; | ||
260 | return 0; | ||
261 | } | ||
262 | |||
263 | static int vidioc_g_input(struct file *filp, void *priv, unsigned int *i) | ||
264 | { | ||
265 | *i = 0; | ||
266 | return 0; | ||
267 | } | ||
268 | |||
269 | static int vidioc_s_input(struct file *filp, void *priv, unsigned int i) | ||
270 | { | ||
271 | if (i != 0) | ||
272 | return -EINVAL; | ||
273 | return 0; | ||
274 | } | ||
275 | |||
276 | static int vidioc_s_audio(struct file *file, void *priv, | ||
277 | struct v4l2_audio *a) | ||
278 | { | ||
279 | if (a->index != 0) | ||
280 | return -EINVAL; | ||
281 | return 0; | ||
282 | } | ||
283 | |||
252 | static struct rt_device rtrack2_unit; | 284 | static struct rt_device rtrack2_unit; |
253 | 285 | ||
254 | static const struct file_operations rtrack2_fops = { | 286 | static const struct file_operations rtrack2_fops = { |
@@ -275,6 +307,10 @@ static struct video_device rtrack2_radio= | |||
275 | .vidioc_queryctrl = vidioc_queryctrl, | 307 | .vidioc_queryctrl = vidioc_queryctrl, |
276 | .vidioc_g_ctrl = vidioc_g_ctrl, | 308 | .vidioc_g_ctrl = vidioc_g_ctrl, |
277 | .vidioc_s_ctrl = vidioc_s_ctrl, | 309 | .vidioc_s_ctrl = vidioc_s_ctrl, |
310 | .vidioc_g_audio = vidioc_g_audio, | ||
311 | .vidioc_s_audio = vidioc_s_audio, | ||
312 | .vidioc_g_input = vidioc_g_input, | ||
313 | .vidioc_s_input = vidioc_s_input, | ||
278 | }; | 314 | }; |
279 | 315 | ||
280 | static int __init rtrack2_init(void) | 316 | static int __init rtrack2_init(void) |