From: Mauro Carvalho Chehab Date: Thu, 25 Jan 2007 18:00:45 +0000 (-0300) Subject: V4L/DVB (5150): Implement VIDIOC_[GS]_AUDIO on maxiradio X-Git-Tag: v2.6.21-rc2~66^2~76 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=140dcc46ede8dcd9032bbe0ce52eb4df104a1ab0;p=linux-2.6 V4L/DVB (5150): Implement VIDIOC_[GS]_AUDIO on maxiradio v4l1-compat requires those two ioctls to translate VIDIOC[SG]RADIO into V4L2 calls. Signed-off-by: Mauro Carvalho Chehab --- diff --git a/drivers/media/radio/radio-maxiradio.c b/drivers/media/radio/radio-maxiradio.c index 2fc866086d..40494dc5b7 100644 --- a/drivers/media/radio/radio-maxiradio.c +++ b/drivers/media/radio/radio-maxiradio.c @@ -220,6 +220,26 @@ static int vidioc_s_tuner (struct file *file, void *priv, return 0; } +static int vidioc_g_audio (struct file *file, void *priv, + struct v4l2_audio *a) +{ + if (a->index > 1) + return -EINVAL; + + strcpy(a->name, "Radio"); + a->capability = V4L2_AUDCAP_STEREO; + return 0; +} + +static int vidioc_s_audio (struct file *file, void *priv, + struct v4l2_audio *a) +{ + if (a->index != 0) + return -EINVAL; + + return 0; +} + static int vidioc_s_frequency (struct file *file, void *priv, struct v4l2_frequency *f) { @@ -304,6 +324,8 @@ static struct video_device maxiradio_radio = .vidioc_querycap = vidioc_querycap, .vidioc_g_tuner = vidioc_g_tuner, .vidioc_s_tuner = vidioc_s_tuner, + .vidioc_g_audio = vidioc_g_audio, + .vidioc_s_audio = vidioc_s_audio, .vidioc_g_frequency = vidioc_g_frequency, .vidioc_s_frequency = vidioc_s_frequency, .vidioc_queryctrl = vidioc_queryctrl,