summaryrefslogtreecommitdiff
path: root/v4l2-spec/vidioc-dbg-g-register.sgml
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2009-01-18 13:51:39 +0100
committerHans Verkuil <hverkuil@xs4all.nl>2009-01-18 13:51:39 +0100
commit0e5ca174b657de9d1f6c75609c81279cc35e8d49 (patch)
tree2203ce72819358a192a1ea1c91512d759227504b /v4l2-spec/vidioc-dbg-g-register.sgml
parent8d4f9d241cdbd71a882a852c6e9285de279c0f87 (diff)
downloadmediapointer-dvb-s2-0e5ca174b657de9d1f6c75609c81279cc35e8d49.tar.gz
mediapointer-dvb-s2-0e5ca174b657de9d1f6c75609c81279cc35e8d49.tar.bz2
v4l2-spec: update the debug ioctls
From: Hans Verkuil <hverkuil@xs4all.nl> Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'v4l2-spec/vidioc-dbg-g-register.sgml')
-rw-r--r--v4l2-spec/vidioc-dbg-g-register.sgml117
1 files changed, 77 insertions, 40 deletions
diff --git a/v4l2-spec/vidioc-dbg-g-register.sgml b/v4l2-spec/vidioc-dbg-g-register.sgml
index 03f3150d9..a29ff35ad 100644
--- a/v4l2-spec/vidioc-dbg-g-register.sgml
+++ b/v4l2-spec/vidioc-dbg-g-register.sgml
@@ -16,7 +16,7 @@
<funcdef>int <function>ioctl</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>request</parameter></paramdef>
- <paramdef>struct v4l2_register *<parameter>argp</parameter></paramdef>
+ <paramdef>struct v4l2_dbg_register *<parameter>argp</parameter></paramdef>
</funcprototype>
</funcsynopsis>
<funcsynopsis>
@@ -24,7 +24,7 @@
<funcdef>int <function>ioctl</function></funcdef>
<paramdef>int <parameter>fd</parameter></paramdef>
<paramdef>int <parameter>request</parameter></paramdef>
- <paramdef>const struct v4l2_register
+ <paramdef>const struct v4l2_dbg_register
*<parameter>argp</parameter></paramdef>
</funcprototype>
</funcsynopsis>
@@ -67,7 +67,7 @@ interface and may change in the future.</para>
<para>For driver debugging purposes these ioctls allow test
applications to access hardware registers directly. Regular
-applications should not use them.</para>
+applications must not use them.</para>
<para>Since writing or even reading registers can jeopardize the
system security, its stability and damage the hardware, both ioctls
@@ -76,65 +76,69 @@ compiled with the <constant>CONFIG_VIDEO_ADV_DEBUG</constant> option
to enable these ioctls.</para>
<para>To write a register applications must initialize all fields
-of a &v4l2-register; and call
+of a &v4l2-dbg-register; and call
<constant>VIDIOC_DBG_S_REGISTER</constant> with a pointer to this
-structure. The <structfield>match_type</structfield> and
-<structfield>match_chip</structfield> fields select a chip on the TV
+structure. The <structfield>match.type</structfield> and
+<structfield>match.addr</structfield> or <structfield>match.name</structfield>
+fields select a chip on the TV
card, the <structfield>reg</structfield> field specifies a register
number and the <structfield>val</structfield> field the value to be
written into the register.</para>
<para>To read a register applications must initialize the
-<structfield>match_type</structfield>,
-<structfield>match_chip</structfield> and
+<structfield>match.type</structfield>,
+<structfield>match.chip</structfield> or <structfield>match.name</structfield> and
<structfield>reg</structfield> fields, and call
<constant>VIDIOC_DBG_G_REGISTER</constant> with a pointer to this
structure. On success the driver stores the register value in the
<structfield>val</structfield> field. On failure the structure remains
unchanged.</para>
- <para>When <structfield>match_type</structfield> is
+ <para>When <structfield>match.type</structfield> is
<constant>V4L2_CHIP_MATCH_HOST</constant>,
-<structfield>match_chip</structfield> selects the nth non-&i2c; chip
-on the TV card. Drivers may also interpret
-<structfield>match_chip</structfield> as a random ID, but we recommend
-against that. The number zero always selects the host chip, &eg; the
-chip connected to the PCI bus. You can find out which chips are
-present with the &VIDIOC-G-CHIP-IDENT; ioctl.</para>
-
- <para>When <structfield>match_type</structfield> is
+<structfield>match.addr</structfield> selects the nth non-&i2c; chip
+on the TV card. The number zero always selects the host chip, &eg; the
+chip connected to the PCI or USB bus. You can find out which chips are
+present with the &VIDIOC-DBG-G-CHIP-IDENT; ioctl.</para>
+
+ <para>When <structfield>match.type</structfield> is
<constant>V4L2_CHIP_MATCH_I2C_DRIVER</constant>,
-<structfield>match_chip</structfield> contains a driver ID as defined
-in the <filename>linux/i2c-id.h</filename> header file. For instance
-<constant>I2C_DRIVERID_SAA7127</constant> will match any chip
+<structfield>match.name</structfield> contains the I2C driver name.
+For instance
+<constant>"saa7127"</constant> will match any chip
supported by the saa7127 driver, regardless of its &i2c; bus address.
When multiple chips supported by the same driver are present, the
effect of these ioctls is undefined. Again with the
-&VIDIOC-G-CHIP-IDENT; ioctl you can find out which &i2c; chips are
+&VIDIOC-DBG-G-CHIP-IDENT; ioctl you can find out which &i2c; chips are
present.</para>
- <para>When <structfield>match_type</structfield> is
+ <para>When <structfield>match.type</structfield> is
<constant>V4L2_CHIP_MATCH_I2C_ADDR</constant>,
-<structfield>match_chip</structfield> selects a chip by its 7 bit &i2c;
+<structfield>match.addr</structfield> selects a chip by its 7 bit &i2c;
bus address.</para>
+ <para>When <structfield>match.type</structfield> is
+<constant>V4L2_CHIP_MATCH_AC97</constant>,
+<structfield>match.addr</structfield> selects the nth AC97 chip
+on the TV card.</para>
+
<note>
<title>Success not guaranteed</title>
<para>Due to a flaw in the Linux &i2c; bus driver these ioctls may
return successfully without actually reading or writing a register. To
-catch the most likely failure we recommend a &VIDIOC-G-CHIP-IDENT;
+catch the most likely failure we recommend a &VIDIOC-DBG-G-CHIP-IDENT;
call confirming the presence of the selected &i2c; chip.</para>
</note>
<para>These ioctls are optional, not all drivers may support them.
However when a driver supports these ioctls it must also support
-&VIDIOC-G-CHIP-IDENT;. Conversely it may support
-<constant>VIDIOC_G_CHIP_IDENT</constant> but not these ioctls.</para>
+&VIDIOC-DBG-G-CHIP-IDENT;. Conversely it may support
+<constant>VIDIOC_DBG_G_CHIP_IDENT</constant> but not these ioctls.</para>
<para><constant>VIDIOC_DBG_G_REGISTER</constant> and
<constant>VIDIOC_DBG_S_REGISTER</constant> were introduced in Linux
-2.6.21.</para>
+2.6.21, but their API was changed to the one described here in kernel 2.6.29.</para>
<para>We recommended the <application>v4l2-dbg</application>
utility over calling these ioctls directly. It is available from the
@@ -142,24 +146,53 @@ LinuxTV v4l-dvb repository; see <ulink
url="http://linuxtv.org/repo/">http://linuxtv.org/repo/</ulink> for
access instructions.</para>
- <table pgwide="1" frame="none" id="v4l2-register">
- <title>struct <structname>v4l2_register</structname></title>
- <tgroup cols="4">
- <colspec colname="c1">
- <colspec colname="c2">
- <colspec colname="c4">
+ <!-- Note for convenience vidioc-dbg-g-chip-ident.sgml
+ contains a duplicate of this table. -->
+ <table pgwide="1" frame="none" id="v4l2-dbg-match">
+ <title>struct <structname>v4l2_dbg_match</structname></title>
+ <tgroup cols="3">
+ &cs-str;
<tbody valign="top">
<row>
<entry>__u32</entry>
<entry><structfield>match_type</structfield></entry>
- <entry>See <xref linkend="chip-match-types"> for a list of
- possible types.</entry>
+ <entry>See <xref linkend="ident-chip-match-types"> for a list of
+possible types.</entry>
+ </row>
+ <row>
+ <entry>union</entry>
+ <entry>(anonymous)</entry>
</row>
<row>
+ <entry></entry>
<entry>__u32</entry>
- <entry><structfield>match_chip</structfield></entry>
+ <entry><structfield>addr</structfield></entry>
<entry>Match a chip by this number, interpreted according
-to the <structfield>match_type</structfield> field.</entry>
+to the <structfield>type</structfield> field.</entry>
+ </row>
+ <row>
+ <entry></entry>
+ <entry>char</entry>
+ <entry><structfield>name[32]</structfield></entry>
+ <entry>Match a chip by this name, interpreted according
+to the <structfield>type</structfield> field.</entry>
+ </row>
+ </tbody>
+ </tgroup>
+ </table>
+
+
+ <table pgwide="1" frame="none" id="v4l2-dbg-register">
+ <title>struct <structname>v4l2_dbg_register</structname></title>
+ <tgroup cols="4">
+ <colspec colname="c1">
+ <colspec colname="c2">
+ <colspec colname="c4">
+ <tbody valign="top">
+ <row>
+ <entry>struct v4l2_dbg_match</entry>
+ <entry><structfield>match</structfield></entry>
+ <entry>How to match the chip, see <xref linkend="v4l2-dbg-match">.</entry>
</row>
<row>
<entry>__u64</entry>
@@ -176,7 +209,7 @@ register.</entry>
</tgroup>
</table>
- <!-- Note for convenience vidioc-g-chip-ident.sgml
+ <!-- Note for convenience vidioc-dbg-g-chip-ident.sgml
contains a duplicate of this table. -->
<table pgwide="1" frame="none" id="chip-match-types">
<title>Chip Match Types</title>
@@ -192,14 +225,18 @@ register.</entry>
<row>
<entry><constant>V4L2_CHIP_MATCH_I2C_DRIVER</constant></entry>
<entry>1</entry>
- <entry>Match an &i2c; chip by its driver ID from the
-<filename>linux/i2c-id.h</filename> header file.</entry>
+ <entry>Match an &i2c; chip by its driver name.</entry>
</row>
<row>
<entry><constant>V4L2_CHIP_MATCH_I2C_ADDR</constant></entry>
<entry>2</entry>
<entry>Match a chip by its 7 bit &i2c; bus address.</entry>
</row>
+ <row>
+ <entry><constant>V4L2_CHIP_MATCH_AC97</constant></entry>
+ <entry>3</entry>
+ <entry>Match the nth anciliary AC97 chip.</entry>
+ </row>
</tbody>
</tgroup>
</table>