diff options
-rw-r--r-- | drivers/media/video/em28xx/em28xx-video.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/media/video/em28xx/em28xx-video.c b/drivers/media/video/em28xx/em28xx-video.c index 477b9b67eaeb..f3ee001f21ca 100644 --- a/drivers/media/video/em28xx/em28xx-video.c +++ b/drivers/media/video/em28xx/em28xx-video.c | |||
@@ -1005,6 +1005,9 @@ static int vidioc_g_audio(struct file *file, void *priv, struct v4l2_audio *a) | |||
1005 | struct em28xx_fh *fh = priv; | 1005 | struct em28xx_fh *fh = priv; |
1006 | struct em28xx *dev = fh->dev; | 1006 | struct em28xx *dev = fh->dev; |
1007 | 1007 | ||
1008 | if (!dev->audio_mode.has_audio) | ||
1009 | return -EINVAL; | ||
1010 | |||
1008 | switch (a->index) { | 1011 | switch (a->index) { |
1009 | case EM28XX_AMUX_VIDEO: | 1012 | case EM28XX_AMUX_VIDEO: |
1010 | strcpy(a->name, "Television"); | 1013 | strcpy(a->name, "Television"); |
@@ -1046,6 +1049,9 @@ static int vidioc_s_audio(struct file *file, void *priv, struct v4l2_audio *a) | |||
1046 | struct em28xx *dev = fh->dev; | 1049 | struct em28xx *dev = fh->dev; |
1047 | 1050 | ||
1048 | 1051 | ||
1052 | if (!dev->audio_mode.has_audio) | ||
1053 | return -EINVAL; | ||
1054 | |||
1049 | if (a->index >= MAX_EM28XX_INPUT) | 1055 | if (a->index >= MAX_EM28XX_INPUT) |
1050 | return -EINVAL; | 1056 | return -EINVAL; |
1051 | if (0 == INPUT(a->index)->type) | 1057 | if (0 == INPUT(a->index)->type) |
@@ -1464,9 +1470,11 @@ static int vidioc_querycap(struct file *file, void *priv, | |||
1464 | cap->capabilities = | 1470 | cap->capabilities = |
1465 | V4L2_CAP_SLICED_VBI_CAPTURE | | 1471 | V4L2_CAP_SLICED_VBI_CAPTURE | |
1466 | V4L2_CAP_VIDEO_CAPTURE | | 1472 | V4L2_CAP_VIDEO_CAPTURE | |
1467 | V4L2_CAP_AUDIO | | ||
1468 | V4L2_CAP_READWRITE | V4L2_CAP_STREAMING; | 1473 | V4L2_CAP_READWRITE | V4L2_CAP_STREAMING; |
1469 | 1474 | ||
1475 | if (dev->audio_mode.has_audio) | ||
1476 | cap->capabilities |= V4L2_CAP_AUDIO; | ||
1477 | |||
1470 | if (dev->tuner_type != TUNER_ABSENT) | 1478 | if (dev->tuner_type != TUNER_ABSENT) |
1471 | cap->capabilities |= V4L2_CAP_TUNER; | 1479 | cap->capabilities |= V4L2_CAP_TUNER; |
1472 | 1480 | ||