Commit e0a9b177 authored by Hans de Goede's avatar Hans de Goede Committed by Mauro Carvalho Chehab

[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: default avatarHans de Goede <hdegoede@redhat.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 6652c716
...@@ -52,11 +52,23 @@ ...@@ -52,11 +52,23 @@
<para>Start a hardware frequency seek from the current frequency. <para>Start a hardware frequency seek from the current frequency.
To do this applications initialize the <structfield>tuner</structfield>, To do this applications initialize the <structfield>tuner</structfield>,
<structfield>type</structfield>, <structfield>seek_upward</structfield>, <structfield>type</structfield>, <structfield>seek_upward</structfield>,
<structfield>spacing</structfield> and <structfield>wrap_around</structfield>, <structfield>spacing</structfield>,
<structfield>wrap_around</structfield> fields, and zero out the <structfield>rangelow</structfield> and <structfield>rangehigh</structfield>
<structfield>reserved</structfield> array of a &v4l2-hw-freq-seek; and fields, and zero out the <structfield>reserved</structfield> array of a
call the <constant>VIDIOC_S_HW_FREQ_SEEK</constant> ioctl with a pointer &v4l2-hw-freq-seek; and call the <constant>VIDIOC_S_HW_FREQ_SEEK</constant>
to this structure.</para> ioctl with a pointer to this structure.</para>
<para>The <structfield>rangelow</structfield> and
<structfield>rangehigh</structfield> fields can be set to a non-zero value to
tell the driver to search a specific band. If the &v4l2-tuner;
<structfield>capability</structfield> field has the
<constant>V4L2_TUNER_CAP_HWSEEK_PROG_LIM</constant> flag set, these values
must fall within one of the bands returned by &VIDIOC-ENUM-FREQ-BANDS;. If
the <constant>V4L2_TUNER_CAP_HWSEEK_PROG_LIM</constant> flag is not set,
then these values must exactly match those of one of the bands returned by
&VIDIOC-ENUM-FREQ-BANDS;. If the current frequency of the tuner does not fall
within the selected band it will be clamped to fit in the band before the
seek is started.</para>
<para>If an error is returned, then the original frequency will <para>If an error is returned, then the original frequency will
be restored.</para> be restored.</para>
...@@ -102,7 +114,27 @@ field and the &v4l2-tuner; <structfield>index</structfield> field.</entry> ...@@ -102,7 +114,27 @@ field and the &v4l2-tuner; <structfield>index</structfield> field.</entry>
</row> </row>
<row> <row>
<entry>__u32</entry> <entry>__u32</entry>
<entry><structfield>reserved</structfield>[7]</entry> <entry><structfield>rangelow</structfield></entry>
<entry>If non-zero, the lowest tunable frequency of the band to
search in units of 62.5 kHz, or if the &v4l2-tuner;
<structfield>capability</structfield> field has the
<constant>V4L2_TUNER_CAP_LOW</constant> flag set, in units of 62.5 Hz.
If <structfield>rangelow</structfield> is zero a reasonable default value
is used.</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>rangehigh</structfield></entry>
<entry>If non-zero, the highest tunable frequency of the band to
search in units of 62.5 kHz, or if the &v4l2-tuner;
<structfield>capability</structfield> field has the
<constant>V4L2_TUNER_CAP_LOW</constant> flag set, in units of 62.5 Hz.
If <structfield>rangehigh</structfield> is zero a reasonable default value
is used.</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>reserved</structfield>[5]</entry>
<entry>Reserved for future extensions. Applications <entry>Reserved for future extensions. Applications
must set the array to zero.</entry> must set the array to zero.</entry>
</row> </row>
...@@ -119,8 +151,10 @@ field and the &v4l2-tuner; <structfield>index</structfield> field.</entry> ...@@ -119,8 +151,10 @@ field and the &v4l2-tuner; <structfield>index</structfield> field.</entry>
<term><errorcode>EINVAL</errorcode></term> <term><errorcode>EINVAL</errorcode></term>
<listitem> <listitem>
<para>The <structfield>tuner</structfield> index is out of <para>The <structfield>tuner</structfield> index is out of
bounds, the wrap_around value is not supported or the value in the <structfield>type</structfield> field is bounds, the <structfield>wrap_around</structfield> value is not supported or
wrong.</para> one of the values in the <structfield>type</structfield>,
<structfield>rangelow</structfield> or <structfield>rangehigh</structfield>
fields is wrong.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
......
...@@ -2033,6 +2033,7 @@ struct v4l2_modulator { ...@@ -2033,6 +2033,7 @@ struct v4l2_modulator {
#define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100 #define V4L2_TUNER_CAP_RDS_BLOCK_IO 0x0100
#define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200 #define V4L2_TUNER_CAP_RDS_CONTROLS 0x0200
#define V4L2_TUNER_CAP_FREQ_BANDS 0x0400 #define V4L2_TUNER_CAP_FREQ_BANDS 0x0400
#define V4L2_TUNER_CAP_HWSEEK_PROG_LIM 0x0800
/* Flags for the 'rxsubchans' field */ /* Flags for the 'rxsubchans' field */
#define V4L2_TUNER_SUB_MONO 0x0001 #define V4L2_TUNER_SUB_MONO 0x0001
...@@ -2078,7 +2079,9 @@ struct v4l2_hw_freq_seek { ...@@ -2078,7 +2079,9 @@ struct v4l2_hw_freq_seek {
__u32 seek_upward; __u32 seek_upward;
__u32 wrap_around; __u32 wrap_around;
__u32 spacing; __u32 spacing;
__u32 reserved[7]; __u32 rangelow;
__u32 rangehigh;
__u32 reserved[5];
}; };
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment