diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2009-01-18 13:51:39 +0100 |
---|---|---|
committer | Hans Verkuil <hverkuil@xs4all.nl> | 2009-01-18 13:51:39 +0100 |
commit | 0e5ca174b657de9d1f6c75609c81279cc35e8d49 (patch) | |
tree | 2203ce72819358a192a1ea1c91512d759227504b | |
parent | 8d4f9d241cdbd71a882a852c6e9285de279c0f87 (diff) | |
download | mediapointer-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>
-rw-r--r-- | v4l2-spec/Makefile | 10 | ||||
-rw-r--r-- | v4l2-spec/compat.sgml | 15 | ||||
-rw-r--r-- | v4l2-spec/v4l2.sgml | 2 | ||||
-rw-r--r-- | v4l2-spec/vidioc-dbg-g-chip-ident.sgml (renamed from v4l2-spec/vidioc-g-chip-ident.sgml) | 103 | ||||
-rw-r--r-- | v4l2-spec/vidioc-dbg-g-register.sgml | 117 |
5 files changed, 168 insertions, 79 deletions
diff --git a/v4l2-spec/Makefile b/v4l2-spec/Makefile index db3d71974..d7fed7edd 100644 --- a/v4l2-spec/Makefile +++ b/v4l2-spec/Makefile @@ -62,7 +62,7 @@ SGMLS = \ vidioc-enumstd.sgml \ vidioc-g-audio.sgml \ vidioc-g-audioout.sgml \ - vidioc-g-chip-ident.sgml \ + vidioc-dbg-g-chip-ident.sgml \ vidioc-g-crop.sgml \ vidioc-g-ctrl.sgml \ vidioc-g-enc-index.sgml \ @@ -134,6 +134,7 @@ FUNCS = \ IOCTLS = \ VIDIOC_CROPCAP \ + VIDIOC_DBG_G_CHIP_IDENT \ VIDIOC_DBG_G_REGISTER \ VIDIOC_DBG_S_REGISTER \ VIDIOC_DQBUF \ @@ -148,7 +149,6 @@ IOCTLS = \ VIDIOC_ENUM_FRAMESIZES \ VIDIOC_G_AUDIO \ VIDIOC_G_AUDOUT \ - VIDIOC_G_CHIP_IDENT \ VIDIOC_G_CROP \ VIDIOC_G_CTRL \ VIDIOC_G_ENC_INDEX \ @@ -218,11 +218,13 @@ STRUCTS = \ v4l2_buffer \ v4l2_capability \ v4l2_captureparm \ - v4l2_chip_ident \ v4l2_clip \ v4l2_control \ v4l2_crop \ v4l2_cropcap \ + v4l2_dbg_chip_ident \ + v4l2_dbg_match \ + v4l2_dbg_register \ v4l2_enc_idx \ v4l2_enc_idx_entry \ v4l2_encoder_cmd \ @@ -247,7 +249,6 @@ STRUCTS = \ v4l2_queryctrl \ v4l2_querymenu \ v4l2_rect \ - v4l2_register \ v4l2_requestbuffers \ v4l2_sliced_vbi_cap \ v4l2_sliced_vbi_data \ @@ -293,6 +294,7 @@ UNDOCUMENTED = \ $(shell for i in \ v4l2_bitrate \ v4l2_bitrate_mode \ + v4l2_chip_ident_old \ v4l2_exposure_auto_type \ v4l2_mpeg_aspectratio \ v4l2_mpeg_aspectratio \ diff --git a/v4l2-spec/compat.sgml b/v4l2-spec/compat.sgml index 3eb873c70..5c1815182 100644 --- a/v4l2-spec/compat.sgml +++ b/v4l2-spec/compat.sgml @@ -2199,7 +2199,18 @@ class</link> was added, with the new controls by the <link linkend="extended-controls">extended controls</link> interface in Linux 2.6.18, where finally removed from the <filename>videodev2.h</filename> header file.</para> - </listitem> + </listitem> + </orderedlist> + </section> + + <section> + <title>V4L2 in Linux 2.6.29</title> + <orderedlist> + <listitem> + <para>The <constant>VIDIOC_G_CHIP_IDENT</constant> ioctl was renamed +to <constant>VIDIOC_G_CHIP_IDENT_OLD</constant> and &VIDIOC-DBG-G-CHIP-IDENT; +was introduced in its place.</para> + </listitem> </orderedlist> </section> </section> @@ -2306,7 +2317,7 @@ ioctls.</para> ioctls.</para> </listitem> <listitem> - <para>&VIDIOC-G-CHIP-IDENT; ioctl.</para> + <para>&VIDIOC-DBG-G-CHIP-IDENT; ioctl.</para> </listitem> </itemizedlist> </section> diff --git a/v4l2-spec/v4l2.sgml b/v4l2-spec/v4l2.sgml index 710943aac..735ebc320 100644 --- a/v4l2-spec/v4l2.sgml +++ b/v4l2-spec/v4l2.sgml @@ -390,6 +390,7 @@ and <ulink url="http://linuxtv.org/downloads/video4linux/API/V4L2_API">http://li &sub-ioctl; <!-- All ioctls go here. --> &sub-cropcap; + &sub-dbg-g-chip-ident; &sub-dbg-g-register; &sub-encoder-cmd; &sub-enumaudio; @@ -402,7 +403,6 @@ and <ulink url="http://linuxtv.org/downloads/video4linux/API/V4L2_API">http://li &sub-enumstd; &sub-g-audio; &sub-g-audioout; - &sub-g-chip-ident; &sub-g-crop; &sub-g-ctrl; &sub-g-enc-index; diff --git a/v4l2-spec/vidioc-g-chip-ident.sgml b/v4l2-spec/vidioc-dbg-g-chip-ident.sgml index 4f3cc59a7..6b13e8188 100644 --- a/v4l2-spec/vidioc-g-chip-ident.sgml +++ b/v4l2-spec/vidioc-dbg-g-chip-ident.sgml @@ -1,11 +1,11 @@ -<refentry id="vidioc-g-chip-ident"> +<refentry id="vidioc-dbg-g-chip-ident"> <refmeta> - <refentrytitle>ioctl VIDIOC_G_CHIP_IDENT</refentrytitle> + <refentrytitle>ioctl VIDIOC_DBG_G_CHIP_IDENT</refentrytitle> &manvol; </refmeta> <refnamediv> - <refname>VIDIOC_G_CHIP_IDENT</refname> + <refname>VIDIOC_DBG_G_CHIP_IDENT</refname> <refpurpose>Identify the chips on a TV card</refpurpose> </refnamediv> @@ -15,7 +15,7 @@ <funcdef>int <function>ioctl</function></funcdef> <paramdef>int <parameter>fd</parameter></paramdef> <paramdef>int <parameter>request</parameter></paramdef> - <paramdef>struct v4l2_chip_ident + <paramdef>struct v4l2_dbg_chip_ident *<parameter>argp</parameter></paramdef> </funcprototype> </funcsynopsis> @@ -34,7 +34,7 @@ <varlistentry> <term><parameter>request</parameter></term> <listitem> - <para>VIDIOC_G_CHIP_IDENT</para> + <para>VIDIOC_DBG_G_CHIP_IDENT</para> </listitem> </varlistentry> <varlistentry> @@ -59,44 +59,51 @@ the future.</para> <para>For driver debugging purposes this ioctl allows test applications to query the driver about the chips present on the TV -card. Regular applications should not use it. When you found a chip -specific bug, please contact the Video4Linux mailing list (&v4l-ml;) +card. Regular applications must not use it. When you found a chip +specific bug, please contact the linux-media mailing list (&v4l-ml;) so it can be fixed.</para> <para>To query the driver applications must initialize the -<structfield>match_type</structfield> and -<structfield>match_chip</structfield> fields of a &v4l2-chip-ident; -and call <constant>VIDIOC_G_CHIP_IDENT</constant> with a pointer to +<structfield>match.type</structfield> and +<structfield>match.addr</structfield> or <structfield>match.name</structfield> +fields of a &v4l2-dbg-chip-ident; +and call <constant>VIDIOC_DBG_G_CHIP_IDENT</constant> with a pointer to this structure. On success the driver stores information about the selected chip in the <structfield>ident</structfield> and <structfield>revision</structfield> fields. 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 +<structfield>match.addr</structfield> selects the nth non-&i2c; chip on the TV card. You can enumerate all chips by starting at zero and -incrementing <structfield>match_chip</structfield> by one until -<constant>VIDIOC_G_CHIP_IDENT</constant> fails with an &EINVAL;. -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, ⪚ the chip connected to the PCI bus.</para> +incrementing <structfield>match.addr</structfield> by one until +<constant>VIDIOC_DBG_G_CHIP_IDENT</constant> fails with an &EINVAL;. +The number zero always selects the host chip, ⪚ the chip connected +to the PCI or USB bus.</para> - <para>When <structfield>match_type</structfield> is + <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 ioctl will return <constant>V4L2_IDENT_AMBIGUOUS</constant> in the <structfield>ident</structfield> field.</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 +<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. You can enumerate all chips by starting at zero and +incrementing <structfield>match.addr</structfield> by one until +<constant>VIDIOC_DBG_G_CHIP_IDENT</constant> fails with an &EINVAL;.</para> + <para>On success, the <structfield>ident</structfield> field will contain a chip ID from the Linux <filename>media/v4l2-chip-ident.h</filename> header file, and the @@ -107,8 +114,7 @@ this chip.</para> <para>When the driver could not identify the selected chip, <structfield>ident</structfield> will contain <constant>V4L2_IDENT_UNKNOWN</constant>. When no chip matched -<structfield>match_type</structfield> and -<structfield>match_chip</structfield>, the ioctl will succeed but the +the ioctl will succeed but the <structfield>ident</structfield> field will contain <constant>V4L2_IDENT_NONE</constant>. If multiple chips matched, <structfield>ident</structfield> will contain @@ -116,7 +122,8 @@ this chip.</para> <structfield>revision</structfield> field remains unchanged.</para> <para>This ioctl is optional, not all drivers may support it. It -was introduced in Linux 2.6.21.</para> +was introduced in Linux 2.6.21, but the API was changed to the +one described here in 2.6.29.</para> <para>We recommended the <application>v4l2-dbg</application> utility over calling this ioctl directly. It is available from the @@ -124,8 +131,10 @@ 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-chip-ident"> - <title>struct <structname>v4l2_chip_ident</structname></title> + <!-- Note for convenience vidioc-dbg-g-register.sgml + contains a duplicate of this table. --> + <table pgwide="1" frame="none" id="ident-v4l2-dbg-match"> + <title>struct <structname>v4l2_dbg_match</structname></title> <tgroup cols="3"> &cs-str; <tbody valign="top"> @@ -136,10 +145,36 @@ access instructions.</para> 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-chip-ident"> + <title>struct <structname>v4l2_dbg_chip_ident</structname></title> + <tgroup cols="3"> + &cs-str; + <tbody valign="top"> + <row> + <entry>struct v4l2_dbg_match</entry> + <entry><structfield>match</structfield></entry> + <entry>How to match the chip, see <xref linkend="ident-v4l2-dbg-match">.</entry> </row> <row> <entry>__u32</entry> @@ -173,14 +208,18 @@ the values from <xref linkend="chip-ids">.</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> 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, ⪚ 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, ⪚ 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> |