diff options
author | Hans Verkuil <hans.verkuil@cisco.com> | 2011-06-12 05:36:41 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2011-07-07 14:02:07 -0400 |
commit | 227690df75382e46a4f6ea1bbc5df855a674b47f (patch) | |
tree | 414d4dcad844523a0cfb9457be5ad966d2414bf5 /drivers | |
parent | 9bf0ef060ebae452c07cf5b0616247780740bb50 (diff) |
[media] v4l2-ioctl.c: prefill tuner type for g_frequency and g/s_tuner
The subdevs are supposed to receive a valid tuner type for the g_frequency
and g/s_tuner subdev ops. Some drivers do this, others don't. So prefill
this in v4l2-ioctl.c based on whether the device node from which this is
called is a radio node or not.
The spec does not require applications to fill in the type, and if they
leave it at 0 then the 'check_mode' call in tuner-core.c will return
an error and the ioctl does nothing.
Cc: stable@kernel.org
Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/media/video/v4l2-ioctl.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c index 506edcc2ddeb..a2e442ab8a5b 100644 --- a/drivers/media/video/v4l2-ioctl.c +++ b/drivers/media/video/v4l2-ioctl.c | |||
@@ -1822,6 +1822,8 @@ static long __video_do_ioctl(struct file *file, | |||
1822 | if (!ops->vidioc_g_tuner) | 1822 | if (!ops->vidioc_g_tuner) |
1823 | break; | 1823 | break; |
1824 | 1824 | ||
1825 | p->type = (vfd->vfl_type == VFL_TYPE_RADIO) ? | ||
1826 | V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; | ||
1825 | ret = ops->vidioc_g_tuner(file, fh, p); | 1827 | ret = ops->vidioc_g_tuner(file, fh, p); |
1826 | if (!ret) | 1828 | if (!ret) |
1827 | dbgarg(cmd, "index=%d, name=%s, type=%d, " | 1829 | dbgarg(cmd, "index=%d, name=%s, type=%d, " |
@@ -1840,6 +1842,8 @@ static long __video_do_ioctl(struct file *file, | |||
1840 | 1842 | ||
1841 | if (!ops->vidioc_s_tuner) | 1843 | if (!ops->vidioc_s_tuner) |
1842 | break; | 1844 | break; |
1845 | p->type = (vfd->vfl_type == VFL_TYPE_RADIO) ? | ||
1846 | V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; | ||
1843 | dbgarg(cmd, "index=%d, name=%s, type=%d, " | 1847 | dbgarg(cmd, "index=%d, name=%s, type=%d, " |
1844 | "capability=0x%x, rangelow=%d, " | 1848 | "capability=0x%x, rangelow=%d, " |
1845 | "rangehigh=%d, signal=%d, afc=%d, " | 1849 | "rangehigh=%d, signal=%d, afc=%d, " |
@@ -1858,6 +1862,8 @@ static long __video_do_ioctl(struct file *file, | |||
1858 | if (!ops->vidioc_g_frequency) | 1862 | if (!ops->vidioc_g_frequency) |
1859 | break; | 1863 | break; |
1860 | 1864 | ||
1865 | p->type = (vfd->vfl_type == VFL_TYPE_RADIO) ? | ||
1866 | V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; | ||
1861 | ret = ops->vidioc_g_frequency(file, fh, p); | 1867 | ret = ops->vidioc_g_frequency(file, fh, p); |
1862 | if (!ret) | 1868 | if (!ret) |
1863 | dbgarg(cmd, "tuner=%d, type=%d, frequency=%d\n", | 1869 | dbgarg(cmd, "tuner=%d, type=%d, frequency=%d\n", |