1
0
Fork 0

media updates for v4.2-rc1

-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQIcBAABAgAGBQJVi+2qAAoJEAhfPr2O5OEVJdUP/2JzjQ17fswt4JCqXZRMjSZi
 ZZThdFY5Cirs4lKovigTsBwoFFf0nZ5ti+8MpbrglKUBRQTOwWXP/KrJt4hCCikD
 nkcEPkATqlhCYNqxI/6TgUgvVODmTO6PtLbWYpnW64zi9zq0FM4Ko1h+s8ynB91O
 UeDXbn00G2ifMo9BXuzyms+uW7f1LI0+Fqhwf3t9QrO8DTjjEU5Km9teUPMrJmgn
 rcfCrj4c3uDX4Wh4xe1DEs6T7Cf6qRKG5BLjwm6uNO3RMsZ5sA6tgCdE6FonhGrF
 Kvso2NCLQggZg6mgvMXoazYmaqxeeXsy06GBkmrQ9Xx6jo5z+nyJAWwVn7awdt7R
 89CWWn9MRrjhG3QLiluacJaH/5Z+fULSe6Stg2AVqfQGy/EwE7N2BR1CqO0i4pbN
 PredVtT77wyuDfUg6cYgJNjhhCcSt2i71X5Wt42rCZMylTGg3vWq//RqLo7xReaz
 XC0uhrJRDnF02BMzwQftUa8+UTn8Ozb7OyV91DzmZq9njsVHLAyY5u5Q/Fye5buH
 4Ejcjou3edVPMKu7aBtOt4Bmnwc03jBLTlMTdBMeHQugaj3aTP7G7EcX2UAGq4SK
 2e5GaYyIaAvpiddhBJzSzzd8u+XtRynKtFvfWnR+wTnILC+w+nfM/PbthVlXNJZx
 4sUv1XmWxbJT3T7wJ8xE
 =iJ/U
 -----END PGP SIGNATURE-----

Merge tag 'media/v4.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media updates from Mauro Carvalho Chehab:

 - Lots of improvements at the DVB API DocBook documentation.  Now, the
   frontend and the network APIs are fully in sync with the Kernel and
   looks more like the rest of the media documentation;

 - New frontend driver: cx24120

 - New driver for a PCI device: cobalt.  This driver is actually not
   sold in the market, but it is a good example of a multi-HDMI input
   device;

 - The dt3155 driver were promoted from staging;

 - The mantis driver got remote controller support;

 - New V4L2 driver for ST bdisp SoC chipsets;

 - Make sparse and smatch happier: several bugs were solved by fixing
   the issues reported by those static code analyzers.

 - Lots of new device additions, new features, improvements and cleanups
   at the existing drivers.

* tag 'media/v4.2-1' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (553 commits)
  [media] lmedm04: fix the range for relative measurements
  [media] lmedm04: use u32 instead of u64 for relative stats
  [media] omap3isp: remove unused var
  [media] saa7134: fix page size on some archs
  [media] use CONFIG_PM_SLEEP for suspend/resume
  [media] tuner-i2c: be consistent with I2C declaration
  [media] si470x: cleanup define namespace
  [media] bdisp: prevent compiling on random arch
  [media] vb2: Don't WARN when v4l2_buffer.bytesused is 0 for multiplanar buffers
  [media] MAINTAINERS: Add entry for the Renesas VSP1 driver
  [media] videodev2.h: fix copy-and-paste error in V4L2_MAP_XFER_FUNC_DEFAULT
  [media] Revert "[media] vb2: Push mmap_sem down to memops"
  [media] mantis: cleanup a warning
  [media] bdisp-debug: don't try to divide by s64
  [media] cx88: don't declare restart_video_queue if not used
  [media] au0828: move dev->boards atribuition to happen earlier
  [media] lmedm04: implement dvb v5 statistics
  [media] bdisp: remove unused var
  [media] bdisp: remove needless check
  ts2020: fix compilation on i386
  ...
hifive-unleashed-5.1
Linus Torvalds 2015-06-25 17:55:48 -07:00
commit 5b4ca44477
571 changed files with 27338 additions and 10264 deletions

View File

@ -0,0 +1 @@
!*.svg

View File

@ -65,29 +65,31 @@ IOCTLS = \
$(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/dvb/video.h) \
$(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/media.h) \
$(shell perl -ne 'print "$$1 " if /\#define\s+([^\s]+)\s+_IO/' $(srctree)/include/uapi/linux/v4l2-subdev.h) \
VIDIOC_SUBDEV_G_FRAME_INTERVAL \
VIDIOC_SUBDEV_S_FRAME_INTERVAL \
VIDIOC_SUBDEV_ENUM_MBUS_CODE \
VIDIOC_SUBDEV_ENUM_FRAME_SIZE \
VIDIOC_SUBDEV_ENUM_FRAME_INTERVAL \
VIDIOC_SUBDEV_G_SELECTION \
VIDIOC_SUBDEV_S_SELECTION \
DEFINES = \
$(shell perl -ne 'print "$$1 " if /\#define\s+(DTV_[^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/frontend.h) \
TYPES = \
$(shell perl -ne 'print "$$1 " if /^typedef\s+[^\s]+\s+([^\s]+)\;/' $(srctree)/include/uapi/linux/videodev2.h) \
$(shell perl -ne 'print "$$1 " if /^}\s+([a-z0-9_]+_t)/' $(srctree)/include/uapi/linux/dvb/frontend.h)
$(shell perl -ne 'print "$$1 " if /^typedef\s+.*\s+(\S+)\;/' $(srctree)/include/uapi/linux/videodev2.h) \
$(shell perl -ne 'print "$$1 " if /^typedef\s+.*\s+(\S+)\;/' $(srctree)/include/uapi/linux/dvb/frontend.h)
ENUMS = \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/videodev2.h) \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/audio.h) \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/ca.h) \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/dmx.h) \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/frontend.h) \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/net.h) \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/dvb/video.h) \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/media.h) \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-mediabus.h) \
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-subdev.h)
$(shell perl -ne 'print "$$1 " if /^enum\s+([^\s]+)\s+/' \
$(srctree)/include/uapi/linux/videodev2.h \
$(srctree)/include/uapi/linux/dvb/audio.h \
$(srctree)/include/uapi/linux/dvb/ca.h \
$(srctree)/include/uapi/linux/dvb/dmx.h \
$(srctree)/include/uapi/linux/dvb/frontend.h \
$(srctree)/include/uapi/linux/dvb/net.h \
$(srctree)/include/uapi/linux/dvb/video.h \
$(srctree)/include/uapi/linux/media.h \
$(srctree)/include/uapi/linux/v4l2-mediabus.h \
$(srctree)/include/uapi/linux/v4l2-subdev.h)
ENUM_DEFS = \
$(shell perl -e 'open IN,"cat @ARGV| cpp -fpreprocessed |"; while (<IN>) { if ($$enum) {print "$$1\n" if (/\s*([A-Z]\S+)\b/); } $$enum = 0 if ($$enum && /^\}/); $$enum = 1 if(/^\s*enum\s/); }; close IN;' \
$(srctree)/include/uapi/linux/dvb/dmx.h \
$(srctree)/include/uapi/linux/dvb/frontend.h)
STRUCTS = \
$(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/videodev2.h) \
@ -95,7 +97,7 @@ STRUCTS = \
$(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/ca.h) \
$(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/dmx.h) \
$(shell perl -ne 'print "$$1 " if (!/dtv\_cmds\_h/ && /^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/frontend.h) \
$(shell perl -ne 'print "$$1 " if (/^struct\s+([A-Z][^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/net.h) \
$(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/ && !/_old/)' $(srctree)/include/uapi/linux/dvb/net.h) \
$(shell perl -ne 'print "$$1 " if (/^struct\s+([^\s]+)\s+/)' $(srctree)/include/uapi/linux/dvb/video.h) \
$(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/media.h) \
$(shell perl -ne 'print "$$1 " if /^struct\s+([^\s]+)\s+/' $(srctree)/include/uapi/linux/v4l2-subdev.h) \
@ -179,7 +181,6 @@ DOCUMENTED = \
-e "s/v4l2\-mpeg\-vbi\-ITV0/v4l2-mpeg-vbi-itv0-1/g"
DVB_DOCUMENTED = \
-e "s/\(linkend\=\"\)FE_SET_PROPERTY/\1FE_GET_PROPERTY/g" \
-e "s,\(struct\s\+\)\([a-z0-9_]\+\)\(\s\+{\),\1\<link linkend=\"\2\">\2\<\/link\>\3,g" \
-e "s,\(}\s\+\)\([a-z0-9_]\+_t\+\),\1\<link linkend=\"\2\">\2\<\/link\>,g" \
-e "s,\(define\s\+\)\(DTV_[A-Z0-9_]\+\)\(\s\+[0-9]\+\),\1\<link linkend=\"\2\">\2\<\/link\>\3,g" \
@ -188,14 +189,17 @@ DVB_DOCUMENTED = \
-e "s,\(audio-mixer\|audio-karaoke\|audio-status\|ca-slot-info\|ca-descr-info\|ca-caps\|ca-msg\|ca-descr\|ca-pid\|dmx-filter\|dmx-caps\|video-system\|video-highlight\|video-spu\|video-spu-palette\|video-navi-pack\)-t,\1,g" \
-e "s,DTV-ISDBT-LAYER[A-C],DTV-ISDBT-LAYER,g" \
-e "s,\(define\s\+\)\([A-Z0-9_]\+\)\(\s\+_IO\),\1\<link linkend=\"\2\">\2\<\/link\>\3,g" \
-e "s,\(define\s\+\)\(DTV_[A-Z0-9_]\+\)\(\s\+\),\1\<link linkend=\"\2\">\2\<\/link\>\3,g" \
-e "s,<link\s\+linkend=\".*\">\(__.*_OLD\)<\/link>,\1,g" \
-e "s/\(linkend\=\"\)FE_SET_PROPERTY/\1FE_GET_PROPERTY/g" \
-e "s,<link\s\+linkend=\".*\">\(DTV_ISDBS_TS_ID_LEGACY\|DTV_MAX_COMMAND\|DTV_IOCTL_MAX_MSGS\)<\/link>,\1,g" \
#
# Media targets and dependencies
#
install_media_images = \
$(Q)-cp $(OBJIMGFILES) $(MEDIA_SRC_DIR)/v4l/*.svg $(MEDIA_OBJ_DIR)/media_api
$(Q)-cp $(OBJIMGFILES) $(MEDIA_SRC_DIR)/*.svg $(MEDIA_SRC_DIR)/v4l/*.svg $(MEDIA_OBJ_DIR)/media_api
$(MEDIA_OBJ_DIR)/%: $(MEDIA_SRC_DIR)/%.b64
$(Q)base64 -d $< >$@
@ -243,9 +247,14 @@ $(MEDIA_OBJ_DIR)/dmx.h.xml: $(srctree)/include/uapi/linux/dvb/dmx.h $(MEDIA_OBJ_
@( \
echo "<programlisting>") > $@
@( \
for ident in $(ENUM_DEFS) ; do \
entity=`echo $$ident | tr _ -` ; \
r="$$r s/([^\w\-])$$ident([^\w\-])/\1\&$$entity\;\2/g;";\
done; \
expand --tabs=8 < $< | \
sed $(ESCAPE) $(DVB_DOCUMENTED) | \
sed 's/i\.e\./&ie;/') >> $@
sed 's/i\.e\./&ie;/' | \
perl -ne "$$r print $$_;") >> $@
@( \
echo "</programlisting>") >> $@
@ -254,9 +263,14 @@ $(MEDIA_OBJ_DIR)/frontend.h.xml: $(srctree)/include/uapi/linux/dvb/frontend.h $(
@( \
echo "<programlisting>") > $@
@( \
for ident in $(ENUM_DEFS) ; do \
entity=`echo $$ident | tr _ -` ; \
r="$$r s/([^\w\-])$$ident([^\w\-])/\1\&$$entity\;\2/g;";\
done; \
expand --tabs=8 < $< | \
sed $(ESCAPE) $(DVB_DOCUMENTED) | \
sed 's/i\.e\./&ie;/') >> $@
sed 's/i\.e\./&ie;/' | \
perl -ne "$$r print $$_;") >> $@
@( \
echo "</programlisting>") >> $@
@ -298,11 +312,22 @@ $(MEDIA_OBJ_DIR)/media-entities.tmpl: $(MEDIA_OBJ_DIR)/v4l2.xml
@( \
echo -e "\n<!-- Ioctls -->") >>$@
@( \
for ident in $(IOCTLS) ; do \
for ident in `echo $(IOCTLS) | sed -e "s,VIDIOC_RESERVED,,"`; do\
entity=`echo $$ident | tr _ -` ; \
id=`grep "<refname>$$ident" $(MEDIA_OBJ_DIR)/vidioc-*.xml $(MEDIA_OBJ_DIR)/media-ioc-*.xml | sed -r s,"^.*/(.*).xml.*","\1",` ; \
echo "<!ENTITY $$entity \"<link" \
id=`grep -e "<refname>$$ident" -e "<section id=\"$$ident\"" $$(find $(MEDIA_SRC_DIR) -name *.xml -type f)| sed -r s,"^.*/(.*).xml.*","\1",` ; \
if [ "$$id" != "" ]; then echo "<!ENTITY $$entity \"<link" \
"linkend='$$id'><constant>$$ident</constant></link>\">" \
>>$@ ; else \
echo "Warning: undocumented ioctl: $$ident. Please document it at the media DocBook!" >&2; \
fi; \
done)
@( \
echo -e "\n<!-- Defines -->") >>$@
@( \
for ident in $(DEFINES) ; do \
entity=`echo $$ident | tr _ -` ; \
echo "<!ENTITY $$entity \"<link" \
"linkend='$$entity'><constant>$$ident</constant></link>\">" \
>>$@ ; \
done)
@( \
@ -322,6 +347,15 @@ $(MEDIA_OBJ_DIR)/media-entities.tmpl: $(MEDIA_OBJ_DIR)/v4l2.xml
"linkend='$$entity'>$$ident</link>\">" >>$@ ; \
done)
@( \
echo -e "\n<!-- Enum definitions -->") >>$@
@( \
for ident in $(ENUM_DEFS) ; do \
entity=`echo $$ident | tr _ -` ; \
echo "<!ENTITY $$entity \"<link" \
"linkend='$$entity'><constant>$$ident</constant></link>\">" \
>>$@ ; \
done)
@( \
echo -e "\n<!-- Structures -->") >>$@
@( \
for ident in $(STRUCTS) ; do \

View File

@ -1,7 +1,7 @@
<title>DVB Audio Device</title>
<para>The DVB audio device controls the MPEG2 audio decoder of the DVB hardware. It
can be accessed through <emphasis role="tt">/dev/dvb/adapter0/audio0</emphasis>. Data types and and
ioctl definitions can be accessed by including <emphasis role="tt">linux/dvb/audio.h</emphasis> in your
can be accessed through <constant>/dev/dvb/adapter?/audio?</constant>. Data types and and
ioctl definitions can be accessed by including <constant>linux/dvb/audio.h</constant> in your
application.
</para>
<para>Please note that some DVB cards don&#8217;t have their own MPEG decoder, which results in
@ -32,7 +32,7 @@ typedef enum {
</programlisting>
<para>AUDIO_SOURCE_DEMUX selects the demultiplexer (fed either by the frontend or the
DVR device) as the source of the video stream. If AUDIO_SOURCE_MEMORY
is selected the stream comes from the application through the <emphasis role="tt">write()</emphasis> system
is selected the stream comes from the application through the <constant>write()</constant> system
call.
</para>

View File

@ -1,7 +1,7 @@
<title>DVB CA Device</title>
<para>The DVB CA device controls the conditional access hardware. It can be accessed through
<emphasis role="tt">/dev/dvb/adapter0/ca0</emphasis>. Data types and and ioctl definitions can be accessed by
including <emphasis role="tt">linux/dvb/ca.h</emphasis> in your application.
<constant>/dev/dvb/adapter?/ca?</constant>. Data types and and ioctl definitions can be accessed by
including <constant>linux/dvb/ca.h</constant> in your application.
</para>
<section id="ca_data_types">

View File

@ -1,33 +1,50 @@
<title>DVB Demux Device</title>
<para>The DVB demux device controls the filters of the DVB hardware/software. It can be
accessed through <emphasis role="tt">/dev/adapter0/demux0</emphasis>. Data types and and ioctl definitions can be
accessed by including <emphasis role="tt">linux/dvb/dmx.h</emphasis> in your application.
accessed through <constant>/dev/adapter?/demux?</constant>. Data types and and ioctl definitions can be
accessed by including <constant>linux/dvb/dmx.h</constant> in your application.
</para>
<section id="dmx_types">
<title>Demux Data Types</title>
<section id="dmx-output-t">
<title>dmx_output_t</title>
<programlisting>
typedef enum
{
DMX_OUT_DECODER, /&#x22C6; Streaming directly to decoder. &#x22C6;/
DMX_OUT_TAP, /&#x22C6; Output going to a memory buffer &#x22C6;/
/&#x22C6; (to be retrieved via the read command).&#x22C6;/
DMX_OUT_TS_TAP, /&#x22C6; Output multiplexed into a new TS &#x22C6;/
/&#x22C6; (to be retrieved by reading from the &#x22C6;/
/&#x22C6; logical DVR device). &#x22C6;/
DMX_OUT_TSDEMUX_TAP /&#x22C6; Like TS_TAP but retrieved from the DMX device &#x22C6;/
} dmx_output_t;
</programlisting>
<para><emphasis role="tt">DMX_OUT_TAP</emphasis> delivers the stream output to the demux device on which the ioctl is
called.
</para>
<para><emphasis role="tt">DMX_OUT_TS_TAP</emphasis> routes output to the logical DVR device <emphasis role="tt">/dev/dvb/adapter0/dvr0</emphasis>,
which delivers a TS multiplexed from all filters for which <emphasis role="tt">DMX_OUT_TS_TAP</emphasis> was
specified.
</para>
<title>Output for the demux</title>
<table pgwide="1" frame="none" id="dmx-output">
<title>enum dmx_output</title>
<tgroup cols="2">
&cs-def;
<thead>
<row>
<entry>ID</entry>
<entry>Description</entry>
</row>
</thead>
<tbody valign="top">
<row>
<entry align="char" id="DMX-OUT-DECODER">DMX_OUT_DECODER</entry>
<entry>Streaming directly to decoder.</entry>
</row><row>
<entry align="char" id="DMX-OUT-TAP">DMX_OUT_TAP</entry>
<entry>Output going to a memory buffer (to be retrieved via the
read command). Delivers the stream output to the demux
device on which the ioctl is called.</entry>
</row><row>
<entry align="char" id="DMX-OUT-TS-TAP">DMX_OUT_TS_TAP</entry>
<entry>Output multiplexed into a new TS (to be retrieved by
reading from the logical DVR device). Routes output to the
logical DVR device <constant>/dev/dvb/adapter?/dvr?</constant>,
which delivers a TS multiplexed from all filters for which
<constant>DMX_OUT_TS_TAP</constant> was specified.</entry>
</row><row>
<entry align="char" id="DMX-OUT-TSDEMUX-TAP">DMX_OUT_TSDEMUX_TAP</entry>
<entry>Like &DMX-OUT-TS-TAP; but retrieved from the DMX
device.</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="dmx-input-t">

View File

@ -28,12 +28,22 @@
<holder>Convergence GmbH</holder>
</copyright>
<copyright>
<year>2009-2014</year>
<year>2009-2015</year>
<holder>Mauro Carvalho Chehab</holder>
</copyright>
<revhistory>
<!-- Put document revisions here, newest first. -->
<revision>
<revnumber>2.1.0</revnumber>
<date>2015-05-29</date>
<authorinitials>mcc</authorinitials>
<revremark>
DocBook improvements and cleanups, in order to document the
system calls on a more standard way and provide more description
about the current DVB API.
</revremark>
</revision>
<revision>
<revnumber>2.0.4</revnumber>
<date>2011-05-06</date>
@ -95,18 +105,26 @@ Added ISDB-T test originally written by Patrick Boettcher
<chapter id="dvb_demux">
&sub-demux;
</chapter>
<chapter id="dvb_video">
&sub-video;
</chapter>
<chapter id="dvb_audio">
&sub-audio;
</chapter>
<chapter id="dvb_ca">
&sub-ca;
</chapter>
<chapter id="dvb_net">
<chapter id="net">
&sub-net;
</chapter>
<chapter id="legacy_dvb_apis">
<title>DVB Deprecated APIs</title>
<para>The APIs described here are kept only for historical reasons. There's
just one driver for a very legacy hardware that uses this API. No
modern drivers should use it. Instead, audio and video should be using
the V4L2 and ALSA APIs, and the pipelines should be set using the
Media Controller API</para>
<section id="dvb_video">
&sub-video;
</section>
<section id="dvb_audio">
&sub-audio;
</section>
</chapter>
<chapter id="dvb_kdapi">
&sub-kdapi;
</chapter>

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +1,10 @@
<title>Examples</title>
<para>In this section we would like to present some examples for using the DVB API.
</para>
<para>Maintainer note: This section is out of date. Please refer to the sample programs packaged
with the driver distribution from <ulink url="http://linuxtv.org/hg/dvb-apps" />.
<para>NOTE: This section is out of date, and the code below won't even
compile. Please refer to the
<ulink url="http://linuxtv.org/docs/libdvbv5/index.html">libdvbv5</ulink>
for updated/recommended examples.
</para>
<section id="tuning">

View File

@ -0,0 +1,78 @@
<refentry id="FE_DISEQC_RECV_SLAVE_REPLY">
<refmeta>
<refentrytitle>ioctl FE_DISEQC_RECV_SLAVE_REPLY</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname>FE_DISEQC_RECV_SLAVE_REPLY</refname>
<refpurpose>Receives reply from a DiSEqC 2.0 command</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>ioctl</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>request</parameter></paramdef>
<paramdef>struct dvb_diseqc_slave_reply *<parameter>argp</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Arguments</title>
<variablelist>
<varlistentry>
<term><parameter>fd</parameter></term>
<listitem>
<para>&fe_fd;</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>request</parameter></term>
<listitem>
<para>FE_DISEQC_RECV_SLAVE_REPLY</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>argp</parameter></term>
<listitem>
<para>pointer to &dvb-diseqc-slave-reply;</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>Receives reply from a DiSEqC 2.0 command.</para>
&return-value-dvb;
<table pgwide="1" frame="none" id="dvb-diseqc-slave-reply">
<title>struct <structname>dvb_diseqc_slave_reply</structname></title>
<tgroup cols="3">
&cs-str;
<tbody valign="top">
<row>
<entry>uint8_t</entry>
<entry>msg[4]</entry>
<entry>DiSEqC message (framing, data[3])</entry>
</row><row>
<entry>uint8_t</entry>
<entry>msg_len</entry>
<entry>Length of the DiSEqC message. Valid values are 0 to 4,
where 0 means no msg</entry>
</row><row>
<entry>int</entry>
<entry>timeout</entry>
<entry>Return from ioctl after timeout ms with errorcode when no
message was received</entry>
</row>
</tbody>
</tgroup>
</table>
</refsect1>
</refentry>

View File

@ -0,0 +1,51 @@
<refentry id="FE_DISEQC_RESET_OVERLOAD">
<refmeta>
<refentrytitle>ioctl FE_DISEQC_RESET_OVERLOAD</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname>FE_DISEQC_RESET_OVERLOAD</refname>
<refpurpose>Restores the power to the antenna subsystem, if it was powered
off due to power overload.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>ioctl</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>request</parameter></paramdef>
<paramdef>NULL</paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Arguments</title>
<variablelist>
<varlistentry>
<term><parameter>fd</parameter></term>
<listitem>
<para>&fe_fd;</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>request</parameter></term>
<listitem>
<para>FE_DISEQC_RESET_OVERLOAD</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>If the bus has been automatically powered off due to power overload, this ioctl
call restores the power to the bus. The call requires read/write access to the
device. This call has no effect if the device is manually powered off. Not all
DVB adapters support this ioctl.</para>
&return-value-dvb;
</refsect1>
</refentry>

View File

@ -0,0 +1,89 @@
<refentry id="FE_DISEQC_SEND_BURST">
<refmeta>
<refentrytitle>ioctl FE_DISEQC_SEND_BURST</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname>FE_DISEQC_SEND_BURST</refname>
<refpurpose>Sends a 22KHz tone burst for 2x1 mini DiSEqC satellite selection.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>ioctl</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>request</parameter></paramdef>
<paramdef>enum fe_sec_mini_cmd *<parameter>tone</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Arguments</title>
<variablelist>
<varlistentry>
<term><parameter>fd</parameter></term>
<listitem>
<para>&fe_fd;</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>request</parameter></term>
<listitem>
<para>FE_DISEQC_SEND_BURST</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>tone</parameter></term>
<listitem>
<para>pointer to &fe-sec-mini-cmd;</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>This ioctl is used to set the generation of a 22kHz tone burst for mini
DiSEqC satellite
selection for 2x1 switches.
This call requires read/write permissions.</para>
<para>It provides support for what's specified at
<ulink url="http://www.eutelsat.com/files/contributed/satellites/pdf/Diseqc/associated%20docs/simple_tone_burst_detec.pdf">Digital Satellite Equipment Control
(DiSEqC) - Simple "ToneBurst" Detection Circuit specification.</ulink>
</para>
&return-value-dvb;
</refsect1>
<refsect1 id="fe-sec-mini-cmd-t">
<title>enum fe_sec_mini_cmd</title>
<table pgwide="1" frame="none" id="fe-sec-mini-cmd">
<title>enum fe_sec_mini_cmd</title>
<tgroup cols="2">
&cs-def;
<thead>
<row>
<entry>ID</entry>
<entry>Description</entry>
</row>
</thead>
<tbody valign="top">
<row>
<entry align="char" id="SEC-MINI-A"><constant>SEC_MINI_A</constant></entry>
<entry align="char">Sends a mini-DiSEqC 22kHz '0' Tone Burst to
select satellite-A</entry>
</row><row>
<entry align="char" id="SEC-MINI-B"><constant>SEC_MINI_B</constant></entry>
<entry align="char">Sends a mini-DiSEqC 22kHz '1' Data Burst to
select satellite-B</entry>
</row>
</tbody>
</tgroup>
</table>
</refsect1>
</refentry>

View File

@ -0,0 +1,72 @@
<refentry id="FE_DISEQC_SEND_MASTER_CMD">
<refmeta>
<refentrytitle>ioctl FE_DISEQC_SEND_MASTER_CMD</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname>FE_DISEQC_SEND_MASTER_CMD</refname>
<refpurpose>Sends a DiSEqC command</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>ioctl</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>request</parameter></paramdef>
<paramdef>struct dvb_diseqc_master_cmd *<parameter>argp</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Arguments</title>
<variablelist>
<varlistentry>
<term><parameter>fd</parameter></term>
<listitem>
<para>&fe_fd;</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>request</parameter></term>
<listitem>
<para>FE_DISEQC_SEND_MASTER_CMD</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>argp</parameter></term>
<listitem>
<para>pointer to &dvb-diseqc-master-cmd;</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>Sends a DiSEqC command to the antenna subsystem.</para>
&return-value-dvb;
<table pgwide="1" frame="none" id="dvb-diseqc-master-cmd">
<title>struct <structname>dvb_diseqc_master_cmd</structname></title>
<tgroup cols="3">
&cs-str;
<tbody valign="top">
<row>
<entry>uint8_t</entry>
<entry>msg[6]</entry>
<entry>DiSEqC message (framing, address, command, data[3])</entry>
</row><row>
<entry>uint8_t</entry>
<entry>msg_len</entry>
<entry>Length of the DiSEqC message. Valid values are 3 to 6</entry>
</row>
</tbody>
</tgroup>
</table>
</refsect1>
</refentry>

View File

@ -0,0 +1,61 @@
<refentry id="FE_ENABLE_HIGH_LNB_VOLTAGE">
<refmeta>
<refentrytitle>ioctl FE_ENABLE_HIGH_LNB_VOLTAGE</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname>FE_ENABLE_HIGH_LNB_VOLTAGE</refname>
<refpurpose>Select output DC level between normal LNBf voltages or higher
LNBf voltages.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>ioctl</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>request</parameter></paramdef>
<paramdef>unsigned int <parameter>high</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Arguments</title>
<variablelist>
<varlistentry>
<term><parameter>fd</parameter></term>
<listitem>
<para>&fe_fd;</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>request</parameter></term>
<listitem>
<para>FE_ENABLE_HIGH_LNB_VOLTAGE</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>high</parameter></term>
<listitem>
<para>Valid flags:</para>
<itemizedlist>
<listitem><para>0 - normal 13V and 18V.</para></listitem>
<listitem><para>&gt;0 - enables slightly higher voltages instead of
13/18V, in order to compensate for long antenna cables.</para></listitem>
</itemizedlist>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>Select output DC level between normal LNBf voltages or higher
LNBf voltages between 0 (normal) or a value grater than 0 for higher
voltages.</para>
&return-value-dvb;
</refsect1>
</refentry>

View File

@ -0,0 +1,266 @@
<refentry id="FE_GET_INFO">
<refmeta>
<refentrytitle>ioctl FE_GET_INFO</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname>FE_GET_INFO</refname>
<refpurpose>Query DVB frontend capabilities and returns information about
the front-end. This call only requires read-only access to the device</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>ioctl</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>request</parameter></paramdef>
<paramdef>struct dvb_frontend_info *<parameter>argp</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Arguments</title>
<variablelist>
<varlistentry>
<term><parameter>fd</parameter></term>
<listitem>
<para>&fe_fd;</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>request</parameter></term>
<listitem>
<para>FE_GET_INFO</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>argp</parameter></term>
<listitem>
<para>pointer to struct &dvb-frontend-info;</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>All DVB frontend devices support the
<constant>FE_GET_INFO</constant> ioctl. It is used to identify
kernel devices compatible with this specification and to obtain
information about driver and hardware capabilities. The ioctl takes a
pointer to dvb_frontend_info which is filled by the driver. When the
driver is not compatible with this specification the ioctl returns an error.
</para>
&return-value-dvb;
<table pgwide="1" frame="none" id="dvb-frontend-info">
<title>struct <structname>dvb_frontend_info</structname></title>
<tgroup cols="3">
&cs-str;
<tbody valign="top">
<row>
<entry>char</entry>
<entry>name[128]</entry>
<entry>Name of the frontend</entry>
</row><row>
<entry>fe_type_t</entry>
<entry>type</entry>
<entry><emphasis role="bold">DEPRECATED</emphasis>. DVBv3 type. Should not be used on modern programs, as a
frontend may have more than one type. So, the DVBv5 API should
be used instead to enumerate and select the frontend type.</entry>
</row><row>
<entry>uint32_t</entry>
<entry>frequency_min</entry>
<entry>Minimal frequency supported by the frontend</entry>
</row><row>
<entry>uint32_t</entry>
<entry>frequency_max</entry>
<entry>Maximal frequency supported by the frontend</entry>
</row><row>
<entry>uint32_t</entry>
<entry>frequency_stepsize</entry>
<entry>Frequency step - all frequencies are multiple of this value</entry>
</row><row>
<entry>uint32_t</entry>
<entry>frequency_tolerance</entry>
<entry>Tolerance of the frequency</entry>
</row><row>
<entry>uint32_t</entry>
<entry>symbol_rate_min</entry>
<entry>Minimal symbol rate (for Cable/Satellite systems), in bauds</entry>
</row><row>
<entry>uint32_t</entry>
<entry>symbol_rate_max</entry>
<entry>Maximal symbol rate (for Cable/Satellite systems), in bauds</entry>
</row><row>
<entry>uint32_t</entry>
<entry>symbol_rate_tolerance</entry>
<entry>Maximal symbol rate tolerance, in ppm</entry>
</row><row>
<entry>uint32_t</entry>
<entry>notifier_delay</entry>
<entry><emphasis role="bold">DEPRECATED</emphasis>. Not used by any driver.</entry>
</row><row>
<entry>&fe-caps;</entry>
<entry>caps</entry>
<entry>Capabilities supported by the frontend</entry>
</row>
</tbody>
</tgroup>
</table>
<para>NOTE: The frequencies are specified in Hz for Terrestrial and Cable
systems. They're specified in kHz for Satellite systems</para>
</refsect1>
<refsect1 id="fe-caps-t">
<title>frontend capabilities</title>
<para>Capabilities describe what a frontend can do. Some capabilities are
supported only on some specific frontend types.</para>
<table pgwide="1" frame="none" id="fe-caps">
<title>enum fe_caps</title>
<tgroup cols="2">
&cs-def;
<thead>
<row>
<entry>ID</entry>
<entry>Description</entry>
</row>
</thead>
<tbody valign="top">
<row>
<entry id="FE-IS-STUPID"><constant>FE_IS_STUPID</constant></entry>
<entry>There's something wrong at the frontend, and it can't
report its capabilities</entry>
</row>
<row>
<entry id="FE-CAN-INVERSION-AUTO"><constant>FE_CAN_INVERSION_AUTO</constant></entry>
<entry>The frontend is capable of auto-detecting inversion</entry>
</row>
<row>
<entry id="FE-CAN-FEC-1-2"><constant>FE_CAN_FEC_1_2</constant></entry>
<entry>The frontend supports FEC 1/2</entry>
</row>
<row>
<entry id="FE-CAN-FEC-2-3"><constant>FE_CAN_FEC_2_3</constant></entry>
<entry>The frontend supports FEC 2/3</entry>
</row>
<row>
<entry id="FE-CAN-FEC-3-4"><constant>FE_CAN_FEC_3_4</constant></entry>
<entry>The frontend supports FEC 3/4</entry>
</row>
<row>
<entry id="FE-CAN-FEC-4-5"><constant>FE_CAN_FEC_4_5</constant></entry>
<entry>The frontend supports FEC 4/5</entry>
</row>
<row>
<entry id="FE-CAN-FEC-5-6"><constant>FE_CAN_FEC_5_6</constant></entry>
<entry>The frontend supports FEC 5/6</entry>
</row>
<row>
<entry id="FE-CAN-FEC-6-7"><constant>FE_CAN_FEC_6_7</constant></entry>
<entry>The frontend supports FEC 6/7</entry>
</row>
<row>
<entry id="FE-CAN-FEC-7-8"><constant>FE_CAN_FEC_7_8</constant></entry>
<entry>The frontend supports FEC 7/8</entry>
</row>
<row>
<entry id="FE-CAN-FEC-8-9"><constant>FE_CAN_FEC_8_9</constant></entry>
<entry>The frontend supports FEC 8/9</entry>
</row>
<row>
<entry id="FE-CAN-FEC-AUTO"><constant>FE_CAN_FEC_AUTO</constant></entry>
<entry>The frontend can autodetect FEC.</entry>
</row>
<row>
<entry id="FE-CAN-QPSK"><constant>FE_CAN_QPSK</constant></entry>
<entry>The frontend supports QPSK modulation</entry>
</row>
<row>
<entry id="FE-CAN-QAM-16"><constant>FE_CAN_QAM_16</constant></entry>
<entry>The frontend supports 16-QAM modulation</entry>
</row>
<row>
<entry id="FE-CAN-QAM-32"><constant>FE_CAN_QAM_32</constant></entry>
<entry>The frontend supports 32-QAM modulation</entry>
</row>
<row>
<entry id="FE-CAN-QAM-64"><constant>FE_CAN_QAM_64</constant></entry>
<entry>The frontend supports 64-QAM modulation</entry>
</row>
<row>
<entry id="FE-CAN-QAM-128"><constant>FE_CAN_QAM_128</constant></entry>
<entry>The frontend supports 128-QAM modulation</entry>
</row>
<row>
<entry id="FE-CAN-QAM-256"><constant>FE_CAN_QAM_256</constant></entry>
<entry>The frontend supports 256-QAM modulation</entry>
</row>
<row>
<entry id="FE-CAN-QAM-AUTO"><constant>FE_CAN_QAM_AUTO</constant></entry>
<entry>The frontend can autodetect modulation</entry>
</row>
<row>
<entry id="FE-CAN-TRANSMISSION-MODE-AUTO"><constant>FE_CAN_TRANSMISSION_MODE_AUTO</constant></entry>
<entry>The frontend can autodetect the transmission mode</entry>
</row>
<row>
<entry id="FE-CAN-BANDWIDTH-AUTO"><constant>FE_CAN_BANDWIDTH_AUTO</constant></entry>
<entry>The frontend can autodetect the bandwidth</entry>
</row>
<row>
<entry id="FE-CAN-GUARD-INTERVAL-AUTO"><constant>FE_CAN_GUARD_INTERVAL_AUTO</constant></entry>
<entry>The frontend can autodetect the guard interval</entry>
</row>
<row>
<entry id="FE-CAN-HIERARCHY-AUTO"><constant>FE_CAN_HIERARCHY_AUTO</constant></entry>
<entry>The frontend can autodetect hierarch</entry>
</row>
<row>
<entry id="FE-CAN-8VSB"><constant>FE_CAN_8VSB</constant></entry>
<entry>The frontend supports 8-VSB modulation</entry>
</row>
<row>
<entry id="FE-CAN-16VSB"><constant>FE_CAN_16VSB</constant></entry>
<entry>The frontend supports 16-VSB modulation</entry>
</row>
<row>
<entry id="FE-HAS-EXTENDED-CAPS"><constant>FE_HAS_EXTENDED_CAPS</constant></entry>
<entry>Currently, unused</entry>
</row>
<row>
<entry id="FE-CAN-MULTISTREAM"><constant>FE_CAN_MULTISTREAM</constant></entry>
<entry>The frontend supports multistream filtering</entry>
</row>
<row>
<entry id="FE-CAN-TURBO-FEC"><constant>FE_CAN_TURBO_FEC</constant></entry>
<entry>The frontend supports turbo FEC modulation</entry>
</row>
<row>
<entry id="FE-CAN-2G-MODULATION"><constant>FE_CAN_2G_MODULATION</constant></entry>
<entry>The frontend supports "2nd generation modulation" (DVB-S2/T2)></entry>
</row>
<row>
<entry id="FE-NEEDS-BENDING"><constant>FE_NEEDS_BENDING</constant></entry>
<entry>Not supported anymore, don't use it</entry>
</row>
<row>
<entry id="FE-CAN-RECOVER"><constant>FE_CAN_RECOVER</constant></entry>
<entry>The frontend can recover from a cable unplug automatically</entry>
</row>
<row>
<entry id="FE-CAN-MUTE-TS"><constant>FE_CAN_MUTE_TS</constant></entry>
<entry>The frontend can stop spurious TS data output</entry>
</row>
</tbody>
</tgroup>
</table>
</refsect1>
</refentry>

View File

@ -0,0 +1,81 @@
<refentry id="FE_GET_PROPERTY">
<refmeta>
<refentrytitle>ioctl FE_SET_PROPERTY, FE_GET_PROPERTY</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname>FE_SET_PROPERTY</refname>
<refname>FE_GET_PROPERTY</refname>
<refpurpose>FE_SET_PROPERTY sets one or more frontend properties.
FE_GET_PROPERTY returns one or more frontend properties.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>ioctl</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>request</parameter></paramdef>
<paramdef>struct dtv_properties *<parameter>argp</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Arguments</title>
<variablelist>
<varlistentry>
<term><parameter>fd</parameter></term>
<listitem>
<para>&fe_fd;</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>request</parameter></term>
<listitem>
<para>FE_SET_PROPERTY, FE_GET_PROPERTY</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>argp</parameter></term>
<listitem>
<para>pointer to &dtv-properties;</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>All DVB frontend devices support the
<constant>FE_SET_PROPERTY</constant> and <constant>FE_GET_PROPERTY</constant>
ioctls. The supported properties and statistics depends on the delivery system
and on the device:</para>
<itemizedlist>
<listitem>
<para><constant>FE_SET_PROPERTY:</constant></para>
<itemizedlist>
<listitem><para>This ioctl is used to set one or more
frontend properties.</para></listitem>
<listitem><para>This is the basic command to request the frontend to tune into some
frequency and to start decoding the digital TV signal.</para></listitem>
<listitem><para>This call requires read/write access to the device.</para></listitem>
<listitem><para>At return, the values are updated to reflect the
actual parameters used.</para></listitem>
</itemizedlist>
</listitem>
<listitem>
<para><constant>FE_GET_PROPERTY:</constant></para>
<itemizedlist>
<listitem><para>This ioctl is used to get properties and
statistics from the frontend.</para></listitem>
<listitem><para>No properties are changed, and statistics aren't reset.</para></listitem>
<listitem><para>This call only requires read-only access to the device.</para></listitem>
</itemizedlist>
</listitem>
</itemizedlist>
&return-value-dvb;
</refsect1>
</refentry>

View File

@ -0,0 +1,107 @@
<refentry id="FE_READ_STATUS">
<refmeta>
<refentrytitle>ioctl FE_READ_STATUS</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname>FE_READ_STATUS</refname>
<refpurpose>Returns status information about the front-end. This call only
requires read-only access to the device</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>ioctl</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>request</parameter></paramdef>
<paramdef>unsigned int *<parameter>status</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Arguments</title>
<variablelist>
<varlistentry>
<term><parameter>fd</parameter></term>
<listitem>
<para>&fe_fd;</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>request</parameter></term>
<listitem>
<para>FE_READ_STATUS</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>status</parameter></term>
<listitem>
<para>pointer to a bitmask integer filled with the values defined by
&fe-status;.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>All DVB frontend devices support the
<constant>FE_READ_STATUS</constant> ioctl. It is used to check about the
locking status of the frontend after being tuned. The ioctl takes a
pointer to an integer where the status will be written.
</para>
<para>NOTE: the size of status is actually sizeof(enum fe_status), with varies
according with the architecture. This needs to be fixed in the future.</para>
&return-value-dvb;
</refsect1>
<refsect1 id="fe-status-t">
<title>int fe_status</title>
<para>The fe_status parameter is used to indicate the current state
and/or state changes of the frontend hardware. It is produced using
the &fe-status; values on a bitmask</para>
<table pgwide="1" frame="none" id="fe-status">
<title>enum fe_status</title>
<tgroup cols="2">
&cs-def;
<thead>
<row>
<entry>ID</entry>
<entry>Description</entry>
</row>
</thead>
<tbody valign="top">
<row>
<entry align="char" id="FE-HAS-SIGNAL"><constant>FE_HAS_SIGNAL</constant></entry>
<entry align="char">The frontend has found something above the noise level</entry>
</row><row>
<entry align="char" id="FE-HAS-CARRIER"><constant>FE_HAS_CARRIER</constant></entry>
<entry align="char">The frontend has found a DVB signal</entry>
</row><row>
<entry align="char" id="FE-HAS-VITERBI"><constant>FE_HAS_VITERBI</constant></entry>
<entry align="char">The frontend FEC inner coding (Viterbi, LDPC or other inner code) is stable</entry>
</row><row>
<entry align="char" id="FE-HAS-SYNC"><constant>FE_HAS_SYNC</constant></entry>
<entry align="char">Synchronization bytes was found</entry>
</row><row>
<entry align="char" id="FE-HAS-LOCK"><constant>FE_HAS_LOCK</constant></entry>
<entry align="char">The DVB were locked and everything is working</entry>
</row><row>
<entry align="char" id="FE-TIMEDOUT"><constant>FE_TIMEDOUT</constant></entry>
<entry align="char">no lock within the last about 2 seconds</entry>
</row><row>
<entry align="char" id="FE-REINIT"><constant>FE_REINIT</constant></entry>
<entry align="char">The frontend was reinitialized, application is
recommended to reset DiSEqC, tone and parameters</entry>
</row>
</tbody>
</tgroup>
</table>
</refsect1>
</refentry>

View File

@ -0,0 +1,64 @@
<refentry id="FE_SET_FRONTEND_TUNE_MODE">
<refmeta>
<refentrytitle>ioctl FE_SET_FRONTEND_TUNE_MODE</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname>FE_SET_FRONTEND_TUNE_MODE</refname>
<refpurpose>Allow setting tuner mode flags to the frontend.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>ioctl</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>request</parameter></paramdef>
<paramdef>unsigned int <parameter>flags</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Arguments</title>
<variablelist>
<varlistentry>
<term><parameter>fd</parameter></term>
<listitem>
<para>&fe_fd;</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>request</parameter></term>
<listitem>
<para>FE_SET_FRONTEND_TUNE_MODE</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>flags</parameter></term>
<listitem>
<para>Valid flags:</para>
<itemizedlist>
<listitem><para>0 - normal tune mode</para></listitem>
<listitem><para>FE_TUNE_MODE_ONESHOT - When set, this flag will
disable any zigzagging or other "normal" tuning behaviour.
Additionally, there will be no automatic monitoring of the
lock status, and hence no frontend events will be
generated. If a frontend device is closed, this flag will
be automatically turned off when the device is reopened
read-write.</para></listitem>
</itemizedlist>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>Allow setting tuner mode flags to the frontend, between 0 (normal)
or FE_TUNE_MODE_ONESHOT mode</para>
&return-value-dvb;
</refsect1>
</refentry>

View File

@ -0,0 +1,91 @@
<refentry id="FE_SET_TONE">
<refmeta>
<refentrytitle>ioctl FE_SET_TONE</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname>FE_SET_TONE</refname>
<refpurpose>Sets/resets the generation of the continuous 22kHz tone.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>ioctl</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>request</parameter></paramdef>
<paramdef>enum fe_sec_tone_mode *<parameter>tone</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Arguments</title>
<variablelist>
<varlistentry>
<term><parameter>fd</parameter></term>
<listitem>
<para>&fe_fd;</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>request</parameter></term>
<listitem>
<para>FE_SET_TONE</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>tone</parameter></term>
<listitem>
<para>pointer to &fe-sec-tone-mode;</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>This ioctl is used to set the generation of the continuous 22kHz tone.
This call requires read/write permissions.</para>
<para>Usually, satellite antenna subsystems require that the digital TV
device to send a 22kHz tone in order to select between high/low band on
some dual-band LNBf. It is also used to send signals to DiSEqC equipment,
but this is done using the DiSEqC ioctls.</para>
<para>NOTE: if more than one device is connected to the same antenna,
setting a tone may interfere on other devices, as they may lose
the capability of selecting the band. So, it is recommended that
applications would change to SEC_TONE_OFF when the device is not used.</para>
&return-value-dvb;
</refsect1>
<refsect1 id="fe-sec-tone-mode-t">
<title>enum fe_sec_tone_mode</title>
<table pgwide="1" frame="none" id="fe-sec-tone-mode">
<title>enum fe_sec_tone_mode</title>
<tgroup cols="2">
&cs-def;
<thead>
<row>
<entry>ID</entry>
<entry>Description</entry>
</row>
</thead>
<tbody valign="top">
<row>
<entry align="char" id="SEC-TONE-ON"><constant>SEC_TONE_ON</constant></entry>
<entry align="char">Sends a 22kHz tone burst to the antenna</entry>
</row><row>
<entry align="char" id="SEC-TONE-OFF"><constant>SEC_TONE_OFF</constant></entry>
<entry align="char">Don't send a 22kHz tone to the antenna
(except if the FE_DISEQC_* ioctls are called)</entry>
</row>
</tbody>
</tgroup>
</table>
</refsect1>
</refentry>

View File

@ -0,0 +1,69 @@
<refentry id="FE_SET_VOLTAGE">
<refmeta>
<refentrytitle>ioctl FE_SET_VOLTAGE</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname>FE_SET_VOLTAGE</refname>
<refpurpose>Allow setting the DC level sent to the antenna subsystem.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>ioctl</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>request</parameter></paramdef>
<paramdef>enum fe_sec_voltage *<parameter>voltage</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Arguments</title>
<variablelist>
<varlistentry>
<term><parameter>fd</parameter></term>
<listitem>
<para>&fe_fd;</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>request</parameter></term>
<listitem>
<para>FE_SET_VOLTAGE</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>voltage</parameter></term>
<listitem>
<para>pointer to &fe-sec-voltage;</para>
<para>Valid values are described at &fe-sec-voltage;.</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>This ioctl allows to set the DC voltage level sent through the antenna
cable to 13V, 18V or off.</para>
<para>Usually, a satellite antenna subsystems require that the digital TV
device to send a DC voltage to feed power to the LNBf. Depending on the
LNBf type, the polarization or the intermediate frequency (IF) of the LNBf
can controlled by the voltage level. Other devices (for example, the ones
that implement DISEqC and multipoint LNBf's don't need to control the
voltage level, provided that either 13V or 18V is sent to power up the
LNBf.</para>
<para>NOTE: if more than one device is connected to the same antenna,
setting a voltage level may interfere on other devices, as they may lose
the capability of setting polarization or IF. So, on those
cases, setting the voltage to SEC_VOLTAGE_OFF while the device is not is
used is recommended.</para>
&return-value-dvb;
</refsect1>
</refentry>

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,654 @@
<section id="frontend_legacy_types">
<title>Frontend Legacy Data Types</title>
<section id="fe-type-t">
<title>Frontend type</title>
<para>For historical reasons, frontend types are named by the type of modulation
used in transmission. The fontend types are given by fe_type_t type, defined as:</para>
<table pgwide="1" frame="none" id="fe-type">
<title>Frontend types</title>
<tgroup cols="3">
&cs-def;
<thead>
<row>
<entry>fe_type</entry>
<entry>Description</entry>
<entry><link linkend="DTV-DELIVERY-SYSTEM">DTV_DELIVERY_SYSTEM</link> equivalent type</entry>
</row>
</thead>
<tbody valign="top">
<row>
<entry id="FE-QPSK"><constant>FE_QPSK</constant></entry>
<entry>For DVB-S standard</entry>
<entry><constant>SYS_DVBS</constant></entry>
</row>
<row>
<entry id="FE-QAM"><constant>FE_QAM</constant></entry>
<entry>For DVB-C annex A standard</entry>
<entry><constant>SYS_DVBC_ANNEX_A</constant></entry>
</row>
<row>
<entry id="FE-OFDM"><constant>FE_OFDM</constant></entry>
<entry>For DVB-T standard</entry>
<entry><constant>SYS_DVBT</constant></entry>
</row>
<row>
<entry id="FE-ATSC"><constant>FE_ATSC</constant></entry>
<entry>For ATSC standard (terrestrial) or for DVB-C Annex B (cable) used in US.</entry>
<entry><constant>SYS_ATSC</constant> (terrestrial) or <constant>SYS_DVBC_ANNEX_B</constant> (cable)</entry>
</row>
</tbody></tgroup></table>
<para>Newer formats like DVB-S2, ISDB-T, ISDB-S and DVB-T2 are not described at the above, as they're
supported via the new <link linkend="FE_GET_PROPERTY">FE_GET_PROPERTY/FE_GET_SET_PROPERTY</link> ioctl's, using the <link linkend="DTV-DELIVERY-SYSTEM">DTV_DELIVERY_SYSTEM</link> parameter.
</para>
<para>In the old days, &dvb-frontend-info; used to contain
<constant>fe_type_t</constant> field to indicate the delivery systems,
filled with either FE_QPSK, FE_QAM, FE_OFDM or FE_ATSC. While this is
still filled to keep backward compatibility, the usage of this
field is deprecated, as it can report just one delivery system, but some
devices support multiple delivery systems. Please use
<link linkend="DTV-ENUM-DELSYS">DTV_ENUM_DELSYS</link> instead.
</para>
<para>On devices that support multiple delivery systems,
&dvb-frontend-info;::<constant>fe_type_t</constant> is filled with the
currently standard, as selected by the last call to
<link linkend="FE_GET_PROPERTY">FE_SET_PROPERTY</link>
using the &DTV-DELIVERY-SYSTEM; property.</para>
</section>
<section id="fe-bandwidth-t">
<title>Frontend bandwidth</title>
<table pgwide="1" frame="none" id="fe-bandwidth">
<title>enum fe_bandwidth</title>
<tgroup cols="2">
&cs-def;
<thead>
<row>
<entry>ID</entry>
<entry>Description</entry>
</row>
</thead>
<tbody valign="top">
<row>
<entry id="BANDWIDTH-AUTO"><constant>BANDWIDTH_AUTO</constant></entry>
<entry>Autodetect bandwidth (if supported)</entry>
</row><row>
<entry id="BANDWIDTH-1-712-MHZ"><constant>BANDWIDTH_1_712_MHZ</constant></entry>
<entry>1.712 MHz</entry>
</row><row>
<entry id="BANDWIDTH-5-MHZ"><constant>BANDWIDTH_5_MHZ</constant></entry>
<entry>5 MHz</entry>
</row><row>
<entry id="BANDWIDTH-6-MHZ"><constant>BANDWIDTH_6_MHZ</constant></entry>
<entry>6 MHz</entry>
</row><row>
<entry id="BANDWIDTH-7-MHZ"><constant>BANDWIDTH_7_MHZ</constant></entry>
<entry>7 MHz</entry>
</row><row>
<entry id="BANDWIDTH-8-MHZ"><constant>BANDWIDTH_8_MHZ</constant></entry>
<entry>8 MHz</entry>
</row><row>
<entry id="BANDWIDTH-10-MHZ"><constant>BANDWIDTH_10_MHZ</constant></entry>
<entry>10 MHz</entry>
</row>
</tbody>
</tgroup>
</table>
</section>
<section id="dvb-frontend-parameters">
<title>frontend parameters</title>
<para>The kind of parameters passed to the frontend device for tuning depend on
the kind of hardware you are using.</para>
<para>The struct <constant>dvb_frontend_parameters</constant> uses an
union with specific per-system parameters. However, as newer delivery systems
required more data, the structure size weren't enough to fit, and just
extending its size would break the existing applications. So, those parameters
were replaced by the usage of <link linkend="FE_GET_PROPERTY">
<constant>FE_GET_PROPERTY/FE_SET_PROPERTY</constant></link> ioctl's. The
new API is flexible enough to add new parameters to existing delivery systems,
and to add newer delivery systems.</para>
<para>So, newer applications should use <link linkend="FE_GET_PROPERTY">
<constant>FE_GET_PROPERTY/FE_SET_PROPERTY</constant></link> instead, in
order to be able to support the newer System Delivery like DVB-S2, DVB-T2,
DVB-C2, ISDB, etc.</para>
<para>All kinds of parameters are combined as an union in the FrontendParameters structure:
<programlisting>
struct dvb_frontend_parameters {
uint32_t frequency; /&#x22C6; (absolute) frequency in Hz for QAM/OFDM &#x22C6;/
/&#x22C6; intermediate frequency in kHz for QPSK &#x22C6;/
&fe-spectral-inversion-t; inversion;
union {
struct dvb_qpsk_parameters qpsk;
struct dvb_qam_parameters qam;
struct dvb_ofdm_parameters ofdm;
struct dvb_vsb_parameters vsb;
} u;
};
</programlisting></para>
<para>In the case of QPSK frontends the <constant>frequency</constant> field specifies the intermediate
frequency, i.e. the offset which is effectively added to the local oscillator frequency (LOF) of
the LNB. The intermediate frequency has to be specified in units of kHz. For QAM and
OFDM frontends the <constant>frequency</constant> specifies the absolute frequency and is given in Hz.
</para>
<section id="dvb-qpsk-parameters">
<title>QPSK parameters</title>
<para>For satellite QPSK frontends you have to use the <constant>dvb_qpsk_parameters</constant> structure:</para>
<programlisting>
struct dvb_qpsk_parameters {
uint32_t symbol_rate; /&#x22C6; symbol rate in Symbols per second &#x22C6;/
&fe-code-rate-t; fec_inner; /&#x22C6; forward error correction (see above) &#x22C6;/
};
</programlisting>
</section>
<section id="dvb-qam-parameters">
<title>QAM parameters</title>
<para>for cable QAM frontend you use the <constant>dvb_qam_parameters</constant> structure:</para>
<programlisting>
struct dvb_qam_parameters {
uint32_t symbol_rate; /&#x22C6; symbol rate in Symbols per second &#x22C6;/
&fe-code-rate-t; fec_inner; /&#x22C6; forward error correction (see above) &#x22C6;/
&fe-modulation-t; modulation; /&#x22C6; modulation type (see above) &#x22C6;/
};
</programlisting>
</section>
<section id="dvb-vsb-parameters">
<title>VSB parameters</title>
<para>ATSC frontends are supported by the <constant>dvb_vsb_parameters</constant> structure:</para>
<programlisting>
struct dvb_vsb_parameters {
&fe-modulation-t; modulation; /&#x22C6; modulation type (see above) &#x22C6;/
};
</programlisting>
</section>
<section id="dvb-ofdm-parameters">
<title>OFDM parameters</title>
<para>DVB-T frontends are supported by the <constant>dvb_ofdm_parameters</constant> structure:</para>
<programlisting>
struct dvb_ofdm_parameters {
&fe-bandwidth-t; bandwidth;
&fe-code-rate-t; code_rate_HP; /&#x22C6; high priority stream code rate &#x22C6;/
&fe-code-rate-t; code_rate_LP; /&#x22C6; low priority stream code rate &#x22C6;/
&fe-modulation-t; constellation; /&#x22C6; modulation type (see above) &#x22C6;/
&fe-transmit-mode-t; transmission_mode;
&fe-guard-interval-t; guard_interval;
&fe-hierarchy-t; hierarchy_information;
};
</programlisting>
</section>
</section>
<section id="dvb-frontend-event">
<title>frontend events</title>
<programlisting>
struct dvb_frontend_event {
fe_status_t status;
struct dvb_frontend_parameters parameters;
};
</programlisting>
</section>
</section>
<section id="frontend_legacy_fcalls">
<title>Frontend Legacy Function Calls</title>
<para>Those functions are defined at DVB version 3. The support is kept in
the kernel due to compatibility issues only. Their usage is strongly
not recommended</para>
<section id="FE_READ_BER">
<title>FE_READ_BER</title>
<para>DESCRIPTION
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>This ioctl call returns the bit error rate for the signal currently
received/demodulated by the front-end. For this command, read-only access to
the device is sufficient.</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>SYNOPSIS
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>int ioctl(int fd, int request = <link linkend="FE_READ_BER">FE_READ_BER</link>,
uint32_t &#x22C6;ber);</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>PARAMETERS
</para>
<informaltable><tgroup cols="2"><tbody><row><entry
align="char">
<para>int fd</para>
</entry><entry
align="char">
<para>File descriptor returned by a previous call to open().</para>
</entry>
</row><row><entry
align="char">
<para>int request</para>
</entry><entry
align="char">
<para>Equals <link linkend="FE_READ_BER">FE_READ_BER</link> for this command.</para>
</entry>
</row><row><entry
align="char">
<para>uint32_t *ber</para>
</entry><entry
align="char">
<para>The bit error rate is stored into *ber.</para>
</entry>
</row></tbody></tgroup></informaltable>
&return-value-dvb;
</section>
<section id="FE_READ_SNR">
<title>FE_READ_SNR</title>
<para>DESCRIPTION
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>This ioctl call returns the signal-to-noise ratio for the signal currently received
by the front-end. For this command, read-only access to the device is sufficient.</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>SYNOPSIS
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>int ioctl(int fd, int request = <link linkend="FE_READ_SNR">FE_READ_SNR</link>, uint16_t
&#x22C6;snr);</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>PARAMETERS
</para>
<informaltable><tgroup cols="2"><tbody><row><entry
align="char">
<para>int fd</para>
</entry><entry
align="char">
<para>File descriptor returned by a previous call to open().</para>
</entry>
</row><row><entry
align="char">
<para>int request</para>
</entry><entry
align="char">
<para>Equals <link linkend="FE_READ_SNR">FE_READ_SNR</link> for this command.</para>
</entry>
</row><row><entry
align="char">
<para>uint16_t *snr</para>
</entry><entry
align="char">
<para>The signal-to-noise ratio is stored into *snr.</para>
</entry>
</row></tbody></tgroup></informaltable>
&return-value-dvb;
</section>
<section id="FE_READ_SIGNAL_STRENGTH">
<title>FE_READ_SIGNAL_STRENGTH</title>
<para>DESCRIPTION
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>This ioctl call returns the signal strength value for the signal currently received
by the front-end. For this command, read-only access to the device is sufficient.</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>SYNOPSIS
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>int ioctl( int fd, int request =
<link linkend="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</link>, uint16_t &#x22C6;strength);</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>PARAMETERS
</para>
<informaltable><tgroup cols="2"><tbody><row><entry
align="char">
<para>int fd</para>
</entry><entry
align="char">
<para>File descriptor returned by a previous call to open().</para>
</entry>
</row><row><entry
align="char">
<para>int request</para>
</entry><entry
align="char">
<para>Equals <link linkend="FE_READ_SIGNAL_STRENGTH">FE_READ_SIGNAL_STRENGTH</link> for this
command.</para>
</entry>
</row><row><entry
align="char">
<para>uint16_t *strength</para>
</entry><entry
align="char">
<para>The signal strength value is stored into *strength.</para>
</entry>
</row></tbody></tgroup></informaltable>
&return-value-dvb;
</section>
<section id="FE_READ_UNCORRECTED_BLOCKS">
<title>FE_READ_UNCORRECTED_BLOCKS</title>
<para>DESCRIPTION
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>This ioctl call returns the number of uncorrected blocks detected by the device
driver during its lifetime. For meaningful measurements, the increment in block
count during a specific time interval should be calculated. For this command,
read-only access to the device is sufficient.</para>
</entry>
</row><row><entry
align="char">
<para>Note that the counter will wrap to zero after its maximum count has been
reached.</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>SYNOPSIS
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>int ioctl( int fd, int request =
<link linkend="FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</link>, uint32_t &#x22C6;ublocks);</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>PARAMETERS
</para>
<informaltable><tgroup cols="2"><tbody><row><entry
align="char">
<para>int fd</para>
</entry><entry
align="char">
<para>File descriptor returned by a previous call to open().</para>
</entry>
</row><row><entry
align="char">
<para>int request</para>
</entry><entry
align="char">
<para>Equals <link linkend="FE_READ_UNCORRECTED_BLOCKS">FE_READ_UNCORRECTED_BLOCKS</link> for this
command.</para>
</entry>
</row><row><entry
align="char">
<para>uint32_t *ublocks</para>
</entry><entry
align="char">
<para>The total number of uncorrected blocks seen by the driver
so far.</para>
</entry>
</row></tbody></tgroup></informaltable>
&return-value-dvb;
</section>
<section id="FE_SET_FRONTEND">
<title>FE_SET_FRONTEND</title>
<para>DESCRIPTION
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>This ioctl call starts a tuning operation using specified parameters. The result
of this call will be successful if the parameters were valid and the tuning could
be initiated. The result of the tuning operation in itself, however, will arrive
asynchronously as an event (see documentation for <link linkend="FE_GET_EVENT">FE_GET_EVENT</link> and
FrontendEvent.) If a new <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> operation is initiated before
the previous one was completed, the previous operation will be aborted in favor
of the new one. This command requires read/write access to the device.</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>SYNOPSIS
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>int ioctl(int fd, int request = <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link>,
struct dvb_frontend_parameters &#x22C6;p);</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>PARAMETERS
</para>
<informaltable><tgroup cols="2"><tbody><row><entry
align="char">
<para>int fd</para>
</entry><entry
align="char">
<para>File descriptor returned by a previous call to open().</para>
</entry>
</row><row><entry
align="char">
<para>int request</para>
</entry><entry
align="char">
<para>Equals <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> for this command.</para>
</entry>
</row><row><entry
align="char">
<para>struct
dvb_frontend_parameters
*p</para>
</entry><entry
align="char">
<para>Points to parameters for tuning operation.</para>
</entry>
</row></tbody></tgroup></informaltable>
&return-value-dvb;
<informaltable><tgroup cols="2"><tbody><row><entry
align="char">
<para>EINVAL</para>
</entry><entry
align="char">
<para>Maximum supported symbol rate reached.</para>
</entry>
</row></tbody></tgroup></informaltable>
</section>
<section id="FE_GET_FRONTEND">
<title>FE_GET_FRONTEND</title>
<para>DESCRIPTION
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>This ioctl call queries the currently effective frontend parameters. For this
command, read-only access to the device is sufficient.</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>SYNOPSIS
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>int ioctl(int fd, int request = <link linkend="FE_GET_FRONTEND">FE_GET_FRONTEND</link>,
struct dvb_frontend_parameters &#x22C6;p);</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>PARAMETERS
</para>
<informaltable><tgroup cols="2"><tbody><row><entry
align="char">
<para>int fd</para>
</entry><entry
align="char">
<para>File descriptor returned by a previous call to open().</para>
</entry>
</row><row><entry
align="char">
<para>int request</para>
</entry><entry
align="char">
<para>Equals <link linkend="FE_SET_FRONTEND">FE_SET_FRONTEND</link> for this command.</para>
</entry>
</row><row><entry
align="char">
<para>struct
dvb_frontend_parameters
*p</para>
</entry><entry
align="char">
<para>Points to parameters for tuning operation.</para>
</entry>
</row></tbody></tgroup></informaltable>
&return-value-dvb;
<informaltable><tgroup cols="2"><tbody><row><entry
align="char">
<para>EINVAL</para>
</entry><entry
align="char">
<para>Maximum supported symbol rate reached.</para>
</entry>
</row></tbody></tgroup></informaltable>
</section>
<section id="FE_GET_EVENT">
<title>FE_GET_EVENT</title>
<para>DESCRIPTION
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>This ioctl call returns a frontend event if available. If an event is not
available, the behavior depends on whether the device is in blocking or
non-blocking mode. In the latter case, the call fails immediately with errno
set to EWOULDBLOCK. In the former case, the call blocks until an event
becomes available.</para>
</entry>
</row><row><entry
align="char">
<para>The standard Linux poll() and/or select() system calls can be used with the
device file descriptor to watch for new events. For select(), the file descriptor
should be included in the exceptfds argument, and for poll(), POLLPRI should
be specified as the wake-up condition. Since the event queue allocated is
rather small (room for 8 events), the queue must be serviced regularly to avoid
overflow. If an overflow happens, the oldest event is discarded from the queue,
and an error (EOVERFLOW) occurs the next time the queue is read. After
reporting the error condition in this fashion, subsequent
<link linkend="FE_GET_EVENT">FE_GET_EVENT</link>
calls will return events from the queue as usual.</para>
</entry>
</row><row><entry
align="char">
<para>For the sake of implementation simplicity, this command requires read/write
access to the device.</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>SYNOPSIS
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>int ioctl(int fd, int request = QPSK_GET_EVENT,
struct dvb_frontend_event &#x22C6;ev);</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>PARAMETERS
</para>
<informaltable><tgroup cols="2"><tbody><row><entry
align="char">
<para>int fd</para>
</entry><entry
align="char">
<para>File descriptor returned by a previous call to open().</para>
</entry>
</row><row><entry
align="char">
<para>int request</para>
</entry><entry
align="char">
<para>Equals <link linkend="FE_GET_EVENT">FE_GET_EVENT</link> for this command.</para>
</entry>
</row><row><entry
align="char">
<para>struct
dvb_frontend_event
*ev</para>
</entry><entry
align="char">
<para>Points to the location where the event,</para>
</entry>
</row><row><entry
align="char">
</entry><entry
align="char">
<para>if any, is to be stored.</para>
</entry>
</row></tbody></tgroup></informaltable>
&return-value-dvb;
<informaltable><tgroup cols="2"><tbody><row><entry
align="char">
<para>EWOULDBLOCK</para>
</entry><entry
align="char">
<para>There is no event pending, and the device is in
non-blocking mode.</para>
</entry>
</row><row><entry
align="char">
<para>EOVERFLOW</para>
</entry><entry
align="char">
<para>Overflow in event queue - one or more events were lost.</para>
</entry>
</row></tbody></tgroup></informaltable>
</section>
<section id="FE_DISHNETWORK_SEND_LEGACY_CMD">
<title>FE_DISHNETWORK_SEND_LEGACY_CMD</title>
<para>DESCRIPTION</para>
<informaltable><tgroup cols="1"><tbody><row>
<entry align="char">
<para>WARNING: This is a very obscure legacy command, used only at stv0299 driver. Should not be used on newer drivers.</para>
<para>It provides a non-standard method for selecting Diseqc voltage on the frontend, for Dish Network legacy switches.</para>
<para>As support for this ioctl were added in 2004, this means that such dishes were already legacy in 2004.</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>SYNOPSIS</para>
<informaltable><tgroup cols="1"><tbody><row>
<entry align="char">
<para>int ioctl(int fd, int request =
<link linkend="FE_DISHNETWORK_SEND_LEGACY_CMD">FE_DISHNETWORK_SEND_LEGACY_CMD</link>, unsigned long cmd);</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>PARAMETERS</para>
<informaltable><tgroup cols="2"><tbody><row>
<entry align="char">
<para>unsigned long cmd</para>
</entry>
<entry align="char">
<para>
sends the specified raw cmd to the dish via DISEqC.
</para>
</entry>
</row></tbody></tgroup></informaltable>
&return-value-dvb;
</section>
</section>

View File

@ -129,41 +129,41 @@ hardware. It can depend on the individual security requirements of the
platform, if and how many of the CA functions are made available to the
application through this device.</para>
<para>All devices can be found in the <emphasis role="tt">/dev</emphasis>
tree under <emphasis role="tt">/dev/dvb</emphasis>. The individual devices
<para>All devices can be found in the <constant>/dev</constant>
tree under <constant>/dev/dvb</constant>. The individual devices
are called:</para>
<itemizedlist>
<listitem>
<para><emphasis role="tt">/dev/dvb/adapterN/audioM</emphasis>,</para>
<para><constant>/dev/dvb/adapterN/audioM</constant>,</para>
</listitem>
<listitem>
<para><emphasis role="tt">/dev/dvb/adapterN/videoM</emphasis>,</para>
<para><constant>/dev/dvb/adapterN/videoM</constant>,</para>
</listitem>
<listitem>
<para><emphasis role="tt">/dev/dvb/adapterN/frontendM</emphasis>,</para>
<para><constant>/dev/dvb/adapterN/frontendM</constant>,</para>
</listitem>
<listitem>
<para><emphasis role="tt">/dev/dvb/adapterN/netM</emphasis>,</para>
<para><constant>/dev/dvb/adapterN/netM</constant>,</para>
</listitem>
<listitem>
<para><emphasis role="tt">/dev/dvb/adapterN/demuxM</emphasis>,</para>
<para><constant>/dev/dvb/adapterN/demuxM</constant>,</para>
</listitem>
<listitem>
<para><emphasis role="tt">/dev/dvb/adapterN/dvrM</emphasis>,</para>
<para><constant>/dev/dvb/adapterN/dvrM</constant>,</para>
</listitem>
<listitem>
<para><emphasis role="tt">/dev/dvb/adapterN/caM</emphasis>,</para></listitem></itemizedlist>
<para><constant>/dev/dvb/adapterN/caM</constant>,</para></listitem></itemizedlist>
<para>where N enumerates the DVB PCI cards in a system starting
from&#x00A0;0, and M enumerates the devices of each type within each
adapter, starting from&#x00A0;0, too. We will omit the &#8220;<emphasis
role="tt">/dev/dvb/adapterN/</emphasis>&#8221; in the further dicussion
adapter, starting from&#x00A0;0, too. We will omit the &#8220;
<constant>/dev/dvb/adapterN/</constant>&#8221; in the further dicussion
of these devices. The naming scheme for the devices is the same wheter
devfs is used or not.</para>
@ -202,10 +202,10 @@ a partial path like:</para>
</programlisting>
<para>To enable applications to support different API version, an
additional include file <emphasis
role="tt">linux/dvb/version.h</emphasis> exists, which defines the
constant <emphasis role="tt">DVB_API_VERSION</emphasis>. This document
describes <emphasis role="tt">DVB_API_VERSION 5.8</emphasis>.
additional include file
<constant>linux/dvb/version.h</constant> exists, which defines the
constant <constant>DVB_API_VERSION</constant>. This document
describes <constant>DVB_API_VERSION 5.10</constant>.
</para>
</section>

View File

@ -1,8 +1,8 @@
<title>Kernel Demux API</title>
<para>The kernel demux API defines a driver-internal interface for registering low-level,
hardware specific driver to a hardware independent demux layer. It is only of interest for
DVB device driver writers. The header file for this API is named <emphasis role="tt">demux.h</emphasis> and located in
<emphasis role="tt">drivers/media/dvb-core</emphasis>.
DVB device driver writers. The header file for this API is named <constant>demux.h</constant> and located in
<constant>">drivers/media/dvb-core</constant>.
</para>
<para>Maintainer note: This section must be reviewed. It is probably out of date.
</para>

View File

@ -1,156 +1,238 @@
<title>DVB Network API</title>
<para>The DVB net device enables feeding of MPE (multi protocol encapsulation) packets
received via DVB into the Linux network protocol stack, e.g. for internet via satellite
applications. It can be accessed through <emphasis role="tt">/dev/dvb/adapter0/net0</emphasis>. Data types and
and ioctl definitions can be accessed by including <emphasis role="tt">linux/dvb/net.h</emphasis> in your
application.
</para>
<section id="dvb_net_types">
<title>DVB Net Data Types</title>
<para>The DVB net device controls the mapping of data packages that are
part of a transport stream to be mapped into a virtual network interface,
visible through the standard Linux network protocol stack.</para>
<para>Currently, two encapsulations are supported:</para>
<itemizedlist>
<listitem><para><ulink url="http://en.wikipedia.org/wiki/Multiprotocol_Encapsulation">
Multi Protocol Encapsulation (MPE)</ulink></para></listitem>
<listitem><para><ulink url="http://en.wikipedia.org/wiki/Unidirectional_Lightweight_Encapsulation">
Ultra Lightweight Encapsulation (ULE)</ulink></para></listitem>
</itemizedlist>
<section id="dvb-net-if">
<title>struct dvb_net_if</title>
<programlisting>
struct dvb_net_if {
__u16 pid;
__u16 if_num;
__u8 feedtype;
#define DVB_NET_FEEDTYPE_MPE 0 /&#x22C6; multi protocol encapsulation &#x22C6;/
#define DVB_NET_FEEDTYPE_ULE 1 /&#x22C6; ultra lightweight encapsulation &#x22C6;/
};
</programlisting>
</section>
<para>In order to create the Linux virtual network interfaces, an application
needs to tell to the Kernel what are the PIDs and the encapsulation types
that are present on the transport stream. This is done through
<constant>/dev/dvb/adapter?/net?</constant> device node.
The data will be available via virtual <constant>dvb?_?</constant>
network interfaces, and will be controled/routed via the standard
ip tools (like ip, route, netstat, ifconfig, etc).</para>
<para> Data types and and ioctl definitions are defined via
<constant>linux/dvb/net.h</constant> header.</para>
</section>
<section id="net_fcalls">
<title>DVB net Function Calls</title>
<para>To be written&#x2026;
</para>
<section id="NET_ADD_IF"
role="subsection"><title>NET_ADD_IF</title>
<para>DESCRIPTION
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>This ioctl is undocumented. Documentation is welcome.</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>SYNOPSIS
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>int ioctl(fd, int request = NET_ADD_IF,
struct dvb_net_if *if);</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>PARAMETERS
</para>
<informaltable><tgroup cols="2"><tbody><row><entry
align="char">
<para>int fd</para>
</entry><entry
align="char">
<para>File descriptor returned by a previous call to open().</para>
</entry>
</row><row><entry
align="char">
<para>int request</para>
</entry><entry
align="char">
<para>Equals NET_ADD_IF for this command.</para>
</entry>
</row><row><entry
align="char">
<para>struct dvb_net_if *if
</para>
</entry><entry
align="char">
<para>Undocumented.</para>
</entry>
</row></tbody></tgroup></informaltable>
&return-value-dvb;
</section>
<section id="NET_REMOVE_IF"
role="subsection"><title>NET_REMOVE_IF</title>
<para>DESCRIPTION
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>This ioctl is undocumented. Documentation is welcome.</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>SYNOPSIS
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>int ioctl(fd, int request = NET_REMOVE_IF);
</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>PARAMETERS
</para>
<informaltable><tgroup cols="2"><tbody><row><entry
align="char">
<para>int fd</para>
</entry><entry
align="char">
<para>File descriptor returned by a previous call to open().</para>
</entry>
</row><row><entry
align="char">
<para>int request</para>
</entry><entry
align="char">
<para>Equals NET_REMOVE_IF for this command.</para>
</entry>
</row></tbody></tgroup></informaltable>
&return-value-dvb;
</section>
<refentry id="NET_ADD_IF">
<refmeta>
<refentrytitle>ioctl NET_ADD_IF</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname>NET_ADD_IF</refname>
<refpurpose>Creates a new network interface for a given Packet ID.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>ioctl</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>request</parameter></paramdef>
<paramdef>struct dvb_net_if *<parameter>net_if</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Arguments</title>
<variablelist>
<varlistentry>
<term><parameter>fd</parameter></term>
<listitem>
<para>&fe_fd;</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>request</parameter></term>
<listitem>
<para>FE_SET_TONE</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>net_if</parameter></term>
<listitem>
<para>pointer to &dvb-net-if;</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>The NET_ADD_IF ioctl system call selects the Packet ID (PID) that
contains a TCP/IP traffic, the type of encapsulation to be used (MPE or ULE)
and the interface number for the new interface to be created. When the
system call successfully returns, a new virtual network interface is created.</para>
<para>The &dvb-net-if;::ifnum field will be filled with the number of the
created interface.</para>
<section id="NET_GET_IF"
role="subsection"><title>NET_GET_IF</title>
<para>DESCRIPTION
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>This ioctl is undocumented. Documentation is welcome.</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>SYNOPSIS
</para>
<informaltable><tgroup cols="1"><tbody><row><entry
align="char">
<para>int ioctl(fd, int request = NET_GET_IF,
struct dvb_net_if *if);</para>
</entry>
</row></tbody></tgroup></informaltable>
<para>PARAMETERS
</para>
<informaltable><tgroup cols="2"><tbody><row><entry
align="char">
<para>int fd</para>
</entry><entry
align="char">
<para>File descriptor returned by a previous call to open().</para>
</entry>
</row><row><entry
align="char">
<para>int request</para>
</entry><entry
align="char">
<para>Equals NET_GET_IF for this command.</para>
</entry>
</row><row><entry
align="char">
<para>struct dvb_net_if *if
</para>
</entry><entry
align="char">
<para>Undocumented.</para>
</entry>
</row></tbody></tgroup></informaltable>
&return-value-dvb;
</section>
</refsect1>
<refsect1 id="dvb-net-if-t">
<title>struct <structname>dvb_net_if</structname> description</title>
<table pgwide="1" frame="none" id="dvb-net-if">
<title>struct <structname>dvb_net_if</structname></title>
<tgroup cols="2">
&cs-def;
<thead>
<row>
<entry>ID</entry>
<entry>Description</entry>
</row>
</thead>
<tbody valign="top">
<row>
<entry align="char">pid</entry>
<entry align="char">Packet ID (PID) of the MPEG-TS that contains
data</entry>
</row><row>
<entry align="char">ifnum</entry>
<entry align="char">number of the DVB interface.</entry>
</row><row>
<entry align="char">feedtype</entry>
<entry align="char">Encapsulation type of the feed. It can be:
<constant>DVB_NET_FEEDTYPE_MPE</constant> for MPE encoding
or
<constant>DVB_NET_FEEDTYPE_ULE</constant> for ULE encoding.
</entry>
</row>
</tbody>
</tgroup>
</table>
</refsect1>
</refentry>
<refentry id="NET_REMOVE_IF">
<refmeta>
<refentrytitle>ioctl NET_REMOVE_IF</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname>NET_REMOVE_IF</refname>
<refpurpose>Removes a network interface.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>ioctl</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>request</parameter></paramdef>
<paramdef>int <parameter>ifnum</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Arguments</title>
<variablelist>
<varlistentry>
<term><parameter>fd</parameter></term>
<listitem>
<para>&fe_fd;</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>request</parameter></term>
<listitem>
<para>FE_SET_TONE</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>net_if</parameter></term>
<listitem>
<para>number of the interface to be removed</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>The NET_REMOVE_IF ioctl deletes an interface previously created
via &NET-ADD-IF;.</para>
&return-value-dvb;
</refsect1>
</refentry>
<refentry id="NET_GET_IF">
<refmeta>
<refentrytitle>ioctl NET_GET_IF</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname>NET_GET_IF</refname>
<refpurpose>Read the configuration data of an interface created via
&NET-ADD-IF;.</refpurpose>
</refnamediv>
<refsynopsisdiv>
<funcsynopsis>
<funcprototype>
<funcdef>int <function>ioctl</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>request</parameter></paramdef>
<paramdef>struct dvb_net_if *<parameter>net_if</parameter></paramdef>
</funcprototype>
</funcsynopsis>
</refsynopsisdiv>
<refsect1>
<title>Arguments</title>
<variablelist>
<varlistentry>
<term><parameter>fd</parameter></term>
<listitem>
<para>&fe_fd;</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>request</parameter></term>
<listitem>
<para>FE_SET_TONE</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>net_if</parameter></term>
<listitem>
<para>pointer to &dvb-net-if;</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1>
<title>Description</title>
<para>The NET_GET_IF ioctl uses the interface number given by the
&dvb-net-if;::ifnum field and fills the content of &dvb-net-if; with
the packet ID and encapsulation type used on such interface. If the
interface was not created yet with &NET-ADD-IF;, it will return -1 and
fill the <constant>errno</constant> with <constant>EINVAL</constant>
error code.</para>
&return-value-dvb;
</refsect1>
</refentry>
</section>

View File

@ -1,12 +1,12 @@
<title>DVB Video Device</title>
<para>The DVB video device controls the MPEG2 video decoder of the DVB hardware. It
can be accessed through <emphasis role="tt">/dev/dvb/adapter0/video0</emphasis>. Data types and and
ioctl definitions can be accessed by including <emphasis role="tt">linux/dvb/video.h</emphasis> in your
can be accessed through <emphasis role="bold">/dev/dvb/adapter0/video0</emphasis>. Data types and and
ioctl definitions can be accessed by including <emphasis role="bold">linux/dvb/video.h</emphasis> in your
application.
</para>
<para>Note that the DVB video device only controls decoding of the MPEG video stream, not
its presentation on the TV or computer screen. On PCs this is typically handled by an
associated video4linux device, e.g. <emphasis role="tt">/dev/video</emphasis>, which allows scaling and defining output
associated video4linux device, e.g. <emphasis role="bold">/dev/video</emphasis>, which allows scaling and defining output
windows.
</para>
<para>Some DVB cards don&#8217;t have their own MPEG decoder, which results in the omission of
@ -24,7 +24,7 @@ have been created to replace that functionality.</para>
<section id="video-format-t">
<title>video_format_t</title>
<para>The <emphasis role="tt">video_format_t</emphasis> data type defined by
<para>The <constant>video_format_t</constant> data type defined by
</para>
<programlisting>
typedef enum {
@ -74,7 +74,7 @@ typedef enum {
</programlisting>
<para>VIDEO_SOURCE_DEMUX selects the demultiplexer (fed either by the frontend or the
DVR device) as the source of the video stream. If VIDEO_SOURCE_MEMORY
is selected the stream comes from the application through the <emphasis role="tt">write()</emphasis> system
is selected the stream comes from the application through the <emphasis role="bold">write()</emphasis> system
call.
</para>
</section>

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 35 KiB

View File

@ -4863,7 +4863,7 @@ interface and may change in the future.</para>
</note>
<para>
The Image Source control class is intended for low-level control of
The Image Process control class is intended for low-level control of
image processing functions. Unlike
<constant>V4L2_CID_IMAGE_SOURCE_CLASS</constant>, the controls in
this class affect processing the image, and do not control capturing
@ -4871,7 +4871,7 @@ interface and may change in the future.</para>
</para>
<table pgwide="1" frame="none" id="image-process-control-id">
<title>Image Source Control IDs</title>
<title>Image Process Control IDs</title>
<tgroup cols="4">
<colspec colname="c1" colwidth="1*" />

View File

@ -841,15 +841,15 @@ is the file descriptor associated with a DMABUF buffer.</entry>
<entry>__u32</entry>
<entry><structfield>reserved2</structfield></entry>
<entry></entry>
<entry>A place holder for future extensions. Applications
should set this to 0.</entry>
<entry>A place holder for future extensions. Drivers and applications
must set this to 0.</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>reserved</structfield></entry>
<entry></entry>
<entry>A place holder for future extensions. Applications
should set this to 0.</entry>
<entry>A place holder for future extensions. Drivers and applications
must set this to 0.</entry>
</row>
</tbody>
</tgroup>
@ -930,8 +930,8 @@ should set this to 0.</entry>
<entry>__u32</entry>
<entry><structfield>reserved[11]</structfield></entry>
<entry></entry>
<entry>Reserved for future use. Should be zeroed by an
application.</entry>
<entry>Reserved for future use. Should be zeroed by drivers and
applications.</entry>
</row>
</tbody>
</tgroup>
@ -1127,6 +1127,18 @@ passed on to a DMA-capable hardware unit for further processing or output.
Typically applications shall use this flag for output buffers if the data
in this buffer has not been created by the CPU but by some DMA-capable unit,
in which case caches have not been used.</entry>
</row>
<row>
<entry><constant>V4L2_BUF_FLAG_LAST</constant></entry>
<entry>0x00100000</entry>
<entry>Last buffer produced by the hardware. mem2mem codec drivers
set this flag on the capture queue for the last buffer when the
<link linkend="vidioc-querybuf">VIDIOC_QUERYBUF</link> or
<link linkend="vidioc-qbuf">VIDIOC_DQBUF</link> ioctl is called. Due to hardware
limitations, the last buffer may be empty. In this case the driver will set the
<structfield>bytesused</structfield> field to 0, regardless of the format. Any
Any subsequent call to the <link linkend="vidioc-qbuf">VIDIOC_DQBUF</link> ioctl
will not block anymore, but return an &EPIPE;.</entry>
</row>
<row>
<entry><constant>V4L2_BUF_FLAG_TIMESTAMP_MASK</constant></entry>
@ -1155,7 +1167,7 @@ in which case caches have not been used.</entry>
<entry>The buffer timestamp has been taken from the
<constant>CLOCK_MONOTONIC</constant> clock. To access the
same clock outside V4L2, use
<function>clock_gettime(2)</function> .</entry>
<function>clock_gettime(2)</function>.</entry>
</row>
<row>
<entry><constant>V4L2_BUF_FLAG_TIMESTAMP_COPY</constant></entry>

View File

@ -44,7 +44,7 @@
<para>To open a media device applications call <function>open()</function>
with the desired device name. The function has no side effects; the device
configuration remain unchanged.</para>
<para>When the device is opened in read-only mode, attemps to modify its
<para>When the device is opened in read-only mode, attempts to modify its
configuration will result in an error, and <varname>errno</varname> will be
set to <errorcode>EBADF</errorcode>.</para>
</refsect1>

View File

@ -0,0 +1,81 @@
<refentry id="V4L2-PIX-FMT-Y16-BE">
<refmeta>
<refentrytitle>V4L2_PIX_FMT_Y16_BE ('Y16 ' | (1 &lt;&lt; 31))</refentrytitle>
&manvol;
</refmeta>
<refnamediv>
<refname><constant>V4L2_PIX_FMT_Y16_BE</constant></refname>
<refpurpose>Grey-scale image</refpurpose>
</refnamediv>
<refsect1>
<title>Description</title>
<para>This is a grey-scale image with a depth of 16 bits per
pixel. The most significant byte is stored at lower memory addresses
(big-endian). Note the actual sampling precision may be lower than
16 bits, for example 10 bits per pixel with values in range 0 to
1023.</para>
<example>
<title><constant>V4L2_PIX_FMT_Y16_BE</constant> 4 &times; 4
pixel image</title>
<formalpara>
<title>Byte Order.</title>
<para>Each cell is one byte.
<informaltable frame="none">
<tgroup cols="9" align="center">
<colspec align="left" colwidth="2*" />
<tbody valign="top">
<row>
<entry>start&nbsp;+&nbsp;0:</entry>
<entry>Y'<subscript>00high</subscript></entry>
<entry>Y'<subscript>00low</subscript></entry>
<entry>Y'<subscript>01high</subscript></entry>
<entry>Y'<subscript>01low</subscript></entry>
<entry>Y'<subscript>02high</subscript></entry>
<entry>Y'<subscript>02low</subscript></entry>
<entry>Y'<subscript>03high</subscript></entry>
<entry>Y'<subscript>03low</subscript></entry>
</row>
<row>
<entry>start&nbsp;+&nbsp;8:</entry>
<entry>Y'<subscript>10high</subscript></entry>
<entry>Y'<subscript>10low</subscript></entry>
<entry>Y'<subscript>11high</subscript></entry>
<entry>Y'<subscript>11low</subscript></entry>
<entry>Y'<subscript>12high</subscript></entry>
<entry>Y'<subscript>12low</subscript></entry>
<entry>Y'<subscript>13high</subscript></entry>
<entry>Y'<subscript>13low</subscript></entry>
</row>
<row>
<entry>start&nbsp;+&nbsp;16:</entry>
<entry>Y'<subscript>20high</subscript></entry>
<entry>Y'<subscript>20low</subscript></entry>
<entry>Y'<subscript>21high</subscript></entry>
<entry>Y'<subscript>21low</subscript></entry>
<entry>Y'<subscript>22high</subscript></entry>
<entry>Y'<subscript>22low</subscript></entry>
<entry>Y'<subscript>23high</subscript></entry>
<entry>Y'<subscript>23low</subscript></entry>
</row>
<row>
<entry>start&nbsp;+&nbsp;24:</entry>
<entry>Y'<subscript>30high</subscript></entry>
<entry>Y'<subscript>30low</subscript></entry>
<entry>Y'<subscript>31high</subscript></entry>
<entry>Y'<subscript>31low</subscript></entry>
<entry>Y'<subscript>32high</subscript></entry>
<entry>Y'<subscript>32low</subscript></entry>
<entry>Y'<subscript>33high</subscript></entry>
<entry>Y'<subscript>33low</subscript></entry>
</row>
</tbody>
</tgroup>
</informaltable>
</para>
</formalpara>
</example>
</refsect1>
</refentry>

View File

@ -155,6 +155,14 @@ see <xref linkend="colorspaces" />.</entry>
<entry>This information supplements the
<structfield>colorspace</structfield> and must be set by the driver for
capture streams and by the application for output streams,
see <xref linkend="colorspaces" />.</entry>
</row>
<row>
<entry>&v4l2-xfer-func;</entry>
<entry><structfield>xfer_func</structfield></entry>
<entry>This information supplements the
<structfield>colorspace</structfield> and must be set by the driver for
capture streams and by the application for output streams,
see <xref linkend="colorspaces" />.</entry>
</row>
</tbody>
@ -190,8 +198,8 @@ see <xref linkend="colorspaces" />.</entry>
<row>
<entry>__u16</entry>
<entry><structfield>reserved[6]</structfield></entry>
<entry>Reserved for future extensions. Should be zeroed by the
application.</entry>
<entry>Reserved for future extensions. Should be zeroed by drivers and
applications.</entry>
</row>
</tbody>
</tgroup>
@ -262,13 +270,21 @@ see <xref linkend="colorspaces" />.</entry>
<entry>This information supplements the
<structfield>colorspace</structfield> and must be set by the driver for
capture streams and by the application for output streams,
see <xref linkend="colorspaces" />.</entry>
</row>
<row>
<entry>&v4l2-xfer-func;</entry>
<entry><structfield>xfer_func</structfield></entry>
<entry>This information supplements the
<structfield>colorspace</structfield> and must be set by the driver for
capture streams and by the application for output streams,
see <xref linkend="colorspaces" />.</entry>
</row>
<row>
<entry>__u8</entry>
<entry><structfield>reserved[8]</structfield></entry>
<entry>Reserved for future extensions. Should be zeroed by the
application.</entry>
<entry><structfield>reserved[7]</structfield></entry>
<entry>Reserved for future extensions. Should be zeroed by drivers
and applications.</entry>
</row>
</tbody>
</tgroup>
@ -476,15 +492,16 @@ is also very useful.</para>
<section>
<title>Defining Colorspaces in V4L2</title>
<para>In V4L2 colorspaces are defined by three values. The first is the colorspace
identifier (&v4l2-colorspace;) which defines the chromaticities, the transfer
<para>In V4L2 colorspaces are defined by four values. The first is the colorspace
identifier (&v4l2-colorspace;) which defines the chromaticities, the default transfer
function, the default Y'CbCr encoding and the default quantization method. The second
is the Y'CbCr encoding identifier (&v4l2-ycbcr-encoding;) to specify non-standard
Y'CbCr encodings and the third is the quantization identifier (&v4l2-quantization;)
to specify non-standard quantization methods. Most of the time only the colorspace
field of &v4l2-pix-format; or &v4l2-pix-format-mplane; needs to be filled in. Note
that the default R'G'B' quantization is full range for all colorspaces except for
BT.2020 which uses limited range R'G'B' quantization.</para>
is the transfer function identifier (&v4l2-xfer-func;) to specify non-standard
transfer functions. The third is the Y'CbCr encoding identifier (&v4l2-ycbcr-encoding;)
to specify non-standard Y'CbCr encodings and the fourth is the quantization identifier
(&v4l2-quantization;) to specify non-standard quantization methods. Most of the time
only the colorspace field of &v4l2-pix-format; or &v4l2-pix-format-mplane; needs to
be filled in. Note that the default R'G'B' quantization is full range for all
colorspaces except for BT.2020 which uses limited range R'G'B' quantization.</para>
<table pgwide="1" frame="none" id="v4l2-colorspace">
<title>V4L2 Colorspaces</title>
@ -497,6 +514,11 @@ BT.2020 which uses limited range R'G'B' quantization.</para>
</row>
</thead>
<tbody valign="top">
<row>
<entry><constant>V4L2_COLORSPACE_DEFAULT</constant></entry>
<entry>The default colorspace. This can be used by applications to let the
driver fill in the colorspace.</entry>
</row>
<row>
<entry><constant>V4L2_COLORSPACE_SMPTE170M</constant></entry>
<entry>See <xref linkend="col-smpte-170m" />.</entry>
@ -533,6 +555,52 @@ BT.2020 which uses limited range R'G'B' quantization.</para>
<entry><constant>V4L2_COLORSPACE_JPEG</constant></entry>
<entry>See <xref linkend="col-jpeg" />.</entry>
</row>
<row>
<entry><constant>V4L2_COLORSPACE_RAW</constant></entry>
<entry>The raw colorspace. This is used for raw image capture where
the image is minimally processed and is using the internal colorspace
of the device. The software that processes an image using this
'colorspace' will have to know the internals of the capture device.</entry>
</row>
</tbody>
</tgroup>
</table>
<table pgwide="1" frame="none" id="v4l2-xfer-func">
<title>V4L2 Transfer Function</title>
<tgroup cols="2" align="left">
&cs-def;
<thead>
<row>
<entry>Identifier</entry>
<entry>Details</entry>
</row>
</thead>
<tbody valign="top">
<row>
<entry><constant>V4L2_XFER_FUNC_DEFAULT</constant></entry>
<entry>Use the default transfer function as defined by the colorspace.</entry>
</row>
<row>
<entry><constant>V4L2_XFER_FUNC_709</constant></entry>
<entry>Use the Rec. 709 transfer function.</entry>
</row>
<row>
<entry><constant>V4L2_XFER_FUNC_SRGB</constant></entry>
<entry>Use the sRGB transfer function.</entry>
</row>
<row>
<entry><constant>V4L2_XFER_FUNC_ADOBERGB</constant></entry>
<entry>Use the AdobeRGB transfer function.</entry>
</row>
<row>
<entry><constant>V4L2_XFER_FUNC_SMPTE240M</constant></entry>
<entry>Use the SMPTE 240M transfer function.</entry>
</row>
<row>
<entry><constant>V4L2_XFER_FUNC_NONE</constant></entry>
<entry>Do not use a transfer function (i.e. use linear RGB values).</entry>
</row>
</tbody>
</tgroup>
</table>
@ -624,7 +692,8 @@ is mapped to [16&hellip;235]. Cb and Cr are mapped from [-0.5&hellip;0.5] to [16
<section id="col-smpte-170m">
<title>Colorspace SMPTE 170M (<constant>V4L2_COLORSPACE_SMPTE170M</constant>)</title>
<para>The <xref linkend="smpte170m" /> standard defines the colorspace used by NTSC and PAL and by SDTV
in general. The default Y'CbCr encoding is <constant>V4L2_YCBCR_ENC_601</constant>.
in general. The default transfer function is <constant>V4L2_XFER_FUNC_709</constant>.
The default Y'CbCr encoding is <constant>V4L2_YCBCR_ENC_601</constant>.
The default Y'CbCr quantization is limited range. The chromaticities of the primary colors and
the white reference are:</para>
<table frame="none">
@ -706,7 +775,8 @@ rarely seen.</para>
<section id="col-rec709">
<title>Colorspace Rec. 709 (<constant>V4L2_COLORSPACE_REC709</constant>)</title>
<para>The <xref linkend="itu709" /> standard defines the colorspace used by HDTV in general. The default
<para>The <xref linkend="itu709" /> standard defines the colorspace used by HDTV in general.
The default transfer function is <constant>V4L2_XFER_FUNC_709</constant>. The default
Y'CbCr encoding is <constant>V4L2_YCBCR_ENC_709</constant>. The default Y'CbCr quantization is
limited range. The chromaticities of the primary colors and the white reference are:</para>
<table frame="none">
@ -817,9 +887,11 @@ The xvYCC encodings always use full range quantization.</para>
<section id="col-srgb">
<title>Colorspace sRGB (<constant>V4L2_COLORSPACE_SRGB</constant>)</title>
<para>The <xref linkend="srgb" /> standard defines the colorspace used by most webcams and computer graphics. The
default Y'CbCr encoding is <constant>V4L2_YCBCR_ENC_SYCC</constant>. The default Y'CbCr quantization
is full range. The chromaticities of the primary colors and the white reference are:</para>
<para>The <xref linkend="srgb" /> standard defines the colorspace used by most webcams
and computer graphics. The default transfer function is <constant>V4L2_XFER_FUNC_SRGB</constant>.
The default Y'CbCr encoding is <constant>V4L2_YCBCR_ENC_SYCC</constant>. The default Y'CbCr
quantization is full range. The chromaticities of the primary colors and the white
reference are:</para>
<table frame="none">
<title>sRGB Chromaticities</title>
<tgroup cols="3" align="left">
@ -896,6 +968,7 @@ values before quantization, but this encoding does not do that.</para>
<title>Colorspace Adobe RGB (<constant>V4L2_COLORSPACE_ADOBERGB</constant>)</title>
<para>The <xref linkend="adobergb" /> standard defines the colorspace used by computer graphics
that use the AdobeRGB colorspace. This is also known as the <xref linkend="oprgb" /> standard.
The default transfer function is <constant>V4L2_XFER_FUNC_ADOBERGB</constant>.
The default Y'CbCr encoding is <constant>V4L2_YCBCR_ENC_601</constant>. The default Y'CbCr
quantization is limited range. The chromaticities of the primary colors and the white reference
are:</para>
@ -967,7 +1040,8 @@ SMPTE 170M/BT.601. The Y'CbCr quantization is limited range.</para>
<section id="col-bt2020">
<title>Colorspace BT.2020 (<constant>V4L2_COLORSPACE_BT2020</constant>)</title>
<para>The <xref linkend="itu2020" /> standard defines the colorspace used by Ultra-high definition
television (UHDTV). The default Y'CbCr encoding is <constant>V4L2_YCBCR_ENC_BT2020</constant>.
television (UHDTV). The default transfer function is <constant>V4L2_XFER_FUNC_709</constant>.
The default Y'CbCr encoding is <constant>V4L2_YCBCR_ENC_BT2020</constant>.
The default R'G'B' quantization is limited range (!), and so is the default Y'CbCr quantization.
The chromaticities of the primary colors and the white reference are:</para>
<table frame="none">
@ -1082,8 +1156,10 @@ clamped to the range [-0.5&hellip;0.5]. The Yc'CbcCrc quantization is limited ra
<section id="col-smpte-240m">
<title>Colorspace SMPTE 240M (<constant>V4L2_COLORSPACE_SMPTE240M</constant>)</title>
<para>The <xref linkend="smpte240m" /> standard was an interim standard used during the early days of HDTV (1988-1998).
It has been superseded by Rec. 709. The default Y'CbCr encoding is <constant>V4L2_YCBCR_ENC_SMPTE240M</constant>.
<para>The <xref linkend="smpte240m" /> standard was an interim standard used during
the early days of HDTV (1988-1998). It has been superseded by Rec. 709.
The default transfer function is <constant>V4L2_XFER_FUNC_SMPTE240M</constant>.
The default Y'CbCr encoding is <constant>V4L2_YCBCR_ENC_SMPTE240M</constant>.
The default Y'CbCr quantization is limited range. The chromaticities of the primary colors and the
white reference are:</para>
<table frame="none">
@ -1156,8 +1232,10 @@ clamped to the range [-0.5&hellip;0.5]. The Y'CbCr quantization is limited range
<section id="col-sysm">
<title>Colorspace NTSC 1953 (<constant>V4L2_COLORSPACE_470_SYSTEM_M</constant>)</title>
<para>This standard defines the colorspace used by NTSC in 1953. In practice this
colorspace is obsolete and SMPTE 170M should be used instead. The default Y'CbCr encoding
is <constant>V4L2_YCBCR_ENC_601</constant>. The default Y'CbCr quantization is limited range.
colorspace is obsolete and SMPTE 170M should be used instead.
The default transfer function is <constant>V4L2_XFER_FUNC_709</constant>.
The default Y'CbCr encoding is <constant>V4L2_YCBCR_ENC_601</constant>.
The default Y'CbCr quantization is limited range.
The chromaticities of the primary colors and the white reference are:</para>
<table frame="none">
<title>NTSC 1953 Chromaticities</title>
@ -1234,8 +1312,10 @@ This transform is identical to one defined in SMPTE 170M/BT.601.</para>
<section id="col-sysbg">
<title>Colorspace EBU Tech. 3213 (<constant>V4L2_COLORSPACE_470_SYSTEM_BG</constant>)</title>
<para>The <xref linkend="tech3213" /> standard defines the colorspace used by PAL/SECAM in 1975. In practice this
colorspace is obsolete and SMPTE 170M should be used instead. The default Y'CbCr encoding
is <constant>V4L2_YCBCR_ENC_601</constant>. The default Y'CbCr quantization is limited range.
colorspace is obsolete and SMPTE 170M should be used instead.
The default transfer function is <constant>V4L2_XFER_FUNC_709</constant>.
The default Y'CbCr encoding is <constant>V4L2_YCBCR_ENC_601</constant>.
The default Y'CbCr quantization is limited range.
The chromaticities of the primary colors and the white reference are:</para>
<table frame="none">
<title>EBU Tech. 3213 Chromaticities</title>
@ -1308,7 +1388,8 @@ This transform is identical to one defined in SMPTE 170M/BT.601.</para>
<section id="col-jpeg">
<title>Colorspace JPEG (<constant>V4L2_COLORSPACE_JPEG</constant>)</title>
<para>This colorspace defines the colorspace used by most (Motion-)JPEG formats. The chromaticities
of the primary colors and the white reference are identical to sRGB. The Y'CbCr encoding is
of the primary colors and the white reference are identical to sRGB. The transfer
function use is <constant>V4L2_XFER_FUNC_SRGB</constant>. The Y'CbCr encoding is
<constant>V4L2_YCBCR_ENC_601</constant> with full range quantization where
Y' is scaled to [0&hellip;255] and Cb/Cr are scaled to [-128&hellip;128] and
then clipped to [-128&hellip;127].</para>
@ -1429,6 +1510,7 @@ information.</para>
&sub-y12;
&sub-y10b;
&sub-y16;
&sub-y16-be;
&sub-uv8;
&sub-yuyv;
&sub-uyvy;

View File

@ -284,7 +284,7 @@ different IR's. Due to that, V4L2 API now specifies a standard for mapping Media
</tgroup>
</table>
<para>It should be noticed that, sometimes, there some fundamental missing keys at some cheaper IR's. Due to that, it is recommended to:</para>
<para>It should be noted that, sometimes, there some fundamental missing keys at some cheaper IR's. Due to that, it is recommended to:</para>
<table pgwide="1" frame="none" id="rc_keymap_notes">
<title>Notes</title>

View File

@ -50,8 +50,16 @@ capture streams and by the application for output streams,
see <xref linkend="colorspaces" />.</entry>
</row>
<row>
<entry>__u32</entry>
<entry><structfield>reserved</structfield>[6]</entry>
<entry>&v4l2-xfer-func;</entry>
<entry><structfield>xfer_func</structfield></entry>
<entry>This information supplements the
<structfield>colorspace</structfield> and must be set by the driver for
capture streams and by the application for output streams,
see <xref linkend="colorspaces" />.</entry>
</row>
<row>
<entry>__u16</entry>
<entry><structfield>reserved</structfield>[11]</entry>
<entry>Reserved for future extensions. Applications and drivers must
set the array to zero.</entry>
</row>

View File

@ -134,7 +134,8 @@ information.</para>
<row>
<entry>__u32</entry>
<entry><structfield>reserved</structfield>[8]</entry>
<entry>A place holder for future extensions.</entry>
<entry>A place holder for future extensions. Drivers and applications
must set the array to zero.</entry>
</row>
</tbody>
</tgroup>

View File

@ -197,7 +197,17 @@ be muted when playing back at a non-standard speed.
this command does nothing. This command has two flags:
if <constant>V4L2_DEC_CMD_STOP_TO_BLACK</constant> is set, then the decoder will
set the picture to black after it stopped decoding. Otherwise the last image will
repeat. If <constant>V4L2_DEC_CMD_STOP_IMMEDIATELY</constant> is set, then the decoder
repeat. mem2mem decoders will stop producing new frames altogether. They will send
a <constant>V4L2_EVENT_EOS</constant> event when the last frame has been decoded
and all frames are ready to be dequeued and will set the
<constant>V4L2_BUF_FLAG_LAST</constant> buffer flag on the last buffer of the
capture queue to indicate there will be no new buffers produced to dequeue. This
buffer may be empty, indicated by the driver setting the
<structfield>bytesused</structfield> field to 0. Once the
<constant>V4L2_BUF_FLAG_LAST</constant> flag was set, the
<link linkend="vidioc-qbuf">VIDIOC_DQBUF</link> ioctl will not block anymore,
but return an &EPIPE;.
If <constant>V4L2_DEC_CMD_STOP_IMMEDIATELY</constant> is set, then the decoder
stops immediately (ignoring the <structfield>pts</structfield> value), otherwise it
will keep decoding until timestamp >= pts or until the last of the pending data from
its internal buffers was decoded.

View File

@ -133,7 +133,10 @@
<entry>struct timespec</entry>
<entry><structfield>timestamp</structfield></entry>
<entry></entry>
<entry>Event timestamp.</entry>
<entry>Event timestamp. The timestamp has been taken from the
<constant>CLOCK_MONOTONIC</constant> clock. To access the
same clock outside V4L2, use <function>clock_gettime(2)</function>.
</entry>
</row>
<row>
<entry>u32</entry>

View File

@ -129,7 +129,15 @@ this command.</entry>
encoding will continue until the end of the current <wordasword>Group
Of Pictures</wordasword>, otherwise encoding will stop immediately.
When the encoder is already stopped, this command does
nothing.</entry>
nothing. mem2mem encoders will send a <constant>V4L2_EVENT_EOS</constant> event
when the last frame has been decoded and all frames are ready to be dequeued and
will set the <constant>V4L2_BUF_FLAG_LAST</constant> buffer flag on the last
buffer of the capture queue to indicate there will be no new buffers produced to
dequeue. This buffer may be empty, indicated by the driver setting the
<structfield>bytesused</structfield> field to 0. Once the
<constant>V4L2_BUF_FLAG_LAST</constant> flag was set, the
<link linkend="vidioc-qbuf">VIDIOC_DQBUF</link> ioctl will not block anymore,
but return an &EPIPE;.</entry>
</row>
<row>
<entry><constant>V4L2_ENC_CMD_PAUSE</constant></entry>

View File

@ -217,7 +217,8 @@ enumerated.</entry>
<entry>__u32</entry>
<entry><structfield>reserved[2]</structfield></entry>
<entry></entry>
<entry>Reserved space for future use.</entry>
<entry>Reserved space for future use. Must be zeroed by drivers and
applications.</entry>
</row>
</tbody>
</tgroup>

View File

@ -223,7 +223,8 @@ application should zero out all members except for the
<entry>__u32</entry>
<entry><structfield>reserved[2]</structfield></entry>
<entry></entry>
<entry>Reserved space for future use.</entry>
<entry>Reserved space for future use. Must be zeroed by drivers and
applications.</entry>
</row>
</tbody>
</tgroup>

View File

@ -184,7 +184,8 @@ of open() for more details.</entry>
<row>
<entry>__u32</entry>
<entry><structfield>reserved[11]</structfield></entry>
<entry>Reserved field for future use. Must be set to zero.</entry>
<entry>Reserved field for future use. Drivers and applications must
set the array to zero.</entry>
</row>
</tbody>
</tgroup>

View File

@ -7,6 +7,8 @@
<refnamediv>
<refname>VIDIOC_G_DV_TIMINGS</refname>
<refname>VIDIOC_S_DV_TIMINGS</refname>
<refname>VIDIOC_SUBDEV_G_DV_TIMINGS</refname>
<refname>VIDIOC_SUBDEV_S_DV_TIMINGS</refname>
<refpurpose>Get or set DV timings for input or output</refpurpose>
</refnamediv>
@ -34,7 +36,7 @@
<varlistentry>
<term><parameter>request</parameter></term>
<listitem>
<para>VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS</para>
<para>VIDIOC_G_DV_TIMINGS, VIDIOC_S_DV_TIMINGS, VIDIOC_SUBDEV_G_DV_TIMINGS, VIDIOC_SUBDEV_S_DV_TIMINGS</para>
</listitem>
</varlistentry>
<varlistentry>

View File

@ -7,6 +7,8 @@
<refnamediv>
<refname>VIDIOC_G_EDID</refname>
<refname>VIDIOC_S_EDID</refname>
<refname>VIDIOC_SUBDEV_G_EDID</refname>
<refname>VIDIOC_SUBDEV_S_EDID</refname>
<refpurpose>Get or set the EDID of a video receiver/transmitter</refpurpose>
</refnamediv>
@ -42,7 +44,7 @@
<varlistentry>
<term><parameter>request</parameter></term>
<listitem>
<para>VIDIOC_G_EDID, VIDIOC_S_EDID</para>
<para>VIDIOC_G_EDID, VIDIOC_S_EDID, VIDIOC_SUBDEV_G_EDID, VIDIOC_SUBDEV_S_EDID</para>
</listitem>
</varlistentry>
<varlistentry>
@ -82,6 +84,13 @@
<para>If blocks have to be retrieved from the sink, then this call will block until they
have been read.</para>
<para>If <structfield>start_block</structfield> and <structfield>blocks</structfield> are
both set to 0 when <constant>VIDIOC_G_EDID</constant> is called, then the driver will
set <structfield>blocks</structfield> to the total number of available EDID blocks
and it will return 0 without copying any data. This is an easy way to discover how many
EDID blocks there are. Note that if there are no EDID blocks available at all, then
the driver will set <structfield>blocks</structfield> to 0 and it returns 0.</para>
<para>To set the EDID blocks of a receiver the application has to fill in the <structfield>pad</structfield>,
<structfield>blocks</structfield> and <structfield>edid</structfield> fields and set
<structfield>start_block</structfield> to 0. It is not possible to set part of an EDID,

View File

@ -199,7 +199,7 @@ exist no rectangle</emphasis> that satisfies the constraints.</para>
<row>
<entry>__u32</entry>
<entry><structfield>reserved[9]</structfield></entry>
<entry>Reserved fields for future use.</entry>
<entry>Reserved fields for future use. Drivers and applications must zero this array.</entry>
</row>
</tbody>
</tgroup>

View File

@ -187,6 +187,16 @@ continue streaming.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><errorcode>EPIPE</errorcode></term>
<listitem>
<para><constant>VIDIOC_DQBUF</constant> returns this on an empty
capture queue for mem2mem codecs if a buffer with the
<constant>V4L2_BUF_FLAG_LAST</constant> was already dequeued and no new buffers
are expected to become available.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
</refentry>

View File

@ -6,6 +6,7 @@
<refnamediv>
<refname>VIDIOC_QUERY_DV_TIMINGS</refname>
<refname>VIDIOC_SUBDEV_QUERY_DV_TIMINGS</refname>
<refpurpose>Sense the DV preset received by the current
input</refpurpose>
</refnamediv>
@ -34,7 +35,7 @@ input</refpurpose>
<varlistentry>
<term><parameter>request</parameter></term>
<listitem>
<para>VIDIOC_QUERY_DV_TIMINGS</para>
<para>VIDIOC_QUERY_DV_TIMINGS, VIDIOC_SUBDEV_QUERY_DV_TIMINGS</para>
</listitem>
</varlistentry>
<varlistentry>

View File

@ -60,7 +60,8 @@ buffer at any time after buffers have been allocated with the
field. Valid index numbers range from zero
to the number of buffers allocated with &VIDIOC-REQBUFS;
(&v4l2-requestbuffers; <structfield>count</structfield>) minus one.
The <structfield>reserved</structfield> field should to set to 0.
The <structfield>reserved</structfield> and <structfield>reserved2 </structfield>
fields must be set to 0.
When using the <link linkend="planar-apis">multi-planar API</link>, the
<structfield>m.planes</structfield> field must contain a userspace pointer to an
array of &v4l2-plane; and the <structfield>length</structfield> field has

View File

@ -112,8 +112,8 @@ as the &v4l2-format; <structfield>type</structfield> field. See <xref
<row>
<entry>__u32</entry>
<entry><structfield>reserved</structfield>[2]</entry>
<entry>A place holder for future extensions. This array should
be zeroed by applications.</entry>
<entry>A place holder for future extensions. Drivers and applications
must set the array to zero.</entry>
</row>
</tbody>
</tgroup>

View File

@ -5,7 +5,8 @@
</refmeta>
<refnamediv>
<refname>VIDIOC_SUBSCRIBE_EVENT, VIDIOC_UNSUBSCRIBE_EVENT</refname>
<refname>VIDIOC_SUBSCRIBE_EVENT</refname>
<refname>VIDIOC_UNSUBSCRIBE_EVENT</refname>
<refpurpose>Subscribe or unsubscribe event</refpurpose>
</refnamediv>

View File

@ -1,12 +1,13 @@
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" [
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
<!ENTITY % media-entities SYSTEM "./media-entities.tmpl"> %media-entities;
<!ENTITY media-indices SYSTEM "./media-indices.tmpl">
<!ENTITY eg "e.&nbsp;g.">
<!ENTITY ie "i.&nbsp;e.">
<!ENTITY fd "File descriptor returned by <link linkend='func-open'><function>open()</function></link>.">
<!ENTITY fe_fd "File descriptor returned by <link linkend='frontend_f_open'><function>open()</function></link>.">
<!ENTITY i2c "I<superscript>2</superscript>C">
<!ENTITY return-value "<title>Return Value</title><para>On success <returnvalue>0</returnvalue> is returned, on error <returnvalue>-1</returnvalue> and the <varname>errno</varname> variable is set appropriately. The generic error codes are described at the <link linkend='gen-errors'>Generic Error Codes</link> chapter.</para>">
<!ENTITY return-value-dvb "<para>RETURN VALUE</para><para>On success <returnvalue>0</returnvalue> is returned, on error <returnvalue>-1</returnvalue> and the <varname>errno</varname> variable is set appropriately. The generic error codes are described at the <link linkend='gen-errors'>Generic Error Codes</link> chapter.</para>">
@ -32,7 +33,7 @@
<!ENTITY dash-ent-24 "<entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry><entry>-</entry>">
]>
<book id="media_api">
<book id="media_api" lang="en">
<bookinfo>
<title>LINUX MEDIA INFRASTRUCTURE API</title>
@ -60,28 +61,56 @@
analog and digital TV receiver cards, AM/FM receiver cards,
streaming capture and output devices, codec devices and remote
controllers.</para>
<para>It is divided into four parts.</para>
<para>A typical media device hardware is shown at
<xref linkend="typical_media_device" />.</para>
<figure id="typical_media_device">
<title>Typical Media Device</title>
<mediaobject>
<imageobject>
<imagedata fileref="typical_media_device.svg" format="SVG" />
</imageobject>
<textobject>
<phrase>Typical Media Device Block Diagram</phrase>
</textobject>
</mediaobject>
</figure>
<para>The media infrastructure API was designed to control such
devices. It is divided into four parts.</para>
<para>The first part covers radio, video capture and output,
cameras, analog TV devices and codecs.</para>
<para>The second part covers the
API used for digital TV and Internet reception via one of the
several digital tv standards. While it is called as DVB API,
in fact it covers several different video standards including
DVB-T, DVB-S, DVB-C and ATSC. The API is currently being updated
to document support also for DVB-S2, ISDB-T and ISDB-S.</para>
DVB-T/T2, DVB-S/S2, DVB-C, ATSC, ISDB-T, ISDB-S,etc. The complete
list of supported standards can be found at
<xref linkend="fe-delivery-system-t" />.</para>
<para>The third part covers the Remote Controller API.</para>
<para>The fourth part covers the Media Controller API.</para>
<para>It should also be noted that a media device may also have audio
components, like mixers, PCM capture, PCM playback, etc, which
are controlled via ALSA API.</para>
<para>For additional information and for the latest development code,
see: <ulink url="http://linuxtv.org">http://linuxtv.org</ulink>.</para>
<para>For discussing improvements, reporting troubles, sending new drivers, etc, please mail to: <ulink url="http://vger.kernel.org/vger-lists.html#linux-media">Linux Media Mailing List (LMML).</ulink>.</para>
</preface>
<part id="v4l2spec">&sub-v4l2;</part>
<part id="dvbapi">&sub-dvbapi;</part>
<part id="remotes">&sub-remote_controllers;</part>
<part id="media_common">&sub-media-controller;</part>
<part id="v4l2spec">
&sub-v4l2;
</part>
<part id="dvbapi">
&sub-dvbapi;
</part>
<part id="remotes">
&sub-remote_controllers;
</part>
<part id="media_common">
&sub-media-controller;
</part>
<chapter id="gen_errors">&sub-gen-errors;</chapter>
<chapter id="gen_errors">
&sub-gen-errors;
</chapter>
&sub-fdl-appendix;

View File

@ -0,0 +1,37 @@
* Analog Devices ADP1653 flash LED driver
Required Properties:
- compatible: Must contain "adi,adp1653"
- reg: I2C slave address
- enable-gpios: Specifier of the GPIO connected to EN pin
There are two LED outputs available - flash and indicator. One LED is
represented by one child node, nodes need to be named "flash" and "indicator".
Required properties of the LED child node:
- max-microamp : see Documentation/devicetree/bindings/leds/common.txt
Required properties of the flash LED child node:
- flash-max-microamp : see Documentation/devicetree/bindings/leds/common.txt
- flash-timeout-us : see Documentation/devicetree/bindings/leds/common.txt
Example:
adp1653: led-controller@30 {
compatible = "adi,adp1653";
reg = <0x30>;
enable-gpios = <&gpio3 24 GPIO_ACTIVE_HIGH>; /* 88 */
flash {
flash-timeout-us = <500000>;
flash-max-microamp = <320000>;
max-microamp = <50000>;
};
indicator {
max-microamp = <17500>;
};
};

View File

@ -0,0 +1,32 @@
STMicroelectronics stih4xx platforms
bdisp: 2D blitter for STMicroelectronics SoC.
Required properties:
- compatible: should be "st,stih407-bdisp".
- reg: BDISP physical address location and length.
- interrupts: BDISP interrupt number.
- clocks: from common clock binding: handle hardware IP needed clocks, the
number of clocks may depend on the SoC type.
See ../clocks/clock-bindings.txt for details.
- clock-names: names of the clocks listed in clocks property in the same order.
Example:
bdisp0:bdisp@9f10000 {
compatible = "st,stih407-bdisp";
reg = <0x9f10000 0x1000>;
interrupts = <GIC_SPI 38 IRQ_TYPE_NONE>;
clock-names = "bdisp";
clocks = <&clk_s_c0_flexgen CLK_IC_BDISP_0>;
};
Aliases:
Each BDISP should have a numbered alias in the aliases node, in the form of
bdispN, N = 0 or 1.
Example:
aliases {
bdisp0 = &bdisp0;
};

View File

@ -36,7 +36,7 @@
35 -> TeVii S471 [d471:9022]
36 -> Hauppauge WinTV-HVR1255 [0070:2259]
37 -> Prof Revolution DVB-S2 8000 [8000:3034]
38 -> Hauppauge WinTV-HVR4400 [0070:c108,0070:c138,0070:c12a,0070:c1f8]
38 -> Hauppauge WinTV-HVR4400/HVR5500 [0070:c108,0070:c138,0070:c1f8]
39 -> AVerTV Hybrid Express Slim HC81R [1461:d939]
40 -> TurboSight TBS 6981 [6981:8888]
41 -> TurboSight TBS 6980 [6980:8888]
@ -45,3 +45,10 @@
44 -> DViCO FusionHDTV DVB-T Dual Express2 [18ac:db98]
45 -> DVBSky T9580 [4254:9580]
46 -> DVBSky T980C [4254:980c]
47 -> DVBSky S950C [4254:950c]
48 -> Technotrend TT-budget CT2-4500 CI [13c2:3013]
49 -> DVBSky S950 [4254:0950]
50 -> DVBSky S952 [4254:0952]
51 -> DVBSky T982 [4254:0982]
52 -> Hauppauge WinTV-HVR5525 [0070:f038]
53 -> Hauppauge WinTV Starburst [0070:c12a]

View File

@ -94,3 +94,5 @@
93 -> KWorld USB ATSC TV Stick UB435-Q V3 (em2874) [1b80:e34c]
94 -> PCTV tripleStick (292e) (em28178)
95 -> Leadtek VC100 (em2861) [0413:6f07]
96 -> Terratec Cinergy T2 Stick HD (em28178)
97 -> Elgato EyeTV Hybrid 2008 INT (em2884) [0fd9:0018]

View File

@ -192,3 +192,4 @@
191 -> Hawell HW-9004V1
192 -> AverMedia AverTV Satellite Hybrid+FM A706 [1461:2055]
193 -> WIS Voyager or compatible [1905:7007]
194 -> AverMedia AverTV/505 [1461:a10a]

View File

@ -9,3 +9,6 @@
8 -> Hauppauge WinTV-HVR2250 [0070:88A1]
9 -> Hauppauge WinTV-HVR2200 [0070:8940]
10 -> Hauppauge WinTV-HVR2200 [0070:8953]
11 -> Hauppauge WinTV-HVR2255(proto)
12 -> Hauppauge WinTV-HVR2255 [0070:f111]
13 -> Hauppauge WinTV-HVR2205 [0070:f123,0070:f120]

View File

@ -1129,6 +1129,10 @@ available event type is 'class base + 1'.
An example on how the V4L2 events may be used can be found in the OMAP
3 ISP driver (drivers/media/platform/omap3isp).
A subdev can directly send an event to the v4l2_device notify function with
V4L2_DEVICE_NOTIFY_EVENT. This allows the bridge to map the subdev that sends
the event to the video node(s) associated with the subdev that need to be
informed about such an event.
V4L2 clocks
-----------

View File

@ -406,9 +406,7 @@ static int skeleton_enum_fmt_vid_cap(struct file *file, void *priv,
if (f->index != 0)
return -EINVAL;
strlcpy(f->description, "4:2:2, packed, YUYV", sizeof(f->description));
f->pixelformat = V4L2_PIX_FMT_YUYV;
f->flags = 0;
return 0;
}

View File

@ -631,26 +631,33 @@ Timestamp Source: selects when the timestamp for each buffer is taken.
Colorspace: selects which colorspace should be used when generating the image.
This only applies if the CSC Colorbar test pattern is selected,
otherwise the test pattern will go through unconverted (except for
the so-called 'Transfer Function' corrections and the R'G'B' to Y'CbCr
conversion). This behavior is also what you want, since a 75% Colorbar
otherwise the test pattern will go through unconverted.
This behavior is also what you want, since a 75% Colorbar
should really have 75% signal intensity and should not be affected
by colorspace conversions.
Changing the colorspace will result in the V4L2_EVENT_SOURCE_CHANGE
to be sent since it emulates a detected colorspace change.
Transfer Function: selects which colorspace transfer function should be used when
generating an image. This only applies if the CSC Colorbar test pattern is
selected, otherwise the test pattern will go through unconverted.
This behavior is also what you want, since a 75% Colorbar
should really have 75% signal intensity and should not be affected
by colorspace conversions.
Changing the transfer function will result in the V4L2_EVENT_SOURCE_CHANGE
to be sent since it emulates a detected colorspace change.
Y'CbCr Encoding: selects which Y'CbCr encoding should be used when generating
a Y'CbCr image. This only applies if the CSC Colorbar test pattern is
selected, and if the format is set to a Y'CbCr format as opposed to an
RGB format.
a Y'CbCr image. This only applies if the format is set to a Y'CbCr format
as opposed to an RGB format.
Changing the Y'CbCr encoding will result in the V4L2_EVENT_SOURCE_CHANGE
to be sent since it emulates a detected colorspace change.
Quantization: selects which quantization should be used for the RGB or Y'CbCr
encoding when generating the test pattern. This only applies if the CSC
Colorbar test pattern is selected.
encoding when generating the test pattern.
Changing the quantization will result in the V4L2_EVENT_SOURCE_CHANGE
to be sent since it emulates a detected colorspace change.
@ -888,7 +895,7 @@ Section 10.1: Video and Sliced VBI looping
The way to enable video/VBI looping is currently fairly crude. A 'Loop Video'
control is available in the "Vivid" control class of the video
output and VBI output devices. When checked the video looping will be enabled.
capture and VBI capture devices. When checked the video looping will be enabled.
Once enabled any video S-Video or HDMI input will show a static test pattern
until the video output has started. At that time the video output will be
looped to the video input provided that:
@ -985,8 +992,9 @@ to change crop and compose rectangles on the fly.
Section 12: Formats
-------------------
The driver supports all the regular packed YUYV formats, 16, 24 and 32 RGB
packed formats and two multiplanar formats (one luma and one chroma plane).
The driver supports all the regular packed and planar 4:4:4, 4:2:2 and 4:2:0
YUYV formats, 8, 16, 24 and 32 RGB packed formats and various multiplanar
formats.
The alpha component can be set through the 'Alpha Component' User control
for those formats that support it. If the 'Apply Alpha To Red Only' control
@ -1119,11 +1127,9 @@ Just as a reminder and in no particular order:
- Use per-queue locks and/or per-device locks to improve throughput
- Add support to loop from a specific output to a specific input across
vivid instances
- Add support for VIDIOC_EXPBUF once support for that has been added to vb2
- The SDR radio should use the same 'frequencies' for stations as the normal
radio receiver, and give back noise if the frequency doesn't match up with
a station frequency
- Improve the sine generation of the SDR radio.
- Make a thread for the RDS generation, that would help in particular for the
"Controls" RDS Rx I/O Mode as the read-only RDS controls could be updated
in real-time.

View File

@ -1991,6 +1991,14 @@ W: http://bcache.evilpiepirate.org
S: Maintained:
F: drivers/md/bcache/
BDISP ST MEDIA DRIVER
M: Fabien Dessenne <fabien.dessenne@st.com>
L: linux-media@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
W: http://linuxtv.org
S: Supported
F: drivers/media/platform/sti/bdisp
BEFS FILE SYSTEM
S: Orphan
F: Documentation/filesystems/befs.txt
@ -2659,6 +2667,14 @@ L: platform-driver-x86@vger.kernel.org
S: Supported
F: drivers/platform/x86/classmate-laptop.c
COBALT MEDIA DRIVER
M: Hans Verkuil <hans.verkuil@cisco.com>
L: linux-media@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
W: http://linuxtv.org
S: Supported
F: drivers/media/pci/cobalt/
COCCINELLE/Semantic Patches (SmPL)
M: Julia Lawall <Julia.Lawall@lip6.fr>
M: Gilles Muller <Gilles.Muller@lip6.fr>
@ -2930,6 +2946,15 @@ S: Maintained
F: drivers/media/common/cx2341x*
F: include/media/cx2341x*
CX24120 MEDIA DRIVER
M: Jemma Denson <jdenson@gmail.com>
M: Patrick Boettcher <patrick.boettcher@posteo.de>
L: linux-media@vger.kernel.org
W: http://linuxtv.org/
Q: http://patchwork.linuxtv.org/project/linux-media/list/
S: Maintained
F: drivers/media/dvb-frontends/cx24120*
CX88 VIDEO4LINUX DRIVER
M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
L: linux-media@vger.kernel.org
@ -3498,6 +3523,14 @@ L: netdev@vger.kernel.org
S: Maintained
F: drivers/net/wan/dscc4.c
DT3155 MEDIA DRIVER
M: Hans Verkuil <hverkuil@xs4all.nl>
L: linux-media@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
W: http://linuxtv.org
S: Odd Fixes
F: drivers/media/pci/dt3155/
DVB_USB_AF9015 MEDIA DRIVER
M: Antti Palosaari <crope@iki.fi>
L: linux-media@vger.kernel.org
@ -6434,6 +6467,15 @@ W: http://linuxtv.org
S: Maintained
F: drivers/media/radio/radio-maxiradio*
MEDIA DRIVERS FOR RENESAS - VSP1
M: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
L: linux-media@vger.kernel.org
L: linux-sh@vger.kernel.org
T: git git://linuxtv.org/media_tree.git
S: Supported
F: Documentation/devicetree/bindings/media/renesas,vsp1.txt
F: drivers/media/platform/vsp1/
MEDIA INPUT INFRASTRUCTURE (V4L/DVB)
M: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
P: LinuxTV.org Project

View File

@ -980,8 +980,7 @@ config TOUCHSCREEN_SUN4I
config TOUCHSCREEN_SUR40
tristate "Samsung SUR40 (Surface 2.0/PixelSense) touchscreen"
depends on USB
depends on MEDIA_USB_SUPPORT
depends on USB && MEDIA_USB_SUPPORT && HAS_DMA
select INPUT_POLLDEV
select VIDEOBUF2_DMA_SG
help

View File

@ -125,7 +125,7 @@ struct sur40_image_header {
#define VIDEO_PACKET_SIZE 16384
/* polling interval (ms) */
#define POLL_INTERVAL 10
#define POLL_INTERVAL 4
/* maximum number of contacts FIXME: this is a guess? */
#define MAX_CONTACTS 64
@ -342,7 +342,7 @@ static void sur40_poll(struct input_polled_dev *polldev)
* instead of at the end.
*/
if (packet_id != header->packet_id)
dev_warn(sur40->dev, "packet ID mismatch\n");
dev_dbg(sur40->dev, "packet ID mismatch\n");
packet_blobs = result / sizeof(struct sur40_blob);
dev_dbg(sur40->dev, "received %d blobs\n", packet_blobs);
@ -389,6 +389,8 @@ static void sur40_process_video(struct sur40_state *sur40)
list_del(&new_buf->list);
spin_unlock(&sur40->qlock);
dev_dbg(sur40->dev, "buffer acquired\n");
/* retrieve data via bulk read */
result = usb_bulk_msg(sur40->usbdev,
usb_rcvbulkpipe(sur40->usbdev, VIDEO_ENDPOINT),
@ -416,6 +418,8 @@ static void sur40_process_video(struct sur40_state *sur40)
goto err_poll;
}
dev_dbg(sur40->dev, "header acquired\n");
sgt = vb2_dma_sg_plane_desc(&new_buf->vb, 0);
result = usb_sg_init(&sgr, sur40->usbdev,
@ -432,11 +436,18 @@ static void sur40_process_video(struct sur40_state *sur40)
goto err_poll;
}
dev_dbg(sur40->dev, "image acquired\n");
/* return error if streaming was stopped in the meantime */
if (sur40->sequence == -1)
goto err_poll;
/* mark as finished */
v4l2_get_timestamp(&new_buf->vb.v4l2_buf.timestamp);
new_buf->vb.v4l2_buf.sequence = sur40->sequence++;
new_buf->vb.v4l2_buf.field = V4L2_FIELD_NONE;
vb2_buffer_done(&new_buf->vb, VB2_BUF_STATE_DONE);
dev_dbg(sur40->dev, "buffer marked done\n");
return;
err_poll:
@ -716,6 +727,7 @@ static int sur40_start_streaming(struct vb2_queue *vq, unsigned int count)
static void sur40_stop_streaming(struct vb2_queue *vq)
{
struct sur40_state *sur40 = vb2_get_drv_priv(vq);
sur40->sequence = -1;
/* Release all active buffers */
return_all_buffers(sur40, VB2_BUF_STATE_ERROR);
@ -778,6 +790,33 @@ static int sur40_vidioc_enum_fmt(struct file *file, void *priv,
return 0;
}
static int sur40_vidioc_enum_framesizes(struct file *file, void *priv,
struct v4l2_frmsizeenum *f)
{
if ((f->index != 0) || (f->pixel_format != V4L2_PIX_FMT_GREY))
return -EINVAL;
f->type = V4L2_FRMSIZE_TYPE_DISCRETE;
f->discrete.width = sur40_video_format.width;
f->discrete.height = sur40_video_format.height;
return 0;
}
static int sur40_vidioc_enum_frameintervals(struct file *file, void *priv,
struct v4l2_frmivalenum *f)
{
if ((f->index > 1) || (f->pixel_format != V4L2_PIX_FMT_GREY)
|| (f->width != sur40_video_format.width)
|| (f->height != sur40_video_format.height))
return -EINVAL;
f->type = V4L2_FRMIVAL_TYPE_DISCRETE;
f->discrete.denominator = 60/(f->index+1);
f->discrete.numerator = 1;
return 0;
}
static const struct usb_device_id sur40_table[] = {
{ USB_DEVICE(ID_MICROSOFT, ID_SUR40) }, /* Samsung SUR40 */
{ } /* terminating null entry */
@ -829,6 +868,9 @@ static const struct v4l2_ioctl_ops sur40_video_ioctl_ops = {
.vidioc_s_fmt_vid_cap = sur40_vidioc_fmt,
.vidioc_g_fmt_vid_cap = sur40_vidioc_fmt,
.vidioc_enum_framesizes = sur40_vidioc_enum_framesizes,
.vidioc_enum_frameintervals = sur40_vidioc_enum_frameintervals,
.vidioc_enum_input = sur40_vidioc_enum_input,
.vidioc_g_input = sur40_vidioc_g_input,
.vidioc_s_input = sur40_vidioc_s_input,

View File

@ -95,7 +95,7 @@ config MEDIA_CONTROLLER
This API is mostly used by camera interfaces in embedded platforms.
config MEDIA_CONTROLLER_DVB
bool "Enable Media controller for DVB"
bool "Enable Media controller for DVB (EXPERIMENTAL)"
depends on MEDIA_CONTROLLER
depends on BROKEN
---help---

View File

@ -14,6 +14,7 @@ config DVB_B2C2_FLEXCOP
select DVB_S5H1420 if MEDIA_SUBDRV_AUTOSELECT
select DVB_TUNER_ITD1000 if MEDIA_SUBDRV_AUTOSELECT
select DVB_ISL6421 if MEDIA_SUBDRV_AUTOSELECT
select DVB_CX24120 if MEDIA_SUBDRV_AUTOSELECT
select DVB_CX24123 if MEDIA_SUBDRV_AUTOSELECT
select MEDIA_TUNER_SIMPLE if MEDIA_SUBDRV_AUTOSELECT
select DVB_TUNER_CX24113 if MEDIA_SUBDRV_AUTOSELECT

View File

@ -91,6 +91,7 @@ struct flexcop_device {
int feedcount;
int pid_filtering;
int fullts_streaming_state;
int skip_6_hw_pid_filter;
/* bus specific callbacks */
flexcop_ibi_value(*read_ibi_reg) (struct flexcop_device *,

View File

@ -12,6 +12,7 @@
#include "cx24113.h"
#include "cx24123.h"
#include "isl6421.h"
#include "cx24120.h"
#include "mt352.h"
#include "bcm3510.h"
#include "nxt200x.h"
@ -26,9 +27,20 @@
#define FE_SUPPORTED(fe) (defined(CONFIG_DVB_##fe) || \
(defined(CONFIG_DVB_##fe##_MODULE) && defined(MODULE)))
#if FE_SUPPORTED(BCM3510) || (FE_SUPPORTED(CX24120) && FE_SUPPORTED(ISL6421))
static int flexcop_fe_request_firmware(struct dvb_frontend *fe,
const struct firmware **fw, char *name)
{
struct flexcop_device *fc = fe->dvb->priv;
return request_firmware(fw, name, fc->dev);
}
#endif
/* lnb control */
#if FE_SUPPORTED(MT312) || FE_SUPPORTED(STV0299)
static int flexcop_set_voltage(struct dvb_frontend *fe, fe_sec_voltage_t voltage)
static int flexcop_set_voltage(struct dvb_frontend *fe,
enum fe_sec_voltage voltage)
{
struct flexcop_device *fc = fe->dvb->priv;
flexcop_ibi_value v;
@ -67,7 +79,7 @@ static int flexcop_sleep(struct dvb_frontend* fe)
/* SkyStar2 DVB-S rev 2.3 */
#if FE_SUPPORTED(MT312) && FE_SUPPORTED(PLL)
static int flexcop_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone)
static int flexcop_set_tone(struct dvb_frontend *fe, enum fe_sec_tone_mode tone)
{
/* u16 wz_half_period_for_45_mhz[] = { 0x01ff, 0x0154, 0x00ff, 0x00cc }; */
struct flexcop_device *fc = fe->dvb->priv;
@ -146,7 +158,7 @@ static int flexcop_diseqc_send_master_cmd(struct dvb_frontend *fe,
}
static int flexcop_diseqc_send_burst(struct dvb_frontend *fe,
fe_sec_mini_cmd_t minicmd)
enum fe_sec_mini_cmd minicmd)
{
return flexcop_send_diseqc_msg(fe, 0, NULL, minicmd);
}
@ -445,13 +457,6 @@ static int airstar_dvbt_attach(struct flexcop_device *fc,
/* AirStar ATSC 1st generation */
#if FE_SUPPORTED(BCM3510)
static int flexcop_fe_request_firmware(struct dvb_frontend *fe,
const struct firmware **fw, char* name)
{
struct flexcop_device *fc = fe->dvb->priv;
return request_firmware(fw, name, fc->dev);
}
static struct bcm3510_config air2pc_atsc_first_gen_config = {
.demod_address = 0x0f,
.request_firmware = flexcop_fe_request_firmware,
@ -619,6 +624,43 @@ fail:
#define cablestar2_attach NULL
#endif
/* SkyStar S2 PCI DVB-S/S2 card based on Conexant cx24120/cx24118 */
#if FE_SUPPORTED(CX24120) && FE_SUPPORTED(ISL6421)
static const struct cx24120_config skystar2_rev3_3_cx24120_config = {
.i2c_addr = 0x55,
.xtal_khz = 10111,
.initial_mpeg_config = { 0xa1, 0x76, 0x07 },
.request_firmware = flexcop_fe_request_firmware,
.i2c_wr_max = 4,
};
static int skystarS2_rev33_attach(struct flexcop_device *fc,
struct i2c_adapter *i2c)
{
fc->fe = dvb_attach(cx24120_attach,
&skystar2_rev3_3_cx24120_config, i2c);
if (!fc->fe)
return 0;
fc->dev_type = FC_SKYS2_REV33;
fc->fc_i2c_adap[2].no_base_addr = 1;
if (!dvb_attach(isl6421_attach, fc->fe, &fc->fc_i2c_adap[2].i2c_adap,
0x08, 0, 0, false)) {
err("ISL6421 could NOT be attached!");
fc->fc_i2c_adap[2].no_base_addr = 0;
return 0;
}
info("ISL6421 successfully attached.");
if (fc->has_32_hw_pid_filter)
fc->skip_6_hw_pid_filter = 1;
return 1;
}
#else
#define skystarS2_rev33_attach NULL
#endif
static struct {
flexcop_device_type_t type;
int (*attach)(struct flexcop_device *, struct i2c_adapter *);
@ -632,6 +674,7 @@ static struct {
{ FC_AIR_ATSC1, airstar_atsc1_attach },
{ FC_CABLE, cablestar2_attach },
{ FC_SKY_REV23, skystar2_rev23_attach },
{ FC_SKYS2_REV33, skystarS2_rev33_attach },
};
/* try to figure out the frontend */

View File

@ -117,6 +117,10 @@ static void flexcop_pid_control(struct flexcop_device *fc,
deb_ts("setting pid: %5d %04x at index %d '%s'\n",
pid, pid, index, onoff ? "on" : "off");
/* First 6 can be buggy - skip over them if option set */
if (fc->skip_6_hw_pid_filter)
index += 6;
/* We could use bit magic here to reduce source code size.
* I decided against it, but to use the real register names */
switch (index) {
@ -170,7 +174,10 @@ static int flexcop_toggle_fullts_streaming(struct flexcop_device *fc, int onoff)
int flexcop_pid_feed_control(struct flexcop_device *fc,
struct dvb_demux_feed *dvbdmxfeed, int onoff)
{
int max_pid_filter = 6 + fc->has_32_hw_pid_filter*32;
int max_pid_filter = 6;
max_pid_filter -= 6 * fc->skip_6_hw_pid_filter;
max_pid_filter += 32 * fc->has_32_hw_pid_filter;
fc->feedcount += onoff ? 1 : -1; /* the number of PIDs/Feed currently requested */
if (dvbdmxfeed->index >= max_pid_filter)
@ -217,7 +224,12 @@ void flexcop_hw_filter_init(struct flexcop_device *fc)
{
int i;
flexcop_ibi_value v;
for (i = 0; i < 6 + 32*fc->has_32_hw_pid_filter; i++)
int max_pid_filter = 6;
max_pid_filter -= 6 * fc->skip_6_hw_pid_filter;
max_pid_filter += 32 * fc->has_32_hw_pid_filter;
for (i = 0; i < max_pid_filter; i++)
flexcop_pid_control(fc, i, 0x1fff, 0);
flexcop_pid_group_filter(fc, 0, 0x1fe0);

View File

@ -56,6 +56,7 @@ static const char *flexcop_device_names[] = {
[FC_SKY_REV26] = "Sky2PC/SkyStar 2 DVB-S rev 2.6",
[FC_SKY_REV27] = "Sky2PC/SkyStar 2 DVB-S rev 2.7a/u",
[FC_SKY_REV28] = "Sky2PC/SkyStar 2 DVB-S rev 2.8",
[FC_SKYS2_REV33] = "Sky2PC/SkyStar S2 DVB-S/S2 rev 3.3",
};
static const char *flexcop_bus_names[] = {

View File

@ -24,6 +24,7 @@ typedef enum {
FC_SKY_REV26,
FC_SKY_REV27,
FC_SKY_REV28,
FC_SKYS2_REV33,
} flexcop_device_type_t;
typedef enum {

View File

@ -1010,6 +1010,7 @@ struct sms_rx_stats_ex {
s32 mrc_in_band_pwr; /* In band power in dBM */
};
#define SRVM_MAX_PID_FILTERS 8
/* statistics information returned as response for
* SmsHostApiGetstatisticsEx_Req for DVB applications, SMS1100 and up */
@ -1021,7 +1022,6 @@ struct sms_stats_dvb {
struct sms_tx_stats transmission_data;
/* Burst parameters, valid only for DVB-H */
#define SRVM_MAX_PID_FILTERS 8
struct sms_pid_data pid_data[SRVM_MAX_PID_FILTERS];
};
@ -1035,7 +1035,6 @@ struct sms_stats_dvb_ex {
struct sms_tx_stats transmission_data;
/* Burst parameters, valid only for DVB-H */
#define SRVM_MAX_PID_FILTERS 8
struct sms_pid_data pid_data[SRVM_MAX_PID_FILTERS];
};

View File

@ -753,7 +753,7 @@ static inline int led_feedback(struct smsdvb_client_t *client)
SMS_LED_HI : SMS_LED_LO);
}
static int smsdvb_read_status(struct dvb_frontend *fe, fe_status_t *stat)
static int smsdvb_read_status(struct dvb_frontend *fe, enum fe_status *stat)
{
int rc;
struct smsdvb_client_t *client;
@ -900,7 +900,7 @@ static int smsdvb_dvbt_set_frontend(struct dvb_frontend *fe)
/* Disable LNA, if any. An error is returned if no LNA is present */
ret = sms_board_lna_control(client->coredev, 0);
if (ret == 0) {
fe_status_t status;
enum fe_status status;
/* tune with LNA off at first */
ret = smsdvb_sendrequest_and_wait(client, &msg, sizeof(msg),
@ -971,7 +971,7 @@ static int smsdvb_isdbt_set_frontend(struct dvb_frontend *fe)
/* Disable LNA, if any. An error is returned if no LNA is present */
ret = sms_board_lna_control(client->coredev, 0);
if (ret == 0) {
fe_status_t status;
enum fe_status status;
/* tune with LNA off at first */
ret = smsdvb_sendrequest_and_wait(client, &msg, sizeof(msg),

View File

@ -40,7 +40,7 @@ struct smsdvb_client_t {
struct dmxdev dmxdev;
struct dvb_frontend frontend;
fe_status_t fe_status;
enum fe_status fe_status;
struct completion tune_done;
struct completion stats_done;

View File

@ -78,7 +78,7 @@ int sms_ir_init(struct smscore_device_t *coredev)
dev->dev.parent = coredev->device;
#if 0
/* TODO: properly initialize the parameters bellow */
/* TODO: properly initialize the parameters below */
dev->input_id.bustype = BUS_USB;
dev->input_id.version = 1;
dev->input_id.vendor = le16_to_cpu(dev->udev->descriptor.idVendor);

View File

@ -40,6 +40,7 @@
#include <linux/freezer.h>
#include <linux/jiffies.h>
#include <linux/kthread.h>
#include <linux/ktime.h>
#include <asm/processor.h>
#include "dvb_frontend.h"
@ -110,7 +111,7 @@ struct dvb_frontend_private {
struct task_struct *thread;
unsigned long release_jiffies;
unsigned int wakeup;
fe_status_t status;
enum fe_status status;
unsigned long tune_mode_flags;
unsigned int delay;
unsigned int reinitialise;
@ -198,7 +199,8 @@ static enum dvbv3_emulation_type dvbv3_type(u32 delivery_system)
}
}
static void dvb_frontend_add_event(struct dvb_frontend *fe, fe_status_t status)
static void dvb_frontend_add_event(struct dvb_frontend *fe,
enum fe_status status)
{
struct dvb_frontend_private *fepriv = fe->frontend_priv;
struct dvb_fe_events *events = &fepriv->events;
@ -429,7 +431,7 @@ static int dvb_frontend_swzigzag_autotune(struct dvb_frontend *fe, int check_wra
static void dvb_frontend_swzigzag(struct dvb_frontend *fe)
{
fe_status_t s = 0;
enum fe_status s = 0;
int retval = 0;
struct dvb_frontend_private *fepriv = fe->frontend_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache, tmp;
@ -690,7 +692,7 @@ static int dvb_frontend_thread(void *data)
{
struct dvb_frontend *fe = data;
struct dvb_frontend_private *fepriv = fe->frontend_priv;
fe_status_t s;
enum fe_status s;
enum dvbfe_algo algo;
#ifdef CONFIG_MEDIA_CONTROLLER_DVB
int ret;
@ -889,42 +891,21 @@ static void dvb_frontend_stop(struct dvb_frontend *fe)
fepriv->thread);
}
s32 timeval_usec_diff(struct timeval lasttime, struct timeval curtime)
{
return ((curtime.tv_usec < lasttime.tv_usec) ?
1000000 - lasttime.tv_usec + curtime.tv_usec :
curtime.tv_usec - lasttime.tv_usec);
}
EXPORT_SYMBOL(timeval_usec_diff);
static inline void timeval_usec_add(struct timeval *curtime, u32 add_usec)
{
curtime->tv_usec += add_usec;
if (curtime->tv_usec >= 1000000) {
curtime->tv_usec -= 1000000;
curtime->tv_sec++;
}
}
/*
* Sleep until gettimeofday() > waketime + add_usec
* This needs to be as precise as possible, but as the delay is
* usually between 2ms and 32ms, it is done using a scheduled msleep
* followed by usleep (normally a busy-wait loop) for the remainder
*/
void dvb_frontend_sleep_until(struct timeval *waketime, u32 add_usec)
void dvb_frontend_sleep_until(ktime_t *waketime, u32 add_usec)
{
struct timeval lasttime;
s32 delta, newdelta;
timeval_usec_add(waketime, add_usec);
do_gettimeofday(&lasttime);
delta = timeval_usec_diff(lasttime, *waketime);
ktime_add_us(*waketime, add_usec);
delta = ktime_us_delta(ktime_get_real(), *waketime);
if (delta > 2500) {
msleep((delta - 1500) / 1000);
do_gettimeofday(&lasttime);
newdelta = timeval_usec_diff(lasttime, *waketime);
newdelta = ktime_us_delta(ktime_get_real(), *waketime);
delta = (newdelta > delta) ? 0 : newdelta;
}
if (delta > 0)
@ -2216,7 +2197,7 @@ static int dtv_set_frontend(struct dvb_frontend *fe)
break;
}
if (rolloff)
c->bandwidth_hz = (c->symbol_rate * rolloff) / 100;
c->bandwidth_hz = mult_frac(c->symbol_rate, rolloff, 100);
/* force auto frequency inversion if requested */
if (dvb_force_auto_inversion)
@ -2341,7 +2322,7 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
}
case FE_READ_STATUS: {
fe_status_t* status = parg;
enum fe_status *status = parg;
/* if retune was requested but hasn't occurred yet, prevent
* that user get signal state from previous tuning */
@ -2403,7 +2384,13 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
case FE_DISEQC_SEND_MASTER_CMD:
if (fe->ops.diseqc_send_master_cmd) {
err = fe->ops.diseqc_send_master_cmd(fe, (struct dvb_diseqc_master_cmd*) parg);
struct dvb_diseqc_master_cmd *cmd = parg;
if (cmd->msg_len > sizeof(cmd->msg)) {
err = -EINVAL;
break;
}
err = fe->ops.diseqc_send_master_cmd(fe, cmd);
fepriv->state = FESTATE_DISEQC;
fepriv->status = 0;
}
@ -2411,7 +2398,8 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
case FE_DISEQC_SEND_BURST:
if (fe->ops.diseqc_send_burst) {
err = fe->ops.diseqc_send_burst(fe, (fe_sec_mini_cmd_t) parg);
err = fe->ops.diseqc_send_burst(fe,
(enum fe_sec_mini_cmd)parg);
fepriv->state = FESTATE_DISEQC;
fepriv->status = 0;
}
@ -2419,8 +2407,9 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
case FE_SET_TONE:
if (fe->ops.set_tone) {
err = fe->ops.set_tone(fe, (fe_sec_tone_mode_t) parg);
fepriv->tone = (fe_sec_tone_mode_t) parg;
err = fe->ops.set_tone(fe,
(enum fe_sec_tone_mode)parg);
fepriv->tone = (enum fe_sec_tone_mode)parg;
fepriv->state = FESTATE_DISEQC;
fepriv->status = 0;
}
@ -2428,8 +2417,9 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
case FE_SET_VOLTAGE:
if (fe->ops.set_voltage) {
err = fe->ops.set_voltage(fe, (fe_sec_voltage_t) parg);
fepriv->voltage = (fe_sec_voltage_t) parg;
err = fe->ops.set_voltage(fe,
(enum fe_sec_voltage)parg);
fepriv->voltage = (enum fe_sec_voltage)parg;
fepriv->state = FESTATE_DISEQC;
fepriv->status = 0;
}
@ -2437,7 +2427,8 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
case FE_DISHNETWORK_SEND_LEGACY_CMD:
if (fe->ops.dishnetwork_send_legacy_command) {
err = fe->ops.dishnetwork_send_legacy_command(fe, (unsigned long) parg);
err = fe->ops.dishnetwork_send_legacy_command(fe,
(unsigned long)parg);
fepriv->state = FESTATE_DISEQC;
fepriv->status = 0;
} else if (fe->ops.set_voltage) {
@ -2458,13 +2449,13 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
* include the initialization or start bit
*/
unsigned long swcmd = ((unsigned long) parg) << 1;
struct timeval nexttime;
struct timeval tv[10];
ktime_t nexttime;
ktime_t tv[10];
int i;
u8 last = 1;
if (dvb_frontend_debug)
printk("%s switch command: 0x%04lx\n", __func__, swcmd);
do_gettimeofday(&nexttime);
nexttime = ktime_get_real();
if (dvb_frontend_debug)
tv[0] = nexttime;
/* before sending a command, initialize by sending
@ -2475,7 +2466,7 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
for (i = 0; i < 9; i++) {
if (dvb_frontend_debug)
do_gettimeofday(&tv[i + 1]);
tv[i+1] = ktime_get_real();
if ((swcmd & 0x01) != last) {
/* set voltage to (last ? 13V : 18V) */
fe->ops.set_voltage(fe, (last) ? SEC_VOLTAGE_13 : SEC_VOLTAGE_18);
@ -2489,7 +2480,8 @@ static int dvb_frontend_ioctl_legacy(struct file *file,
printk("%s(%d): switch delay (should be 32k followed by all 8k\n",
__func__, fe->dvb->num);
for (i = 1; i < 10; i++)
printk("%d: %d\n", i, timeval_usec_diff(tv[i-1] , tv[i]));
printk("%d: %d\n", i,
(int) ktime_us_delta(tv[i], tv[i-1]));
}
err = 0;
fepriv->state = FESTATE_DISEQC;

View File

@ -279,7 +279,7 @@ struct dvb_frontend_ops {
bool re_tune,
unsigned int mode_flags,
unsigned int *delay,
fe_status_t *status);
enum fe_status *status);
/* get frontend tuning algorithm from the module */
enum dvbfe_algo (*get_frontend_algo)(struct dvb_frontend *fe);
@ -289,7 +289,7 @@ struct dvb_frontend_ops {
int (*get_frontend)(struct dvb_frontend *fe);
int (*read_status)(struct dvb_frontend* fe, fe_status_t* status);
int (*read_status)(struct dvb_frontend *fe, enum fe_status *status);
int (*read_ber)(struct dvb_frontend* fe, u32* ber);
int (*read_signal_strength)(struct dvb_frontend* fe, u16* strength);
int (*read_snr)(struct dvb_frontend* fe, u16* snr);
@ -298,9 +298,11 @@ struct dvb_frontend_ops {
int (*diseqc_reset_overload)(struct dvb_frontend* fe);
int (*diseqc_send_master_cmd)(struct dvb_frontend* fe, struct dvb_diseqc_master_cmd* cmd);
int (*diseqc_recv_slave_reply)(struct dvb_frontend* fe, struct dvb_diseqc_slave_reply* reply);
int (*diseqc_send_burst)(struct dvb_frontend* fe, fe_sec_mini_cmd_t minicmd);
int (*set_tone)(struct dvb_frontend* fe, fe_sec_tone_mode_t tone);
int (*set_voltage)(struct dvb_frontend* fe, fe_sec_voltage_t voltage);
int (*diseqc_send_burst)(struct dvb_frontend *fe,
enum fe_sec_mini_cmd minicmd);
int (*set_tone)(struct dvb_frontend *fe, enum fe_sec_tone_mode tone);
int (*set_voltage)(struct dvb_frontend *fe,
enum fe_sec_voltage voltage);
int (*enable_high_lnb_voltage)(struct dvb_frontend* fe, long arg);
int (*dishnetwork_send_legacy_command)(struct dvb_frontend* fe, unsigned long cmd);
int (*i2c_gate_ctrl)(struct dvb_frontend* fe, int enable);
@ -338,24 +340,24 @@ struct dtv_frontend_properties {
u32 state;
u32 frequency;
fe_modulation_t modulation;
enum fe_modulation modulation;
fe_sec_voltage_t voltage;
fe_sec_tone_mode_t sectone;
fe_spectral_inversion_t inversion;
fe_code_rate_t fec_inner;
fe_transmit_mode_t transmission_mode;
enum fe_sec_voltage voltage;
enum fe_sec_tone_mode sectone;
enum fe_spectral_inversion inversion;
enum fe_code_rate fec_inner;
enum fe_transmit_mode transmission_mode;
u32 bandwidth_hz; /* 0 = AUTO */
fe_guard_interval_t guard_interval;
fe_hierarchy_t hierarchy;
enum fe_guard_interval guard_interval;
enum fe_hierarchy hierarchy;
u32 symbol_rate;
fe_code_rate_t code_rate_HP;
fe_code_rate_t code_rate_LP;
enum fe_code_rate code_rate_HP;
enum fe_code_rate code_rate_LP;
fe_pilot_t pilot;
fe_rolloff_t rolloff;
enum fe_pilot pilot;
enum fe_rolloff rolloff;
fe_delivery_system_t delivery_system;
enum fe_delivery_system delivery_system;
enum fe_interleaving interleaving;
@ -368,8 +370,8 @@ struct dtv_frontend_properties {
u8 isdbt_layer_enabled;
struct {
u8 segment_count;
fe_code_rate_t fec;
fe_modulation_t modulation;
enum fe_code_rate fec;
enum fe_modulation modulation;
u8 interleaving;
} layer[3];
@ -439,7 +441,6 @@ extern void dvb_frontend_reinitialise(struct dvb_frontend *fe);
extern int dvb_frontend_suspend(struct dvb_frontend *fe);
extern int dvb_frontend_resume(struct dvb_frontend *fe);
extern void dvb_frontend_sleep_until(struct timeval *waketime, u32 add_usec);
extern s32 timeval_usec_diff(struct timeval lasttime, struct timeval curtime);
extern void dvb_frontend_sleep_until(ktime_t *waketime, u32 add_usec);
#endif

View File

@ -36,8 +36,9 @@ config DVB_STV6110x
A Silicon tuner that supports DVB-S and DVB-S2 modes
config DVB_M88DS3103
tristate "Montage M88DS3103"
tristate "Montage Technology M88DS3103"
depends on DVB_CORE && I2C && I2C_MUX
select REGMAP_I2C
default m if !MEDIA_SUBDRV_AUTOSELECT
help
Say Y when you want to support this frontend.
@ -223,6 +224,13 @@ config DVB_CX24117
help
A Dual DVB-S/S2 tuner module. Say Y when you want to support this frontend.
config DVB_CX24120
tristate "Conexant CX24120 based"
depends on DVB_CORE && I2C
default m if !MEDIA_SUBDRV_AUTOSELECT
help
A DVB-S/S2 tuner module. Say Y when you want to support this frontend.
config DVB_SI21XX
tristate "Silicon Labs SI21XX based"
depends on DVB_CORE && I2C
@ -232,7 +240,8 @@ config DVB_SI21XX
config DVB_TS2020
tristate "Montage Tehnology TS2020 based tuners"
depends on DVB_CORE && I2C
depends on DVB_CORE
select REGMAP_I2C
default m if !MEDIA_SUBDRV_AUTOSELECT
help
A DVB-S/S2 silicon tuner. Say Y when you want to support this tuner.

View File

@ -83,6 +83,7 @@ obj-$(CONFIG_DVB_DUMMY_FE) += dvb_dummy_fe.o
obj-$(CONFIG_DVB_AF9013) += af9013.o
obj-$(CONFIG_DVB_CX24116) += cx24116.o
obj-$(CONFIG_DVB_CX24117) += cx24117.o
obj-$(CONFIG_DVB_CX24120) += cx24120.o
obj-$(CONFIG_DVB_SI21XX) += si21xx.o
obj-$(CONFIG_DVB_SI2168) += si2168.o
obj-$(CONFIG_DVB_STV0288) += stv0288.o

View File

@ -22,8 +22,9 @@
#include "a8293.h"
struct a8293_priv {
u8 i2c_addr;
struct i2c_adapter *i2c;
const struct a8293_config *cfg;
struct i2c_client *client;
u8 reg[2];
};
@ -32,7 +33,7 @@ static int a8293_i2c(struct a8293_priv *priv, u8 *val, int len, bool rd)
int ret;
struct i2c_msg msg[1] = {
{
.addr = priv->cfg->i2c_addr,
.addr = priv->i2c_addr,
.len = len,
.buf = val,
}
@ -66,7 +67,7 @@ static int a8293_rd(struct a8293_priv *priv, u8 *val, int len)
}
static int a8293_set_voltage(struct dvb_frontend *fe,
fe_sec_voltage_t fe_sec_voltage)
enum fe_sec_voltage fe_sec_voltage)
{
struct a8293_priv *priv = fe->sec_priv;
int ret;
@ -128,7 +129,7 @@ struct dvb_frontend *a8293_attach(struct dvb_frontend *fe,
/* setup the priv */
priv->i2c = i2c;
priv->cfg = cfg;
priv->i2c_addr = cfg->i2c_addr;
fe->sec_priv = priv;
/* check if the SEC is there */
@ -164,6 +165,86 @@ err:
}
EXPORT_SYMBOL(a8293_attach);
static int a8293_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct a8293_priv *dev;
struct a8293_platform_data *pdata = client->dev.platform_data;
struct dvb_frontend *fe = pdata->dvb_frontend;
int ret;
u8 buf[2];
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
if (!dev) {
ret = -ENOMEM;
goto err;
}
dev->client = client;
dev->i2c = client->adapter;
dev->i2c_addr = client->addr;
/* check if the SEC is there */
ret = a8293_rd(dev, buf, 2);
if (ret)
goto err_kfree;
/* ENB=0 */
dev->reg[0] = 0x10;
ret = a8293_wr(dev, &dev->reg[0], 1);
if (ret)
goto err_kfree;
/* TMODE=0, TGATE=1 */
dev->reg[1] = 0x82;
ret = a8293_wr(dev, &dev->reg[1], 1);
if (ret)
goto err_kfree;
/* override frontend ops */
fe->ops.set_voltage = a8293_set_voltage;
fe->sec_priv = dev;
i2c_set_clientdata(client, dev);
dev_info(&client->dev, "Allegro A8293 SEC successfully attached\n");
return 0;
err_kfree:
kfree(dev);
err:
dev_dbg(&client->dev, "failed=%d\n", ret);
return ret;
}
static int a8293_remove(struct i2c_client *client)
{
struct a8293_dev *dev = i2c_get_clientdata(client);
dev_dbg(&client->dev, "\n");
kfree(dev);
return 0;
}
static const struct i2c_device_id a8293_id_table[] = {
{"a8293", 0},
{}
};
MODULE_DEVICE_TABLE(i2c, a8293_id_table);
static struct i2c_driver a8293_driver = {
.driver = {
.owner = THIS_MODULE,
.name = "a8293",
.suppress_bind_attrs = true,
},
.probe = a8293_probe,
.remove = a8293_remove,
.id_table = a8293_id_table,
};
module_i2c_driver(a8293_driver);
MODULE_AUTHOR("Antti Palosaari <crope@iki.fi>");
MODULE_DESCRIPTION("Allegro A8293 SEC driver");
MODULE_LICENSE("GPL");

View File

@ -21,8 +21,23 @@
#ifndef A8293_H
#define A8293_H
#include "dvb_frontend.h"
#include <linux/kconfig.h>
/*
* I2C address
* 0x08, 0x09, 0x0a, 0x0b
*/
/**
* struct a8293_platform_data - Platform data for the a8293 driver
* @dvb_frontend: DVB frontend.
*/
struct a8293_platform_data {
struct dvb_frontend *dvb_frontend;
};
struct a8293_config {
u8 i2c_addr;
};

View File

@ -39,7 +39,7 @@ struct af9013_state {
u32 ucblocks;
u16 snr;
u32 bandwidth_hz;
fe_status_t fe_status;
enum fe_status fe_status;
unsigned long set_frontend_jiffies;
unsigned long read_status_jiffies;
bool first_tune;
@ -605,6 +605,10 @@ static int af9013_set_frontend(struct dvb_frontend *fe)
}
}
/* Return an error if can't find bandwidth or the right clock */
if (i == ARRAY_SIZE(coeff_lut))
return -EINVAL;
ret = af9013_wr_regs(state, 0xae00, coeff_lut[i].val,
sizeof(coeff_lut[i].val));
}
@ -979,7 +983,7 @@ err:
return ret;
}
static int af9013_read_status(struct dvb_frontend *fe, fe_status_t *status)
static int af9013_read_status(struct dvb_frontend *fe, enum fe_status *status)
{
struct af9013_state *state = fe->demodulator_priv;
int ret;

View File

@ -35,7 +35,7 @@ struct af9033_dev {
bool ts_mode_parallel;
bool ts_mode_serial;
fe_status_t fe_status;
enum fe_status fe_status;
u64 post_bit_error_prev; /* for old read_ber we return (curr - prev) */
u64 post_bit_error;
u64 post_bit_count;
@ -818,7 +818,7 @@ err:
return ret;
}
static int af9033_read_status(struct dvb_frontend *fe, fe_status_t *status)
static int af9033_read_status(struct dvb_frontend *fe, enum fe_status *status)
{
struct af9033_dev *dev = fe->demodulator_priv;
int ret;

View File

@ -32,7 +32,7 @@ struct as102_state {
uint32_t ber;
};
static uint8_t as102_fe_get_code_rate(fe_code_rate_t arg)
static uint8_t as102_fe_get_code_rate(enum fe_code_rate arg)
{
uint8_t c;
@ -306,7 +306,7 @@ static int as102_fe_get_tune_settings(struct dvb_frontend *fe,
return 0;
}
static int as102_fe_read_status(struct dvb_frontend *fe, fe_status_t *status)
static int as102_fe_read_status(struct dvb_frontend *fe, enum fe_status *status)
{
int ret = 0;
struct as102_state *state = fe->demodulator_priv;

View File

@ -335,7 +335,8 @@ static int atbm8830_get_tune_settings(struct dvb_frontend *fe,
return 0;
}
static int atbm8830_read_status(struct dvb_frontend *fe, fe_status_t *fe_status)
static int atbm8830_read_status(struct dvb_frontend *fe,
enum fe_status *fe_status)
{
struct atbm_state *priv = fe->demodulator_priv;
u8 locked = 0;

View File

@ -552,7 +552,7 @@ static struct {
};
static int au8522_enable_modulation(struct dvb_frontend *fe,
fe_modulation_t m)
enum fe_modulation m)
{
struct au8522_state *state = fe->demodulator_priv;
int i;
@ -644,7 +644,7 @@ static int au8522_set_frontend(struct dvb_frontend *fe)
return 0;
}
static int au8522_read_status(struct dvb_frontend *fe, fe_status_t *status)
static int au8522_read_status(struct dvb_frontend *fe, enum fe_status *status)
{
struct au8522_state *state = fe->demodulator_priv;
u8 reg;

View File

@ -55,7 +55,7 @@ struct au8522_state {
struct dvb_frontend frontend;
u32 current_frequency;
fe_modulation_t current_modulation;
enum fe_modulation current_modulation;
u32 fe_status;
unsigned int led_state;

View File

@ -289,7 +289,7 @@ static int bcm3510_refresh_state(struct bcm3510_state *st)
return 0;
}
static int bcm3510_read_status(struct dvb_frontend *fe, fe_status_t *status)
static int bcm3510_read_status(struct dvb_frontend *fe, enum fe_status *status)
{
struct bcm3510_state* st = fe->demodulator_priv;
bcm3510_refresh_state(st);
@ -685,7 +685,7 @@ static int bcm3510_reset(struct bcm3510_state *st)
if ((ret = bcm3510_writeB(st,0xa0,v)) < 0)
return ret;
t = jiffies + 3*HZ;
t = jiffies + 3*HZ;
while (time_before(jiffies, t)) {
msleep(10);
if ((ret = bcm3510_readB(st,0xa2,&v)) < 0)
@ -708,7 +708,7 @@ static int bcm3510_clear_reset(struct bcm3510_state *st)
if ((ret = bcm3510_writeB(st,0xa0,v)) < 0)
return ret;
t = jiffies + 3*HZ;
t = jiffies + 3*HZ;
while (time_before(jiffies, t)) {
msleep(10);
if ((ret = bcm3510_readB(st,0xa2,&v)) < 0)

View File

@ -191,9 +191,10 @@ static int cx22700_set_tps(struct cx22700_state *state,
static int cx22700_get_tps(struct cx22700_state *state,
struct dtv_frontend_properties *p)
{
static const fe_modulation_t qam_tab [3] = { QPSK, QAM_16, QAM_64 };
static const fe_code_rate_t fec_tab [5] = { FEC_1_2, FEC_2_3, FEC_3_4,
FEC_5_6, FEC_7_8 };
static const enum fe_modulation qam_tab[3] = { QPSK, QAM_16, QAM_64 };
static const enum fe_code_rate fec_tab[5] = {
FEC_1_2, FEC_2_3, FEC_3_4, FEC_5_6, FEC_7_8
};
u8 val;
dprintk ("%s\n", __func__);
@ -253,7 +254,7 @@ static int cx22700_init (struct dvb_frontend* fe)
return 0;
}
static int cx22700_read_status(struct dvb_frontend* fe, fe_status_t* status)
static int cx22700_read_status(struct dvb_frontend *fe, enum fe_status *status)
{
struct cx22700_state* state = fe->demodulator_priv;

View File

@ -452,7 +452,7 @@ static int cx22702_init(struct dvb_frontend *fe)
return 0;
}
static int cx22702_read_status(struct dvb_frontend *fe, fe_status_t *status)
static int cx22702_read_status(struct dvb_frontend *fe, enum fe_status *status)
{
struct cx22702_state *state = fe->demodulator_priv;
u8 reg0A;

View File

@ -143,7 +143,8 @@ static int cx24110_readreg (struct cx24110_state* state, u8 reg)
return b1[0];
}
static int cx24110_set_inversion (struct cx24110_state* state, fe_spectral_inversion_t inversion)
static int cx24110_set_inversion(struct cx24110_state *state,
enum fe_spectral_inversion inversion)
{
/* fixme (low): error handling */
@ -177,7 +178,7 @@ static int cx24110_set_inversion (struct cx24110_state* state, fe_spectral_inver
return 0;
}
static int cx24110_set_fec(struct cx24110_state* state, fe_code_rate_t fec)
static int cx24110_set_fec(struct cx24110_state *state, enum fe_code_rate fec)
{
static const int rate[FEC_AUTO] = {-1, 1, 2, 3, 5, 7, -1};
static const int g1[FEC_AUTO] = {-1, 0x01, 0x02, 0x05, 0x15, 0x45, -1};
@ -220,7 +221,7 @@ static int cx24110_set_fec(struct cx24110_state* state, fe_code_rate_t fec)
return 0;
}
static fe_code_rate_t cx24110_get_fec (struct cx24110_state* state)
static enum fe_code_rate cx24110_get_fec(struct cx24110_state *state)
{
int i;
@ -365,7 +366,8 @@ static int cx24110_initfe(struct dvb_frontend* fe)
return 0;
}
static int cx24110_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltage)
static int cx24110_set_voltage(struct dvb_frontend *fe,
enum fe_sec_voltage voltage)
{
struct cx24110_state *state = fe->demodulator_priv;
@ -379,7 +381,8 @@ static int cx24110_set_voltage (struct dvb_frontend* fe, fe_sec_voltage_t voltag
}
}
static int cx24110_diseqc_send_burst(struct dvb_frontend* fe, fe_sec_mini_cmd_t burst)
static int cx24110_diseqc_send_burst(struct dvb_frontend *fe,
enum fe_sec_mini_cmd burst)
{
int rv, bit;
struct cx24110_state *state = fe->demodulator_priv;
@ -434,7 +437,8 @@ static int cx24110_send_diseqc_msg(struct dvb_frontend* fe,
return 0;
}
static int cx24110_read_status(struct dvb_frontend* fe, fe_status_t* status)
static int cx24110_read_status(struct dvb_frontend *fe,
enum fe_status *status)
{
struct cx24110_state *state = fe->demodulator_priv;
@ -574,7 +578,8 @@ static int cx24110_get_frontend(struct dvb_frontend *fe)
return 0;
}
static int cx24110_set_tone(struct dvb_frontend* fe, fe_sec_tone_mode_t tone)
static int cx24110_set_tone(struct dvb_frontend *fe,
enum fe_sec_tone_mode tone)
{
struct cx24110_state *state = fe->demodulator_priv;

View File

@ -160,13 +160,13 @@ enum cmds {
struct cx24116_tuning {
u32 frequency;
u32 symbol_rate;
fe_spectral_inversion_t inversion;
fe_code_rate_t fec;
enum fe_spectral_inversion inversion;
enum fe_code_rate fec;
fe_delivery_system_t delsys;
fe_modulation_t modulation;
fe_pilot_t pilot;
fe_rolloff_t rolloff;
enum fe_delivery_system delsys;
enum fe_modulation modulation;
enum fe_pilot pilot;
enum fe_rolloff rolloff;
/* Demod values */
u8 fec_val;
@ -285,7 +285,7 @@ static int cx24116_readreg(struct cx24116_state *state, u8 reg)
}
static int cx24116_set_inversion(struct cx24116_state *state,
fe_spectral_inversion_t inversion)
enum fe_spectral_inversion inversion)
{
dprintk("%s(%d)\n", __func__, inversion);
@ -373,9 +373,9 @@ static int cx24116_set_inversion(struct cx24116_state *state,
* a scheme are support. Especially, no auto detect when in S2 mode.
*/
static struct cx24116_modfec {
fe_delivery_system_t delivery_system;
fe_modulation_t modulation;
fe_code_rate_t fec;
enum fe_delivery_system delivery_system;
enum fe_modulation modulation;
enum fe_code_rate fec;
u8 mask; /* In DVBS mode this is used to autodetect */
u8 val; /* Passed to the firmware to indicate mode selection */
} CX24116_MODFEC_MODES[] = {
@ -415,7 +415,7 @@ static struct cx24116_modfec {
};
static int cx24116_lookup_fecmod(struct cx24116_state *state,
fe_delivery_system_t d, fe_modulation_t m, fe_code_rate_t f)
enum fe_delivery_system d, enum fe_modulation m, enum fe_code_rate f)
{
int i, ret = -EOPNOTSUPP;
@ -434,7 +434,9 @@ static int cx24116_lookup_fecmod(struct cx24116_state *state,
}
static int cx24116_set_fec(struct cx24116_state *state,
fe_delivery_system_t delsys, fe_modulation_t mod, fe_code_rate_t fec)
enum fe_delivery_system delsys,
enum fe_modulation mod,
enum fe_code_rate fec)
{
int ret = 0;
@ -683,7 +685,7 @@ static int cx24116_load_firmware(struct dvb_frontend *fe,
return 0;
}
static int cx24116_read_status(struct dvb_frontend *fe, fe_status_t *status)
static int cx24116_read_status(struct dvb_frontend *fe, enum fe_status *status)
{
struct cx24116_state *state = fe->demodulator_priv;
@ -844,7 +846,7 @@ static int cx24116_wait_for_lnb(struct dvb_frontend *fe)
}
static int cx24116_set_voltage(struct dvb_frontend *fe,
fe_sec_voltage_t voltage)
enum fe_sec_voltage voltage)
{
struct cx24116_cmd cmd;
int ret;
@ -872,7 +874,7 @@ static int cx24116_set_voltage(struct dvb_frontend *fe,
}
static int cx24116_set_tone(struct dvb_frontend *fe,
fe_sec_tone_mode_t tone)
enum fe_sec_tone_mode tone)
{
struct cx24116_cmd cmd;
int ret;
@ -963,6 +965,10 @@ static int cx24116_send_diseqc_msg(struct dvb_frontend *fe,
struct cx24116_state *state = fe->demodulator_priv;
int i, ret;
/* Validate length */
if (d->msg_len > sizeof(d->msg))
return -EINVAL;
/* Dump DiSEqC message */
if (debug) {
printk(KERN_INFO "cx24116: %s(", __func__);
@ -974,10 +980,6 @@ static int cx24116_send_diseqc_msg(struct dvb_frontend *fe,
printk(") toneburst=%d\n", toneburst);
}
/* Validate length */
if (d->msg_len > (CX24116_ARGLEN - CX24116_DISEQC_MSGOFS))
return -EINVAL;
/* DiSEqC message */
for (i = 0; i < d->msg_len; i++)
state->dsec_cmd.args[CX24116_DISEQC_MSGOFS + i] = d->msg[i];
@ -1055,7 +1057,7 @@ static int cx24116_send_diseqc_msg(struct dvb_frontend *fe,
/* Send DiSEqC burst */
static int cx24116_diseqc_send_burst(struct dvb_frontend *fe,
fe_sec_mini_cmd_t burst)
enum fe_sec_mini_cmd burst)
{
struct cx24116_state *state = fe->demodulator_priv;
int ret;
@ -1220,7 +1222,7 @@ static int cx24116_set_frontend(struct dvb_frontend *fe)
struct cx24116_state *state = fe->demodulator_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct cx24116_cmd cmd;
fe_status_t tunerstat;
enum fe_status tunerstat;
int i, status, ret, retune = 1;
dprintk("%s()\n", __func__);
@ -1441,7 +1443,7 @@ tuned: /* Set/Reset B/W */
}
static int cx24116_tune(struct dvb_frontend *fe, bool re_tune,
unsigned int mode_flags, unsigned int *delay, fe_status_t *status)
unsigned int mode_flags, unsigned int *delay, enum fe_status *status)
{
/*
* It is safe to discard "params" here, as the DVB core will sync

View File

@ -171,13 +171,13 @@ static DEFINE_MUTEX(cx24117_list_mutex);
struct cx24117_tuning {
u32 frequency;
u32 symbol_rate;
fe_spectral_inversion_t inversion;
fe_code_rate_t fec;
enum fe_spectral_inversion inversion;
enum fe_code_rate fec;
fe_delivery_system_t delsys;
fe_modulation_t modulation;
fe_pilot_t pilot;
fe_rolloff_t rolloff;
enum fe_delivery_system delsys;
enum fe_modulation modulation;
enum fe_pilot pilot;
enum fe_rolloff rolloff;
/* Demod values */
u8 fec_val;
@ -220,9 +220,9 @@ struct cx24117_state {
/* modfec (modulation and FEC) lookup table */
/* Check cx24116.c for a detailed description of each field */
static struct cx24117_modfec {
fe_delivery_system_t delivery_system;
fe_modulation_t modulation;
fe_code_rate_t fec;
enum fe_delivery_system delivery_system;
enum fe_modulation modulation;
enum fe_code_rate fec;
u8 mask; /* In DVBS mode this is used to autodetect */
u8 val; /* Passed to the firmware to indicate mode selection */
} cx24117_modfec_modes[] = {
@ -362,7 +362,7 @@ static int cx24117_readregN(struct cx24117_state *state,
}
static int cx24117_set_inversion(struct cx24117_state *state,
fe_spectral_inversion_t inversion)
enum fe_spectral_inversion inversion)
{
dev_dbg(&state->priv->i2c->dev, "%s(%d) demod%d\n",
__func__, inversion, state->demod);
@ -387,7 +387,7 @@ static int cx24117_set_inversion(struct cx24117_state *state,
}
static int cx24117_lookup_fecmod(struct cx24117_state *state,
fe_delivery_system_t d, fe_modulation_t m, fe_code_rate_t f)
enum fe_delivery_system d, enum fe_modulation m, enum fe_code_rate f)
{
int i, ret = -EINVAL;
@ -408,7 +408,9 @@ static int cx24117_lookup_fecmod(struct cx24117_state *state,
}
static int cx24117_set_fec(struct cx24117_state *state,
fe_delivery_system_t delsys, fe_modulation_t mod, fe_code_rate_t fec)
enum fe_delivery_system delsys,
enum fe_modulation mod,
enum fe_code_rate fec)
{
int ret;
@ -737,7 +739,7 @@ error:
return ret;
}
static int cx24117_read_status(struct dvb_frontend *fe, fe_status_t *status)
static int cx24117_read_status(struct dvb_frontend *fe, enum fe_status *status)
{
struct cx24117_state *state = fe->demodulator_priv;
int lock;
@ -843,7 +845,7 @@ static int cx24117_read_snr(struct dvb_frontend *fe, u16 *snr)
static int cx24117_read_ucblocks(struct dvb_frontend *fe, u32 *ucblocks)
{
struct cx24117_state *state = fe->demodulator_priv;
fe_delivery_system_t delsys = fe->dtv_property_cache.delivery_system;
enum fe_delivery_system delsys = fe->dtv_property_cache.delivery_system;
int ret;
u8 buf[2];
u8 reg = (state->demod == 0) ?
@ -904,7 +906,7 @@ static int cx24117_wait_for_lnb(struct dvb_frontend *fe)
}
static int cx24117_set_voltage(struct dvb_frontend *fe,
fe_sec_voltage_t voltage)
enum fe_sec_voltage voltage)
{
struct cx24117_state *state = fe->demodulator_priv;
struct cx24117_cmd cmd;
@ -956,7 +958,7 @@ static int cx24117_set_voltage(struct dvb_frontend *fe,
}
static int cx24117_set_tone(struct dvb_frontend *fe,
fe_sec_tone_mode_t tone)
enum fe_sec_tone_mode tone)
{
struct cx24117_state *state = fe->demodulator_priv;
struct cx24117_cmd cmd;
@ -1043,7 +1045,7 @@ static int cx24117_send_diseqc_msg(struct dvb_frontend *fe,
dev_dbg(&state->priv->i2c->dev, ")\n");
/* Validate length */
if (d->msg_len > 15)
if (d->msg_len > sizeof(d->msg))
return -EINVAL;
/* DiSEqC message */
@ -1112,7 +1114,7 @@ static int cx24117_send_diseqc_msg(struct dvb_frontend *fe,
/* Send DiSEqC burst */
static int cx24117_diseqc_send_burst(struct dvb_frontend *fe,
fe_sec_mini_cmd_t burst)
enum fe_sec_mini_cmd burst)
{
struct cx24117_state *state = fe->demodulator_priv;
@ -1306,7 +1308,7 @@ static int cx24117_set_frontend(struct dvb_frontend *fe)
struct cx24117_state *state = fe->demodulator_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
struct cx24117_cmd cmd;
fe_status_t tunerstat;
enum fe_status tunerstat;
int i, status, ret, retune = 1;
u8 reg_clkdiv, reg_ratediv;
@ -1537,7 +1539,7 @@ static int cx24117_set_frontend(struct dvb_frontend *fe)
}
static int cx24117_tune(struct dvb_frontend *fe, bool re_tune,
unsigned int mode_flags, unsigned int *delay, fe_status_t *status)
unsigned int mode_flags, unsigned int *delay, enum fe_status *status)
{
struct cx24117_state *state = fe->demodulator_priv;

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,58 @@
/*
* Conexant CX24120/CX24118 - DVB-S/S2 demod/tuner driver
*
* Copyright (C) 2008 Patrick Boettcher <pb@linuxtv.org>
* Copyright (C) 2009 Sergey Tyurin <forum.free-x.de>
* Updated 2012 by Jannis Achstetter <jannis_achstetter@web.de>
* Copyright (C) 2015 Jemma Denson <jdenson@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.
*/
#ifndef CX24120_H
#define CX24120_H
#include <linux/kconfig.h>
#include <linux/dvb/frontend.h>
#include <linux/firmware.h>
struct cx24120_initial_mpeg_config {
u8 x1;
u8 x2;
u8 x3;
};
struct cx24120_config {
u8 i2c_addr;
u32 xtal_khz;
struct cx24120_initial_mpeg_config initial_mpeg_config;
int (*request_firmware)(struct dvb_frontend *fe,
const struct firmware **fw, char *name);
/* max bytes I2C provider can write at once */
u16 i2c_wr_max;
};
#if IS_REACHABLE(CONFIG_DVB_CX24120)
struct dvb_frontend *cx24120_attach(const struct cx24120_config *config,
struct i2c_adapter *i2c);
#else
static inline
struct dvb_frontend *cx24120_attach(const struct cx24120_config *config,
struct i2c_adapter *i2c)
{
pr_warn("%s: driver disabled by Kconfig\n", __func__);
return NULL;
}
#endif
#endif /* CX24120_H */

View File

@ -290,7 +290,7 @@ static int cx24123_i2c_readreg(struct cx24123_state *state, u8 i2c_addr, u8 reg)
cx24123_i2c_writereg(state, state->config->demod_address, reg, val)
static int cx24123_set_inversion(struct cx24123_state *state,
fe_spectral_inversion_t inversion)
enum fe_spectral_inversion inversion)
{
u8 nom_reg = cx24123_readreg(state, 0x0e);
u8 auto_reg = cx24123_readreg(state, 0x10);
@ -318,7 +318,7 @@ static int cx24123_set_inversion(struct cx24123_state *state,
}
static int cx24123_get_inversion(struct cx24123_state *state,
fe_spectral_inversion_t *inversion)
enum fe_spectral_inversion *inversion)
{
u8 val;
@ -335,7 +335,7 @@ static int cx24123_get_inversion(struct cx24123_state *state,
return 0;
}
static int cx24123_set_fec(struct cx24123_state *state, fe_code_rate_t fec)
static int cx24123_set_fec(struct cx24123_state *state, enum fe_code_rate fec)
{
u8 nom_reg = cx24123_readreg(state, 0x0e) & ~0x07;
@ -397,7 +397,7 @@ static int cx24123_set_fec(struct cx24123_state *state, fe_code_rate_t fec)
return 0;
}
static int cx24123_get_fec(struct cx24123_state *state, fe_code_rate_t *fec)
static int cx24123_get_fec(struct cx24123_state *state, enum fe_code_rate *fec)
{
int ret;
@ -720,7 +720,7 @@ static int cx24123_initfe(struct dvb_frontend *fe)
}
static int cx24123_set_voltage(struct dvb_frontend *fe,
fe_sec_voltage_t voltage)
enum fe_sec_voltage voltage)
{
struct cx24123_state *state = fe->demodulator_priv;
u8 val;
@ -795,7 +795,7 @@ static int cx24123_send_diseqc_msg(struct dvb_frontend *fe,
}
static int cx24123_diseqc_send_burst(struct dvb_frontend *fe,
fe_sec_mini_cmd_t burst)
enum fe_sec_mini_cmd burst)
{
struct cx24123_state *state = fe->demodulator_priv;
int val, tone;
@ -831,7 +831,7 @@ static int cx24123_diseqc_send_burst(struct dvb_frontend *fe,
return 0;
}
static int cx24123_read_status(struct dvb_frontend *fe, fe_status_t *status)
static int cx24123_read_status(struct dvb_frontend *fe, enum fe_status *status)
{
struct cx24123_state *state = fe->demodulator_priv;
int sync = cx24123_readreg(state, 0x14);
@ -966,7 +966,7 @@ static int cx24123_get_frontend(struct dvb_frontend *fe)
return 0;
}
static int cx24123_set_tone(struct dvb_frontend *fe, fe_sec_tone_mode_t tone)
static int cx24123_set_tone(struct dvb_frontend *fe, enum fe_sec_tone_mode tone)
{
struct cx24123_state *state = fe->demodulator_priv;
u8 val;
@ -995,7 +995,7 @@ static int cx24123_tune(struct dvb_frontend *fe,
bool re_tune,
unsigned int mode_flags,
unsigned int *delay,
fe_status_t *status)
enum fe_status *status)
{
int retval = 0;

View File

@ -50,7 +50,7 @@ static inline struct dvb_frontend *cx24123_attach(
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
return NULL;
}
static struct i2c_adapter *
static inline struct i2c_adapter *
cx24123_get_tuner_i2c_adapter(struct dvb_frontend *fe)
{
printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);

View File

@ -259,7 +259,7 @@ int cxd2820r_read_ucblocks_c(struct dvb_frontend *fe, u32 *ucblocks)
return 0;
}
int cxd2820r_read_status_c(struct dvb_frontend *fe, fe_status_t *status)
int cxd2820r_read_status_c(struct dvb_frontend *fe, enum fe_status *status)
{
struct cxd2820r_priv *priv = fe->demodulator_priv;
int ret;

View File

@ -287,7 +287,8 @@ static int cxd2820r_set_frontend(struct dvb_frontend *fe)
err:
return ret;
}
static int cxd2820r_read_status(struct dvb_frontend *fe, fe_status_t *status)
static int cxd2820r_read_status(struct dvb_frontend *fe, enum fe_status *status)
{
struct cxd2820r_priv *priv = fe->demodulator_priv;
int ret;
@ -501,7 +502,7 @@ static enum dvbfe_search cxd2820r_search(struct dvb_frontend *fe)
struct cxd2820r_priv *priv = fe->demodulator_priv;
struct dtv_frontend_properties *c = &fe->dtv_property_cache;
int ret, i;
fe_status_t status = 0;
enum fe_status status = 0;
dev_dbg(&priv->i2c->dev, "%s: delsys=%d\n", __func__,
fe->dtv_property_cache.delivery_system);

View File

@ -48,7 +48,7 @@ struct cxd2820r_priv {
struct gpio_chip gpio_chip;
#endif
fe_delivery_system_t delivery_system;
enum fe_delivery_system delivery_system;
bool last_tune_failed; /* for switch between T and T2 tune */
};
@ -80,7 +80,7 @@ int cxd2820r_get_frontend_c(struct dvb_frontend *fe);
int cxd2820r_set_frontend_c(struct dvb_frontend *fe);
int cxd2820r_read_status_c(struct dvb_frontend *fe, fe_status_t *status);
int cxd2820r_read_status_c(struct dvb_frontend *fe, enum fe_status *status);
int cxd2820r_read_ber_c(struct dvb_frontend *fe, u32 *ber);
@ -103,7 +103,7 @@ int cxd2820r_get_frontend_t(struct dvb_frontend *fe);
int cxd2820r_set_frontend_t(struct dvb_frontend *fe);
int cxd2820r_read_status_t(struct dvb_frontend *fe, fe_status_t *status);
int cxd2820r_read_status_t(struct dvb_frontend *fe, enum fe_status *status);
int cxd2820r_read_ber_t(struct dvb_frontend *fe, u32 *ber);
@ -126,7 +126,7 @@ int cxd2820r_get_frontend_t2(struct dvb_frontend *fe);
int cxd2820r_set_frontend_t2(struct dvb_frontend *fe);
int cxd2820r_read_status_t2(struct dvb_frontend *fe, fe_status_t *status);
int cxd2820r_read_status_t2(struct dvb_frontend *fe, enum fe_status *status);
int cxd2820r_read_ber_t2(struct dvb_frontend *fe, u32 *ber);

View File

@ -349,7 +349,7 @@ int cxd2820r_read_ucblocks_t(struct dvb_frontend *fe, u32 *ucblocks)
return 0;
}
int cxd2820r_read_status_t(struct dvb_frontend *fe, fe_status_t *status)
int cxd2820r_read_status_t(struct dvb_frontend *fe, enum fe_status *status)
{
struct cxd2820r_priv *priv = fe->demodulator_priv;
int ret;

View File

@ -284,7 +284,7 @@ error:
return ret;
}
int cxd2820r_read_status_t2(struct dvb_frontend *fe, fe_status_t *status)
int cxd2820r_read_status_t2(struct dvb_frontend *fe, enum fe_status *status)
{
struct cxd2820r_priv *priv = fe->demodulator_priv;
int ret;

View File

@ -58,10 +58,10 @@ struct dib0070_state {
u16 wbd_ff_offset;
u8 revision;
enum frontend_tune_state tune_state;
u32 current_rf;
enum frontend_tune_state tune_state;
u32 current_rf;
/* for the captrim binary search */
/* for the captrim binary search */
s8 step;
u16 adc_diff;
@ -72,7 +72,7 @@ struct dib0070_state {
const struct dib0070_tuning *current_tune_table_index;
const struct dib0070_lna_match *lna_match;
u8 wbd_gain_current;
u8 wbd_gain_current;
u16 wbd_offset_3_3[2];
/* for the I2C transfer */
@ -151,31 +151,31 @@ static int dib0070_write_reg(struct dib0070_state *state, u8 reg, u16 val)
} while (0)
static int dib0070_set_bandwidth(struct dvb_frontend *fe)
{
struct dib0070_state *state = fe->tuner_priv;
u16 tmp = dib0070_read_reg(state, 0x02) & 0x3fff;
{
struct dib0070_state *state = fe->tuner_priv;
u16 tmp = dib0070_read_reg(state, 0x02) & 0x3fff;
if (state->fe->dtv_property_cache.bandwidth_hz/1000 > 7000)
tmp |= (0 << 14);
else if (state->fe->dtv_property_cache.bandwidth_hz/1000 > 6000)
tmp |= (1 << 14);
else if (state->fe->dtv_property_cache.bandwidth_hz/1000 > 5000)
tmp |= (2 << 14);
else
tmp |= (3 << 14);
if (state->fe->dtv_property_cache.bandwidth_hz/1000 > 7000)
tmp |= (0 << 14);
else if (state->fe->dtv_property_cache.bandwidth_hz/1000 > 6000)
tmp |= (1 << 14);
else if (state->fe->dtv_property_cache.bandwidth_hz/1000 > 5000)
tmp |= (2 << 14);
else
tmp |= (3 << 14);
dib0070_write_reg(state, 0x02, tmp);
dib0070_write_reg(state, 0x02, tmp);
/* sharpen the BB filter in ISDB-T to have higher immunity to adjacent channels */
if (state->fe->dtv_property_cache.delivery_system == SYS_ISDBT) {
u16 value = dib0070_read_reg(state, 0x17);
/* sharpen the BB filter in ISDB-T to have higher immunity to adjacent channels */
if (state->fe->dtv_property_cache.delivery_system == SYS_ISDBT) {
u16 value = dib0070_read_reg(state, 0x17);
dib0070_write_reg(state, 0x17, value & 0xfffc);
tmp = dib0070_read_reg(state, 0x01) & 0x01ff;
dib0070_write_reg(state, 0x01, tmp | (60 << 9));
dib0070_write_reg(state, 0x17, value & 0xfffc);
tmp = dib0070_read_reg(state, 0x01) & 0x01ff;
dib0070_write_reg(state, 0x01, tmp | (60 << 9));
dib0070_write_reg(state, 0x17, value);
}
dib0070_write_reg(state, 0x17, value);
}
return 0;
}
@ -186,7 +186,6 @@ static int dib0070_captrim(struct dib0070_state *state, enum frontend_tune_state
int ret = 0;
if (*tune_state == CT_TUNER_STEP_0) {
dib0070_write_reg(state, 0x0f, 0xed10);
dib0070_write_reg(state, 0x17, 0x0034);
@ -195,7 +194,7 @@ static int dib0070_captrim(struct dib0070_state *state, enum frontend_tune_state
state->adc_diff = 3000;
ret = 20;
*tune_state = CT_TUNER_STEP_1;
*tune_state = CT_TUNER_STEP_1;
} else if (*tune_state == CT_TUNER_STEP_1) {
state->step /= 2;
dib0070_write_reg(state, 0x14, state->lo4 | state->captrim);
@ -220,9 +219,6 @@ static int dib0070_captrim(struct dib0070_state *state, enum frontend_tune_state
dprintk("CAPTRIM=%hd is closer to target (%hd/%hd)", state->captrim, adc, state->adc_diff);
state->adc_diff = adc;
state->fcaptrim = state->captrim;
}
state->captrim += (step_sign * state->step);
@ -243,7 +239,8 @@ static int dib0070_captrim(struct dib0070_state *state, enum frontend_tune_state
static int dib0070_set_ctrl_lo5(struct dvb_frontend *fe, u8 vco_bias_trim, u8 hf_div_trim, u8 cp_current, u8 third_order_filt)
{
struct dib0070_state *state = fe->tuner_priv;
u16 lo5 = (third_order_filt << 14) | (0 << 13) | (1 << 12) | (3 << 9) | (cp_current << 6) | (hf_div_trim << 3) | (vco_bias_trim << 0);
u16 lo5 = (third_order_filt << 14) | (0 << 13) | (1 << 12) | (3 << 9) | (cp_current << 6) | (hf_div_trim << 3) | (vco_bias_trim << 0);
dprintk("CTRL_LO5: 0x%x", lo5);
return dib0070_write_reg(state, 0x15, lo5);
}
@ -257,281 +254,282 @@ void dib0070_ctrl_agc_filter(struct dvb_frontend *fe, u8 open)
dib0070_write_reg(state, 0x1a, 0x0000);
} else {
dib0070_write_reg(state, 0x1b, 0x4112);
if (state->cfg->vga_filter != 0) {
dib0070_write_reg(state, 0x1a, state->cfg->vga_filter);
dprintk("vga filter register is set to %x", state->cfg->vga_filter);
} else
dib0070_write_reg(state, 0x1a, 0x0009);
if (state->cfg->vga_filter != 0) {
dib0070_write_reg(state, 0x1a, state->cfg->vga_filter);
dprintk("vga filter register is set to %x", state->cfg->vga_filter);
} else
dib0070_write_reg(state, 0x1a, 0x0009);
}
}
EXPORT_SYMBOL(dib0070_ctrl_agc_filter);
struct dib0070_tuning {
u32 max_freq; /* for every frequency less than or equal to that field: this information is correct */
u8 switch_trim;
u8 vco_band;
u8 hfdiv;
u8 vco_multi;
u8 presc;
u8 wbdmux;
u16 tuner_enable;
u32 max_freq; /* for every frequency less than or equal to that field: this information is correct */
u8 switch_trim;
u8 vco_band;
u8 hfdiv;
u8 vco_multi;
u8 presc;
u8 wbdmux;
u16 tuner_enable;
};
struct dib0070_lna_match {
u32 max_freq; /* for every frequency less than or equal to that field: this information is correct */
u8 lna_band;
u32 max_freq; /* for every frequency less than or equal to that field: this information is correct */
u8 lna_band;
};
static const struct dib0070_tuning dib0070s_tuning_table[] = {
{ 570000, 2, 1, 3, 6, 6, 2, 0x4000 | 0x0800 }, /* UHF */
{ 700000, 2, 0, 2, 4, 2, 2, 0x4000 | 0x0800 },
{ 863999, 2, 1, 2, 4, 2, 2, 0x4000 | 0x0800 },
{ 1500000, 0, 1, 1, 2, 2, 4, 0x2000 | 0x0400 }, /* LBAND */
{ 1600000, 0, 1, 1, 2, 2, 4, 0x2000 | 0x0400 },
{ 2000000, 0, 1, 1, 2, 2, 4, 0x2000 | 0x0400 },
{ 0xffffffff, 0, 0, 8, 1, 2, 1, 0x8000 | 0x1000 }, /* SBAND */
{ 570000, 2, 1, 3, 6, 6, 2, 0x4000 | 0x0800 }, /* UHF */
{ 700000, 2, 0, 2, 4, 2, 2, 0x4000 | 0x0800 },
{ 863999, 2, 1, 2, 4, 2, 2, 0x4000 | 0x0800 },
{ 1500000, 0, 1, 1, 2, 2, 4, 0x2000 | 0x0400 }, /* LBAND */
{ 1600000, 0, 1, 1, 2, 2, 4, 0x2000 | 0x0400 },
{ 2000000, 0, 1, 1, 2, 2, 4, 0x2000 | 0x0400 },
{ 0xffffffff, 0, 0, 8, 1, 2, 1, 0x8000 | 0x1000 }, /* SBAND */
};
static const struct dib0070_tuning dib0070_tuning_table[] = {
{ 115000, 1, 0, 7, 24, 2, 1, 0x8000 | 0x1000 }, /* FM below 92MHz cannot be tuned */
{ 179500, 1, 0, 3, 16, 2, 1, 0x8000 | 0x1000 }, /* VHF */
{ 189999, 1, 1, 3, 16, 2, 1, 0x8000 | 0x1000 },
{ 250000, 1, 0, 6, 12, 2, 1, 0x8000 | 0x1000 },
{ 569999, 2, 1, 5, 6, 2, 2, 0x4000 | 0x0800 }, /* UHF */
{ 699999, 2, 0, 1, 4, 2, 2, 0x4000 | 0x0800 },
{ 863999, 2, 1, 1, 4, 2, 2, 0x4000 | 0x0800 },
{ 0xffffffff, 0, 1, 0, 2, 2, 4, 0x2000 | 0x0400 }, /* LBAND or everything higher than UHF */
{ 115000, 1, 0, 7, 24, 2, 1, 0x8000 | 0x1000 }, /* FM below 92MHz cannot be tuned */
{ 179500, 1, 0, 3, 16, 2, 1, 0x8000 | 0x1000 }, /* VHF */
{ 189999, 1, 1, 3, 16, 2, 1, 0x8000 | 0x1000 },
{ 250000, 1, 0, 6, 12, 2, 1, 0x8000 | 0x1000 },
{ 569999, 2, 1, 5, 6, 2, 2, 0x4000 | 0x0800 }, /* UHF */
{ 699999, 2, 0, 1, 4, 2, 2, 0x4000 | 0x0800 },
{ 863999, 2, 1, 1, 4, 2, 2, 0x4000 | 0x0800 },
{ 0xffffffff, 0, 1, 0, 2, 2, 4, 0x2000 | 0x0400 }, /* LBAND or everything higher than UHF */
};
static const struct dib0070_lna_match dib0070_lna_flip_chip[] = {
{ 180000, 0 }, /* VHF */
{ 188000, 1 },
{ 196400, 2 },
{ 250000, 3 },
{ 550000, 0 }, /* UHF */
{ 590000, 1 },
{ 666000, 3 },
{ 864000, 5 },
{ 1500000, 0 }, /* LBAND or everything higher than UHF */
{ 1600000, 1 },
{ 2000000, 3 },
{ 0xffffffff, 7 },
{ 180000, 0 }, /* VHF */
{ 188000, 1 },
{ 196400, 2 },
{ 250000, 3 },
{ 550000, 0 }, /* UHF */
{ 590000, 1 },
{ 666000, 3 },
{ 864000, 5 },
{ 1500000, 0 }, /* LBAND or everything higher than UHF */
{ 1600000, 1 },
{ 2000000, 3 },
{ 0xffffffff, 7 },
};
static const struct dib0070_lna_match dib0070_lna[] = {
{ 180000, 0 }, /* VHF */
{ 188000, 1 },
{ 196400, 2 },
{ 250000, 3 },
{ 550000, 2 }, /* UHF */
{ 650000, 3 },
{ 750000, 5 },
{ 850000, 6 },
{ 864000, 7 },
{ 1500000, 0 }, /* LBAND or everything higher than UHF */
{ 1600000, 1 },
{ 2000000, 3 },
{ 0xffffffff, 7 },
{ 180000, 0 }, /* VHF */
{ 188000, 1 },
{ 196400, 2 },
{ 250000, 3 },
{ 550000, 2 }, /* UHF */
{ 650000, 3 },
{ 750000, 5 },
{ 850000, 6 },
{ 864000, 7 },
{ 1500000, 0 }, /* LBAND or everything higher than UHF */
{ 1600000, 1 },
{ 2000000, 3 },
{ 0xffffffff, 7 },
};
#define LPF 100
static int dib0070_tune_digital(struct dvb_frontend *fe)
{
struct dib0070_state *state = fe->tuner_priv;
struct dib0070_state *state = fe->tuner_priv;
const struct dib0070_tuning *tune;
const struct dib0070_lna_match *lna_match;
const struct dib0070_tuning *tune;
const struct dib0070_lna_match *lna_match;
enum frontend_tune_state *tune_state = &state->tune_state;
int ret = 10; /* 1ms is the default delay most of the time */
enum frontend_tune_state *tune_state = &state->tune_state;
int ret = 10; /* 1ms is the default delay most of the time */
u8 band = (u8)BAND_OF_FREQUENCY(fe->dtv_property_cache.frequency/1000);
u32 freq = fe->dtv_property_cache.frequency/1000 + (band == BAND_VHF ? state->cfg->freq_offset_khz_vhf : state->cfg->freq_offset_khz_uhf);
u8 band = (u8)BAND_OF_FREQUENCY(fe->dtv_property_cache.frequency/1000);
u32 freq = fe->dtv_property_cache.frequency/1000 + (band == BAND_VHF ? state->cfg->freq_offset_khz_vhf : state->cfg->freq_offset_khz_uhf);
#ifdef CONFIG_SYS_ISDBT
if (state->fe->dtv_property_cache.delivery_system == SYS_ISDBT && state->fe->dtv_property_cache.isdbt_sb_mode == 1)
if (((state->fe->dtv_property_cache.isdbt_sb_segment_count % 2)
&& (state->fe->dtv_property_cache.isdbt_sb_segment_idx == ((state->fe->dtv_property_cache.isdbt_sb_segment_count / 2) + 1)))
|| (((state->fe->dtv_property_cache.isdbt_sb_segment_count % 2) == 0)
&& (state->fe->dtv_property_cache.isdbt_sb_segment_idx == (state->fe->dtv_property_cache.isdbt_sb_segment_count / 2)))
|| (((state->fe->dtv_property_cache.isdbt_sb_segment_count % 2) == 0)
&& (state->fe->dtv_property_cache.isdbt_sb_segment_idx == ((state->fe->dtv_property_cache.isdbt_sb_segment_count / 2) + 1))))
freq += 850;
if (state->fe->dtv_property_cache.delivery_system == SYS_ISDBT && state->fe->dtv_property_cache.isdbt_sb_mode == 1)
if (((state->fe->dtv_property_cache.isdbt_sb_segment_count % 2)
&& (state->fe->dtv_property_cache.isdbt_sb_segment_idx == ((state->fe->dtv_property_cache.isdbt_sb_segment_count / 2) + 1)))
|| (((state->fe->dtv_property_cache.isdbt_sb_segment_count % 2) == 0)
&& (state->fe->dtv_property_cache.isdbt_sb_segment_idx == (state->fe->dtv_property_cache.isdbt_sb_segment_count / 2)))
|| (((state->fe->dtv_property_cache.isdbt_sb_segment_count % 2) == 0)
&& (state->fe->dtv_property_cache.isdbt_sb_segment_idx == ((state->fe->dtv_property_cache.isdbt_sb_segment_count / 2) + 1))))
freq += 850;
#endif
if (state->current_rf != freq) {
switch (state->revision) {
case DIB0070S_P1A:
tune = dib0070s_tuning_table;
lna_match = dib0070_lna;
break;
default:
tune = dib0070_tuning_table;
if (state->cfg->flip_chip)
lna_match = dib0070_lna_flip_chip;
else
lna_match = dib0070_lna;
break;
}
while (freq > tune->max_freq) /* find the right one */
tune++;
while (freq > lna_match->max_freq) /* find the right one */
lna_match++;
state->current_tune_table_index = tune;
state->lna_match = lna_match;
}
if (*tune_state == CT_TUNER_START) {
dprintk("Tuning for Band: %hd (%d kHz)", band, freq);
if (state->current_rf != freq) {
u8 REFDIV;
u32 FBDiv, Rest, FREF, VCOF_kHz;
u8 Den;
state->current_rf = freq;
state->lo4 = (state->current_tune_table_index->vco_band << 11) | (state->current_tune_table_index->hfdiv << 7);
dib0070_write_reg(state, 0x17, 0x30);
VCOF_kHz = state->current_tune_table_index->vco_multi * freq * 2;
switch (band) {
case BAND_VHF:
REFDIV = (u8) ((state->cfg->clock_khz + 9999) / 10000);
break;
case BAND_FM:
REFDIV = (u8) ((state->cfg->clock_khz) / 1000);
break;
default:
REFDIV = (u8) (state->cfg->clock_khz / 10000);
break;
}
FREF = state->cfg->clock_khz / REFDIV;
switch (state->revision) {
case DIB0070S_P1A:
FBDiv = (VCOF_kHz / state->current_tune_table_index->presc / FREF);
Rest = (VCOF_kHz / state->current_tune_table_index->presc) - FBDiv * FREF;
break;
case DIB0070_P1G:
case DIB0070_P1F:
tune = dib0070s_tuning_table;
lna_match = dib0070_lna;
break;
default:
FBDiv = (freq / (FREF / 2));
Rest = 2 * freq - FBDiv * FREF;
break;
tune = dib0070_tuning_table;
if (state->cfg->flip_chip)
lna_match = dib0070_lna_flip_chip;
else
lna_match = dib0070_lna;
break;
}
while (freq > tune->max_freq) /* find the right one */
tune++;
while (freq > lna_match->max_freq) /* find the right one */
lna_match++;
if (Rest < LPF)
Rest = 0;
else if (Rest < 2 * LPF)
Rest = 2 * LPF;
else if (Rest > (FREF - LPF)) {
Rest = 0;
FBDiv += 1;
} else if (Rest > (FREF - 2 * LPF))
Rest = FREF - 2 * LPF;
Rest = (Rest * 6528) / (FREF / 10);
Den = 1;
if (Rest > 0) {
state->lo4 |= (1 << 14) | (1 << 12);
Den = 255;
}
dib0070_write_reg(state, 0x11, (u16)FBDiv);
dib0070_write_reg(state, 0x12, (Den << 8) | REFDIV);
dib0070_write_reg(state, 0x13, (u16) Rest);
if (state->revision == DIB0070S_P1A) {
if (band == BAND_SBAND) {
dib0070_set_ctrl_lo5(fe, 2, 4, 3, 0);
dib0070_write_reg(state, 0x1d, 0xFFFF);
} else
dib0070_set_ctrl_lo5(fe, 5, 4, 3, 1);
}
dib0070_write_reg(state, 0x20,
0x0040 | 0x0020 | 0x0010 | 0x0008 | 0x0002 | 0x0001 | state->current_tune_table_index->tuner_enable);
dprintk("REFDIV: %hd, FREF: %d", REFDIV, FREF);
dprintk("FBDIV: %d, Rest: %d", FBDiv, Rest);
dprintk("Num: %hd, Den: %hd, SD: %hd", (u16) Rest, Den, (state->lo4 >> 12) & 0x1);
dprintk("HFDIV code: %hd", state->current_tune_table_index->hfdiv);
dprintk("VCO = %hd", state->current_tune_table_index->vco_band);
dprintk("VCOF: ((%hd*%d) << 1))", state->current_tune_table_index->vco_multi, freq);
*tune_state = CT_TUNER_STEP_0;
} else { /* we are already tuned to this frequency - the configuration is correct */
ret = 50; /* wakeup time */
*tune_state = CT_TUNER_STEP_5;
state->current_tune_table_index = tune;
state->lna_match = lna_match;
}
} else if ((*tune_state > CT_TUNER_START) && (*tune_state < CT_TUNER_STEP_4)) {
ret = dib0070_captrim(state, tune_state);
if (*tune_state == CT_TUNER_START) {
dprintk("Tuning for Band: %hd (%d kHz)", band, freq);
if (state->current_rf != freq) {
u8 REFDIV;
u32 FBDiv, Rest, FREF, VCOF_kHz;
u8 Den;
} else if (*tune_state == CT_TUNER_STEP_4) {
const struct dib0070_wbd_gain_cfg *tmp = state->cfg->wbd_gain;
if (tmp != NULL) {
while (freq/1000 > tmp->freq) /* find the right one */
tmp++;
dib0070_write_reg(state, 0x0f,
(0 << 15) | (1 << 14) | (3 << 12)
| (tmp->wbd_gain_val << 9) | (0 << 8) | (1 << 7)
| (state->current_tune_table_index->wbdmux << 0));
state->wbd_gain_current = tmp->wbd_gain_val;
} else {
state->current_rf = freq;
state->lo4 = (state->current_tune_table_index->vco_band << 11) | (state->current_tune_table_index->hfdiv << 7);
dib0070_write_reg(state, 0x17, 0x30);
VCOF_kHz = state->current_tune_table_index->vco_multi * freq * 2;
switch (band) {
case BAND_VHF:
REFDIV = (u8) ((state->cfg->clock_khz + 9999) / 10000);
break;
case BAND_FM:
REFDIV = (u8) ((state->cfg->clock_khz) / 1000);
break;
default:
REFDIV = (u8) (state->cfg->clock_khz / 10000);
break;
}
FREF = state->cfg->clock_khz / REFDIV;
switch (state->revision) {
case DIB0070S_P1A:
FBDiv = (VCOF_kHz / state->current_tune_table_index->presc / FREF);
Rest = (VCOF_kHz / state->current_tune_table_index->presc) - FBDiv * FREF;
break;
case DIB0070_P1G:
case DIB0070_P1F:
default:
FBDiv = (freq / (FREF / 2));
Rest = 2 * freq - FBDiv * FREF;
break;
}
if (Rest < LPF)
Rest = 0;
else if (Rest < 2 * LPF)
Rest = 2 * LPF;
else if (Rest > (FREF - LPF)) {
Rest = 0;
FBDiv += 1;
} else if (Rest > (FREF - 2 * LPF))
Rest = FREF - 2 * LPF;
Rest = (Rest * 6528) / (FREF / 10);
Den = 1;
if (Rest > 0) {
state->lo4 |= (1 << 14) | (1 << 12);
Den = 255;
}
dib0070_write_reg(state, 0x11, (u16)FBDiv);
dib0070_write_reg(state, 0x12, (Den << 8) | REFDIV);
dib0070_write_reg(state, 0x13, (u16) Rest);
if (state->revision == DIB0070S_P1A) {
if (band == BAND_SBAND) {
dib0070_set_ctrl_lo5(fe, 2, 4, 3, 0);
dib0070_write_reg(state, 0x1d, 0xFFFF);
} else
dib0070_set_ctrl_lo5(fe, 5, 4, 3, 1);
}
dib0070_write_reg(state, 0x20,
0x0040 | 0x0020 | 0x0010 | 0x0008 | 0x0002 | 0x0001 | state->current_tune_table_index->tuner_enable);
dprintk("REFDIV: %hd, FREF: %d", REFDIV, FREF);
dprintk("FBDIV: %d, Rest: %d", FBDiv, Rest);
dprintk("Num: %hd, Den: %hd, SD: %hd", (u16) Rest, Den, (state->lo4 >> 12) & 0x1);
dprintk("HFDIV code: %hd", state->current_tune_table_index->hfdiv);
dprintk("VCO = %hd", state->current_tune_table_index->vco_band);
dprintk("VCOF: ((%hd*%d) << 1))", state->current_tune_table_index->vco_multi, freq);
*tune_state = CT_TUNER_STEP_0;
} else { /* we are already tuned to this frequency - the configuration is correct */
ret = 50; /* wakeup time */
*tune_state = CT_TUNER_STEP_5;
}
} else if ((*tune_state > CT_TUNER_START) && (*tune_state < CT_TUNER_STEP_4)) {
ret = dib0070_captrim(state, tune_state);
} else if (*tune_state == CT_TUNER_STEP_4) {
const struct dib0070_wbd_gain_cfg *tmp = state->cfg->wbd_gain;
if (tmp != NULL) {
while (freq/1000 > tmp->freq) /* find the right one */
tmp++;
dib0070_write_reg(state, 0x0f,
(0 << 15) | (1 << 14) | (3 << 12) | (6 << 9) | (0 << 8) | (1 << 7) | (state->current_tune_table_index->
wbdmux << 0));
state->wbd_gain_current = 6;
}
(0 << 15) | (1 << 14) | (3 << 12)
| (tmp->wbd_gain_val << 9) | (0 << 8) | (1 << 7)
| (state->current_tune_table_index->wbdmux << 0));
state->wbd_gain_current = tmp->wbd_gain_val;
} else {
dib0070_write_reg(state, 0x0f,
(0 << 15) | (1 << 14) | (3 << 12)
| (6 << 9) | (0 << 8) | (1 << 7)
| (state->current_tune_table_index->wbdmux << 0));
state->wbd_gain_current = 6;
}
dib0070_write_reg(state, 0x06, 0x3fff);
dib0070_write_reg(state, 0x06, 0x3fff);
dib0070_write_reg(state, 0x07,
(state->current_tune_table_index->switch_trim << 11) | (7 << 8) | (state->lna_match->lna_band << 3) | (3 << 0));
dib0070_write_reg(state, 0x08, (state->lna_match->lna_band << 10) | (3 << 7) | (127));
dib0070_write_reg(state, 0x0d, 0x0d80);
dib0070_write_reg(state, 0x08, (state->lna_match->lna_band << 10) | (3 << 7) | (127));
dib0070_write_reg(state, 0x0d, 0x0d80);
dib0070_write_reg(state, 0x18, 0x07ff);
dib0070_write_reg(state, 0x17, 0x0033);
dib0070_write_reg(state, 0x18, 0x07ff);
dib0070_write_reg(state, 0x17, 0x0033);
*tune_state = CT_TUNER_STEP_5;
} else if (*tune_state == CT_TUNER_STEP_5) {
dib0070_set_bandwidth(fe);
*tune_state = CT_TUNER_STOP;
} else {
ret = FE_CALLBACK_TIME_NEVER; /* tuner finished, time to call again infinite */
}
return ret;
*tune_state = CT_TUNER_STEP_5;
} else if (*tune_state == CT_TUNER_STEP_5) {
dib0070_set_bandwidth(fe);
*tune_state = CT_TUNER_STOP;
} else {
ret = FE_CALLBACK_TIME_NEVER; /* tuner finished, time to call again infinite */
}
return ret;
}
static int dib0070_tune(struct dvb_frontend *fe)
{
struct dib0070_state *state = fe->tuner_priv;
uint32_t ret;
struct dib0070_state *state = fe->tuner_priv;
uint32_t ret;
state->tune_state = CT_TUNER_START;
state->tune_state = CT_TUNER_START;
do {
ret = dib0070_tune_digital(fe);
if (ret != FE_CALLBACK_TIME_NEVER)
msleep(ret/10);
else
break;
} while (state->tune_state != CT_TUNER_STOP);
do {
ret = dib0070_tune_digital(fe);
if (ret != FE_CALLBACK_TIME_NEVER)
msleep(ret/10);
else
break;
} while (state->tune_state != CT_TUNER_STOP);
return 0;
return 0;
}
static int dib0070_wakeup(struct dvb_frontend *fe)
@ -610,48 +608,48 @@ static const u16 dib0070_p1f_defaults[] =
static u16 dib0070_read_wbd_offset(struct dib0070_state *state, u8 gain)
{
u16 tuner_en = dib0070_read_reg(state, 0x20);
u16 offset;
u16 tuner_en = dib0070_read_reg(state, 0x20);
u16 offset;
dib0070_write_reg(state, 0x18, 0x07ff);
dib0070_write_reg(state, 0x20, 0x0800 | 0x4000 | 0x0040 | 0x0020 | 0x0010 | 0x0008 | 0x0002 | 0x0001);
dib0070_write_reg(state, 0x0f, (1 << 14) | (2 << 12) | (gain << 9) | (1 << 8) | (1 << 7) | (0 << 0));
msleep(9);
offset = dib0070_read_reg(state, 0x19);
dib0070_write_reg(state, 0x20, tuner_en);
return offset;
dib0070_write_reg(state, 0x18, 0x07ff);
dib0070_write_reg(state, 0x20, 0x0800 | 0x4000 | 0x0040 | 0x0020 | 0x0010 | 0x0008 | 0x0002 | 0x0001);
dib0070_write_reg(state, 0x0f, (1 << 14) | (2 << 12) | (gain << 9) | (1 << 8) | (1 << 7) | (0 << 0));
msleep(9);
offset = dib0070_read_reg(state, 0x19);
dib0070_write_reg(state, 0x20, tuner_en);
return offset;
}
static void dib0070_wbd_offset_calibration(struct dib0070_state *state)
{
u8 gain;
for (gain = 6; gain < 8; gain++) {
state->wbd_offset_3_3[gain - 6] = ((dib0070_read_wbd_offset(state, gain) * 8 * 18 / 33 + 1) / 2);
dprintk("Gain: %d, WBDOffset (3.3V) = %hd", gain, state->wbd_offset_3_3[gain-6]);
}
u8 gain;
for (gain = 6; gain < 8; gain++) {
state->wbd_offset_3_3[gain - 6] = ((dib0070_read_wbd_offset(state, gain) * 8 * 18 / 33 + 1) / 2);
dprintk("Gain: %d, WBDOffset (3.3V) = %hd", gain, state->wbd_offset_3_3[gain-6]);
}
}
u16 dib0070_wbd_offset(struct dvb_frontend *fe)
{
struct dib0070_state *state = fe->tuner_priv;
const struct dib0070_wbd_gain_cfg *tmp = state->cfg->wbd_gain;
u32 freq = fe->dtv_property_cache.frequency/1000;
struct dib0070_state *state = fe->tuner_priv;
const struct dib0070_wbd_gain_cfg *tmp = state->cfg->wbd_gain;
u32 freq = fe->dtv_property_cache.frequency/1000;
if (tmp != NULL) {
while (freq/1000 > tmp->freq) /* find the right one */
tmp++;
state->wbd_gain_current = tmp->wbd_gain_val;
if (tmp != NULL) {
while (freq/1000 > tmp->freq) /* find the right one */
tmp++;
state->wbd_gain_current = tmp->wbd_gain_val;
} else
state->wbd_gain_current = 6;
state->wbd_gain_current = 6;
return state->wbd_offset_3_3[state->wbd_gain_current - 6];
return state->wbd_offset_3_3[state->wbd_gain_current - 6];
}
EXPORT_SYMBOL(dib0070_wbd_offset);
#define pgm_read_word(w) (*w)
static int dib0070_reset(struct dvb_frontend *fe)
{
struct dib0070_state *state = fe->tuner_priv;
struct dib0070_state *state = fe->tuner_priv;
u16 l, r, *n;
HARD_RESET(state);
@ -664,7 +662,7 @@ static int dib0070_reset(struct dvb_frontend *fe)
#else
#warning forcing SBAND
#endif
state->revision = DIB0070S_P1A;
state->revision = DIB0070S_P1A;
/* P1F or not */
dprintk("Revision: %x", state->revision);
@ -703,24 +701,25 @@ static int dib0070_reset(struct dvb_frontend *fe)
dib0070_write_reg(state, 0x02, r | (1 << 5));
}
if (state->revision == DIB0070S_P1A)
dib0070_set_ctrl_lo5(fe, 2, 4, 3, 0);
else
dib0070_set_ctrl_lo5(fe, 5, 4, state->cfg->charge_pump, state->cfg->enable_third_order_filter);
if (state->revision == DIB0070S_P1A)
dib0070_set_ctrl_lo5(fe, 2, 4, 3, 0);
else
dib0070_set_ctrl_lo5(fe, 5, 4, state->cfg->charge_pump,
state->cfg->enable_third_order_filter);
dib0070_write_reg(state, 0x01, (54 << 9) | 0xc8);
dib0070_wbd_offset_calibration(state);
dib0070_wbd_offset_calibration(state);
return 0;
return 0;
}
static int dib0070_get_frequency(struct dvb_frontend *fe, u32 *frequency)
{
struct dib0070_state *state = fe->tuner_priv;
struct dib0070_state *state = fe->tuner_priv;
*frequency = 1000 * state->current_rf;
return 0;
*frequency = 1000 * state->current_rf;
return 0;
}
static int dib0070_release(struct dvb_frontend *fe)

Some files were not shown because too many files have changed in this diff Show More