diff options
author | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2016-12-15 21:36:09 -0800 |
---|---|---|
committer | Dmitry Torokhov <dmitry.torokhov@gmail.com> | 2016-12-15 21:36:09 -0800 |
commit | ebfb0184ef560897fad35005989e82433419202c (patch) | |
tree | 226a8195fdae6c79d90d76baa1cbdaf80f794bb0 /Documentation/media/kapi/dtv-core.rst | |
parent | Input: imx6ul_tsc - generalize the averaging property (diff) | |
parent | Input: synaptics-rmi4 - add support for F34 V7 bootloader (diff) | |
download | linux-dev-ebfb0184ef560897fad35005989e82433419202c.tar.xz linux-dev-ebfb0184ef560897fad35005989e82433419202c.zip |
Merge branch 'synaptics-rmi4' into next
Merge updated Synaptics RMI4 support, including support for SMBus
controllers and flashing firmware.
Diffstat (limited to 'Documentation/media/kapi/dtv-core.rst')
-rw-r--r-- | Documentation/media/kapi/dtv-core.rst | 40 |
1 files changed, 37 insertions, 3 deletions
diff --git a/Documentation/media/kapi/dtv-core.rst b/Documentation/media/kapi/dtv-core.rst index dd96e846fef9..a3c4642eabfc 100644 --- a/Documentation/media/kapi/dtv-core.rst +++ b/Documentation/media/kapi/dtv-core.rst @@ -6,8 +6,6 @@ Digital TV Common functions .. kernel-doc:: drivers/media/dvb-core/dvb_math.h -.. kernel-doc:: drivers/media/dvb-core/dvb_ringbuffer.h - .. kernel-doc:: drivers/media/dvb-core/dvbdev.h @@ -18,6 +16,42 @@ Digital TV Common functions .. kernel-doc:: drivers/media/dvb-core/dvbdev.h :export: drivers/media/dvb-core/dvbdev.c +Digital TV Ring buffer +---------------------- + +Those routines implement ring buffers used to handle digital TV data and +copy it from/to userspace. + +.. note:: + + 1) For performance reasons read and write routines don't check buffer sizes + and/or number of bytes free/available. This has to be done before these + routines are called. For example: + + .. code-block:: c + + /* write @buflen: bytes */ + free = dvb_ringbuffer_free(rbuf); + if (free >= buflen) + count = dvb_ringbuffer_write(rbuf, buffer, buflen); + else + /* do something */ + + /* read min. 1000, max. @bufsize: bytes */ + avail = dvb_ringbuffer_avail(rbuf); + if (avail >= 1000) + count = dvb_ringbuffer_read(rbuf, buffer, min(avail, bufsize)); + else + /* do something */ + + 2) If there is exactly one reader and one writer, there is no need + to lock read or write operations. + Two or more readers must be locked against each other. + Flushing the buffer counts as a read operation. + Resetting the buffer counts as a read and write operation. + Two or more writers must be locked against each other. + +.. kernel-doc:: drivers/media/dvb-core/dvb_ringbuffer.h Digital TV Frontend kABI @@ -121,7 +155,7 @@ triggered by a hardware interrupt, it is recommended to use the Linux bottom half mechanism or start a tasklet instead of making the callback function call directly from a hardware interrupt. -This mechanism is implemented by :c:func:`dmx_ts_cb()` and :cpp:func:`dmx_section_cb()` +This mechanism is implemented by :c:func:`dmx_ts_cb()` and :c:func:`dmx_section_cb()` callbacks. .. kernel-doc:: drivers/media/dvb-core/demux.h |