diff options
-rw-r--r-- | Documentation/DocBook/media/v4l/vidioc-g-frequency.xml | 7 | ||||
-rw-r--r-- | Documentation/feature-removal-schedule.txt | 11 | ||||
-rw-r--r-- | drivers/media/video/v4l2-ioctl.c | 8 |
3 files changed, 12 insertions, 14 deletions
diff --git a/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml b/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml index 16431813beb..66e9a525786 100644 --- a/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml +++ b/Documentation/DocBook/media/v4l/vidioc-g-frequency.xml | |||
@@ -98,8 +98,11 @@ the &v4l2-output; <structfield>modulator</structfield> field and the | |||
98 | <entry>&v4l2-tuner-type;</entry> | 98 | <entry>&v4l2-tuner-type;</entry> |
99 | <entry><structfield>type</structfield></entry> | 99 | <entry><structfield>type</structfield></entry> |
100 | <entry>The tuner type. This is the same value as in the | 100 | <entry>The tuner type. This is the same value as in the |
101 | &v4l2-tuner; <structfield>type</structfield> field. The field is not | 101 | &v4l2-tuner; <structfield>type</structfield> field. The type must be set |
102 | applicable to modulators, &ie; ignored by drivers.</entry> | 102 | to <constant>V4L2_TUNER_RADIO</constant> for <filename>/dev/radioX</filename> |
103 | device nodes, and to <constant>V4L2_TUNER_ANALOG_TV</constant> | ||
104 | for all others. The field is not applicable to modulators, &ie; ignored | ||
105 | by drivers.</entry> | ||
103 | </row> | 106 | </row> |
104 | <row> | 107 | <row> |
105 | <entry>__u32</entry> | 108 | <entry>__u32</entry> |
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index c4362ef3a79..fed5a34a727 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
@@ -460,17 +460,6 @@ Who: Jean Delvare <khali@linux-fr.org> | |||
460 | 460 | ||
461 | ---------------------------- | 461 | ---------------------------- |
462 | 462 | ||
463 | What: For VIDIOC_S_FREQUENCY the type field must match the device node's type. | ||
464 | If not, return -EINVAL. | ||
465 | When: 3.2 | ||
466 | Why: It makes no sense to switch the tuner to radio mode by calling | ||
467 | VIDIOC_S_FREQUENCY on a video node, or to switch the tuner to tv mode by | ||
468 | calling VIDIOC_S_FREQUENCY on a radio node. This is the first step of a | ||
469 | move to more consistent handling of tv and radio tuners. | ||
470 | Who: Hans Verkuil <hans.verkuil@cisco.com> | ||
471 | |||
472 | ---------------------------- | ||
473 | |||
474 | What: Opening a radio device node will no longer automatically switch the | 463 | What: Opening a radio device node will no longer automatically switch the |
475 | tuner mode from tv to radio. | 464 | tuner mode from tv to radio. |
476 | When: 3.3 | 465 | When: 3.3 |
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c index 77feeb67e2d..3f623859a33 100644 --- a/drivers/media/video/v4l2-ioctl.c +++ b/drivers/media/video/v4l2-ioctl.c | |||
@@ -1871,6 +1871,7 @@ static long __video_do_ioctl(struct file *file, | |||
1871 | case VIDIOC_S_FREQUENCY: | 1871 | case VIDIOC_S_FREQUENCY: |
1872 | { | 1872 | { |
1873 | struct v4l2_frequency *p = arg; | 1873 | struct v4l2_frequency *p = arg; |
1874 | enum v4l2_tuner_type type; | ||
1874 | 1875 | ||
1875 | if (!ops->vidioc_s_frequency) | 1876 | if (!ops->vidioc_s_frequency) |
1876 | break; | 1877 | break; |
@@ -1878,9 +1879,14 @@ static long __video_do_ioctl(struct file *file, | |||
1878 | ret = ret_prio; | 1879 | ret = ret_prio; |
1879 | break; | 1880 | break; |
1880 | } | 1881 | } |
1882 | type = (vfd->vfl_type == VFL_TYPE_RADIO) ? | ||
1883 | V4L2_TUNER_RADIO : V4L2_TUNER_ANALOG_TV; | ||
1881 | dbgarg(cmd, "tuner=%d, type=%d, frequency=%d\n", | 1884 | dbgarg(cmd, "tuner=%d, type=%d, frequency=%d\n", |
1882 | p->tuner, p->type, p->frequency); | 1885 | p->tuner, p->type, p->frequency); |
1883 | ret = ops->vidioc_s_frequency(file, fh, p); | 1886 | if (p->type != type) |
1887 | ret = -EINVAL; | ||
1888 | else | ||
1889 | ret = ops->vidioc_s_frequency(file, fh, p); | ||
1884 | break; | 1890 | break; |
1885 | } | 1891 | } |
1886 | case VIDIOC_G_SLICED_VBI_CAP: | 1892 | case VIDIOC_G_SLICED_VBI_CAP: |