aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2012-07-12 15:55:45 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2012-07-30 19:23:11 -0400
commite0a9b1770bac048171961625875aaf15118a7ae9 (patch)
tree21961241a5623a6213db2cfcf3ffb0c68fb59706
parent6652c716a5e46f0631d26a7f83a8f7247d293ae7 (diff)
[media] v4l2: Add rangelow and rangehigh fields to the v4l2_hw_freq_seek struct
To allow apps to limit a hw-freq-seek to a specific band, for further info see the documentation this patch adds for these new fields. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
-rw-r--r--Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml50
-rw-r--r--include/linux/videodev2.h5
2 files changed, 46 insertions, 9 deletions
diff --git a/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml b/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml
index f4db44d0d95a..3dd1bec6d3c7 100644
--- a/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml
+++ b/Documentation/DocBook/media/v4l/vidioc-s-hw-freq-seek.xml
@@ -52,11 +52,23 @@
52 <para>Start a hardware frequency seek from the current frequency. 52 <para>Start a hardware frequency seek from the current frequency.
53To do this applications initialize the <structfield>tuner</structfield>, 53To do this applications initialize the <structfield>tuner</structfield>,
54<structfield>type</structfield>, <structfield>seek_upward</structfield>, 54<structfield>type</structfield>, <structfield>seek_upward</structfield>,
55<structfield>spacing</structfield> and 55<structfield>wrap_around</structfield>, <structfield>spacing</structfield>,
56<structfield>wrap_around</structfield> fields, and zero out the 56<structfield>rangelow</structfield> and <structfield>rangehigh</structfield>
57<structfield>reserved</structfield> array of a &v4l2-hw-freq-seek; and 57fields, and zero out the <structfield>reserved</structfield> array of a
58call the <constant>VIDIOC_S_HW_FREQ_SEEK</constant> ioctl with a pointer 58&v4l2-hw-freq-seek; and call the <constant>VIDIOC_S_HW_FREQ_SEEK</constant>
59to this structure.</para> 59ioctl with a pointer to this structure.</para>
60
61 <para>The <structfield>rangelow</structfield> and
62<structfield>rangehigh</structfield> fields can be set to a non-zero value to
63tell the driver to search a specific band. If the &v4l2-tuner;
64<structfield>capability</structfield> field has the
65<constant>V4L2_TUNER_CAP_HWSEEK_PROG_LIM</constant> flag set, these values
66must fall within one of the bands returned by &VIDIOC-ENUM-FREQ-BANDS;. If
67the <constant>V4L2_TUNER_CAP_HWSEEK_PROG_LIM</constant> flag is not set,
68then these values must exactly match those of one of the bands returned by
69&VIDIOC-ENUM-FREQ-BANDS;. If the current frequency of the tuner does not fall
70within the selected band it will be clamped to fit in the band before the
71seek is started.</para>
60 72
61 <para>If an error is returned, then the original frequency will 73 <para>If an error is returned, then the original frequency will
62 be restored.</para> 74 be restored.</para>
@@ -102,7 +114,27 @@ field and the &v4l2-tuner; <structfield>index</structfield> field.</entry>
102 </row> 114 </row>
103 <row> 115 <row>
104 <entry>__u32</entry> 116 <entry>__u32</entry>
105 <entry><structfield>reserved</structfield>[7]</entry> 117 <entry><structfield>rangelow</structfield></entry>
118 <entry>If non-zero, the lowest tunable frequency of the band to
119search in units of 62.5 kHz, or if the &v4l2-tuner;
120<structfield>capability</structfield> field has the
121<constant>V4L2_TUNER_CAP_LOW</constant> flag set, in units of 62.5 Hz.
122If <structfield>rangelow</structfield> is zero a reasonable default value
123is used.</entry>
124 </row>
125 <row>
126 <entry>__u32</entry>
127 <entry><structfield>rangehigh</structfield></entry>
128 <entry>If non-zero, the highest tunable frequency of the band to
129search in units of 62.5 kHz, or if the &v4l2-tuner;
130<structfield>capability</structfield> field has the
131<constant>V4L2_TUNER_CAP_LOW</constant> flag set, in units of 62.5 Hz.
132If <structfield>rangehigh</structfield> is zero a reasonable default value
133is used.</entry>
134 </row>
135 <row>
136 <entry>__u32</entry>
137 <entry><structfield>reserved</structfield>[5]</entry>
106 <entry>Reserved for future extensions. Applications 138 <entry>Reserved for future extensions. Applications
107 must set the array to zero.</entry> 139 must set the array to zero.</entry>
108 </row> 140 </row>
@@ -119,8 +151,10 @@ field and the &v4l2-tuner; <structfield>index</structfield> field.</entry>
119 <term><errorcode>EINVAL</errorcode></term> 151 <term><errorcode>EINVAL</errorcode></term>
120 <listitem> 152 <listitem>
121 <para>The <structfield>tuner</structfield> index is out of 153 <para>The <structfield>tuner</structfield> index is out of
122bounds, the wrap_around value is not supported or the value in the <structfield>type</structfield> field is 154bounds, the <structfield>wrap_around</structfield> value is not supported or
123wrong.</para> 155one of the values in the <structfield>type</structfield>,
156<structfield>rangelow</structfield> or <structfield>rangehigh</structfield>
157fields is wrong.</para>
124 </listitem> 158 </listitem>
125 </varlistentry> 159 </varlistentry>
126 <varlistentry> 160 <varlistentry>
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 63c950f6fcc2..7a147c8299ab 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -2033,6 +2033,7 @@ struct v4l2_modulator {
2033#define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100 2033#define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100
2034#define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200 2034#define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200
2035#define V4L2_TUNER_CAP_FREQ_BANDS 0x0400 2035#define V4L2_TUNER_CAP_FREQ_BANDS 0x0400
2036#define V4L2_TUNER_CAP_HWSEEK_PROG_LIM 0x0800
2036 2037
2037/* Flags for the 'rxsubchans' field */ 2038/* Flags for the 'rxsubchans' field */
2038#define V4L2_TUNER_SUB_MONO 0x0001 2039#define V4L2_TUNER_SUB_MONO 0x0001
@@ -2078,7 +2079,9 @@ struct v4l2_hw_freq_seek {
2078 __u32 seek_upward; 2079 __u32 seek_upward;
2079 __u32 wrap_around; 2080 __u32 wrap_around;
2080 __u32 spacing; 2081 __u32 spacing;
2081 __u32 reserved[7]; 2082 __u32 rangelow;
2083 __u32 rangehigh;
2084 __u32 reserved[5];
2082}; 2085};
2083 2086
2084/* 2087/*