Commit 6df419e4 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media updates from Mauro Carvalho Chehab:
 "This is the first part of the media patches for v3.6.

  This patch series contain:
   - new DVB frontend: rtl2832
   - new video drivers: adv7393
   - some unused files got removed
   - a selection API cleanup between V4L2 and V4L2 subdev API's
   - a major redesign at v4l-ioctl2, in order to clean it up
   - several driver fixes and improvements."

* 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (174 commits)
  v4l: Export v4l2-common.h in include/linux/Kbuild
  media: Revert "[media] Terratec Cinergy S2 USB HD Rev.2"
  [media] media: Use pr_info not homegrown pr_reg macro
  [media] Terratec Cinergy S2 USB HD Rev.2
  [media] v4l: Correct conflicting V4L2 subdev selection API documentation
  [media] Feature removal: V4L2 selections API target and flag definitions
  [media] v4l: Unify selection flags documentation
  [media] v4l: Unify selection flags
  [media] v4l: Common documentation for selection targets
  [media] v4l: Unify selection targets across V4L2 and V4L2 subdev interfaces
  [media] v4l: Remove "_ACTUAL" from subdev selection API target definition names
  [media] V4L: Remove "_ACTIVE" from the selection target name definitions
  [media] media: dvb-usb: print mac address via native %pM
  [media] s5p-tv: Use module_i2c_driver in sii9234_drv.c file
  [media] media: gpio-ir-recv: add allowed_protos for platform data
  [media] s5p-jpeg: Use module_platform_driver in jpeg-core.c file
  [media] saa7134: fix spelling of detach in label
  [media] cx88-blackbird: replace ioctl by unlocked_ioctl
  [media] cx88: don't use current_norm
  [media] cx88: fix a number of v4l2-compliance violations
  ...
parents 27c1ee3f c893e7c6
...@@ -194,7 +194,7 @@ in the frequency range from 87,5 to 108,0 MHz</title> ...@@ -194,7 +194,7 @@ in the frequency range from 87,5 to 108,0 MHz</title>
<corpauthor>National Radio Systems Committee <corpauthor>National Radio Systems Committee
(<ulink url="http://www.nrscstandards.org">http://www.nrscstandards.org</ulink>)</corpauthor> (<ulink url="http://www.nrscstandards.org">http://www.nrscstandards.org</ulink>)</corpauthor>
</authorgroup> </authorgroup>
<title>NTSC-4: United States RBDS Standard</title> <title>NRSC-4: United States RBDS Standard</title>
</biblioentry> </biblioentry>
<biblioentry id="iso12232"> <biblioentry id="iso12232">
......
...@@ -464,14 +464,14 @@ The <structfield>type</structfield> field of the respective ...@@ -464,14 +464,14 @@ The <structfield>type</structfield> field of the respective
<structfield>tuner</structfield> field contains the index number of <structfield>tuner</structfield> field contains the index number of
the tuner.</para> the tuner.</para>
<para>Radio devices have exactly one tuner with index zero, no <para>Radio input devices have exactly one tuner with index zero, no
video inputs.</para> video inputs.</para>
<para>To query and change tuner properties applications use the <para>To query and change tuner properties applications use the
&VIDIOC-G-TUNER; and &VIDIOC-S-TUNER; ioctl, respectively. The &VIDIOC-G-TUNER; and &VIDIOC-S-TUNER; ioctl, respectively. The
&v4l2-tuner; returned by <constant>VIDIOC_G_TUNER</constant> also &v4l2-tuner; returned by <constant>VIDIOC_G_TUNER</constant> also
contains signal status information applicable when the tuner of the contains signal status information applicable when the tuner of the
current video input, or a radio tuner is queried. Note that current video or radio input is queried. Note that
<constant>VIDIOC_S_TUNER</constant> does not switch the current tuner, <constant>VIDIOC_S_TUNER</constant> does not switch the current tuner,
when there is more than one at all. The tuner is solely determined by when there is more than one at all. The tuner is solely determined by
the current video input. Drivers must support both ioctls and set the the current video input. Drivers must support both ioctls and set the
...@@ -491,8 +491,17 @@ the modulator. The <structfield>type</structfield> field of the ...@@ -491,8 +491,17 @@ the modulator. The <structfield>type</structfield> field of the
respective &v4l2-output; returned by the &VIDIOC-ENUMOUTPUT; ioctl is respective &v4l2-output; returned by the &VIDIOC-ENUMOUTPUT; ioctl is
set to <constant>V4L2_OUTPUT_TYPE_MODULATOR</constant> and its set to <constant>V4L2_OUTPUT_TYPE_MODULATOR</constant> and its
<structfield>modulator</structfield> field contains the index number <structfield>modulator</structfield> field contains the index number
of the modulator. This specification does not define radio output of the modulator.</para>
devices.</para>
<para>Radio output devices have exactly one modulator with index
zero, no video outputs.</para>
<para>A video or radio device cannot support both a tuner and a
modulator. Two separate device nodes will have to be used for such
hardware, one that supports the tuner functionality and one that supports
the modulator functionality. The reason is a limitation with the
&VIDIOC-S-FREQUENCY; ioctl where you cannot specify whether the frequency
is for a tuner or a modulator.</para>
<para>To query and change modulator properties applications use <para>To query and change modulator properties applications use
the &VIDIOC-G-MODULATOR; and &VIDIOC-S-MODULATOR; ioctl. Note that the &VIDIOC-G-MODULATOR; and &VIDIOC-S-MODULATOR; ioctl. Note that
......
...@@ -2377,10 +2377,11 @@ that used it. It was originally scheduled for removal in 2.6.35. ...@@ -2377,10 +2377,11 @@ that used it. It was originally scheduled for removal in 2.6.35.
<para>V4L2_CTRL_FLAG_VOLATILE was added to signal volatile controls to userspace.</para> <para>V4L2_CTRL_FLAG_VOLATILE was added to signal volatile controls to userspace.</para>
</listitem> </listitem>
<listitem> <listitem>
<para>Add selection API for extended control over cropping and <para>Add selection API for extended control over cropping
composing. Does not affect the compatibility of current drivers and and composing. Does not affect the compatibility of current
applications. See <link linkend="selection-api"> selection API </link> for drivers and applications. See <link
details.</para> linkend="selection-api"> selection API </link> for
details.</para>
</listitem> </listitem>
</orderedlist> </orderedlist>
</section> </section>
...@@ -2458,6 +2459,18 @@ details.</para> ...@@ -2458,6 +2459,18 @@ details.</para>
</orderedlist> </orderedlist>
</section> </section>
<section>
<title>V4L2 in Linux 3.5</title>
<orderedlist>
<listitem>
<para>Replaced <structfield>input</structfield> in
<structname>v4l2_buffer</structname> by
<structfield>reserved2</structfield> and removed
<constant>V4L2_BUF_FLAG_INPUT</constant>.</para>
</listitem>
</orderedlist>
</section>
<section id="other"> <section id="other">
<title>Relation of V4L2 to other Linux multimedia APIs</title> <title>Relation of V4L2 to other Linux multimedia APIs</title>
......
...@@ -276,7 +276,7 @@ ...@@ -276,7 +276,7 @@
</para> </para>
</section> </section>
<section> <section id="v4l2-subdev-selections">
<title>Selections: cropping, scaling and composition</title> <title>Selections: cropping, scaling and composition</title>
<para>Many sub-devices support cropping frames on their input or output <para>Many sub-devices support cropping frames on their input or output
...@@ -290,8 +290,8 @@ ...@@ -290,8 +290,8 @@
size. Both the coordinates and sizes are expressed in pixels.</para> size. Both the coordinates and sizes are expressed in pixels.</para>
<para>As for pad formats, drivers store try and active <para>As for pad formats, drivers store try and active
rectangles for the selection targets of ACTUAL type <xref rectangles for the selection targets <xref
linkend="v4l2-subdev-selection-targets">.</xref></para> linkend="v4l2-selections-common" />.</para>
<para>On sink pads, cropping is applied relative to the <para>On sink pads, cropping is applied relative to the
current pad format. The pad format represents the image size as current pad format. The pad format represents the image size as
...@@ -308,7 +308,7 @@ ...@@ -308,7 +308,7 @@
<para>Scaling support is optional. When supported by a subdev, <para>Scaling support is optional. When supported by a subdev,
the crop rectangle on the subdev's sink pad is scaled to the the crop rectangle on the subdev's sink pad is scaled to the
size configured using the &VIDIOC-SUBDEV-S-SELECTION; IOCTL size configured using the &VIDIOC-SUBDEV-S-SELECTION; IOCTL
using <constant>V4L2_SUBDEV_SEL_COMPOSE_ACTUAL</constant> using <constant>V4L2_SEL_TGT_COMPOSE</constant>
selection target on the same pad. If the subdev supports scaling selection target on the same pad. If the subdev supports scaling
but not composing, the top and left values are not used and must but not composing, the top and left values are not used and must
always be set to zero.</para> always be set to zero.</para>
...@@ -323,32 +323,32 @@ ...@@ -323,32 +323,32 @@
<para>The drivers should always use the closest possible <para>The drivers should always use the closest possible
rectangle the user requests on all selection targets, unless rectangle the user requests on all selection targets, unless
specifically told otherwise. specifically told otherwise.
<constant>V4L2_SUBDEV_SEL_FLAG_SIZE_GE</constant> and <constant>V4L2_SEL_FLAG_GE</constant> and
<constant>V4L2_SUBDEV_SEL_FLAG_SIZE_LE</constant> flags may be <constant>V4L2_SEL_FLAG_LE</constant> flags may be
used to round the image size either up or down. <xref used to round the image size either up or down. <xref
linkend="v4l2-subdev-selection-flags"></xref></para> linkend="v4l2-selection-flags" /></para>
</section> </section>
<section> <section>
<title>Types of selection targets</title> <title>Types of selection targets</title>
<section> <section>
<title>ACTUAL targets</title> <title>Actual targets</title>
<para>ACTUAL targets reflect the actual hardware configuration <para>Actual targets (without a postfix) reflect the actual
at any point of time. There is a BOUNDS target hardware configuration at any point of time. There is a BOUNDS
corresponding to every ACTUAL.</para> target corresponding to every actual target.</para>
</section> </section>
<section> <section>
<title>BOUNDS targets</title> <title>BOUNDS targets</title>
<para>BOUNDS targets is the smallest rectangle that contains <para>BOUNDS targets is the smallest rectangle that contains all
all valid ACTUAL rectangles. It may not be possible to set the valid actual rectangles. It may not be possible to set the actual
ACTUAL rectangle as large as the BOUNDS rectangle, however. rectangle as large as the BOUNDS rectangle, however. This may be
This may be because e.g. a sensor's pixel array is not because e.g. a sensor's pixel array is not rectangular but
rectangular but cross-shaped or round. The maximum size may cross-shaped or round. The maximum size may also be smaller than the
also be smaller than the BOUNDS rectangle.</para> BOUNDS rectangle.</para>
</section> </section>
</section> </section>
...@@ -362,7 +362,7 @@ ...@@ -362,7 +362,7 @@
performed by the user: the changes made will be propagated to performed by the user: the changes made will be propagated to
any subsequent stages. If this behaviour is not desired, the any subsequent stages. If this behaviour is not desired, the
user must set user must set
<constant>V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG</constant> flag. This <constant>V4L2_SEL_FLAG_KEEP_CONFIG</constant> flag. This
flag causes no propagation of the changes are allowed in any flag causes no propagation of the changes are allowed in any
circumstances. This may also cause the accessed rectangle to be circumstances. This may also cause the accessed rectangle to be
adjusted by the driver, depending on the properties of the adjusted by the driver, depending on the properties of the
......
...@@ -683,14 +683,12 @@ memory, set by the application. See <xref linkend="userp" /> for details. ...@@ -683,14 +683,12 @@ memory, set by the application. See <xref linkend="userp" /> for details.
</row> </row>
<row> <row>
<entry>__u32</entry> <entry>__u32</entry>
<entry><structfield>input</structfield></entry> <entry><structfield>reserved2</structfield></entry>
<entry></entry> <entry></entry>
<entry>Some video capture drivers support rapid and <entry>A place holder for future extensions and custom
synchronous video input changes, a function useful for example in (driver defined) buffer types
video surveillance applications. For this purpose applications set the <constant>V4L2_BUF_TYPE_PRIVATE</constant> and higher. Applications
<constant>V4L2_BUF_FLAG_INPUT</constant> flag, and this field to the should set this to 0.</entry>
number of a video input as in &v4l2-input; field
<structfield>index</structfield>.</entry>
</row> </row>
<row> <row>
<entry>__u32</entry> <entry>__u32</entry>
...@@ -921,13 +919,6 @@ previous key frame.</entry> ...@@ -921,13 +919,6 @@ previous key frame.</entry>
<entry>The <structfield>timecode</structfield> field is valid. <entry>The <structfield>timecode</structfield> field is valid.
Drivers set or clear this flag when the <constant>VIDIOC_DQBUF</constant> Drivers set or clear this flag when the <constant>VIDIOC_DQBUF</constant>
ioctl is called.</entry> ioctl is called.</entry>
</row>
<row>
<entry><constant>V4L2_BUF_FLAG_INPUT</constant></entry>
<entry>0x0200</entry>
<entry>The <structfield>input</structfield> field is valid.
Applications set or clear this flag before calling the
<constant>VIDIOC_QBUF</constant> ioctl.</entry>
</row> </row>
<row> <row>
<entry><constant>V4L2_BUF_FLAG_PREPARED</constant></entry> <entry><constant>V4L2_BUF_FLAG_PREPARED</constant></entry>
......
...@@ -53,11 +53,11 @@ cropping and composing rectangles have the same size.</para> ...@@ -53,11 +53,11 @@ cropping and composing rectangles have the same size.</para>
</mediaobject> </mediaobject>
</figure> </figure>
For complete list of the available selection targets see table <xref
linkend="v4l2-sel-target"/>
</section> </section>
See <xref linkend="v4l2-selection-targets" /> for more
information.
<section> <section>
<title>Configuration</title> <title>Configuration</title>
...@@ -74,7 +74,7 @@ cropping/composing rectangles may have to be aligned, and both the source and ...@@ -74,7 +74,7 @@ cropping/composing rectangles may have to be aligned, and both the source and
the sink may have arbitrary upper and lower size limits. Therefore, as usual, the sink may have arbitrary upper and lower size limits. Therefore, as usual,
drivers are expected to adjust the requested parameters and return the actual drivers are expected to adjust the requested parameters and return the actual
values selected. An application can control the rounding behaviour using <link values selected. An application can control the rounding behaviour using <link
linkend="v4l2-sel-flags"> constraint flags </link>.</para> linkend="v4l2-selection-flags"> constraint flags </link>.</para>
<section> <section>
...@@ -91,7 +91,7 @@ top/left corner at position <constant> (0,0) </constant>. The rectangle's ...@@ -91,7 +91,7 @@ top/left corner at position <constant> (0,0) </constant>. The rectangle's
coordinates are expressed in pixels.</para> coordinates are expressed in pixels.</para>
<para>The top left corner, width and height of the source rectangle, that is <para>The top left corner, width and height of the source rectangle, that is
the area actually sampled, is given by the <constant> V4L2_SEL_TGT_CROP_ACTIVE the area actually sampled, is given by the <constant> V4L2_SEL_TGT_CROP
</constant> target. It uses the same coordinate system as <constant> </constant> target. It uses the same coordinate system as <constant>
V4L2_SEL_TGT_CROP_BOUNDS </constant>. The active cropping area must lie V4L2_SEL_TGT_CROP_BOUNDS </constant>. The active cropping area must lie
completely inside the capture boundaries. The driver may further adjust the completely inside the capture boundaries. The driver may further adjust the
...@@ -111,13 +111,13 @@ height are equal to the image size set by <constant> VIDIOC_S_FMT </constant>. ...@@ -111,13 +111,13 @@ height are equal to the image size set by <constant> VIDIOC_S_FMT </constant>.
</para> </para>
<para>The part of a buffer into which the image is inserted by the hardware is <para>The part of a buffer into which the image is inserted by the hardware is
controlled by the <constant> V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target. controlled by the <constant> V4L2_SEL_TGT_COMPOSE </constant> target.
The rectangle's coordinates are also expressed in the same coordinate system as The rectangle's coordinates are also expressed in the same coordinate system as
the bounds rectangle. The composing rectangle must lie completely inside bounds the bounds rectangle. The composing rectangle must lie completely inside bounds
rectangle. The driver must adjust the composing rectangle to fit to the rectangle. The driver must adjust the composing rectangle to fit to the
bounding limits. Moreover, the driver can perform other adjustments according bounding limits. Moreover, the driver can perform other adjustments according
to hardware limitations. The application can control rounding behaviour using to hardware limitations. The application can control rounding behaviour using
<link linkend="v4l2-sel-flags"> constraint flags </link>.</para> <link linkend="v4l2-selection-flags"> constraint flags </link>.</para>
<para>For capture devices the default composing rectangle is queried using <para>For capture devices the default composing rectangle is queried using
<constant> V4L2_SEL_TGT_COMPOSE_DEFAULT </constant>. It is usually equal to the <constant> V4L2_SEL_TGT_COMPOSE_DEFAULT </constant>. It is usually equal to the
...@@ -125,7 +125,7 @@ bounding rectangle.</para> ...@@ -125,7 +125,7 @@ bounding rectangle.</para>
<para>The part of a buffer that is modified by the hardware is given by <para>The part of a buffer that is modified by the hardware is given by
<constant> V4L2_SEL_TGT_COMPOSE_PADDED </constant>. It contains all pixels <constant> V4L2_SEL_TGT_COMPOSE_PADDED </constant>. It contains all pixels
defined using <constant> V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> plus all defined using <constant> V4L2_SEL_TGT_COMPOSE </constant> plus all
padding data modified by hardware during insertion process. All pixels outside padding data modified by hardware during insertion process. All pixels outside
this rectangle <emphasis>must not</emphasis> be changed by the hardware. The this rectangle <emphasis>must not</emphasis> be changed by the hardware. The
content of pixels that lie inside the padded area but outside active area is content of pixels that lie inside the padded area but outside active area is
...@@ -153,7 +153,7 @@ specified using <constant> VIDIOC_S_FMT </constant> ioctl.</para> ...@@ -153,7 +153,7 @@ specified using <constant> VIDIOC_S_FMT </constant> ioctl.</para>
<para>The top left corner, width and height of the source rectangle, that is <para>The top left corner, width and height of the source rectangle, that is
the area from which image date are processed by the hardware, is given by the the area from which image date are processed by the hardware, is given by the
<constant> V4L2_SEL_TGT_CROP_ACTIVE </constant>. Its coordinates are expressed <constant> V4L2_SEL_TGT_CROP </constant>. Its coordinates are expressed
in in the same coordinate system as the bounds rectangle. The active cropping in in the same coordinate system as the bounds rectangle. The active cropping
area must lie completely inside the crop boundaries and the driver may further area must lie completely inside the crop boundaries and the driver may further
adjust the requested size and/or position according to hardware adjust the requested size and/or position according to hardware
...@@ -165,7 +165,7 @@ bounding rectangle.</para> ...@@ -165,7 +165,7 @@ bounding rectangle.</para>
<para>The part of a video signal or graphics display where the image is <para>The part of a video signal or graphics display where the image is
inserted by the hardware is controlled by <constant> inserted by the hardware is controlled by <constant>
V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target. The rectangle's coordinates V4L2_SEL_TGT_COMPOSE </constant> target. The rectangle's coordinates
are expressed in pixels. The composing rectangle must lie completely inside the are expressed in pixels. The composing rectangle must lie completely inside the
bounds rectangle. The driver must adjust the area to fit to the bounding bounds rectangle. The driver must adjust the area to fit to the bounding
limits. Moreover, the driver can perform other adjustments according to limits. Moreover, the driver can perform other adjustments according to
...@@ -184,7 +184,7 @@ such a padded area is driver-dependent feature not covered by this document. ...@@ -184,7 +184,7 @@ such a padded area is driver-dependent feature not covered by this document.
Driver developers are encouraged to keep padded rectangle equal to active one. Driver developers are encouraged to keep padded rectangle equal to active one.
The padded target is accessed by the <constant> V4L2_SEL_TGT_COMPOSE_PADDED The padded target is accessed by the <constant> V4L2_SEL_TGT_COMPOSE_PADDED
</constant> identifier. It must contain all pixels from the <constant> </constant> identifier. It must contain all pixels from the <constant>
V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target.</para> V4L2_SEL_TGT_COMPOSE </constant> target.</para>
</section> </section>
...@@ -193,8 +193,8 @@ V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target.</para> ...@@ -193,8 +193,8 @@ V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> target.</para>
<title>Scaling control</title> <title>Scaling control</title>
<para>An application can detect if scaling is performed by comparing the width <para>An application can detect if scaling is performed by comparing the width
and the height of rectangles obtained using <constant> V4L2_SEL_TGT_CROP_ACTIVE and the height of rectangles obtained using <constant> V4L2_SEL_TGT_CROP
</constant> and <constant> V4L2_SEL_TGT_COMPOSE_ACTIVE </constant> targets. If </constant> and <constant> V4L2_SEL_TGT_COMPOSE </constant> targets. If
these are not equal then the scaling is applied. The application can compute these are not equal then the scaling is applied. The application can compute
the scaling ratios using these values.</para> the scaling ratios using these values.</para>
...@@ -252,7 +252,7 @@ area)</para> ...@@ -252,7 +252,7 @@ area)</para>
ret = ioctl(fd, &VIDIOC-G-SELECTION;, &amp;sel); ret = ioctl(fd, &VIDIOC-G-SELECTION;, &amp;sel);
if (ret) if (ret)
exit(-1); exit(-1);
sel.target = V4L2_SEL_TGT_CROP_ACTIVE; sel.target = V4L2_SEL_TGT_CROP;
ret = ioctl(fd, &VIDIOC-S-SELECTION;, &amp;sel); ret = ioctl(fd, &VIDIOC-S-SELECTION;, &amp;sel);
if (ret) if (ret)
exit(-1); exit(-1);
...@@ -281,7 +281,7 @@ area)</para> ...@@ -281,7 +281,7 @@ area)</para>
r.left = sel.r.width / 4; r.left = sel.r.width / 4;
r.top = sel.r.height / 4; r.top = sel.r.height / 4;
sel.r = r; sel.r = r;
sel.target = V4L2_SEL_TGT_COMPOSE_ACTIVE; sel.target = V4L2_SEL_TGT_COMPOSE;
sel.flags = V4L2_SEL_FLAG_LE; sel.flags = V4L2_SEL_FLAG_LE;
ret = ioctl(fd, &VIDIOC-S-SELECTION;, &amp;sel); ret = ioctl(fd, &VIDIOC-S-SELECTION;, &amp;sel);
if (ret) if (ret)
...@@ -298,11 +298,11 @@ V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> for other devices</para> ...@@ -298,11 +298,11 @@ V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> for other devices</para>
&v4l2-selection; compose = { &v4l2-selection; compose = {
.type = V4L2_BUF_TYPE_VIDEO_OUTPUT, .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
.target = V4L2_SEL_TGT_COMPOSE_ACTIVE, .target = V4L2_SEL_TGT_COMPOSE,
}; };
&v4l2-selection; crop = { &v4l2-selection; crop = {
.type = V4L2_BUF_TYPE_VIDEO_OUTPUT, .type = V4L2_BUF_TYPE_VIDEO_OUTPUT,
.target = V4L2_SEL_TGT_CROP_ACTIVE, .target = V4L2_SEL_TGT_CROP,
}; };
double hscale, vscale; double hscale, vscale;
......
<section id="v4l2-selections-common">
<title>Common selection definitions</title>
<para>While the <link linkend="selection-api">V4L2 selection
API</link> and <link linkend="v4l2-subdev-selections">V4L2 subdev
selection APIs</link> are very similar, there's one fundamental
difference between the two. On sub-device API, the selection
rectangle refers to the media bus format, and is bound to a
sub-device's pad. On the V4L2 interface the selection rectangles
refer to the in-memory pixel format.</para>
<para>This section defines the common definitions of the
selection interfaces on the two APIs.</para>
<section id="v4l2-selection-targets">
<title>Selection targets</title>
<para>The precise meaning of the selection targets may be
dependent on which of the two interfaces they are used.</para>
<table pgwide="1" frame="none" id="v4l2-selection-targets-table">
<title>Selection target definitions</title>
<tgroup cols="5">
<colspec colname="c1" />
<colspec colname="c2" />
<colspec colname="c3" />
<colspec colname="c4" />
<colspec colname="c5" />
&cs-def;
<thead>
<row rowsep="1">
<entry align="left">Target name</entry>
<entry align="left">id</entry>
<entry align="left">Definition</entry>
<entry align="left">Valid for V4L2</entry>
<entry align="left">Valid for V4L2 subdev</entry>
</row>
</thead>
<tbody valign="top">
<row>
<entry><constant>V4L2_SEL_TGT_CROP</constant></entry>
<entry>0x0000</entry>
<entry>Crop rectangle. Defines the cropped area.</entry>
<entry>Yes</entry>
<entry>Yes</entry>
</row>
<row>
<entry><constant>V4L2_SEL_TGT_CROP_DEFAULT</constant></entry>
<entry>0x0001</entry>
<entry>Suggested cropping rectangle that covers the "whole picture".</entry>
<entry>Yes</entry>
<entry>No</entry>
</row>
<row>
<entry><constant>V4L2_SEL_TGT_CROP_BOUNDS</constant></entry>
<entry>0x0002</entry>
<entry>Bounds of the crop rectangle. All valid crop
rectangles fit inside the crop bounds rectangle.
</entry>
<entry>Yes</entry>
<entry>Yes</entry>
</row>
<row>
<entry><constant>V4L2_SEL_TGT_COMPOSE</constant></entry>
<entry>0x0100</entry>
<entry>Compose rectangle. Used to configure scaling
and composition.</entry>
<entry>Yes</entry>
<entry>Yes</entry>
</row>
<row>
<entry><constant>V4L2_SEL_TGT_COMPOSE_DEFAULT</constant></entry>
<entry>0x0101</entry>
<entry>Suggested composition rectangle that covers the "whole picture".</entry>
<entry>Yes</entry>
<entry>No</entry>
</row>
<row>
<entry><constant>V4L2_SEL_TGT_COMPOSE_BOUNDS</constant></entry>
<entry>0x0102</entry>
<entry>Bounds of the compose rectangle. All valid compose
rectangles fit inside the compose bounds rectangle.</entry>
<entry>Yes</entry>
<entry>Yes</entry>
</row>
<row>
<entry><constant>V4L2_SEL_TGT_COMPOSE_PADDED</constant></entry>
<entry>0x0103</entry>
<entry>The active area and all padding pixels that are inserted or
modified by hardware.</entry>
<entry>Yes</entry>
<entry>No</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="v4l2-selection-flags">
<title>Selection flags</title>
<table pgwide="1" frame="none" id="v4l2-selection-flags-table">
<title>Selection flag definitions</title>
<tgroup cols="5">
<colspec colname="c1" />
<colspec colname="c2" />
<colspec colname="c3" />
<colspec colname="c4" />
<colspec colname="c5" />
&cs-def;
<thead>
<row rowsep="1">
<entry align="left">Flag name</entry>
<entry align="left">id</entry>
<entry align="left">Definition</entry>
<entry align="left">Valid for V4L2</entry>
<entry align="left">Valid for V4L2 subdev</entry>
</row>
</thead>
<tbody valign="top">
<row>
<entry><constant>V4L2_SEL_FLAG_GE</constant></entry>
<entry>(1 &lt;&lt; 0)</entry>
<entry>Suggest the driver it should choose greater or
equal rectangle (in size) than was requested. Albeit the
driver may choose a lesser size, it will only do so due to
hardware limitations. Without this flag (and
<constant>V4L2_SEL_FLAG_LE</constant>) the
behaviour is to choose the closest possible
rectangle.</entry>
<entry>Yes</entry>
<entry>Yes</entry>
</row>
<row>
<entry><constant>V4L2_SEL_FLAG_LE</constant></entry>
<entry>(1 &lt;&lt; 1)</entry>
<entry>Suggest the driver it
should choose lesser or equal rectangle (in size) than was
requested. Albeit the driver may choose a greater size, it
will only do so due to hardware limitations.</entry>
<entry>Yes</entry>
<entry>Yes</entry>
</row>
<row>
<entry><constant>V4L2_SEL_FLAG_KEEP_CONFIG</constant></entry>
<entry>(1 &lt;&lt; 2)</entry>
<entry>The configuration must not be propagated to any
further processing steps. If this flag is not given, the
configuration is propagated inside the subdevice to all
further processing steps.</entry>
<entry>No</entry>
<entry>Yes</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
</section>
...@@ -589,6 +589,11 @@ and discussions on the V4L mailing list.</revremark> ...@@ -589,6 +589,11 @@ and discussions on the V4L mailing list.</revremark>
&sub-write; &sub-write;
</appendix> </appendix>
<appendix>
<title>Common definitions for V4L2 and V4L2 subdev interfaces</title>
&sub-selections-common;
</appendix>
<appendix id="videodev"> <appendix id="videodev">
<title>Video For Linux Two Header File</title> <title>Video For Linux Two Header File</title>
&sub-videodev2-h; &sub-videodev2-h;
......
...@@ -97,7 +97,13 @@ information.</para> ...@@ -97,7 +97,13 @@ information.</para>
<row> <row>
<entry>__u32</entry> <entry>__u32</entry>
<entry><structfield>count</structfield></entry> <entry><structfield>count</structfield></entry>
<entry>The number of buffers requested or granted.</entry> <entry>The number of buffers requested or granted. If count == 0, then
<constant>VIDIOC_CREATE_BUFS</constant> will set <structfield>index</structfield>
to the current number of created buffers, and it will check the validity of
<structfield>memory</structfield> and <structfield>format.type</structfield>.
If those are invalid -1 is returned and errno is set to &EINVAL;,
otherwise <constant>VIDIOC_CREATE_BUFS</constant> returns 0. It will
never set errno to &EBUSY; in this particular case.</entry>
</row> </row>
<row> <row>
<entry>__u32</entry> <entry>__u32</entry>
......
...@@ -135,6 +135,12 @@ bounds or the value in the <structfield>type</structfield> field is ...@@ -135,6 +135,12 @@ bounds or the value in the <structfield>type</structfield> field is
wrong.</para> wrong.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry>
<term><errorcode>EBUSY</errorcode></term>
<listitem>
<para>A hardware seek is in progress.</para>
</listitem>
</varlistentry>
</variablelist> </variablelist>
</refsect1> </refsect1>
</refentry> </refentry>
...@@ -65,9 +65,9 @@ Do not use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE ...@@ -65,9 +65,9 @@ Do not use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE
</constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of </constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of
<constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>. The next step is <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>. The next step is
setting the value of &v4l2-selection; <structfield>target</structfield> field setting the value of &v4l2-selection; <structfield>target</structfield> field
to <constant> V4L2_SEL_TGT_CROP_ACTIVE </constant> (<constant> to <constant> V4L2_SEL_TGT_CROP </constant> (<constant>
V4L2_SEL_TGT_COMPOSE_ACTIVE </constant>). Please refer to table <xref V4L2_SEL_TGT_COMPOSE </constant>). Please refer to table <xref
linkend="v4l2-sel-target" /> or <xref linkend="selection-api" /> for additional linkend="v4l2-selections-common" /> or <xref linkend="selection-api" /> for additional
targets. The <structfield>flags</structfield> and <structfield>reserved targets. The <structfield>flags</structfield> and <structfield>reserved
</structfield> fields of &v4l2-selection; are ignored and they must be filled </structfield> fields of &v4l2-selection; are ignored and they must be filled
with zeros. The driver fills the rest of the structure or with zeros. The driver fills the rest of the structure or
...@@ -86,9 +86,9 @@ use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE ...@@ -86,9 +86,9 @@ use multiplanar buffers. Use <constant> V4L2_BUF_TYPE_VIDEO_CAPTURE
</constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of </constant>. Use <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT </constant> instead of
<constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>. The next step is <constant> V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE </constant>. The next step is
setting the value of &v4l2-selection; <structfield>target</structfield> to setting the value of &v4l2-selection; <structfield>target</structfield> to
<constant>V4L2_SEL_TGT_CROP_ACTIVE</constant> (<constant> <constant>V4L2_SEL_TGT_CROP</constant> (<constant>
V4L2_SEL_TGT_COMPOSE_ACTIVE </constant>). Please refer to table <xref V4L2_SEL_TGT_COMPOSE </constant>). Please refer to table <xref
linkend="v4l2-sel-target" /> or <xref linkend="selection-api" /> for additional linkend="v4l2-selections-common" /> or <xref linkend="selection-api" /> for additional
targets. The &v4l2-rect; <structfield>r</structfield> rectangle need to be targets. The &v4l2-rect; <structfield>r</structfield> rectangle need to be
set to the desired active area. Field &v4l2-selection; <structfield> reserved set to the desired active area. Field &v4l2-selection; <structfield> reserved
</structfield> is ignored and must be filled with zeros. The driver may adjust </structfield> is ignored and must be filled with zeros. The driver may adjust
...@@ -154,74 +154,8 @@ exist no rectangle </emphasis> that satisfies the constraints.</para> ...@@ -154,74 +154,8 @@ exist no rectangle </emphasis> that satisfies the constraints.</para>
</refsect1> </refsect1>
<refsect1> <para>Selection targets and flags are documented in <xref
<table frame="none" pgwide="1" id="v4l2-sel-target"> linkend="v4l2-selections-common"/>.</para>
<title>Selection targets.</title>
<tgroup cols="3">
&cs-def;
<tbody valign="top">
<row>
<entry><constant>V4L2_SEL_TGT_CROP_ACTIVE</constant></entry>
<entry>0x0000</entry>
<entry>The area that is currently cropped by hardware.</entry>
</row>
<row>
<entry><constant>V4L2_SEL_TGT_CROP_DEFAULT</constant></entry>
<entry>0x0001</entry>
<entry>Suggested cropping rectangle that covers the "whole picture".</entry>
</row>
<row>
<entry><constant>V4L2_SEL_TGT_CROP_BOUNDS</constant></entry>
<entry>0x0002</entry>
<entry>Limits for the cropping rectangle.</entry>
</row>
<row>
<entry><constant>V4L2_SEL_TGT_COMPOSE_ACTIVE</constant></entry>
<entry>0x0100</entry>
<entry>The area to which data is composed by hardware.</entry>
</row>
<row>
<entry><constant>V4L2_SEL_TGT_COMPOSE_DEFAULT</constant></entry>
<entry>0x0101</entry>
<entry>Suggested composing rectangle that covers the "whole picture".</entry>
</row>
<row>
<entry><constant>V4L2_SEL_TGT_COMPOSE_BOUNDS</constant></entry>
<entry>0x0102</entry>
<entry>Limits for the composing rectangle.</entry>
</row>
<row>
<entry><constant>V4L2_SEL_TGT_COMPOSE_PADDED</constant></entry>
<entry>0x0103</entry>
<entry>The active area and all padding pixels that are inserted or modified by hardware.</entry>
</row>
</tbody>
</tgroup>
</table>
</refsect1>
<refsect1>
<table frame="none" pgwide="1" id="v4l2-sel-flags">
<title>Selection constraint flags</title>
<tgroup cols="3">
&cs-def;
<tbody valign="top">
<row>
<entry><constant>V4L2_SEL_FLAG_GE</constant></entry>
<entry>0x00000001</entry>
<entry>Indicates that the adjusted rectangle must contain the original
&v4l2-selection; <structfield>r</structfield> rectangle.</entry>
</row>
<row>
<entry><constant>V4L2_SEL_FLAG_LE</constant></entry>
<entry>0x00000002</entry>
<entry>Indicates that the adjusted rectangle must be inside the original
&v4l2-rect; <structfield>r</structfield> rectangle.</entry>
</row>
</tbody>
</tgroup>
</table>
</refsect1>
<section> <section>
<figure id="sel-const-adjust"> <figure id="sel-const-adjust">
...@@ -252,14 +186,14 @@ exist no rectangle </emphasis> that satisfies the constraints.</para> ...@@ -252,14 +186,14 @@ exist no rectangle </emphasis> that satisfies the constraints.</para>
<row> <row>
<entry>__u32</entry> <entry>__u32</entry>
<entry><structfield>target</structfield></entry> <entry><structfield>target</structfield></entry>
<entry>Used to select between <link linkend="v4l2-sel-target"> cropping <entry>Used to select between <link linkend="v4l2-selections-common"> cropping
and composing rectangles</link>.</entry> and composing rectangles</link>.</entry>
</row> </row>
<row> <row>
<entry>__u32</entry> <entry>__u32</entry>
<entry><structfield>flags</structfield></entry> <entry><structfield>flags</structfield></entry>
<entry>Flags controlling the selection rectangle adjustments, refer to <entry>Flags controlling the selection rectangle adjustments, refer to
<link linkend="v4l2-sel-flags">selection flags</link>.</entry> <link linkend="v4l2-selection-flags">selection flags</link>.</entry>
</row> </row>
<row> <row>
<entry>&v4l2-rect;</entry> <entry>&v4l2-rect;</entry>
......
...@@ -275,6 +275,18 @@ can or must be switched. (B/G PAL tuners for example are typically not ...@@ -275,6 +275,18 @@ can or must be switched. (B/G PAL tuners for example are typically not
see the description of ioctl &VIDIOC-ENUMINPUT; for details. Only see the description of ioctl &VIDIOC-ENUMINPUT; for details. Only
<constant>V4L2_TUNER_ANALOG_TV</constant> tuners can have this capability.</entry> <constant>V4L2_TUNER_ANALOG_TV</constant> tuners can have this capability.</entry>
</row> </row>
<row>
<entry><constant>V4L2_TUNER_CAP_HWSEEK_BOUNDED</constant></entry>
<entry>0x0004</entry>
<entry>If set, then this tuner supports the hardware seek functionality
where the seek stops when it reaches the end of the frequency range.</entry>
</row>
<row>
<entry><constant>V4L2_TUNER_CAP_HWSEEK_WRAP</constant></entry>
<entry>0x0008</entry>
<entry>If set, then this tuner supports the hardware seek functionality
where the seek wraps around when it reaches the end of the frequency range.</entry>
</row>
<row> <row>
<entry><constant>V4L2_TUNER_CAP_STEREO</constant></entry> <entry><constant>V4L2_TUNER_CAP_STEREO</constant></entry>
<entry>0x0010</entry> <entry>0x0010</entry>
......
...@@ -71,12 +71,9 @@ initialize the <structfield>bytesused</structfield>, ...@@ -71,12 +71,9 @@ initialize the <structfield>bytesused</structfield>,
<structfield>field</structfield> and <structfield>field</structfield> and
<structfield>timestamp</structfield> fields, see <xref <structfield>timestamp</structfield> fields, see <xref
linkend="buffer" /> for details. linkend="buffer" /> for details.
Applications must also set <structfield>flags</structfield> to 0. If a driver Applications must also set <structfield>flags</structfield> to 0.
supports capturing from specific video inputs and you want to specify a video The <structfield>reserved2</structfield> and
input, then <structfield>flags</structfield> should be set to <structfield>reserved</structfield> fields must be set to 0. When using
<constant>V4L2_BUF_FLAG_INPUT</constant> and the field
<structfield>input</structfield> must be initialized to the desired input.
The <structfield>reserved</structfield> field must be set to 0. When using
the <link linkend="planar-apis">multi-planar API</link>, the the <link linkend="planar-apis">multi-planar API</link>, the
<structfield>m.planes</structfield> field must contain a userspace pointer <structfield>m.planes</structfield> field must contain a userspace pointer
to a filled-in array of &v4l2-plane; and the <structfield>length</structfield> to a filled-in array of &v4l2-plane; and the <structfield>length</structfield>
......
...@@ -58,6 +58,9 @@ To do this applications initialize the <structfield>tuner</structfield>, ...@@ -58,6 +58,9 @@ To do this applications initialize the <structfield>tuner</structfield>,
call the <constant>VIDIOC_S_HW_FREQ_SEEK</constant> ioctl with a pointer call the <constant>VIDIOC_S_HW_FREQ_SEEK</constant> ioctl with a pointer
to this structure.</para> to this structure.</para>
<para>If an error is returned, then the original frequency will
be restored.</para>
<para>This ioctl is supported if the <constant>V4L2_CAP_HW_FREQ_SEEK</constant> capability is set.</para> <para>This ioctl is supported if the <constant>V4L2_CAP_HW_FREQ_SEEK</constant> capability is set.</para>
<table pgwide="1" frame="none" id="v4l2-hw-freq-seek"> <table pgwide="1" frame="none" id="v4l2-hw-freq-seek">
...@@ -87,7 +90,10 @@ field and the &v4l2-tuner; <structfield>index</structfield> field.</entry> ...@@ -87,7 +90,10 @@ field and the &v4l2-tuner; <structfield>index</structfield> field.</entry>
<row> <row>
<entry>__u32</entry> <entry>__u32</entry>
<entry><structfield>wrap_around</structfield></entry> <entry><structfield>wrap_around</structfield></entry>
<entry>If non-zero, wrap around when at the end of the frequency range, else stop seeking.</entry> <entry>If non-zero, wrap around when at the end of the frequency range, else stop seeking.
The &v4l2-tuner; <structfield>capability</structfield> field will tell you what the
hardware supports.
</entry>
</row> </row>
<row> <row>
<entry>__u32</entry> <entry>__u32</entry>
...@@ -118,9 +124,15 @@ wrong.</para> ...@@ -118,9 +124,15 @@ wrong.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
<varlistentry> <varlistentry>
<term><errorcode>EAGAIN</errorcode></term> <term><errorcode>ENODATA</errorcode></term>
<listitem>
<para>The hardware seek found no channels.</para>
</listitem>
</varlistentry>
<varlistentry>
<term><errorcode>EBUSY</errorcode></term>
<listitem> <listitem>
<para>The ioctl timed-out. Try again.</para> <para>Another hardware seek is already in progress.</para>
</listitem> </listitem>
</varlistentry> </varlistentry>
</variablelist> </variablelist>
......
...@@ -72,10 +72,10 @@ ...@@ -72,10 +72,10 @@
<section> <section>
<title>Types of selection targets</title> <title>Types of selection targets</title>
<para>There are two types of selection targets: actual and bounds. <para>There are two types of selection targets: actual and bounds. The
The ACTUAL targets are the targets which configure the hardware. actual targets are the targets which configure the hardware. The BOUNDS
The BOUNDS target will return a rectangle that contain all target will return a rectangle that contain all possible actual
possible ACTUAL rectangles.</para> rectangles.</para>
</section> </section>
<section> <section>
...@@ -87,71 +87,8 @@ ...@@ -87,71 +87,8 @@
<constant>EINVAL</constant>.</para> <constant>EINVAL</constant>.</para>
</section> </section>
<table pgwide="1" frame="none" id="v4l2-subdev-selection-targets"> <para>Selection targets and flags are documented in <xref
<title>V4L2 subdev selection targets</title> linkend="v4l2-selections-common"/>.</para>
<tgroup cols="3">
&cs-def;
<tbody valign="top">
<row>
<entry><constant>V4L2_SUBDEV_SEL_TGT_CROP_ACTUAL</constant></entry>
<entry>0x0000</entry>
<entry>Actual crop. Defines the cropping
performed by the processing step.</entry>
</row>
<row>
<entry><constant>V4L2_SUBDEV_SEL_TGT_CROP_BOUNDS</constant></entry>
<entry>0x0002</entry>
<entry>Bounds of the crop rectangle.</entry>
</row>
<row>
<entry><constant>V4L2_SUBDEV_SEL_TGT_COMPOSE_ACTUAL</constant></entry>
<entry>0x0100</entry>
<entry>Actual compose rectangle. Used to configure scaling
on sink pads and composition on source pads.</entry>
</row>
<row>
<entry><constant>V4L2_SUBDEV_SEL_TGT_COMPOSE_BOUNDS</constant></entry>
<entry>0x0102</entry>
<entry>Bounds of the compose rectangle.</entry>
</row>
</tbody>
</tgroup>
</table>
<table pgwide="1" frame="none" id="v4l2-subdev-selection-flags">
<title>V4L2 subdev selection flags</title>
<tgroup cols="3">
&cs-def;
<tbody valign="top">
<row>
<entry><constant>V4L2_SUBDEV_SEL_FLAG_SIZE_GE</constant></entry>
<entry>(1 &lt;&lt; 0)</entry> <entry>Suggest the driver it
should choose greater or equal rectangle (in size) than
was requested. Albeit the driver may choose a lesser size,
it will only do so due to hardware limitations. Without
this flag (and
<constant>V4L2_SUBDEV_SEL_FLAG_SIZE_LE</constant>) the
behaviour is to choose the closest possible
rectangle.</entry>
</row>
<row>
<entry><constant>V4L2_SUBDEV_SEL_FLAG_SIZE_LE</constant></entry>
<entry>(1 &lt;&lt; 1)</entry> <entry>Suggest the driver it
should choose lesser or equal rectangle (in size) than was
requested. Albeit the driver may choose a greater size, it
will only do so due to hardware limitations.</entry>
</row>
<row>
<entry><constant>V4L2_SUBDEV_SEL_FLAG_KEEP_CONFIG</constant></entry>
<entry>(1 &lt;&lt; 2)</entry>
<entry>The configuration should not be propagated to any
further processing steps. If this flag is not given, the
configuration is propagated inside the subdevice to all
further processing steps.</entry>
</row>
</tbody>
</tgroup>
</table>
<table pgwide="1" frame="none" id="v4l2-subdev-selection"> <table pgwide="1" frame="none" id="v4l2-subdev-selection">
<title>struct <structname>v4l2_subdev_selection</structname></title> <title>struct <structname>v4l2_subdev_selection</structname></title>
...@@ -173,13 +110,13 @@ ...@@ -173,13 +110,13 @@
<entry>__u32</entry> <entry>__u32</entry>
<entry><structfield>target</structfield></entry> <entry><structfield>target</structfield></entry>
<entry>Target selection rectangle. See <entry>Target selection rectangle. See
<xref linkend="v4l2-subdev-selection-targets">.</xref>.</entry> <xref linkend="v4l2-selections-common" />.</entry>
</row> </row>
<row> <row>
<entry>__u32</entry> <entry>__u32</entry>
<entry><structfield>flags</structfield></entry> <entry><structfield>flags</structfield></entry>
<entry>Flags. See <entry>Flags. See
<xref linkend="v4l2-subdev-selection-flags">.</xref></entry> <xref linkend="v4l2-selection-flags" />.</entry>
</row> </row>
<row> <row>
<entry>&v4l2-rect;</entry> <entry>&v4l2-rect;</entry>
......
...@@ -29,7 +29,7 @@ use IO::Handle; ...@@ -29,7 +29,7 @@ use IO::Handle;
"af9015", "ngene", "az6027", "lme2510_lg", "lme2510c_s7395", "af9015", "ngene", "az6027", "lme2510_lg", "lme2510c_s7395",
"lme2510c_s7395_old", "drxk", "drxk_terratec_h5", "lme2510c_s7395_old", "drxk", "drxk_terratec_h5",
"drxk_hauppauge_hvr930c", "tda10071", "it9135", "it9137", "drxk_hauppauge_hvr930c", "tda10071", "it9135", "it9137",
"drxk_pctv"); "drxk_pctv", "drxk_terratec_htc_stick", "sms1xxx_hcw");
# Check args # Check args
syntax() if (scalar(@ARGV) != 1); syntax() if (scalar(@ARGV) != 1);
...@@ -676,6 +676,24 @@ sub drxk_terratec_h5 { ...@@ -676,6 +676,24 @@ sub drxk_terratec_h5 {
"$fwfile" "$fwfile"
} }
sub drxk_terratec_htc_stick {
my $url = "http://ftp.terratec.de/Receiver/Cinergy_HTC_Stick/Updates/";
my $zipfile = "Cinergy_HTC_Stick_Drv_5.09.1202.00_XP_Vista_7.exe";
my $hash = "6722a2442a05423b781721fbc069ed5e";
my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 0);
my $drvfile = "Cinergy HTC Stick/BDA Driver 5.09.1202.00/Windows 32 Bit/emOEM.sys";
my $fwfile = "dvb-usb-terratec-htc-stick-drxk.fw";
checkstandard();
wgetfile($zipfile, $url . $zipfile);
verify($zipfile, $hash);
unzip($zipfile, $tmpdir);
extract("$tmpdir/$drvfile", 0x4e5c0, 42692, "$fwfile");
"$fwfile"
}
sub it9135 { sub it9135 {
my $sourcefile = "dvb-usb-it9135.zip"; my $sourcefile = "dvb-usb-it9135.zip";
my $url = "http://www.ite.com.tw/uploads/firmware/v3.6.0.0/$sourcefile"; my $url = "http://www.ite.com.tw/uploads/firmware/v3.6.0.0/$sourcefile";
...@@ -748,6 +766,28 @@ sub drxk_pctv { ...@@ -748,6 +766,28 @@ sub drxk_pctv {
"$fwfile"; "$fwfile";
} }
sub sms1xxx_hcw {
my $url = "http://steventoth.net/linux/sms1xxx/";
my %files = (
'sms1xxx-hcw-55xxx-dvbt-01.fw' => "afb6f9fb9a71d64392e8564ef9577e5a",
'sms1xxx-hcw-55xxx-dvbt-02.fw' => "b44807098ba26e52cbedeadc052ba58f",
'sms1xxx-hcw-55xxx-isdbt-02.fw' => "dae934eeea85225acbd63ce6cfe1c9e4",
);
checkstandard();
my $allfiles;
foreach my $fwfile (keys %files) {
wgetfile($fwfile, "$url/$fwfile");
verify($fwfile, $files{$fwfile});
$allfiles .= " $fwfile";
}
$allfiles =~ s/^\s//;
$allfiles;
}
# --------------------------------------------------------------- # ---------------------------------------------------------------
# Utilities # Utilities
......
...@@ -600,3 +600,21 @@ When: June 2013 ...@@ -600,3 +600,21 @@ When: June 2013
Why: Unsupported/unmaintained/unused since 2.6 Why: Unsupported/unmaintained/unused since 2.6
---------------------------- ----------------------------
What: V4L2 selections API target rectangle and flags unification, the
following definitions will be removed: V4L2_SEL_TGT_CROP_ACTIVE,
V4L2_SEL_TGT_COMPOSE_ACTIVE, V4L2_SUBDEV_SEL_*, V4L2_SUBDEV_SEL_FLAG_*
in favor of common V4L2_SEL_TGT_* and V4L2_SEL_FLAG_* definitions.
For more details see include/linux/v4l2-common.h.
When: 3.8
Why: The regular V4L2 selections and the subdev selection API originally
defined distinct names for the target rectangles and flags - V4L2_SEL_*
and V4L2_SUBDEV_SEL_*. Although, it turned out that the meaning of these
target rectangles is virtually identical and the APIs were consolidated
to use single set of names - V4L2_SEL_*. This didn't involve any ABI
changes. Alias definitions were created for the original ones to avoid
any instabilities in the user space interface. After few cycles these
backward compatibility definitions will be removed.
Who: Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
----------------------------
...@@ -594,6 +594,15 @@ You should also set these fields: ...@@ -594,6 +594,15 @@ You should also set these fields:
unlocked_ioctl file operation is called this lock will be taken by the unlocked_ioctl file operation is called this lock will be taken by the
core and released afterwards. See the next section for more details. core and released afterwards. See the next section for more details.
- queue: a pointer to the struct vb2_queue associated with this device node.
If queue is non-NULL, and queue->lock is non-NULL, then queue->lock is
used for the queuing ioctls (VIDIOC_REQBUFS, CREATE_BUFS, QBUF, DQBUF,
QUERYBUF, PREPARE_BUF, STREAMON and STREAMOFF) instead of the lock above.
That way the vb2 queuing framework does not have to wait for other ioctls.
This queue pointer is also used by the vb2 helper functions to check for
queuing ownership (i.e. is the filehandle calling it allowed to do the
operation).
- prio: keeps track of the priorities. Used to implement VIDIOC_G/S_PRIORITY. - prio: keeps track of the priorities. Used to implement VIDIOC_G/S_PRIORITY.
If left to NULL, then it will use the struct v4l2_prio_state in v4l2_device. If left to NULL, then it will use the struct v4l2_prio_state in v4l2_device.
If you want to have a separate priority state per (group of) device node(s), If you want to have a separate priority state per (group of) device node(s),
...@@ -647,47 +656,43 @@ manually set the struct media_entity type and name fields. ...@@ -647,47 +656,43 @@ manually set the struct media_entity type and name fields.
A reference to the entity will be automatically acquired/released when the A reference to the entity will be automatically acquired/released when the
video device is opened/closed. video device is opened/closed.
v4l2_file_operations and locking ioctls and locking
-------------------------------- ------------------
You can set a pointer to a mutex_lock in struct video_device. Usually this
will be either a top-level mutex or a mutex per device node. By default this
lock will be used for unlocked_ioctl, but you can disable locking for
selected ioctls by calling:
void v4l2_disable_ioctl_locking(struct video_device *vdev, unsigned int cmd);
E.g.: v4l2_disable_ioctl_locking(vdev, VIDIOC_DQBUF);
You have to call this before you register the video_device. The V4L core provides optional locking services. The main service is the
lock field in struct video_device, which is a pointer to a mutex. If you set
this pointer, then that will be used by unlocked_ioctl to serialize all ioctls.
Particularly with USB drivers where certain commands such as setting controls If you are using the videobuf2 framework, then there is a second lock that you
can take a long time you may want to do your own locking for the buffer queuing can set: video_device->queue->lock. If set, then this lock will be used instead
ioctls. of video_device->lock to serialize all queuing ioctls (see the previous section
for the full list of those ioctls).
If you want still finer-grained locking then you have to set mutex_lock to NULL The advantage of using a different lock for the queuing ioctls is that for some
and do you own locking completely. drivers (particularly USB drivers) certain commands such as setting controls
can take a long time, so you want to use a separate lock for the buffer queuing
ioctls. That way your VIDIOC_DQBUF doesn't stall because the driver is busy
changing the e.g. exposure of the webcam.
It is up to the driver developer to decide which method to use. However, if Of course, you can always do all the locking yourself by leaving both lock
your driver has high-latency operations (for example, changing the exposure pointers at NULL.
of a USB webcam might take a long time), then you might be better off with
doing your own locking if you want to allow the user to do other things with
the device while waiting for the high-latency command to finish.
If a lock is specified then all ioctl commands will be serialized on that If you use the old videobuf then you must pass the video_device lock to the
lock. If you use videobuf then you must pass the same lock to the videobuf videobuf queue initialize function: if videobuf has to wait for a frame to
queue initialize function: if videobuf has to wait for a frame to arrive, then arrive, then it will temporarily unlock the lock and relock it afterwards. If
it will temporarily unlock the lock and relock it afterwards. If your driver your driver also waits in the code, then you should do the same to allow other
also waits in the code, then you should do the same to allow other processes processes to access the device node while the first process is waiting for
to access the device node while the first process is waiting for something. something.
In the case of videobuf2 you will need to implement the wait_prepare and In the case of videobuf2 you will need to implement the wait_prepare and
wait_finish callbacks to unlock/lock if applicable. In particular, if you use wait_finish callbacks to unlock/lock if applicable. If you use the queue->lock
the lock in struct video_device then you must unlock/lock this mutex in pointer, then you can use the helper functions vb2_ops_wait_prepare/finish.
wait_prepare and wait_finish.
The implementation of a hotplug disconnect should also take the lock from
The implementation of a hotplug disconnect should also take the lock before video_device before calling v4l2_device_disconnect. If you are also using
calling v4l2_device_disconnect. video_device->queue->lock, then you have to first lock video_device->queue->lock
followed by video_device->lock. That way you can be sure no ioctl is running
when you call v4l2_device_disconnect.
video_device registration video_device registration
------------------------- -------------------------
......
...@@ -3156,8 +3156,7 @@ S: Maintained ...@@ -3156,8 +3156,7 @@ S: Maintained
F: drivers/media/video/gspca/t613.c F: drivers/media/video/gspca/t613.c
GSPCA USB WEBCAM DRIVER GSPCA USB WEBCAM DRIVER
M: Jean-Francois Moine <moinejf@free.fr> M: Hans de Goede <hdegoede@redhat.com>
W: http://moinejf.free.fr
L: linux-media@vger.kernel.org L: linux-media@vger.kernel.org
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media.git T: git git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media.git
S: Maintained S: Maintained
......
...@@ -1311,6 +1311,37 @@ module_exit(i2c_exit); ...@@ -1311,6 +1311,37 @@ module_exit(i2c_exit);
* ---------------------------------------------------- * ----------------------------------------------------
*/ */
/**
* __i2c_transfer - unlocked flavor of i2c_transfer
* @adap: Handle to I2C bus
* @msgs: One or more messages to execute before STOP is issued to
* terminate the operation; each message begins with a START.
* @num: Number of messages to be executed.
*
* Returns negative errno, else the number of messages executed.
*
* Adapter lock must be held when calling this function. No debug logging
* takes place. adap->algo->master_xfer existence isn't checked.
*/
int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
{
unsigned long orig_jiffies;
int ret, try;
/* Retry automatically on arbitration loss */
orig_jiffies = jiffies;
for (ret = 0, try = 0; try <= adap->retries; try++) {
ret = adap->algo->master_xfer(adap, msgs, num);
if (ret != -EAGAIN)
break;
if (time_after(jiffies, orig_jiffies + adap->timeout))
break;
}
return ret;
}
EXPORT_SYMBOL(__i2c_transfer);
/** /**
* i2c_transfer - execute a single or combined I2C message * i2c_transfer - execute a single or combined I2C message
* @adap: Handle to I2C bus * @adap: Handle to I2C bus
...@@ -1325,8 +1356,7 @@ module_exit(i2c_exit); ...@@ -1325,8 +1356,7 @@ module_exit(i2c_exit);
*/ */
int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
{ {
unsigned long orig_jiffies; int ret;
int ret, try;
/* REVISIT the fault reporting model here is weak: /* REVISIT the fault reporting model here is weak:
* *
...@@ -1364,15 +1394,7 @@ int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) ...@@ -1364,15 +1394,7 @@ int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num)
i2c_lock_adapter(adap); i2c_lock_adapter(adap);
} }
/* Retry automatically on arbitration loss */ ret = __i2c_transfer(adap, msgs, num);
orig_jiffies = jiffies;
for (ret = 0, try = 0; try <= adap->retries; try++) {
ret = adap->algo->master_xfer(adap, msgs, num);
if (ret != -EAGAIN)
break;
if (time_after(jiffies, orig_jiffies + adap->timeout))
break;
}
i2c_unlock_adapter(adap); i2c_unlock_adapter(adap);
return ret; return ret;
......
...@@ -6,20 +6,82 @@ menuconfig MEDIA_SUPPORT ...@@ -6,20 +6,82 @@ menuconfig MEDIA_SUPPORT
tristate "Multimedia support" tristate "Multimedia support"
depends on HAS_IOMEM depends on HAS_IOMEM
help help
If you want to use Video for Linux, DVB for Linux, or DAB adapters, If you want to use Webcams, Video grabber devices and/or TV devices
enable this option and other options below. enable this option and other options below.
Additional info and docs are available on the web at
<http://linuxtv.org>
if MEDIA_SUPPORT if MEDIA_SUPPORT
comment "Multimedia core support" comment "Multimedia core support"
#
# Multimedia support - automatically enable V4L2 and DVB core
#
config MEDIA_CAMERA_SUPPORT
bool "Cameras/video grabbers support"
---help---
Enable support for webcams and video grabbers.
Say Y when you have a webcam or a video capture grabber board.
config MEDIA_ANALOG_TV_SUPPORT
bool "Analog TV support"
---help---
Enable analog TV support.
Say Y when you have a TV board with analog support or with a
hybrid analog/digital TV chipset.
Note: There are several DVB cards that are based on chips that
support both analog and digital TV. Disabling this option
will disable support for them.
config MEDIA_DIGITAL_TV_SUPPORT
bool "Digital TV support"
---help---
Enable digital TV support.
Say Y when you have a board with digital support or a board with
hybrid digital TV and analog TV.
config MEDIA_RADIO_SUPPORT
bool "AM/FM radio receivers/transmitters support"
---help---
Enable AM/FM radio support.
Additional info and docs are available on the web at
<http://linuxtv.org>
Say Y when you have a board with radio support.
Note: There are several TV cards that are based on chips that
support radio reception. Disabling this option will
disable support for them.
config MEDIA_RC_SUPPORT
bool "Remote Controller support"
depends on INPUT
---help---
Enable support for Remote Controllers on Linux. This is
needed in order to support several video capture adapters,
standalone IR receivers/transmitters, and RF receivers.
Enable this option if you have a video capture board even
if you don't need IR, as otherwise, you may not be able to
compile the driver for your adapter.
Say Y when you have a TV or an IR device.
# #
# Media controller # Media controller
# Selectable only for webcam/grabbers, as other drivers don't use it
# #
config MEDIA_CONTROLLER config MEDIA_CONTROLLER
bool "Media Controller API (EXPERIMENTAL)" bool "Media Controller API (EXPERIMENTAL)"
depends on EXPERIMENTAL depends on EXPERIMENTAL
depends on MEDIA_CAMERA_SUPPORT
---help--- ---help---
Enable the media controller API used to query media devices internal Enable the media controller API used to query media devices internal
topology and configure it dynamically. topology and configure it dynamically.
...@@ -27,26 +89,15 @@ config MEDIA_CONTROLLER ...@@ -27,26 +89,15 @@ config MEDIA_CONTROLLER
This API is mostly used by camera interfaces in embedded platforms. This API is mostly used by camera interfaces in embedded platforms.
# #
# V4L core and enabled API's # Video4Linux support
# Only enables if one of the V4L2 types (ATV, webcam, radio) is selected
# #
config VIDEO_DEV config VIDEO_DEV
tristate "Video For Linux" tristate
---help--- depends on MEDIA_SUPPORT
V4L core support for video capture and overlay devices, webcams and depends on MEDIA_CAMERA_SUPPORT || MEDIA_ANALOG_TV_SUPPORT || MEDIA_RADIO_SUPPORT
AM/FM radio cards. default y
This kernel includes support for the new Video for Linux Two API,
(V4L2).
Additional info and docs are available on the web at
<http://linuxtv.org>
Documentation for V4L2 is also available on the web at
<http://bytesex.org/v4l/>.
To compile this driver as a module, choose M here: the
module will be called videodev.
config VIDEO_V4L2_COMMON config VIDEO_V4L2_COMMON
tristate tristate
...@@ -64,25 +115,15 @@ config VIDEO_V4L2_SUBDEV_API ...@@ -64,25 +115,15 @@ config VIDEO_V4L2_SUBDEV_API
# #
# DVB Core # DVB Core
# Only enables if one of DTV is selected
# #
config DVB_CORE config DVB_CORE
tristate "DVB for Linux" tristate
depends on MEDIA_SUPPORT
depends on MEDIA_DIGITAL_TV_SUPPORT
default y
select CRC32 select CRC32
help
DVB core utility functions for device handling, software fallbacks etc.
Enable this if you own a DVB/ATSC adapter and want to use it or if
you compile Linux for a digital SetTopBox.
Say Y when you have a DVB or an ATSC card and want to use it.
API specs and user tools are available from <http://www.linuxtv.org/>.
Please report problems regarding this support to the LinuxDVB
mailing list.
If unsure say N.
config DVB_NET config DVB_NET
bool "DVB Network Support" bool "DVB Network Support"
...@@ -97,12 +138,7 @@ config DVB_NET ...@@ -97,12 +138,7 @@ config DVB_NET
You may want to disable the network support on embedded devices. If You may want to disable the network support on embedded devices. If
unsure say Y. unsure say Y.
config VIDEO_MEDIA comment "Media drivers"
tristate
default (DVB_CORE && (VIDEO_DEV = n)) || (VIDEO_DEV && (DVB_CORE = n)) || (DVB_CORE && VIDEO_DEV)
comment "Multimedia drivers"
source "drivers/media/common/Kconfig" source "drivers/media/common/Kconfig"
source "drivers/media/rc/Kconfig" source "drivers/media/rc/Kconfig"
......
config MEDIA_ATTACH config MEDIA_ATTACH
bool "Load and attach frontend and tuner driver modules as needed" bool "Load and attach frontend and tuner driver modules as needed"
depends on VIDEO_MEDIA depends on MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_RADIO_SUPPORT
depends on MODULES depends on MODULES
default y if !EXPERT
help help
Remove the static dependency of DVB card drivers on all Remove the static dependency of DVB card drivers on all
frontend modules for all possible card variants. Instead, frontend modules for all possible card variants. Instead,
...@@ -19,15 +20,15 @@ config MEDIA_ATTACH ...@@ -19,15 +20,15 @@ config MEDIA_ATTACH
config MEDIA_TUNER config MEDIA_TUNER
tristate tristate
default VIDEO_MEDIA && I2C depends on (MEDIA_ANALOG_TV_SUPPORT || MEDIA_RADIO_SUPPORT) && I2C
depends on VIDEO_MEDIA && I2C default y
select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_XC2028 if !MEDIA_TUNER_CUSTOMISE
select MEDIA_TUNER_XC5000 if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_XC5000 if !MEDIA_TUNER_CUSTOMISE
select MEDIA_TUNER_XC4000 if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_XC4000 if !MEDIA_TUNER_CUSTOMISE
select MEDIA_TUNER_MT20XX if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_MT20XX if !MEDIA_TUNER_CUSTOMISE
select MEDIA_TUNER_TDA8290 if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_TDA8290 if !MEDIA_TUNER_CUSTOMISE
select MEDIA_TUNER_TEA5761 if !MEDIA_TUNER_CUSTOMISE && EXPERIMENTAL select MEDIA_TUNER_TEA5761 if !MEDIA_TUNER_CUSTOMISE && MEDIA_RADIO_SUPPORT && EXPERIMENTAL
select MEDIA_TUNER_TEA5767 if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_TEA5767 if !MEDIA_TUNER_CUSTOMISE && MEDIA_RADIO_SUPPORT
select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_SIMPLE if !MEDIA_TUNER_CUSTOMISE
select MEDIA_TUNER_TDA9887 if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_TDA9887 if !MEDIA_TUNER_CUSTOMISE
select MEDIA_TUNER_MC44S803 if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_MC44S803 if !MEDIA_TUNER_CUSTOMISE
...@@ -47,10 +48,11 @@ config MEDIA_TUNER_CUSTOMISE ...@@ -47,10 +48,11 @@ config MEDIA_TUNER_CUSTOMISE
menu "Customize TV tuners" menu "Customize TV tuners"
visible if MEDIA_TUNER_CUSTOMISE visible if MEDIA_TUNER_CUSTOMISE
depends on MEDIA_ANALOG_TV_SUPPORT || MEDIA_DIGITAL_TV_SUPPORT || MEDIA_RADIO_SUPPORT
config MEDIA_TUNER_SIMPLE config MEDIA_TUNER_SIMPLE
tristate "Simple tuner support" tristate "Simple tuner support"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
select MEDIA_TUNER_TDA9887 select MEDIA_TUNER_TDA9887
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
...@@ -58,7 +60,7 @@ config MEDIA_TUNER_SIMPLE ...@@ -58,7 +60,7 @@ config MEDIA_TUNER_SIMPLE
config MEDIA_TUNER_TDA8290 config MEDIA_TUNER_TDA8290
tristate "TDA 8290/8295 + 8275(a)/18271 tuner combo" tristate "TDA 8290/8295 + 8275(a)/18271 tuner combo"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
select MEDIA_TUNER_TDA827X select MEDIA_TUNER_TDA827X
select MEDIA_TUNER_TDA18271 select MEDIA_TUNER_TDA18271
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
...@@ -67,21 +69,21 @@ config MEDIA_TUNER_TDA8290 ...@@ -67,21 +69,21 @@ config MEDIA_TUNER_TDA8290
config MEDIA_TUNER_TDA827X config MEDIA_TUNER_TDA827X
tristate "Philips TDA827X silicon tuner" tristate "Philips TDA827X silicon tuner"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
A DVB-T silicon tuner module. Say Y when you want to support this tuner. A DVB-T silicon tuner module. Say Y when you want to support this tuner.
config MEDIA_TUNER_TDA18271 config MEDIA_TUNER_TDA18271
tristate "NXP TDA18271 silicon tuner" tristate "NXP TDA18271 silicon tuner"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
A silicon tuner module. Say Y when you want to support this tuner. A silicon tuner module. Say Y when you want to support this tuner.
config MEDIA_TUNER_TDA9887 config MEDIA_TUNER_TDA9887
tristate "TDA 9885/6/7 analog IF demodulator" tristate "TDA 9885/6/7 analog IF demodulator"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
Say Y here to include support for Philips TDA9885/6/7 Say Y here to include support for Philips TDA9885/6/7
...@@ -89,7 +91,7 @@ config MEDIA_TUNER_TDA9887 ...@@ -89,7 +91,7 @@ config MEDIA_TUNER_TDA9887
config MEDIA_TUNER_TEA5761 config MEDIA_TUNER_TEA5761
tristate "TEA 5761 radio tuner (EXPERIMENTAL)" tristate "TEA 5761 radio tuner (EXPERIMENTAL)"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
depends on EXPERIMENTAL depends on EXPERIMENTAL
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
...@@ -97,63 +99,63 @@ config MEDIA_TUNER_TEA5761 ...@@ -97,63 +99,63 @@ config MEDIA_TUNER_TEA5761
config MEDIA_TUNER_TEA5767 config MEDIA_TUNER_TEA5767
tristate "TEA 5767 radio tuner" tristate "TEA 5767 radio tuner"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
Say Y here to include support for the Philips TEA5767 radio tuner. Say Y here to include support for the Philips TEA5767 radio tuner.
config MEDIA_TUNER_MT20XX config MEDIA_TUNER_MT20XX
tristate "Microtune 2032 / 2050 tuners" tristate "Microtune 2032 / 2050 tuners"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
Say Y here to include support for the MT2032 / MT2050 tuner. Say Y here to include support for the MT2032 / MT2050 tuner.
config MEDIA_TUNER_MT2060 config MEDIA_TUNER_MT2060
tristate "Microtune MT2060 silicon IF tuner" tristate "Microtune MT2060 silicon IF tuner"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
A driver for the silicon IF tuner MT2060 from Microtune. A driver for the silicon IF tuner MT2060 from Microtune.
config MEDIA_TUNER_MT2063 config MEDIA_TUNER_MT2063
tristate "Microtune MT2063 silicon IF tuner" tristate "Microtune MT2063 silicon IF tuner"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
A driver for the silicon IF tuner MT2063 from Microtune. A driver for the silicon IF tuner MT2063 from Microtune.
config MEDIA_TUNER_MT2266 config MEDIA_TUNER_MT2266
tristate "Microtune MT2266 silicon tuner" tristate "Microtune MT2266 silicon tuner"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
A driver for the silicon baseband tuner MT2266 from Microtune. A driver for the silicon baseband tuner MT2266 from Microtune.
config MEDIA_TUNER_MT2131 config MEDIA_TUNER_MT2131
tristate "Microtune MT2131 silicon tuner" tristate "Microtune MT2131 silicon tuner"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
A driver for the silicon baseband tuner MT2131 from Microtune. A driver for the silicon baseband tuner MT2131 from Microtune.
config MEDIA_TUNER_QT1010 config MEDIA_TUNER_QT1010
tristate "Quantek QT1010 silicon tuner" tristate "Quantek QT1010 silicon tuner"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
A driver for the silicon tuner QT1010 from Quantek. A driver for the silicon tuner QT1010 from Quantek.
config MEDIA_TUNER_XC2028 config MEDIA_TUNER_XC2028
tristate "XCeive xc2028/xc3028 tuners" tristate "XCeive xc2028/xc3028 tuners"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
Say Y here to include support for the xc2028/xc3028 tuners. Say Y here to include support for the xc2028/xc3028 tuners.
config MEDIA_TUNER_XC5000 config MEDIA_TUNER_XC5000
tristate "Xceive XC5000 silicon tuner" tristate "Xceive XC5000 silicon tuner"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
A driver for the silicon tuner XC5000 from Xceive. A driver for the silicon tuner XC5000 from Xceive.
...@@ -162,7 +164,7 @@ config MEDIA_TUNER_XC5000 ...@@ -162,7 +164,7 @@ config MEDIA_TUNER_XC5000
config MEDIA_TUNER_XC4000 config MEDIA_TUNER_XC4000
tristate "Xceive XC4000 silicon tuner" tristate "Xceive XC4000 silicon tuner"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
A driver for the silicon tuner XC4000 from Xceive. A driver for the silicon tuner XC4000 from Xceive.
...@@ -171,70 +173,70 @@ config MEDIA_TUNER_XC4000 ...@@ -171,70 +173,70 @@ config MEDIA_TUNER_XC4000
config MEDIA_TUNER_MXL5005S config MEDIA_TUNER_MXL5005S
tristate "MaxLinear MSL5005S silicon tuner" tristate "MaxLinear MSL5005S silicon tuner"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
A driver for the silicon tuner MXL5005S from MaxLinear. A driver for the silicon tuner MXL5005S from MaxLinear.
config MEDIA_TUNER_MXL5007T config MEDIA_TUNER_MXL5007T
tristate "MaxLinear MxL5007T silicon tuner" tristate "MaxLinear MxL5007T silicon tuner"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
A driver for the silicon tuner MxL5007T from MaxLinear. A driver for the silicon tuner MxL5007T from MaxLinear.
config MEDIA_TUNER_MC44S803 config MEDIA_TUNER_MC44S803
tristate "Freescale MC44S803 Low Power CMOS Broadband tuners" tristate "Freescale MC44S803 Low Power CMOS Broadband tuners"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
Say Y here to support the Freescale MC44S803 based tuners Say Y here to support the Freescale MC44S803 based tuners
config MEDIA_TUNER_MAX2165 config MEDIA_TUNER_MAX2165
tristate "Maxim MAX2165 silicon tuner" tristate "Maxim MAX2165 silicon tuner"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
A driver for the silicon tuner MAX2165 from Maxim. A driver for the silicon tuner MAX2165 from Maxim.
config MEDIA_TUNER_TDA18218 config MEDIA_TUNER_TDA18218
tristate "NXP TDA18218 silicon tuner" tristate "NXP TDA18218 silicon tuner"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
NXP TDA18218 silicon tuner driver. NXP TDA18218 silicon tuner driver.
config MEDIA_TUNER_FC0011 config MEDIA_TUNER_FC0011
tristate "Fitipower FC0011 silicon tuner" tristate "Fitipower FC0011 silicon tuner"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
Fitipower FC0011 silicon tuner driver. Fitipower FC0011 silicon tuner driver.
config MEDIA_TUNER_FC0012 config MEDIA_TUNER_FC0012
tristate "Fitipower FC0012 silicon tuner" tristate "Fitipower FC0012 silicon tuner"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
Fitipower FC0012 silicon tuner driver. Fitipower FC0012 silicon tuner driver.
config MEDIA_TUNER_FC0013 config MEDIA_TUNER_FC0013
tristate "Fitipower FC0013 silicon tuner" tristate "Fitipower FC0013 silicon tuner"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
Fitipower FC0013 silicon tuner driver. Fitipower FC0013 silicon tuner driver.
config MEDIA_TUNER_TDA18212 config MEDIA_TUNER_TDA18212
tristate "NXP TDA18212 silicon tuner" tristate "NXP TDA18212 silicon tuner"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
NXP TDA18212 silicon tuner driver. NXP TDA18212 silicon tuner driver.
config MEDIA_TUNER_TUA9001 config MEDIA_TUNER_TUA9001
tristate "Infineon TUA 9001 silicon tuner" tristate "Infineon TUA 9001 silicon tuner"
depends on VIDEO_MEDIA && I2C depends on MEDIA_SUPPORT && I2C
default m if MEDIA_TUNER_CUSTOMISE default m if MEDIA_TUNER_CUSTOMISE
help help
Infineon TUA 9001 silicon tuner driver. Infineon TUA 9001 silicon tuner driver.
......
This diff is collapsed.
...@@ -717,6 +717,12 @@ static int xc5000_set_params(struct dvb_frontend *fe) ...@@ -717,6 +717,12 @@ static int xc5000_set_params(struct dvb_frontend *fe)
priv->freq_hz = freq - 1750000; priv->freq_hz = freq - 1750000;
priv->video_standard = DTV6; priv->video_standard = DTV6;
break; break;
case SYS_ISDBT:
/* All ISDB-T are currently for 6 MHz bw */
if (!bw)
bw = 6000000;
/* fall to OFDM handling */
case SYS_DMBTH:
case SYS_DVBT: case SYS_DVBT:
case SYS_DVBT2: case SYS_DVBT2:
dprintk(1, "%s() OFDM\n", __func__); dprintk(1, "%s() OFDM\n", __func__);
......
...@@ -578,6 +578,7 @@ static int demod_attach_drxk(struct ddb_input *input) ...@@ -578,6 +578,7 @@ static int demod_attach_drxk(struct ddb_input *input)
memset(&config, 0, sizeof(config)); memset(&config, 0, sizeof(config));
config.microcode_name = "drxk_a3.mc"; config.microcode_name = "drxk_a3.mc";
config.qam_demod_parameter_count = 4;
config.adr = 0x29 + (input->nr & 1); config.adr = 0x29 + (input->nr & 1);
fe = input->fe = dvb_attach(drxk_attach, &config, i2c); fe = input->fe = dvb_attach(drxk_attach, &config, i2c);
......
...@@ -220,6 +220,7 @@ struct dvb_tuner_ops { ...@@ -220,6 +220,7 @@ struct dvb_tuner_ops {
#define TUNER_STATUS_STEREO 2 #define TUNER_STATUS_STEREO 2
int (*get_status)(struct dvb_frontend *fe, u32 *status); int (*get_status)(struct dvb_frontend *fe, u32 *status);
int (*get_rf_strength)(struct dvb_frontend *fe, u16 *strength); int (*get_rf_strength)(struct dvb_frontend *fe, u16 *strength);
int (*get_afc)(struct dvb_frontend *fe, s32 *afc);
/** These are provided separately from set_params in order to facilitate silicon /** These are provided separately from set_params in order to facilitate silicon
* tuners which require sophisticated tuning loops, controlling each parameter separately. */ * tuners which require sophisticated tuning loops, controlling each parameter separately. */
......
...@@ -418,9 +418,12 @@ config DVB_USB_RTL28XXU ...@@ -418,9 +418,12 @@ config DVB_USB_RTL28XXU
tristate "Realtek RTL28xxU DVB USB support" tristate "Realtek RTL28xxU DVB USB support"
depends on DVB_USB && EXPERIMENTAL depends on DVB_USB && EXPERIMENTAL
select DVB_RTL2830 select DVB_RTL2830
select DVB_RTL2832
select MEDIA_TUNER_QT1010 if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_QT1010 if !MEDIA_TUNER_CUSTOMISE
select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_MT2060 if !MEDIA_TUNER_CUSTOMISE
select MEDIA_TUNER_MXL5005S if !MEDIA_TUNER_CUSTOMISE select MEDIA_TUNER_MXL5005S if !MEDIA_TUNER_CUSTOMISE
select MEDIA_TUNER_FC0012 if !MEDIA_TUNER_CUSTOMISE
select MEDIA_TUNER_FC0013 if !MEDIA_TUNER_CUSTOMISE
help help
Say Y here to support the Realtek RTL28xxU DVB USB receiver. Say Y here to support the Realtek RTL28xxU DVB USB receiver.
......
...@@ -593,9 +593,7 @@ static int az6007_read_mac_addr(struct dvb_usb_device *d, u8 mac[6]) ...@@ -593,9 +593,7 @@ static int az6007_read_mac_addr(struct dvb_usb_device *d, u8 mac[6])
memcpy(mac, st->data, sizeof(mac)); memcpy(mac, st->data, sizeof(mac));
if (ret > 0) if (ret > 0)
deb_info("%s: mac is %02x:%02x:%02x:%02x:%02x:%02x\n", deb_info("%s: mac is %pM\n", __func__, mac);
__func__, mac[0], mac[1], mac[2],
mac[3], mac[4], mac[5]);
return ret; return ret;
} }
......
...@@ -100,6 +100,7 @@ ...@@ -100,6 +100,7 @@
#define USB_PID_CONCEPTRONIC_CTVDIGRCU 0xe397 #define USB_PID_CONCEPTRONIC_CTVDIGRCU 0xe397
#define USB_PID_CONEXANT_D680_DMB 0x86d6 #define USB_PID_CONEXANT_D680_DMB 0x86d6
#define USB_PID_CREATIX_CTX1921 0x1921 #define USB_PID_CREATIX_CTX1921 0x1921
#define USB_PID_DELOCK_USB2_DVBT 0xb803
#define USB_PID_DIBCOM_HOOK_DEFAULT 0x0064 #define USB_PID_DIBCOM_HOOK_DEFAULT 0x0064
#define USB_PID_DIBCOM_HOOK_DEFAULT_REENUM 0x0065 #define USB_PID_DIBCOM_HOOK_DEFAULT_REENUM 0x0065
#define USB_PID_DIBCOM_MOD3000_COLD 0x0bb8 #define USB_PID_DIBCOM_MOD3000_COLD 0x0bb8
...@@ -160,6 +161,7 @@ ...@@ -160,6 +161,7 @@
#define USB_PID_TERRATEC_CINERGY_T_STICK 0x0093 #define USB_PID_TERRATEC_CINERGY_T_STICK 0x0093
#define USB_PID_TERRATEC_CINERGY_T_STICK_RC 0x0097 #define USB_PID_TERRATEC_CINERGY_T_STICK_RC 0x0097
#define USB_PID_TERRATEC_CINERGY_T_STICK_DUAL_RC 0x0099 #define USB_PID_TERRATEC_CINERGY_T_STICK_DUAL_RC 0x0099
#define USB_PID_TERRATEC_CINERGY_T_STICK_BLACK_REV1 0x00a9
#define USB_PID_TWINHAN_VP7041_COLD 0x3201 #define USB_PID_TWINHAN_VP7041_COLD 0x3201
#define USB_PID_TWINHAN_VP7041_WARM 0x3202 #define USB_PID_TWINHAN_VP7041_WARM 0x3202
#define USB_PID_TWINHAN_VP7020_COLD 0x3203 #define USB_PID_TWINHAN_VP7020_COLD 0x3203
...@@ -245,6 +247,7 @@ ...@@ -245,6 +247,7 @@
#define USB_PID_TERRATEC_H7_2 0x10a3 #define USB_PID_TERRATEC_H7_2 0x10a3
#define USB_PID_TERRATEC_T3 0x10a0 #define USB_PID_TERRATEC_T3 0x10a0
#define USB_PID_TERRATEC_T5 0x10a1 #define USB_PID_TERRATEC_T5 0x10a1
#define USB_PID_NOXON_DAB_STICK 0x00b3
#define USB_PID_PINNACLE_EXPRESSCARD_320CX 0x022e #define USB_PID_PINNACLE_EXPRESSCARD_320CX 0x022e
#define USB_PID_PINNACLE_PCTV2000E 0x022c #define USB_PID_PINNACLE_PCTV2000E 0x022c
#define USB_PID_PINNACLE_PCTV_DVB_T_FLASH 0x0228 #define USB_PID_PINNACLE_PCTV_DVB_T_FLASH 0x0228
......
This diff is collapsed.
config DVB_FE_CUSTOMISE config DVB_FE_CUSTOMISE
bool "Customise the frontend modules to build" bool "Customise the frontend modules to build"
depends on DVB_CORE depends on DVB_CORE
depends on EXPERT
default y if EXPERT default y if EXPERT
help help
This allows the user to select/deselect frontend drivers for their This allows the user to select/deselect frontend drivers for their
...@@ -432,6 +433,13 @@ config DVB_RTL2830 ...@@ -432,6 +433,13 @@ config DVB_RTL2830
help help
Say Y when you want to support this frontend. Say Y when you want to support this frontend.
config DVB_RTL2832
tristate "Realtek RTL2832 DVB-T"
depends on DVB_CORE && I2C
default m if DVB_FE_CUSTOMISE
help
Say Y when you want to support this frontend.
comment "DVB-C (cable) frontends" comment "DVB-C (cable) frontends"
depends on DVB_CORE depends on DVB_CORE
......
...@@ -99,6 +99,7 @@ obj-$(CONFIG_DVB_IT913X_FE) += it913x-fe.o ...@@ -99,6 +99,7 @@ obj-$(CONFIG_DVB_IT913X_FE) += it913x-fe.o
obj-$(CONFIG_DVB_A8293) += a8293.o obj-$(CONFIG_DVB_A8293) += a8293.o
obj-$(CONFIG_DVB_TDA10071) += tda10071.o obj-$(CONFIG_DVB_TDA10071) += tda10071.o
obj-$(CONFIG_DVB_RTL2830) += rtl2830.o obj-$(CONFIG_DVB_RTL2830) += rtl2830.o
obj-$(CONFIG_DVB_RTL2832) += rtl2832.o
obj-$(CONFIG_DVB_M88RS2000) += m88rs2000.o obj-$(CONFIG_DVB_M88RS2000) += m88rs2000.o
obj-$(CONFIG_DVB_AF9033) += af9033.o obj-$(CONFIG_DVB_AF9033) += af9033.o
...@@ -21,24 +21,6 @@ ...@@ -21,24 +21,6 @@
#include "dvb_frontend.h" #include "dvb_frontend.h"
#include "a8293.h" #include "a8293.h"
static int debug;
module_param(debug, int, 0644);
MODULE_PARM_DESC(debug, "Turn on/off debugging (default:off).");
#define LOG_PREFIX "a8293"
#undef dbg
#define dbg(f, arg...) \
if (debug) \
printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg)
#undef err
#define err(f, arg...) printk(KERN_ERR LOG_PREFIX": " f "\n" , ## arg)
#undef info
#define info(f, arg...) printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg)
#undef warn
#define warn(f, arg...) printk(KERN_WARNING LOG_PREFIX": " f "\n" , ## arg)
struct a8293_priv { struct a8293_priv {
struct i2c_adapter *i2c; struct i2c_adapter *i2c;
const struct a8293_config *cfg; const struct a8293_config *cfg;
...@@ -65,7 +47,8 @@ static int a8293_i2c(struct a8293_priv *priv, u8 *val, int len, bool rd) ...@@ -65,7 +47,8 @@ static int a8293_i2c(struct a8293_priv *priv, u8 *val, int len, bool rd)
if (ret == 1) { if (ret == 1) {
ret = 0; ret = 0;
} else { } else {
warn("i2c failed=%d rd=%d", ret, rd); dev_warn(&priv->i2c->dev, "%s: i2c failed=%d rd=%d\n",
KBUILD_MODNAME, ret, rd);
ret = -EREMOTEIO; ret = -EREMOTEIO;
} }
...@@ -88,7 +71,8 @@ static int a8293_set_voltage(struct dvb_frontend *fe, ...@@ -88,7 +71,8 @@ static int a8293_set_voltage(struct dvb_frontend *fe,
struct a8293_priv *priv = fe->sec_priv; struct a8293_priv *priv = fe->sec_priv;
int ret; int ret;
dbg("%s: fe_sec_voltage=%d", __func__, fe_sec_voltage); dev_dbg(&priv->i2c->dev, "%s: fe_sec_voltage=%d\n", __func__,
fe_sec_voltage);
switch (fe_sec_voltage) { switch (fe_sec_voltage) {
case SEC_VOLTAGE_OFF: case SEC_VOLTAGE_OFF:
...@@ -114,14 +98,12 @@ static int a8293_set_voltage(struct dvb_frontend *fe, ...@@ -114,14 +98,12 @@ static int a8293_set_voltage(struct dvb_frontend *fe,
return ret; return ret;
err: err:
dbg("%s: failed=%d", __func__, ret); dev_dbg(&priv->i2c->dev, "%s: failed=%d\n", __func__, ret);
return ret; return ret;
} }
static void a8293_release_sec(struct dvb_frontend *fe) static void a8293_release_sec(struct dvb_frontend *fe)
{ {
dbg("%s:", __func__);
a8293_set_voltage(fe, SEC_VOLTAGE_OFF); a8293_set_voltage(fe, SEC_VOLTAGE_OFF);
kfree(fe->sec_priv); kfree(fe->sec_priv);
...@@ -154,7 +136,7 @@ struct dvb_frontend *a8293_attach(struct dvb_frontend *fe, ...@@ -154,7 +136,7 @@ struct dvb_frontend *a8293_attach(struct dvb_frontend *fe,
/* ENB=0 */ /* ENB=0 */
priv->reg[0] = 0x10; priv->reg[0] = 0x10;
ret = a8293_wr(priv, &priv->reg[1], 1); ret = a8293_wr(priv, &priv->reg[0], 1);
if (ret) if (ret)
goto err; goto err;
...@@ -164,16 +146,17 @@ struct dvb_frontend *a8293_attach(struct dvb_frontend *fe, ...@@ -164,16 +146,17 @@ struct dvb_frontend *a8293_attach(struct dvb_frontend *fe,
if (ret) if (ret)
goto err; goto err;
info("Allegro A8293 SEC attached.");
fe->ops.release_sec = a8293_release_sec; fe->ops.release_sec = a8293_release_sec;
/* override frontend ops */ /* override frontend ops */
fe->ops.set_voltage = a8293_set_voltage; fe->ops.set_voltage = a8293_set_voltage;
dev_info(&priv->i2c->dev, "%s: Allegro A8293 SEC attached\n",
KBUILD_MODNAME);
return fe; return fe;
err: err:
dbg("%s: failed=%d", __func__, ret); dev_dbg(&i2c->dev, "%s: failed=%d\n", __func__, ret);
kfree(priv); kfree(priv);
return NULL; return NULL;
} }
......
...@@ -20,6 +20,14 @@ ...@@ -20,6 +20,14 @@
* means that 1=DVBC, 0 = DVBT. Zero means the opposite. * means that 1=DVBC, 0 = DVBT. Zero means the opposite.
* @mpeg_out_clk_strength: DRXK Mpeg output clock drive strength. * @mpeg_out_clk_strength: DRXK Mpeg output clock drive strength.
* @microcode_name: Name of the firmware file with the microcode * @microcode_name: Name of the firmware file with the microcode
* @qam_demod_parameter_count: The number of parameters used for the command
* to set the demodulator parameters. All
* firmwares are using the 2-parameter commmand.
* An exception is the "drxk_a3.mc" firmware,
* which uses the 4-parameter command.
* A value of 0 (default) or lower indicates that
* the correct number of parameters will be
* automatically detected.
* *
* On the *_gpio vars, bit 0 is UIO-1, bit 1 is UIO-2 and bit 2 is * On the *_gpio vars, bit 0 is UIO-1, bit 1 is UIO-2 and bit 2 is
* UIO-3. * UIO-3.
...@@ -38,7 +46,8 @@ struct drxk_config { ...@@ -38,7 +46,8 @@ struct drxk_config {
u8 mpeg_out_clk_strength; u8 mpeg_out_clk_strength;
int chunk_size; int chunk_size;
const char *microcode_name; const char *microcode_name;
int qam_demod_parameter_count;
}; };
#if defined(CONFIG_DVB_DRXK) || (defined(CONFIG_DVB_DRXK_MODULE) \ #if defined(CONFIG_DVB_DRXK) || (defined(CONFIG_DVB_DRXK_MODULE) \
......
This diff is collapsed.
...@@ -94,7 +94,15 @@ enum DRXPowerMode { ...@@ -94,7 +94,15 @@ enum DRXPowerMode {
enum AGC_CTRL_MODE { DRXK_AGC_CTRL_AUTO = 0, DRXK_AGC_CTRL_USER, DRXK_AGC_CTRL_OFF }; enum AGC_CTRL_MODE { DRXK_AGC_CTRL_AUTO = 0, DRXK_AGC_CTRL_USER, DRXK_AGC_CTRL_OFF };
enum EDrxkState { DRXK_UNINITIALIZED = 0, DRXK_STOPPED, DRXK_DTV_STARTED, DRXK_ATV_STARTED, DRXK_POWERED_DOWN }; enum EDrxkState {
DRXK_UNINITIALIZED = 0,
DRXK_STOPPED,
DRXK_DTV_STARTED,
DRXK_ATV_STARTED,
DRXK_POWERED_DOWN,
DRXK_NO_DEV /* If drxk init failed */
};
enum EDrxkCoefArrayIndex { enum EDrxkCoefArrayIndex {
DRXK_COEF_IDX_MN = 0, DRXK_COEF_IDX_MN = 0,
DRXK_COEF_IDX_FM , DRXK_COEF_IDX_FM ,
...@@ -325,6 +333,9 @@ struct drxk_state { ...@@ -325,6 +333,9 @@ struct drxk_state {
enum DRXPowerMode m_currentPowerMode; enum DRXPowerMode m_currentPowerMode;
/* when true, avoids other devices to use the I2C bus */
bool drxk_i2c_exclusive_lock;
/* /*
* Configurable parameters at the driver. They stores the values found * Configurable parameters at the driver. They stores the values found
* at struct drxk_config. * at struct drxk_config.
...@@ -338,7 +349,11 @@ struct drxk_state { ...@@ -338,7 +349,11 @@ struct drxk_state {
bool antenna_dvbt; bool antenna_dvbt;
u16 antenna_gpio; u16 antenna_gpio;
/* Firmware */
const char *microcode_name; const char *microcode_name;
struct completion fw_wait_load;
const struct firmware *fw;
int qam_demod_parameter_count;
}; };
#define NEVER_LOCK 0 #define NEVER_LOCK 0
......
This diff is collapsed.
/*
* Realtek RTL2832 DVB-T demodulator driver
*
* Copyright (C) 2012 Thomas Mair <thomas.mair86@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef RTL2832_H
#define RTL2832_H
#include <linux/dvb/frontend.h>
struct rtl2832_config {
/*
* Demodulator I2C address.
*/
u8 i2c_addr;
/*
* Xtal frequency.
* Hz
* 4000000, 16000000, 25000000, 28800000
*/
u32 xtal;
/*
* IFs for all used modes.
* Hz
* 4570000, 4571429, 36000000, 36125000, 36166667, 44000000
*/
u32 if_dvbt;
/*
*/
u8 tuner;
};
#if defined(CONFIG_DVB_RTL2832) || \
(defined(CONFIG_DVB_RTL2832_MODULE) && defined(MODULE))
extern struct dvb_frontend *rtl2832_attach(
const struct rtl2832_config *cfg,
struct i2c_adapter *i2c
);
extern struct i2c_adapter *rtl2832_get_tuner_i2c_adapter(
struct dvb_frontend *fe
);
#else
static inline struct dvb_frontend *rtl2832_attach(
const struct rtl2832_config *config,
struct i2c_adapter *i2c
)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return NULL;
}
#endif
#endif /* RTL2832_H */
/*
* Realtek RTL2832 DVB-T demodulator driver
*
* Copyright (C) 2012 Thomas Mair <thomas.mair86@gmail.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/
#ifndef RTL2832_PRIV_H
#define RTL2832_PRIV_H
#include "dvb_frontend.h"
#include "rtl2832.h"
#define LOG_PREFIX "rtl2832"
#undef dbg
#define dbg(f, arg...) \
do { \
if (rtl2832_debug) \
printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg); \
} while (0)
#undef err
#define err(f, arg...) printk(KERN_ERR LOG_PREFIX": " f "\n" , ## arg)
#undef info
#define info(f, arg...) printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg)
#undef warn
#define warn(f, arg...) printk(KERN_WARNING LOG_PREFIX": " f "\n" , ## arg)
struct rtl2832_priv {
struct i2c_adapter *i2c;
struct dvb_frontend fe;
struct rtl2832_config cfg;
bool i2c_gate_state;
bool sleeping;
u8 tuner;
u8 page; /* active register page */
};
struct rtl2832_reg_entry {
u8 page;
u8 start_address;
u8 msb;
u8 lsb;
};
struct rtl2832_reg_value {
int reg;
u32 value;
};
/* Demod register bit names */
enum DVBT_REG_BIT_NAME {
DVBT_SOFT_RST,
DVBT_IIC_REPEAT,
DVBT_TR_WAIT_MIN_8K,
DVBT_RSD_BER_FAIL_VAL,
DVBT_EN_BK_TRK,
DVBT_REG_PI,
DVBT_REG_PFREQ_1_0,
DVBT_PD_DA8,
DVBT_LOCK_TH,
DVBT_BER_PASS_SCAL,
DVBT_CE_FFSM_BYPASS,
DVBT_ALPHAIIR_N,
DVBT_ALPHAIIR_DIF,
DVBT_EN_TRK_SPAN,
DVBT_LOCK_TH_LEN,
DVBT_CCI_THRE,
DVBT_CCI_MON_SCAL,
DVBT_CCI_M0,
DVBT_CCI_M1,
DVBT_CCI_M2,
DVBT_CCI_M3,
DVBT_SPEC_INIT_0,
DVBT_SPEC_INIT_1,
DVBT_SPEC_INIT_2,
DVBT_AD_EN_REG,
DVBT_AD_EN_REG1,
DVBT_EN_BBIN,
DVBT_MGD_THD0,
DVBT_MGD_THD1,
DVBT_MGD_THD2,
DVBT_MGD_THD3,
DVBT_MGD_THD4,
DVBT_MGD_THD5,
DVBT_MGD_THD6,
DVBT_MGD_THD7,
DVBT_EN_CACQ_NOTCH,
DVBT_AD_AV_REF,
DVBT_PIP_ON,
DVBT_SCALE1_B92,
DVBT_SCALE1_B93,
DVBT_SCALE1_BA7,
DVBT_SCALE1_BA9,
DVBT_SCALE1_BAA,
DVBT_SCALE1_BAB,
DVBT_SCALE1_BAC,
DVBT_SCALE1_BB0,
DVBT_SCALE1_BB1,
DVBT_KB_P1,
DVBT_KB_P2,
DVBT_KB_P3,
DVBT_OPT_ADC_IQ,
DVBT_AD_AVI,
DVBT_AD_AVQ,
DVBT_K1_CR_STEP12,
DVBT_TRK_KS_P2,
DVBT_TRK_KS_I2,
DVBT_TR_THD_SET2,
DVBT_TRK_KC_P2,
DVBT_TRK_KC_I2,
DVBT_CR_THD_SET2,
DVBT_PSET_IFFREQ,
DVBT_SPEC_INV,
DVBT_BW_INDEX,
DVBT_RSAMP_RATIO,
DVBT_CFREQ_OFF_RATIO,
DVBT_FSM_STAGE,
DVBT_RX_CONSTEL,
DVBT_RX_HIER,
DVBT_RX_C_RATE_LP,
DVBT_RX_C_RATE_HP,
DVBT_GI_IDX,
DVBT_FFT_MODE_IDX,
DVBT_RSD_BER_EST,
DVBT_CE_EST_EVM,
DVBT_RF_AGC_VAL,
DVBT_IF_AGC_VAL,
DVBT_DAGC_VAL,
DVBT_SFREQ_OFF,
DVBT_CFREQ_OFF,
DVBT_POLAR_RF_AGC,
DVBT_POLAR_IF_AGC,
DVBT_AAGC_HOLD,
DVBT_EN_RF_AGC,
DVBT_EN_IF_AGC,
DVBT_IF_AGC_MIN,
DVBT_IF_AGC_MAX,
DVBT_RF_AGC_MIN,
DVBT_RF_AGC_MAX,
DVBT_IF_AGC_MAN,
DVBT_IF_AGC_MAN_VAL,
DVBT_RF_AGC_MAN,
DVBT_RF_AGC_MAN_VAL,
DVBT_DAGC_TRG_VAL,
DVBT_AGC_TARG_VAL,
DVBT_LOOP_GAIN_3_0,
DVBT_LOOP_GAIN_4,
DVBT_VTOP,
DVBT_KRF,
DVBT_AGC_TARG_VAL_0,
DVBT_AGC_TARG_VAL_8_1,
DVBT_AAGC_LOOP_GAIN,
DVBT_LOOP_GAIN2_3_0,
DVBT_LOOP_GAIN2_4,
DVBT_LOOP_GAIN3,
DVBT_VTOP1,
DVBT_VTOP2,
DVBT_VTOP3,
DVBT_KRF1,
DVBT_KRF2,
DVBT_KRF3,
DVBT_KRF4,
DVBT_EN_GI_PGA,
DVBT_THD_LOCK_UP,
DVBT_THD_LOCK_DW,
DVBT_THD_UP1,
DVBT_THD_DW1,
DVBT_INTER_CNT_LEN,
DVBT_GI_PGA_STATE,
DVBT_EN_AGC_PGA,
DVBT_CKOUTPAR,
DVBT_CKOUT_PWR,
DVBT_SYNC_DUR,
DVBT_ERR_DUR,
DVBT_SYNC_LVL,
DVBT_ERR_LVL,
DVBT_VAL_LVL,
DVBT_SERIAL,
DVBT_SER_LSB,
DVBT_CDIV_PH0,
DVBT_CDIV_PH1,
DVBT_MPEG_IO_OPT_2_2,
DVBT_MPEG_IO_OPT_1_0,
DVBT_CKOUTPAR_PIP,
DVBT_CKOUT_PWR_PIP,
DVBT_SYNC_LVL_PIP,
DVBT_ERR_LVL_PIP,
DVBT_VAL_LVL_PIP,
DVBT_CKOUTPAR_PID,
DVBT_CKOUT_PWR_PID,
DVBT_SYNC_LVL_PID,
DVBT_ERR_LVL_PID,
DVBT_VAL_LVL_PID,
DVBT_SM_PASS,
DVBT_UPDATE_REG_2,
DVBT_BTHD_P3,
DVBT_BTHD_D3,
DVBT_FUNC4_REG0,
DVBT_FUNC4_REG1,
DVBT_FUNC4_REG2,
DVBT_FUNC4_REG3,
DVBT_FUNC4_REG4,
DVBT_FUNC4_REG5,
DVBT_FUNC4_REG6,
DVBT_FUNC4_REG7,
DVBT_FUNC4_REG8,
DVBT_FUNC4_REG9,
DVBT_FUNC4_REG10,
DVBT_FUNC5_REG0,
DVBT_FUNC5_REG1,
DVBT_FUNC5_REG2,
DVBT_FUNC5_REG3,
DVBT_FUNC5_REG4,
DVBT_FUNC5_REG5,
DVBT_FUNC5_REG6,
DVBT_FUNC5_REG7,
DVBT_FUNC5_REG8,
DVBT_FUNC5_REG9,
DVBT_FUNC5_REG10,
DVBT_FUNC5_REG11,
DVBT_FUNC5_REG12,
DVBT_FUNC5_REG13,
DVBT_FUNC5_REG14,
DVBT_FUNC5_REG15,
DVBT_FUNC5_REG16,
DVBT_FUNC5_REG17,
DVBT_FUNC5_REG18,
DVBT_AD7_SETTING,
DVBT_RSSI_R,
DVBT_ACI_DET_IND,
DVBT_REG_MON,
DVBT_REG_MONSEL,
DVBT_REG_GPE,
DVBT_REG_GPO,
DVBT_REG_4MSEL,
DVBT_TEST_REG_1,
DVBT_TEST_REG_2,
DVBT_TEST_REG_3,
DVBT_TEST_REG_4,
DVBT_REG_BIT_NAME_ITEM_TERMINATOR,
};
#endif /* RTL2832_PRIV_H */
...@@ -634,7 +634,6 @@ static int s5h1420_set_frontend(struct dvb_frontend *fe) ...@@ -634,7 +634,6 @@ static int s5h1420_set_frontend(struct dvb_frontend *fe)
struct s5h1420_state* state = fe->demodulator_priv; struct s5h1420_state* state = fe->demodulator_priv;
int frequency_delta; int frequency_delta;
struct dvb_frontend_tune_settings fesettings; struct dvb_frontend_tune_settings fesettings;
uint8_t clock_setting;
dprintk("enter %s\n", __func__); dprintk("enter %s\n", __func__);
...@@ -679,25 +678,6 @@ static int s5h1420_set_frontend(struct dvb_frontend *fe) ...@@ -679,25 +678,6 @@ static int s5h1420_set_frontend(struct dvb_frontend *fe)
else else
state->fclk = 44000000; state->fclk = 44000000;
/* Clock */
switch (state->fclk) {
default:
case 88000000:
clock_setting = 80;
break;
case 86000000:
clock_setting = 78;
break;
case 80000000:
clock_setting = 72;
break;
case 59000000:
clock_setting = 51;
break;
case 44000000:
clock_setting = 36;
break;
}
dprintk("pll01: %d, ToneFreq: %d\n", state->fclk/1000000 - 8, (state->fclk + (TONE_FREQ * 32) - 1) / (TONE_FREQ * 32)); dprintk("pll01: %d, ToneFreq: %d\n", state->fclk/1000000 - 8, (state->fclk + (TONE_FREQ * 32) - 1) / (TONE_FREQ * 32));
s5h1420_writereg(state, PLL01, state->fclk/1000000 - 8); s5h1420_writereg(state, PLL01, state->fclk/1000000 - 8);
s5h1420_writereg(state, PLL02, 0x40); s5h1420_writereg(state, PLL02, 0x40);
......
...@@ -1129,7 +1129,6 @@ static int stb0899_read_ber(struct dvb_frontend *fe, u32 *ber) ...@@ -1129,7 +1129,6 @@ static int stb0899_read_ber(struct dvb_frontend *fe, u32 *ber)
struct stb0899_internal *internal = &state->internal; struct stb0899_internal *internal = &state->internal;
u8 lsb, msb; u8 lsb, msb;
u32 i;
*ber = 0; *ber = 0;
...@@ -1137,14 +1136,9 @@ static int stb0899_read_ber(struct dvb_frontend *fe, u32 *ber) ...@@ -1137,14 +1136,9 @@ static int stb0899_read_ber(struct dvb_frontend *fe, u32 *ber)
case SYS_DVBS: case SYS_DVBS:
case SYS_DSS: case SYS_DSS:
if (internal->lock) { if (internal->lock) {
/* average 5 BER values */ lsb = stb0899_read_reg(state, STB0899_ECNT1L);
for (i = 0; i < 5; i++) { msb = stb0899_read_reg(state, STB0899_ECNT1M);
msleep(100); *ber = MAKEWORD16(msb, lsb);
lsb = stb0899_read_reg(state, STB0899_ECNT1L);
msb = stb0899_read_reg(state, STB0899_ECNT1M);
*ber += MAKEWORD16(msb, lsb);
}
*ber /= 5;
/* Viterbi Check */ /* Viterbi Check */
if (STB0899_GETFIELD(VSTATUS_PRFVIT, internal->v_status)) { if (STB0899_GETFIELD(VSTATUS_PRFVIT, internal->v_status)) {
/* Error Rate */ /* Error Rate */
...@@ -1157,13 +1151,9 @@ static int stb0899_read_ber(struct dvb_frontend *fe, u32 *ber) ...@@ -1157,13 +1151,9 @@ static int stb0899_read_ber(struct dvb_frontend *fe, u32 *ber)
break; break;
case SYS_DVBS2: case SYS_DVBS2:
if (internal->lock) { if (internal->lock) {
/* Average 5 PER values */ lsb = stb0899_read_reg(state, STB0899_ECNT1L);
for (i = 0; i < 5; i++) { msb = stb0899_read_reg(state, STB0899_ECNT1M);
msleep(100); *ber = MAKEWORD16(msb, lsb);
lsb = stb0899_read_reg(state, STB0899_ECNT1L);
msb = stb0899_read_reg(state, STB0899_ECNT1M);
*ber += MAKEWORD16(msb, lsb);
}
/* ber = ber * 10 ^ 7 */ /* ber = ber * 10 ^ 7 */
*ber *= 10000000; *ber *= 10000000;
*ber /= (-1 + (1 << (4 + 2 * STB0899_GETFIELD(NOE, internal->err_ctrl)))); *ber /= (-1 + (1 << (4 + 2 * STB0899_GETFIELD(NOE, internal->err_ctrl))));
......
...@@ -1584,7 +1584,7 @@ static int stv0367ter_algo(struct dvb_frontend *fe) ...@@ -1584,7 +1584,7 @@ static int stv0367ter_algo(struct dvb_frontend *fe)
struct stv0367ter_state *ter_state = state->ter_state; struct stv0367ter_state *ter_state = state->ter_state;
int offset = 0, tempo = 0; int offset = 0, tempo = 0;
u8 u_var; u8 u_var;
u8 /*constell,*/ counter, tps_rcvd[2]; u8 /*constell,*/ counter;
s8 step; s8 step;
s32 timing_offset = 0; s32 timing_offset = 0;
u32 trl_nomrate = 0, InternalFreq = 0, temp = 0; u32 trl_nomrate = 0, InternalFreq = 0, temp = 0;
...@@ -1709,9 +1709,6 @@ static int stv0367ter_algo(struct dvb_frontend *fe) ...@@ -1709,9 +1709,6 @@ static int stv0367ter_algo(struct dvb_frontend *fe)
return 0; return 0;
ter_state->state = FE_TER_LOCKOK; ter_state->state = FE_TER_LOCKOK;
/* update results */
tps_rcvd[0] = stv0367_readreg(state, R367TER_TPS_RCVD2);
tps_rcvd[1] = stv0367_readreg(state, R367TER_TPS_RCVD3);
ter_state->mode = stv0367_readbits(state, F367TER_SYR_MODE); ter_state->mode = stv0367_readbits(state, F367TER_SYR_MODE);
ter_state->guard = stv0367_readbits(state, F367TER_SYR_GUARD); ter_state->guard = stv0367_readbits(state, F367TER_SYR_GUARD);
......
...@@ -3172,7 +3172,7 @@ static enum stv090x_signal_state stv090x_algo(struct stv090x_state *state) ...@@ -3172,7 +3172,7 @@ static enum stv090x_signal_state stv090x_algo(struct stv090x_state *state)
enum stv090x_signal_state signal_state = STV090x_NOCARRIER; enum stv090x_signal_state signal_state = STV090x_NOCARRIER;
u32 reg; u32 reg;
s32 agc1_power, power_iq = 0, i; s32 agc1_power, power_iq = 0, i;
int lock = 0, low_sr = 0, no_signal = 0; int lock = 0, low_sr = 0;
reg = STV090x_READ_DEMOD(state, TSCFGH); reg = STV090x_READ_DEMOD(state, TSCFGH);
STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 1); /* Stop path 1 stream merger */ STV090x_SETFIELD_Px(reg, RST_HWARE_FIELD, 1); /* Stop path 1 stream merger */
...@@ -3413,7 +3413,7 @@ static enum stv090x_signal_state stv090x_algo(struct stv090x_state *state) ...@@ -3413,7 +3413,7 @@ static enum stv090x_signal_state stv090x_algo(struct stv090x_state *state)
goto err; goto err;
} else { } else {
signal_state = STV090x_NODATA; signal_state = STV090x_NODATA;
no_signal = stv090x_chk_signal(state); stv090x_chk_signal(state);
} }
} }
return signal_state; return signal_state;
......
This diff is collapsed.
...@@ -25,19 +25,6 @@ ...@@ -25,19 +25,6 @@
#include "tda10071.h" #include "tda10071.h"
#include <linux/firmware.h> #include <linux/firmware.h>
#define LOG_PREFIX "tda10071"
#undef dbg
#define dbg(f, arg...) \
if (tda10071_debug) \
printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg)
#undef err
#define err(f, arg...) printk(KERN_ERR LOG_PREFIX": " f "\n" , ## arg)
#undef info
#define info(f, arg...) printk(KERN_INFO LOG_PREFIX": " f "\n" , ## arg)
#undef warn
#define warn(f, arg...) printk(KERN_WARNING LOG_PREFIX": " f "\n" , ## arg)
struct tda10071_priv { struct tda10071_priv {
struct i2c_adapter *i2c; struct i2c_adapter *i2c;
struct dvb_frontend fe; struct dvb_frontend fe;
...@@ -112,7 +99,7 @@ struct tda10071_reg_val_mask { ...@@ -112,7 +99,7 @@ struct tda10071_reg_val_mask {
#define CMD_BER_UPDATE_COUNTERS 0x3f #define CMD_BER_UPDATE_COUNTERS 0x3f
/* firmare command struct */ /* firmare command struct */
#define TDA10071_ARGLEN 0x1e #define TDA10071_ARGLEN 30
struct tda10071_cmd { struct tda10071_cmd {
u8 args[TDA10071_ARGLEN]; u8 args[TDA10071_ARGLEN];
u8 len; u8 len;
......
...@@ -217,6 +217,7 @@ static int demod_attach_drxk(struct ngene_channel *chan, ...@@ -217,6 +217,7 @@ static int demod_attach_drxk(struct ngene_channel *chan,
memset(&config, 0, sizeof(config)); memset(&config, 0, sizeof(config));
config.microcode_name = "drxk_a3.mc"; config.microcode_name = "drxk_a3.mc";
config.qam_demod_parameter_count = 4;
config.adr = 0x29 + (chan->number ^ 2); config.adr = 0x29 + (chan->number ^ 2);
chan->fe = dvb_attach(drxk_attach, &config, i2c); chan->fe = dvb_attach(drxk_attach, &config, i2c);
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
menuconfig RADIO_ADAPTERS menuconfig RADIO_ADAPTERS
bool "Radio Adapters" bool "Radio Adapters"
depends on VIDEO_V4L2 depends on VIDEO_V4L2
depends on MEDIA_RADIO_SUPPORT
default y default y
---help--- ---help---
Say Y here to enable selecting AM/FM radio adapters. Say Y here to enable selecting AM/FM radio adapters.
......
#ifndef __LM7000_H
#define __LM7000_H
/* Sanyo LM7000 tuner chip control
*
* Copyright 2012 Ondrej Zary <linux@rainbow-software.org>
* based on radio-aimslab.c by M. Kirkwood
* and radio-sf16fmi.c by M. Kirkwood and Petr Vandrovec
*/
#define LM7000_DATA (1 << 0)
#define LM7000_CLK (1 << 1)
#define LM7000_CE (1 << 2)
#define LM7000_FM_100 (0 << 20)
#define LM7000_FM_50 (1 << 20)
#define LM7000_FM_25 (2 << 20)
#define LM7000_BIT_FM (1 << 23)
static inline void lm7000_set_freq(u32 freq, void *handle,
void (*set_pins)(void *handle, u8 pins))
{
int i;
u8 data;
u32 val;
freq += 171200; /* Add 10.7 MHz IF */
freq /= 400; /* Convert to 25 kHz units */
val = freq | LM7000_FM_25 | LM7000_BIT_FM;
/* write the 24-bit register, starting with LSB */
for (i = 0; i < 24; i++) {
data = val & (1 << i) ? LM7000_DATA : 0;
set_pins(handle, data | LM7000_CE);
udelay(2);
set_pins(handle, data | LM7000_CE | LM7000_CLK);
udelay(2);
set_pins(handle, data | LM7000_CE);
udelay(2);
}
set_pins(handle, 0);
}
#endif /* __LM7000_H */
...@@ -37,6 +37,7 @@ ...@@ -37,6 +37,7 @@
#include <media/v4l2-ioctl.h> #include <media/v4l2-ioctl.h>
#include <media/v4l2-ctrls.h> #include <media/v4l2-ctrls.h>
#include "radio-isa.h" #include "radio-isa.h"
#include "lm7000.h"
MODULE_AUTHOR("M. Kirkwood"); MODULE_AUTHOR("M. Kirkwood");
MODULE_DESCRIPTION("A driver for the RadioTrack/RadioReveal radio card."); MODULE_DESCRIPTION("A driver for the RadioTrack/RadioReveal radio card.");
...@@ -72,55 +73,38 @@ static struct radio_isa_card *rtrack_alloc(void) ...@@ -72,55 +73,38 @@ static struct radio_isa_card *rtrack_alloc(void)
return rt ? &rt->isa : NULL; return rt ? &rt->isa : NULL;
} }
/* The 128+64 on these outb's is to keep the volume stable while tuning. #define AIMS_BIT_TUN_CE (1 << 0)
* Without them, the volume _will_ creep up with each frequency change #define AIMS_BIT_TUN_CLK (1 << 1)
* and bit 4 (+16) is to keep the signal strength meter enabled. #define AIMS_BIT_TUN_DATA (1 << 2)
*/ #define AIMS_BIT_VOL_CE (1 << 3)
#define AIMS_BIT_TUN_STRQ (1 << 4)
/* bit 5 is not connected */
#define AIMS_BIT_VOL_UP (1 << 6) /* active low */
#define AIMS_BIT_VOL_DN (1 << 7) /* active low */
static void send_0_byte(struct radio_isa_card *isa, int on) void rtrack_set_pins(void *handle, u8 pins)
{ {
outb_p(128+64+16+on+1, isa->io); /* wr-enable + data low */ struct radio_isa_card *isa = handle;
outb_p(128+64+16+on+2+1, isa->io); /* clock */ struct rtrack *rt = container_of(isa, struct rtrack, isa);
msleep(1); u8 bits = AIMS_BIT_VOL_DN | AIMS_BIT_VOL_UP | AIMS_BIT_TUN_STRQ;
}
static void send_1_byte(struct radio_isa_card *isa, int on) if (!v4l2_ctrl_g_ctrl(rt->isa.mute))
{ bits |= AIMS_BIT_VOL_CE;
outb_p(128+64+16+on+4+1, isa->io); /* wr-enable+data high */
outb_p(128+64+16+on+4+2+1, isa->io); /* clock */ if (pins & LM7000_DATA)
msleep(1); bits |= AIMS_BIT_TUN_DATA;
if (pins & LM7000_CLK)
bits |= AIMS_BIT_TUN_CLK;
if (pins & LM7000_CE)
bits |= AIMS_BIT_TUN_CE;
outb_p(bits, rt->isa.io);
} }
static int rtrack_s_frequency(struct radio_isa_card *isa, u32 freq) static int rtrack_s_frequency(struct radio_isa_card *isa, u32 freq)
{ {
int on = v4l2_ctrl_g_ctrl(isa->mute) ? 0 : 8; lm7000_set_freq(freq, isa, rtrack_set_pins);
int i;
freq += 171200; /* Add 10.7 MHz IF */
freq /= 800; /* Convert to 50 kHz units */
send_0_byte(isa, on); /* 0: LSB of frequency */
for (i = 0; i < 13; i++) /* : frequency bits (1-13) */
if (freq & (1 << i))
send_1_byte(isa, on);
else
send_0_byte(isa, on);
send_0_byte(isa, on); /* 14: test bit - always 0 */
send_0_byte(isa, on); /* 15: test bit - always 0 */
send_0_byte(isa, on); /* 16: band data 0 - always 0 */
send_0_byte(isa, on); /* 17: band data 1 - always 0 */
send_0_byte(isa, on); /* 18: band data 2 - always 0 */
send_0_byte(isa, on); /* 19: time base - always 0 */
send_0_byte(isa, on); /* 20: spacing (0 = 25 kHz) */
send_1_byte(isa, on); /* 21: spacing (1 = 25 kHz) */
send_0_byte(isa, on); /* 22: spacing (0 = 25 kHz) */
send_1_byte(isa, on); /* 23: AM/FM (FM = 1, always) */
outb(0xd0 + on, isa->io); /* volume steady + sigstr */
return 0; return 0;
} }
......
...@@ -295,7 +295,8 @@ static int vidioc_g_tuner(struct file *file, void *priv, ...@@ -295,7 +295,8 @@ static int vidioc_g_tuner(struct file *file, void *priv,
v->type = V4L2_TUNER_RADIO; v->type = V4L2_TUNER_RADIO;
v->rangelow = FREQ_MIN * FREQ_MUL; v->rangelow = FREQ_MIN * FREQ_MUL;
v->rangehigh = FREQ_MAX * FREQ_MUL; v->rangehigh = FREQ_MAX * FREQ_MUL;
v->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO; v->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO |
V4L2_TUNER_CAP_HWSEEK_WRAP;
v->rxsubchans = is_stereo ? V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO; v->rxsubchans = is_stereo ? V4L2_TUNER_SUB_STEREO : V4L2_TUNER_SUB_MONO;
v->audmode = radio->stereo ? v->audmode = radio->stereo ?
V4L2_TUNER_MODE_STEREO : V4L2_TUNER_MODE_MONO; V4L2_TUNER_MODE_STEREO : V4L2_TUNER_MODE_MONO;
...@@ -372,7 +373,7 @@ static int vidioc_s_hw_freq_seek(struct file *file, void *priv, ...@@ -372,7 +373,7 @@ static int vidioc_s_hw_freq_seek(struct file *file, void *priv,
timeout = jiffies + msecs_to_jiffies(30000); timeout = jiffies + msecs_to_jiffies(30000);
for (;;) { for (;;) {
if (time_after(jiffies, timeout)) { if (time_after(jiffies, timeout)) {
retval = -EAGAIN; retval = -ENODATA;
break; break;
} }
if (schedule_timeout_interruptible(msecs_to_jiffies(10))) { if (schedule_timeout_interruptible(msecs_to_jiffies(10))) {
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include <linux/io.h> /* outb, outb_p */ #include <linux/io.h> /* outb, outb_p */
#include <media/v4l2-device.h> #include <media/v4l2-device.h>
#include <media/v4l2-ioctl.h> #include <media/v4l2-ioctl.h>
#include "lm7000.h"
MODULE_AUTHOR("Petr Vandrovec, vandrove@vc.cvut.cz and M. Kirkwood"); MODULE_AUTHOR("Petr Vandrovec, vandrove@vc.cvut.cz and M. Kirkwood");
MODULE_DESCRIPTION("A driver for the SF16-FMI, SF16-FMP and SF16-FMD radio."); MODULE_DESCRIPTION("A driver for the SF16-FMI, SF16-FMP and SF16-FMD radio.");
...@@ -54,31 +55,33 @@ static struct fmi fmi_card; ...@@ -54,31 +55,33 @@ static struct fmi fmi_card;
static struct pnp_dev *dev; static struct pnp_dev *dev;
bool pnp_attached; bool pnp_attached;
/* freq is in 1/16 kHz to internal number, hw precision is 50 kHz */
/* It is only useful to give freq in interval of 800 (=0.05Mhz),
* other bits will be truncated, e.g 92.7400016 -> 92.7, but
* 92.7400017 -> 92.75
*/
#define RSF16_ENCODE(x) ((x) / 800 + 214)
#define RSF16_MINFREQ (87 * 16000) #define RSF16_MINFREQ (87 * 16000)
#define RSF16_MAXFREQ (108 * 16000) #define RSF16_MAXFREQ (108 * 16000)
static void outbits(int bits, unsigned int data, int io) #define FMI_BIT_TUN_CE (1 << 0)
#define FMI_BIT_TUN_CLK (1 << 1)
#define FMI_BIT_TUN_DATA (1 << 2)
#define FMI_BIT_VOL_SW (1 << 3)
#define FMI_BIT_TUN_STRQ (1 << 4)
void fmi_set_pins(void *handle, u8 pins)
{ {
while (bits--) { struct fmi *fmi = handle;
if (data & 1) { u8 bits = FMI_BIT_TUN_STRQ;
outb(5, io);
udelay(6); if (!fmi->mute)
outb(7, io); bits |= FMI_BIT_VOL_SW;
udelay(6);
} else { if (pins & LM7000_DATA)
outb(1, io); bits |= FMI_BIT_TUN_DATA;
udelay(6); if (pins & LM7000_CLK)
outb(3, io); bits |= FMI_BIT_TUN_CLK;
udelay(6); if (pins & LM7000_CE)
} bits |= FMI_BIT_TUN_CE;
data >>= 1;
} mutex_lock(&fmi->lock);
outb_p(bits, fmi->io);
mutex_unlock(&fmi->lock);
} }
static inline void fmi_mute(struct fmi *fmi) static inline void fmi_mute(struct fmi *fmi)
...@@ -95,20 +98,6 @@ static inline void fmi_unmute(struct fmi *fmi) ...@@ -95,20 +98,6 @@ static inline void fmi_unmute(struct fmi *fmi)
mutex_unlock(&fmi->lock); mutex_unlock(&fmi->lock);
} }
static inline int fmi_setfreq(struct fmi *fmi, unsigned long freq)
{
mutex_lock(&fmi->lock);
fmi->curfreq = freq;
outbits(16, RSF16_ENCODE(freq), fmi->io);
outbits(8, 0xC0, fmi->io);
msleep(143); /* was schedule_timeout(HZ/7) */
mutex_unlock(&fmi->lock);
if (!fmi->mute)
fmi_unmute(fmi);
return 0;
}
static inline int fmi_getsigstr(struct fmi *fmi) static inline int fmi_getsigstr(struct fmi *fmi)
{ {
int val; int val;
...@@ -173,7 +162,7 @@ static int vidioc_s_frequency(struct file *file, void *priv, ...@@ -173,7 +162,7 @@ static int vidioc_s_frequency(struct file *file, void *priv,
return -EINVAL; return -EINVAL;
/* rounding in steps of 800 to match the freq /* rounding in steps of 800 to match the freq
that will be used */ that will be used */
fmi_setfreq(fmi, (f->frequency / 800) * 800); lm7000_set_freq((f->frequency / 800) * 800, fmi, fmi_set_pins);
return 0; return 0;
} }
......
...@@ -1514,7 +1514,8 @@ static int wl1273_fm_vidioc_g_tuner(struct file *file, void *priv, ...@@ -1514,7 +1514,8 @@ static int wl1273_fm_vidioc_g_tuner(struct file *file, void *priv,
tuner->rangehigh = WL1273_FREQ(WL1273_BAND_OTHER_HIGH); tuner->rangehigh = WL1273_FREQ(WL1273_BAND_OTHER_HIGH);
tuner->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_RDS | tuner->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_RDS |
V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_RDS_BLOCK_IO; V4L2_TUNER_CAP_STEREO | V4L2_TUNER_CAP_RDS_BLOCK_IO |
V4L2_TUNER_CAP_HWSEEK_BOUNDED | V4L2_TUNER_CAP_HWSEEK_WRAP;
if (radio->stereo) if (radio->stereo)
tuner->audmode = V4L2_TUNER_MODE_STEREO; tuner->audmode = V4L2_TUNER_MODE_STEREO;
......
...@@ -363,7 +363,7 @@ static int si470x_set_seek(struct si470x_device *radio, ...@@ -363,7 +363,7 @@ static int si470x_set_seek(struct si470x_device *radio,
/* try again, if timed out */ /* try again, if timed out */
if (retval == 0 && timed_out) if (retval == 0 && timed_out)
return -EAGAIN; return -ENODATA;
return retval; return retval;
} }
...@@ -596,7 +596,9 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv, ...@@ -596,7 +596,9 @@ static int si470x_vidioc_g_tuner(struct file *file, void *priv,
strcpy(tuner->name, "FM"); strcpy(tuner->name, "FM");
tuner->type = V4L2_TUNER_RADIO; tuner->type = V4L2_TUNER_RADIO;
tuner->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO | tuner->capability = V4L2_TUNER_CAP_LOW | V4L2_TUNER_CAP_STEREO |
V4L2_TUNER_CAP_RDS | V4L2_TUNER_CAP_RDS_BLOCK_IO; V4L2_TUNER_CAP_RDS | V4L2_TUNER_CAP_RDS_BLOCK_IO |
V4L2_TUNER_CAP_HWSEEK_BOUNDED |
V4L2_TUNER_CAP_HWSEEK_WRAP;
/* range limits */ /* range limits */
switch ((radio->registers[SYSCONFIG2] & SYSCONFIG2_BAND) >> 6) { switch ((radio->registers[SYSCONFIG2] & SYSCONFIG2_BAND) >> 6) {
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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