Re: [PATCH v6 07/11] DocBook/media: add CEC documentation

Hans Verkuil
2015-05-08T10:46:10Z

Hi Kamil,

A few more comments about the documentation:

First of all you should add some documentation about what the passthrough mode
actually is. Right now all this says is that you can enable or disable it, but
not what it actually does.

And next I have a few small comments about the timestamp documentation:

> diff --git a/Documentation/DocBook/media/v4l/cec-ioc-g-event.xml b/Documentation/DocBook/media/v4l/cec-ioc-g-event.xml
> new file mode 100644
> index 0000000..cbde320
> --- /dev/null
> +++ b/Documentation/DocBook/media/v4l/cec-ioc-g-event.xml
> @@ -0,0 +1,125 @@

...

> + <refsect1>
> + Description
> +
> + CEC devices can send asynchronous events. These can be retrieved by calling
> + the <constant>CEC_G_EVENT</constant> ioctl. If the file descriptor is in non-blocking
> + mode and no event is pending, then it will return -1 and set errno to the &EAGAIN;.
> +
> + There can be up to 40 events queued up. If more events are added, then the oldest event will be discarded.
> +
> +
> + struct <structname>cec_event</structname>
> + <tgroup cols="3">
> + &cs-str;
> +
> + <row>
> + <entry>__u64</entry>
> + <entry><structfield>ts</structfield></entry>
> + <entry>Timestamp of the event in ns.</entry>

"Timestamp of the event in ns. This is based on the monotonic clock. Applications
can access this clock using <function>clock_gettime(2)</function> with clock ID
<constant>CLOCK_MONOTONIC</constant>. To turn this into a <structname>struct timespec</structname>
use:

<programlisting>
struct timespec tmspec;

tmspec.tv_sec = ts / 1000000000;
tmspec.tv_nsec = ts % 1000000000;
<programlisting>"

(I hope the docbook syntax for programlisting is correct)

<snip>

> diff --git a/Documentation/DocBook/media/v4l/cec-ioc-receive.xml b/Documentation/DocBook/media/v4l/cec-ioc-receive.xml
> new file mode 100644
> index 0000000..dbec20a
> --- /dev/null
> +++ b/Documentation/DocBook/media/v4l/cec-ioc-receive.xml
> @@ -0,0 +1,185 @@

...

> +
> + struct <structname>cec_msg</structname>
> + <tgroup cols="3">
> + &cs-str;
> +
> + <row>
> + <entry>__u64</entry>
> + <entry><structfield>ts</structfield></entry>
> + <entry>Timestamp of when the message was transmitted in ns in the case
> + of <constant>CEC_TRANSMIT</constant> with <structfield>reply</structfield>
> + set to 0, or the timestamp of the received message in all other cases.</entry>

The same timestamp explanation should be given here.

Regards,

Hans