diff options
author | Jean-Francois Moine <moinejf@free.fr> | 2008-11-28 12:51:50 +0100 |
---|---|---|
committer | Jean-Francois Moine <moinejf@free.fr> | 2008-11-28 12:51:50 +0100 |
commit | 24e5836b4aa995ffe84be439a2a69517f01201ed (patch) | |
tree | 323948f0d746514852a4e176c1c544f7635252c6 /linux/drivers/media/video/gspca | |
parent | 5e8806761e3146cdf8f1c400b2ff0090bfb6d2f0 (diff) | |
download | mediapointer-dvb-s2-24e5836b4aa995ffe84be439a2a69517f01201ed.tar.gz mediapointer-dvb-s2-24e5836b4aa995ffe84be439a2a69517f01201ed.tar.bz2 |
gspca: Do the webcam microphone work when present.
From: Jean-Francois Moine <moinejf@free.fr>
This patch adds the set/get/enum audio controls.
Priority: normal
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
Diffstat (limited to 'linux/drivers/media/video/gspca')
-rw-r--r-- | linux/drivers/media/video/gspca/gspca.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/linux/drivers/media/video/gspca/gspca.c b/linux/drivers/media/video/gspca/gspca.c index baf4aa524..4fda0fca6 100644 --- a/linux/drivers/media/video/gspca/gspca.c +++ b/linux/drivers/media/video/gspca/gspca.c @@ -671,7 +671,7 @@ static int gspca_set_alt0(struct gspca_dev *gspca_dev) ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, 0); if (ret < 0) - PDEBUG(D_ERR|D_STREAM, "set interface 0 err %d", ret); + PDEBUG(D_ERR|D_STREAM, "set alt 0 err %d", ret); return ret; } @@ -1081,6 +1081,35 @@ static int vidioc_g_ctrl(struct file *file, void *priv, return -EINVAL; } +/*fixme: have an audio flag in gspca_dev?*/ +static int vidioc_s_audio(struct file *file, void *priv, + struct v4l2_audio *audio) +{ + if (audio->index != 0) + return -EINVAL; + return 0; +} + +static int vidioc_g_audio(struct file *file, void *priv, + struct v4l2_audio *audio) +{ + memset(audio, 0, sizeof *audio); + strcpy(audio->name, "Microphone"); + return 0; +} + +static int vidioc_enumaudio(struct file *file, void *priv, + struct v4l2_audio *audio) +{ + if (audio->index != 0) + return -EINVAL; + + strcpy(audio->name, "Microphone"); + audio->capability = 0; + audio->mode = 0; + return 0; +} + static int vidioc_querymenu(struct file *file, void *priv, struct v4l2_querymenu *qmenu) { @@ -1797,6 +1826,9 @@ static const struct v4l2_ioctl_ops dev_ioctl_ops = { .vidioc_queryctrl = vidioc_queryctrl, .vidioc_g_ctrl = vidioc_g_ctrl, .vidioc_s_ctrl = vidioc_s_ctrl, + .vidioc_g_audio = vidioc_g_audio, + .vidioc_s_audio = vidioc_s_audio, + .vidioc_enumaudio = vidioc_enumaudio, .vidioc_querymenu = vidioc_querymenu, .vidioc_enum_input = vidioc_enum_input, .vidioc_g_input = vidioc_g_input, |