aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/media/video/gspca/gspca.c34
1 files changed, 33 insertions, 1 deletions
diff --git a/drivers/media/video/gspca/gspca.c b/drivers/media/video/gspca/gspca.c
index 6d924f180696..a5c21ca959d8 100644
--- a/drivers/media/video/gspca/gspca.c
+++ b/drivers/media/video/gspca/gspca.c
@@ -661,7 +661,7 @@ static int gspca_set_alt0(struct gspca_dev *gspca_dev)
661 661
662 ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, 0); 662 ret = usb_set_interface(gspca_dev->dev, gspca_dev->iface, 0);
663 if (ret < 0) 663 if (ret < 0)
664 PDEBUG(D_ERR|D_STREAM, "set interface 0 err %d", ret); 664 PDEBUG(D_ERR|D_STREAM, "set alt 0 err %d", ret);
665 return ret; 665 return ret;
666} 666}
667 667
@@ -1071,6 +1071,35 @@ static int vidioc_g_ctrl(struct file *file, void *priv,
1071 return -EINVAL; 1071 return -EINVAL;
1072} 1072}
1073 1073
1074/*fixme: have an audio flag in gspca_dev?*/
1075static int vidioc_s_audio(struct file *file, void *priv,
1076 struct v4l2_audio *audio)
1077{
1078 if (audio->index != 0)
1079 return -EINVAL;
1080 return 0;
1081}
1082
1083static int vidioc_g_audio(struct file *file, void *priv,
1084 struct v4l2_audio *audio)
1085{
1086 memset(audio, 0, sizeof *audio);
1087 strcpy(audio->name, "Microphone");
1088 return 0;
1089}
1090
1091static int vidioc_enumaudio(struct file *file, void *priv,
1092 struct v4l2_audio *audio)
1093{
1094 if (audio->index != 0)
1095 return -EINVAL;
1096
1097 strcpy(audio->name, "Microphone");
1098 audio->capability = 0;
1099 audio->mode = 0;
1100 return 0;
1101}
1102
1074static int vidioc_querymenu(struct file *file, void *priv, 1103static int vidioc_querymenu(struct file *file, void *priv,
1075 struct v4l2_querymenu *qmenu) 1104 struct v4l2_querymenu *qmenu)
1076{ 1105{
@@ -1787,6 +1816,9 @@ static const struct v4l2_ioctl_ops dev_ioctl_ops = {
1787 .vidioc_queryctrl = vidioc_queryctrl, 1816 .vidioc_queryctrl = vidioc_queryctrl,
1788 .vidioc_g_ctrl = vidioc_g_ctrl, 1817 .vidioc_g_ctrl = vidioc_g_ctrl,
1789 .vidioc_s_ctrl = vidioc_s_ctrl, 1818 .vidioc_s_ctrl = vidioc_s_ctrl,
1819 .vidioc_g_audio = vidioc_g_audio,
1820 .vidioc_s_audio = vidioc_s_audio,
1821 .vidioc_enumaudio = vidioc_enumaudio,
1790 .vidioc_querymenu = vidioc_querymenu, 1822 .vidioc_querymenu = vidioc_querymenu,
1791 .vidioc_enum_input = vidioc_enum_input, 1823 .vidioc_enum_input = vidioc_enum_input,
1792 .vidioc_g_input = vidioc_g_input, 1824 .vidioc_g_input = vidioc_g_input,