+++ /dev/null
-CEC Kernel Support
-==================
-
-The CEC framework provides a unified kernel interface for use with HDMI CEC
-hardware. It is designed to handle a multiple types of hardware (receivers,
-transmitters, USB dongles). The framework also gives the option to decide
-what to do in the kernel driver and what should be handled by userspace
-applications. In addition it integrates the remote control passthrough
-feature into the kernel's remote control framework.
-
-
-The CEC Protocol
-----------------
-
-The CEC protocol enables consumer electronic devices to communicate with each
-other through the HDMI connection. The protocol uses logical addresses in the
-communication. The logical address is strictly connected with the functionality
-provided by the device. The TV acting as the communication hub is always
-assigned address 0. The physical address is determined by the physical
-connection between devices.
-
-The CEC framework described here is up to date with the CEC 2.0 specification.
-It is documented in the HDMI 1.4 specification with the new 2.0 bits documented
-in the HDMI 2.0 specification. But for most of the features the freely available
-HDMI 1.3a specification is sufficient:
-
-http://www.microprocessor.org/HDMISpecification13a.pdf
-
-
-The Kernel Interface
-====================
-
-CEC Adapter
------------
-
-The struct cec_adapter represents the CEC adapter hardware. It is created by
-calling cec_allocate_adapter() and deleted by calling cec_delete_adapter():
-
-struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
- void *priv, const char *name, u32 caps, u8 available_las,
- struct device *parent);
-void cec_delete_adapter(struct cec_adapter *adap);
-
-To create an adapter you need to pass the following information:
-
-ops: adapter operations which are called by the CEC framework and that you
-have to implement.
-
-priv: will be stored in adap->priv and can be used by the adapter ops.
-
-name: the name of the CEC adapter. Note: this name will be copied.
-
-caps: capabilities of the CEC adapter. These capabilities determine the
- capabilities of the hardware and which parts are to be handled
- by userspace and which parts are handled by kernelspace. The
- capabilities are returned by CEC_ADAP_G_CAPS.
-
-available_las: the number of simultaneous logical addresses that this
- adapter can handle. Must be 1 <= available_las <= CEC_MAX_LOG_ADDRS.
-
-parent: the parent device.
-
-
-To register the /dev/cecX device node and the remote control device (if
-CEC_CAP_RC is set) you call:
-
-int cec_register_adapter(struct cec_adapter *adap);
-
-To unregister the devices call:
-
-void cec_unregister_adapter(struct cec_adapter *adap);
-
-Note: if cec_register_adapter() fails, then call cec_delete_adapter() to
-clean up. But if cec_register_adapter() succeeded, then only call
-cec_unregister_adapter() to clean up, never cec_delete_adapter(). The
-unregister function will delete the adapter automatically once the last user
-of that /dev/cecX device has closed its file handle.
-
-
-Implementing the Low-Level CEC Adapter
---------------------------------------
-
-The following low-level adapter operations have to be implemented in
-your driver:
-
-struct cec_adap_ops {
- /* Low-level callbacks */
- int (*adap_enable)(struct cec_adapter *adap, bool enable);
- int (*adap_monitor_all_enable)(struct cec_adapter *adap, bool enable);
- int (*adap_log_addr)(struct cec_adapter *adap, u8 logical_addr);
- int (*adap_transmit)(struct cec_adapter *adap, u8 attempts,
- u32 signal_free_time, struct cec_msg *msg);
- void (*adap_log_status)(struct cec_adapter *adap);
-
- /* High-level callbacks */
- ...
-};
-
-The three low-level ops deal with various aspects of controlling the CEC adapter
-hardware:
-
-
-To enable/disable the hardware:
-
- int (*adap_enable)(struct cec_adapter *adap, bool enable);
-
-This callback enables or disables the CEC hardware. Enabling the CEC hardware
-means powering it up in a state where no logical addresses are claimed. This
-op assumes that the physical address (adap->phys_addr) is valid when enable is
-true and will not change while the CEC adapter remains enabled. The initial
-state of the CEC adapter after calling cec_allocate_adapter() is disabled.
-
-Note that adap_enable must return 0 if enable is false.
-
-
-To enable/disable the 'monitor all' mode:
-
- int (*adap_monitor_all_enable)(struct cec_adapter *adap, bool enable);
-
-If enabled, then the adapter should be put in a mode to also monitor messages
-that not for us. Not all hardware supports this and this function is only
-called if the CEC_CAP_MONITOR_ALL capability is set. This callback is optional
-(some hardware may always be in 'monitor all' mode).
-
-Note that adap_monitor_all_enable must return 0 if enable is false.
-
-
-To program a new logical address:
-
- int (*adap_log_addr)(struct cec_adapter *adap, u8 logical_addr);
-
-If logical_addr == CEC_LOG_ADDR_INVALID then all programmed logical addresses
-are to be erased. Otherwise the given logical address should be programmed.
-If the maximum number of available logical addresses is exceeded, then it
-should return -ENXIO. Once a logical address is programmed the CEC hardware
-can receive directed messages to that address.
-
-Note that adap_log_addr must return 0 if logical_addr is CEC_LOG_ADDR_INVALID.
-
-
-To transmit a new message:
-
- int (*adap_transmit)(struct cec_adapter *adap, u8 attempts,
- u32 signal_free_time, struct cec_msg *msg);
-
-This transmits a new message. The attempts argument is the suggested number of
-attempts for the transmit.
-
-The signal_free_time is the number of data bit periods that the adapter should
-wait when the line is free before attempting to send a message. This value
-depends on whether this transmit is a retry, a message from a new initiator or
-a new message for the same initiator. Most hardware will handle this
-automatically, but in some cases this information is needed.
-
-The CEC_FREE_TIME_TO_USEC macro can be used to convert signal_free_time to
-microseconds (one data bit period is 2.4 ms).
-
-
-To log the current CEC hardware status:
-
- void (*adap_status)(struct cec_adapter *adap, struct seq_file *file);
-
-This optional callback can be used to show the status of the CEC hardware.
-The status is available through debugfs: cat /sys/kernel/debug/cec/cecX/status
-
-
-Your adapter driver will also have to react to events (typically interrupt
-driven) by calling into the framework in the following situations:
-
-When a transmit finished (successfully or otherwise):
-
-void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt,
- u8 nack_cnt, u8 low_drive_cnt, u8 error_cnt);
-
-The status can be one of:
-
-CEC_TX_STATUS_OK: the transmit was successful.
-CEC_TX_STATUS_ARB_LOST: arbitration was lost: another CEC initiator
-took control of the CEC line and you lost the arbitration.
-CEC_TX_STATUS_NACK: the message was nacked (for a directed message) or
-acked (for a broadcast message). A retransmission is needed.
-CEC_TX_STATUS_LOW_DRIVE: low drive was detected on the CEC bus. This
-indicates that a follower detected an error on the bus and requested a
-retransmission.
-CEC_TX_STATUS_ERROR: some unspecified error occurred: this can be one of
-the previous two if the hardware cannot differentiate or something else
-entirely.
-CEC_TX_STATUS_MAX_RETRIES: could not transmit the message after
-trying multiple times. Should only be set by the driver if it has hardware
-support for retrying messages. If set, then the framework assumes that it
-doesn't have to make another attempt to transmit the message since the
-hardware did that already.
-
-The *_cnt arguments are the number of error conditions that were seen.
-This may be 0 if no information is available. Drivers that do not support
-hardware retry can just set the counter corresponding to the transmit error
-to 1, if the hardware does support retry then either set these counters to
-0 if the hardware provides no feedback of which errors occurred and how many
-times, or fill in the correct values as reported by the hardware.
-
-When a CEC message was received:
-
-void cec_received_msg(struct cec_adapter *adap, struct cec_msg *msg);
-
-Speaks for itself.
-
-Implementing the High-Level CEC Adapter
----------------------------------------
-
-The low-level operations drive the hardware, the high-level operations are
-CEC protocol driven. The following high-level callbacks are available:
-
-struct cec_adap_ops {
- /* Low-level callbacks */
- ...
-
- /* High-level CEC message callback */
- int (*received)(struct cec_adapter *adap, struct cec_msg *msg);
-};
-
-The received() callback allows the driver to optionally handle a newly
-received CEC message
-
- int (*received)(struct cec_adapter *adap, struct cec_msg *msg);
-
-If the driver wants to process a CEC message, then it can implement this
-callback. If it doesn't want to handle this message, then it should return
--ENOMSG, otherwise the CEC framework assumes it processed this message and
-it will not no anything with it.
-
-
-CEC framework functions
------------------------
-
-CEC Adapter drivers can call the following CEC framework functions:
-
-int cec_transmit_msg(struct cec_adapter *adap, struct cec_msg *msg,
- bool block);
-
-Transmit a CEC message. If block is true, then wait until the message has been
-transmitted, otherwise just queue it and return.
-
-void cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr, bool block);
-
-Change the physical address. This function will set adap->phys_addr and
-send an event if it has changed. If cec_s_log_addrs() has been called and
-the physical address has become valid, then the CEC framework will start
-claiming the logical addresses. If block is true, then this function won't
-return until this process has finished.
-
-When the physical address is set to a valid value the CEC adapter will
-be enabled (see the adap_enable op). When it is set to CEC_PHYS_ADDR_INVALID,
-then the CEC adapter will be disabled. If you change a valid physical address
-to another valid physical address, then this function will first set the
-address to CEC_PHYS_ADDR_INVALID before enabling the new physical address.
-
-int cec_s_log_addrs(struct cec_adapter *adap,
- struct cec_log_addrs *log_addrs, bool block);
-
-Claim the CEC logical addresses. Should never be called if CEC_CAP_LOG_ADDRS
-is set. If block is true, then wait until the logical addresses have been
-claimed, otherwise just queue it and return. To unconfigure all logical
-addresses call this function with log_addrs set to NULL or with
-log_addrs->num_log_addrs set to 0. The block argument is ignored when
-unconfiguring. This function will just return if the physical address is
-invalid. Once the physical address becomes valid, then the framework will
-attempt to claim these logical addresses.
--- /dev/null
+Atmel Image Sensor Controller (ISC)
+----------------------------------------------
+
+Required properties for ISC:
+- compatible
+ Must be "atmel,sama5d2-isc".
+- reg
+ Physical base address and length of the registers set for the device.
+- interrupts
+ Should contain IRQ line for the ISC.
+- clocks
+ List of clock specifiers, corresponding to entries in
+ the clock-names property;
+ Please refer to clock-bindings.txt.
+- clock-names
+ Required elements: "hclock", "iscck", "gck".
+- #clock-cells
+ Should be 0.
+- clock-output-names
+ Should be "isc-mck".
+- pinctrl-names, pinctrl-0
+ Please refer to pinctrl-bindings.txt.
+
+ISC supports a single port node with parallel bus. It should contain one
+'port' child node with child 'endpoint' node. Please refer to the bindings
+defined in Documentation/devicetree/bindings/media/video-interfaces.txt.
+
+Example:
+isc: isc@f0008000 {
+ compatible = "atmel,sama5d2-isc";
+ reg = <0xf0008000 0x4000>;
+ interrupts = <46 IRQ_TYPE_LEVEL_HIGH 5>;
+ clocks = <&isc_clk>, <&iscck>, <&isc_gclk>;
+ clock-names = "hclock", "iscck", "gck";
+ #clock-cells = <0>;
+ clock-output-names = "isc-mck";
+ pinctrl-names = "default";
+ pinctrl-0 = <&pinctrl_isc_base &pinctrl_isc_data_8bit &pinctrl_isc_data_9_10 &pinctrl_isc_data_11_12>;
+
+ port {
+ isc_0: endpoint {
+ remote-endpoint = <&ov7740_0>;
+ hsync-active = <1>;
+ vsync-active = <0>;
+ pclk-sample = <1>;
+ };
+ };
+};
+
+i2c1: i2c@fc028000 {
+ ov7740: camera@21 {
+ compatible = "ovti,ov7740";
+ reg = <0x21>;
+ clocks = <&isc>;
+ clock-names = "xvclk";
+ assigned-clocks = <&isc>;
+ assigned-clock-rates = <24000000>;
+
+ port {
+ ov7740_0: endpoint {
+ remote-endpoint = <&isc_0>;
+ };
+ };
+ };
+};
--- /dev/null
+CEC Kernel Support
+==================
+
+The CEC framework provides a unified kernel interface for use with HDMI CEC
+hardware. It is designed to handle a multiple types of hardware (receivers,
+transmitters, USB dongles). The framework also gives the option to decide
+what to do in the kernel driver and what should be handled by userspace
+applications. In addition it integrates the remote control passthrough
+feature into the kernel's remote control framework.
+
+
+The CEC Protocol
+----------------
+
+The CEC protocol enables consumer electronic devices to communicate with each
+other through the HDMI connection. The protocol uses logical addresses in the
+communication. The logical address is strictly connected with the functionality
+provided by the device. The TV acting as the communication hub is always
+assigned address 0. The physical address is determined by the physical
+connection between devices.
+
+The CEC framework described here is up to date with the CEC 2.0 specification.
+It is documented in the HDMI 1.4 specification with the new 2.0 bits documented
+in the HDMI 2.0 specification. But for most of the features the freely available
+HDMI 1.3a specification is sufficient:
+
+http://www.microprocessor.org/HDMISpecification13a.pdf
+
+
+The Kernel Interface
+====================
+
+CEC Adapter
+-----------
+
+The struct cec_adapter represents the CEC adapter hardware. It is created by
+calling cec_allocate_adapter() and deleted by calling cec_delete_adapter():
+
+.. c:function::
+ struct cec_adapter *cec_allocate_adapter(const struct cec_adap_ops *ops,
+ void *priv, const char *name, u32 caps, u8 available_las,
+ struct device *parent);
+
+.. c:function::
+ void cec_delete_adapter(struct cec_adapter *adap);
+
+To create an adapter you need to pass the following information:
+
+ops:
+ adapter operations which are called by the CEC framework and that you
+ have to implement.
+
+priv:
+ will be stored in adap->priv and can be used by the adapter ops.
+
+name:
+ the name of the CEC adapter. Note: this name will be copied.
+
+caps:
+ capabilities of the CEC adapter. These capabilities determine the
+ capabilities of the hardware and which parts are to be handled
+ by userspace and which parts are handled by kernelspace. The
+ capabilities are returned by CEC_ADAP_G_CAPS.
+
+available_las:
+ the number of simultaneous logical addresses that this
+ adapter can handle. Must be 1 <= available_las <= CEC_MAX_LOG_ADDRS.
+
+parent:
+ the parent device.
+
+
+To register the /dev/cecX device node and the remote control device (if
+CEC_CAP_RC is set) you call:
+
+.. c:function::
+ int cec_register_adapter(struct cec_adapter \*adap);
+
+To unregister the devices call:
+
+.. c:function::
+ void cec_unregister_adapter(struct cec_adapter \*adap);
+
+Note: if cec_register_adapter() fails, then call cec_delete_adapter() to
+clean up. But if cec_register_adapter() succeeded, then only call
+cec_unregister_adapter() to clean up, never cec_delete_adapter(). The
+unregister function will delete the adapter automatically once the last user
+of that /dev/cecX device has closed its file handle.
+
+
+Implementing the Low-Level CEC Adapter
+--------------------------------------
+
+The following low-level adapter operations have to be implemented in
+your driver:
+
+.. c:type:: struct cec_adap_ops
+
+.. code-block:: none
+
+ struct cec_adap_ops
+ {
+ /* Low-level callbacks */
+ int (*adap_enable)(struct cec_adapter *adap, bool enable);
+ int (*adap_monitor_all_enable)(struct cec_adapter *adap, bool enable);
+ int (*adap_log_addr)(struct cec_adapter *adap, u8 logical_addr);
+ int (*adap_transmit)(struct cec_adapter *adap, u8 attempts,
+ u32 signal_free_time, struct cec_msg *msg);
+ void (\*adap_log_status)(struct cec_adapter *adap);
+
+ /* High-level callbacks */
+ ...
+ };
+
+The three low-level ops deal with various aspects of controlling the CEC adapter
+hardware:
+
+
+To enable/disable the hardware:
+
+.. c:function::
+ int (*adap_enable)(struct cec_adapter *adap, bool enable);
+
+This callback enables or disables the CEC hardware. Enabling the CEC hardware
+means powering it up in a state where no logical addresses are claimed. This
+op assumes that the physical address (adap->phys_addr) is valid when enable is
+true and will not change while the CEC adapter remains enabled. The initial
+state of the CEC adapter after calling cec_allocate_adapter() is disabled.
+
+Note that adap_enable must return 0 if enable is false.
+
+
+To enable/disable the 'monitor all' mode:
+
+.. c:function::
+ int (*adap_monitor_all_enable)(struct cec_adapter *adap, bool enable);
+
+If enabled, then the adapter should be put in a mode to also monitor messages
+that not for us. Not all hardware supports this and this function is only
+called if the CEC_CAP_MONITOR_ALL capability is set. This callback is optional
+(some hardware may always be in 'monitor all' mode).
+
+Note that adap_monitor_all_enable must return 0 if enable is false.
+
+
+To program a new logical address:
+
+.. c:function::
+ int (*adap_log_addr)(struct cec_adapter *adap, u8 logical_addr);
+
+If logical_addr == CEC_LOG_ADDR_INVALID then all programmed logical addresses
+are to be erased. Otherwise the given logical address should be programmed.
+If the maximum number of available logical addresses is exceeded, then it
+should return -ENXIO. Once a logical address is programmed the CEC hardware
+can receive directed messages to that address.
+
+Note that adap_log_addr must return 0 if logical_addr is CEC_LOG_ADDR_INVALID.
+
+
+To transmit a new message:
+
+.. c:function::
+ int (*adap_transmit)(struct cec_adapter *adap, u8 attempts,
+ u32 signal_free_time, struct cec_msg *msg);
+
+This transmits a new message. The attempts argument is the suggested number of
+attempts for the transmit.
+
+The signal_free_time is the number of data bit periods that the adapter should
+wait when the line is free before attempting to send a message. This value
+depends on whether this transmit is a retry, a message from a new initiator or
+a new message for the same initiator. Most hardware will handle this
+automatically, but in some cases this information is needed.
+
+The CEC_FREE_TIME_TO_USEC macro can be used to convert signal_free_time to
+microseconds (one data bit period is 2.4 ms).
+
+
+To log the current CEC hardware status:
+
+.. c:function::
+ void (*adap_status)(struct cec_adapter *adap, struct seq_file *file);
+
+This optional callback can be used to show the status of the CEC hardware.
+The status is available through debugfs: cat /sys/kernel/debug/cec/cecX/status
+
+
+Your adapter driver will also have to react to events (typically interrupt
+driven) by calling into the framework in the following situations:
+
+When a transmit finished (successfully or otherwise):
+
+.. c:function::
+ void cec_transmit_done(struct cec_adapter *adap, u8 status, u8 arb_lost_cnt,
+ u8 nack_cnt, u8 low_drive_cnt, u8 error_cnt);
+
+The status can be one of:
+
+CEC_TX_STATUS_OK:
+ the transmit was successful.
+
+CEC_TX_STATUS_ARB_LOST:
+ arbitration was lost: another CEC initiator
+ took control of the CEC line and you lost the arbitration.
+
+CEC_TX_STATUS_NACK:
+ the message was nacked (for a directed message) or
+ acked (for a broadcast message). A retransmission is needed.
+
+CEC_TX_STATUS_LOW_DRIVE:
+ low drive was detected on the CEC bus. This indicates that
+ a follower detected an error on the bus and requested a
+ retransmission.
+
+CEC_TX_STATUS_ERROR:
+ some unspecified error occurred: this can be one of
+ the previous two if the hardware cannot differentiate or something
+ else entirely.
+
+CEC_TX_STATUS_MAX_RETRIES:
+ could not transmit the message after trying multiple times.
+ Should only be set by the driver if it has hardware support for
+ retrying messages. If set, then the framework assumes that it
+ doesn't have to make another attempt to transmit the message
+ since the hardware did that already.
+
+The \*_cnt arguments are the number of error conditions that were seen.
+This may be 0 if no information is available. Drivers that do not support
+hardware retry can just set the counter corresponding to the transmit error
+to 1, if the hardware does support retry then either set these counters to
+0 if the hardware provides no feedback of which errors occurred and how many
+times, or fill in the correct values as reported by the hardware.
+
+When a CEC message was received:
+
+.. c:function::
+ void cec_received_msg(struct cec_adapter *adap, struct cec_msg *msg);
+
+Speaks for itself.
+
+Implementing the High-Level CEC Adapter
+---------------------------------------
+
+The low-level operations drive the hardware, the high-level operations are
+CEC protocol driven. The following high-level callbacks are available:
+
+.. code-block:: none
+
+ struct cec_adap_ops {
+ /\* Low-level callbacks \*/
+ ...
+
+ /\* High-level CEC message callback \*/
+ int (\*received)(struct cec_adapter \*adap, struct cec_msg \*msg);
+ };
+
+The received() callback allows the driver to optionally handle a newly
+received CEC message
+
+.. c:function::
+ int (*received)(struct cec_adapter *adap, struct cec_msg *msg);
+
+If the driver wants to process a CEC message, then it can implement this
+callback. If it doesn't want to handle this message, then it should return
+-ENOMSG, otherwise the CEC framework assumes it processed this message and
+it will not no anything with it.
+
+
+CEC framework functions
+-----------------------
+
+CEC Adapter drivers can call the following CEC framework functions:
+
+.. c:function::
+ int cec_transmit_msg(struct cec_adapter *adap, struct cec_msg *msg,
+ bool block);
+
+Transmit a CEC message. If block is true, then wait until the message has been
+transmitted, otherwise just queue it and return.
+
+.. c:function::
+ void cec_s_phys_addr(struct cec_adapter *adap, u16 phys_addr,
+ bool block);
+
+Change the physical address. This function will set adap->phys_addr and
+send an event if it has changed. If cec_s_log_addrs() has been called and
+the physical address has become valid, then the CEC framework will start
+claiming the logical addresses. If block is true, then this function won't
+return until this process has finished.
+
+When the physical address is set to a valid value the CEC adapter will
+be enabled (see the adap_enable op). When it is set to CEC_PHYS_ADDR_INVALID,
+then the CEC adapter will be disabled. If you change a valid physical address
+to another valid physical address, then this function will first set the
+address to CEC_PHYS_ADDR_INVALID before enabling the new physical address.
+
+.. c:function::
+ int cec_s_log_addrs(struct cec_adapter *adap,
+ struct cec_log_addrs *log_addrs, bool block);
+
+Claim the CEC logical addresses. Should never be called if CEC_CAP_LOG_ADDRS
+is set. If block is true, then wait until the logical addresses have been
+claimed, otherwise just queue it and return. To unconfigure all logical
+addresses call this function with log_addrs set to NULL or with
+log_addrs->num_log_addrs set to 0. The block argument is ignored when
+unconfiguring. This function will just return if the physical address is
+invalid. Once the physical address becomes valid, then the framework will
+attempt to claim these logical addresses.
It is a bitmask and the following bits can be set:
+.. tabularcolumns:: |p{5ex}|L|
===== ================================================================
Mask Description
kapi/dtv-core
kapi/rc-core
kapi/mc-core
+ kapi/cec-core
Description
===========
-.. note:: This documents the proposed CEC API. This API is not yet finalized
+.. note::
+
+ This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module.
Closes the cec device. Resources associated with the file descriptor are
Description
===========
-.. note:: This documents the proposed CEC API. This API is not yet finalized
+.. note::
+
+ This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module.
The :c:func:`ioctl()` function manipulates cec device parameters. The
Description
===========
-.. note:: This documents the proposed CEC API. This API is not yet finalized
+.. note::
+
+ This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module.
To open a cec device applications call :c:func:`open()` with the
Description
===========
-.. note:: This documents the proposed CEC API. This API is not yet finalized
+.. note::
+
+ This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module.
With the :c:func:`poll()` function applications can wait for CEC
Introduction
============
-.. note:: This documents the proposed CEC API. This API is not yet finalized
+.. note::
+
+ This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module.
HDMI connectors provide a single pin for use by the Consumer Electronics
Description
===========
-.. note:: This documents the proposed CEC API. This API is not yet finalized
+.. note::
+
+ This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module.
All cec devices must support :ref:`ioctl CEC_ADAP_G_CAPS <CEC_ADAP_G_CAPS>`. To query
struct :ref:`cec_caps <cec-caps>`. The driver fills the structure and
returns the information to the application. The ioctl never fails.
+.. tabularcolumns:: |p{1.2cm}|p{2.5cm}|p{13.8cm}|
.. _cec-caps:
macro.
+.. tabularcolumns:: |p{4.4cm}|p{2.5cm}|p{10.6cm}|
.. _cec-capabilities:
Description
===========
-.. note:: This documents the proposed CEC API. This API is not yet finalized
+.. note::
+
+ This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module.
To query the current CEC logical addresses, applications call
Attempting to call :ref:`ioctl CEC_ADAP_S_LOG_ADDRS <CEC_ADAP_S_LOG_ADDRS>` when
logical address types are already defined will return with error ``EBUSY``.
+.. tabularcolumns:: |p{1.0cm}|p{7.5cm}|p{8.0cm}|
.. _cec-log-addrs:
+.. cssclass:: longtable
+
.. flat-table:: struct cec_log_addrs
:header-rows: 0
:stub-columns: 0
give the CEC framework more information about the device type, even
though the framework won't use it directly in the CEC message.
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _cec-versions:
.. flat-table:: CEC Versions
- CEC version according to the HDMI 2.0 standard.
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
.. _cec-prim-dev-types:
- Use for a video processor device.
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
.. _cec-log-addr-types:
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _cec-all-dev-types-flags:
.. flat-table:: CEC All Device Types Flags
Description
===========
-.. note:: This documents the proposed CEC API. This API is not yet finalized
+.. note::
+
+ This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module.
To query the current physical address applications call
Description
===========
-.. note:: This documents the proposed CEC API. This API is not yet finalized
+.. note::
+
+ This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module.
CEC devices can send asynchronous events. These can be retrieved by
the same state). In that case the intermediate state changes were lost but
it is guaranteed that the state did change in between the two events.
+.. tabularcolumns:: |p{1.2cm}|p{2.9cm}|p{13.4cm}|
.. _cec-event-state-change_s:
- The current set of claimed logical addresses.
+.. tabularcolumns:: |p{1.0cm}|p{2.0cm}|p{14.5cm}|
.. _cec-event-lost-msgs_s:
this is more than enough.
+.. tabularcolumns:: |p{1.0cm}|p{4.2cm}|p{2.5cm}|p{8.8cm}|
.. _cec-event:
- ``ts``
- - Timestamp of the event in ns.
+ - :cspan:`1` Timestamp of the event in ns.
+
The timestamp has been taken from the ``CLOCK_MONOTONIC`` clock. To access
the same clock from userspace use :c:func:`clock_gettime(2)`.
- -
-
- .. row 2
- __u32
- ``event``
- - The CEC event type, see :ref:`cec-events`.
-
- -
+ - :cspan:`1` The CEC event type, see :ref:`cec-events`.
- .. row 3
- ``flags``
- - Event flags, see :ref:`cec-event-flags`.
-
- -
+ - :cspan:`1` Event flags, see :ref:`cec-event-flags`.
- .. row 4
event.
+.. tabularcolumns:: |p{5.6cm}|p{0.9cm}|p{11.0cm}|
.. _cec-events:
application didn't dequeue CEC messages fast enough.
+.. tabularcolumns:: |p{6.0cm}|p{0.6cm}|p{10.9cm}|
.. _cec-event-flags:
Description
===========
-.. note:: This documents the proposed CEC API. This API is not yet finalized
+.. note::
+
+ This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module.
By default any filehandle can use :ref:`CEC_TRANSMIT`, but in order to prevent
Available initiator modes are:
+.. tabularcolumns:: |p{5.6cm}|p{0.9cm}|p{11.0cm}|
.. _cec-mode-initiator_e:
Available follower modes are:
+.. tabularcolumns:: |p{6.6cm}|p{0.9cm}|p{10.0cm}|
.. _cec-mode-follower_e:
Core message processing details:
+.. tabularcolumns:: |p{6.6cm}|p{10.9cm}|
.. _cec-core-processing:
Description
===========
-.. note:: This documents the proposed CEC API. This API is not yet finalized
+.. note::
+
+ This documents the proposed CEC API. This API is not yet finalized
and is currently only available as a staging kernel module.
To receive a CEC message the application has to fill in the
result.
+.. tabularcolumns:: |p{1.0cm}|p{3.5cm}|p{13.0cm}|
+
.. _cec-msg:
+.. cssclass:: longtable
+
.. flat-table:: struct cec_msg
:header-rows: 0
:stub-columns: 0
valid if the :ref:`CEC_TX_STATUS_ERROR <CEC-TX-STATUS-ERROR>` status bit is set.
+.. tabularcolumns:: |p{5.6cm}|p{0.9cm}|p{11.0cm}|
.. _cec-tx-status:
be set to explain which failures were seen.
+.. tabularcolumns:: |p{5.6cm}|p{0.9cm}|p{11.0cm}|
.. _cec-rx-status:
Return Value
------------
+.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
Return Value
------------
+.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
circular buffer to buf. The maximum amount of data to be transferred is
implied by count.
-
Return Value
------------
+.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
Return Value
------------
+.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
-
+.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
.. flat-table::
:header-rows: 0
appropriately. The generic error codes are described at the
:ref:`Generic Error Codes <gen-errors>` chapter.
-
+.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
.. flat-table::
:header-rows: 0
Output for the demux
====================
+.. tabularcolumns:: |p{5.0cm}|p{12.5cm}|
.. _dmx-output:
Signal statistics are provided via
:ref:`FE_GET_PROPERTY`.
-.. note:: Most statistics require the demodulator to be fully locked
+.. note::
+
+ Most statistics require the demodulator to be fully locked
(e. g. with FE_HAS_LOCK bit set). See
:ref:`Frontend statistics indicators <frontend-stat-properties>` for
more details.
Part II - Digital TV API
########################
-.. note:: This API is also known as **DVB API**, although it is generic
+.. note::
+
+ This API is also known as **DVB API**, although it is generic
enough to support all digital TV standards.
**Version 5.10**
breaking userspace. So, the decision was to deprecate the legacy
union/struct based approach, in favor of a properties set approach.
-.. note:: On Linux DVB API version 3, setting a frontend were done via
+.. note::
+
+ On Linux DVB API version 3, setting a frontend were done via
:ref:`struct dvb_frontend_parameters <dvb-frontend-parameters>`.
This got replaced on version 5 (also called "S2API", as this API were
added originally_enabled to provide support for DVB-S2), because the
In this section we would like to present some examples for using the DVB
API.
-..note:: This section is out of date, and the code below won't even
+.. note::
+
+ This section is out of date, and the code below won't even
compile. Please refer to the
`libdvbv5 <https://linuxtv.org/docs/libdvbv5/index.html>`__ for
updated/recommended examples.
struct dvb_diseqc_slave_reply
-----------------------------
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct dvb_diseqc_slave_reply
:header-rows: 0
:stub-columns: 0
struct dvb_diseqc_master_cmd
============================
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct dvb_diseqc_master_cmd
:header-rows: 0
:stub-columns: 0
struct dvb_frontend_info
========================
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct dvb_frontend_info
:header-rows: 0
:stub-columns: 0
- Capabilities supported by the frontend
-.. note:: The frequencies are specified in Hz for Terrestrial and Cable
+.. note::
+
+ The frequencies are specified in Hz for Terrestrial and Cable
systems. They're specified in kHz for Satellite systems
Capabilities describe what a frontend can do. Some capabilities are
supported only on some specific frontend types.
+.. tabularcolumns:: |p{6.5cm}|p{11.0cm}|
.. _fe-caps:
tuned. The ioctl takes a pointer to an integer where the status will be
written.
-.. note:: The size of status is actually sizeof(enum fe_status), with
+.. 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.
state changes of the frontend hardware. It is produced using the enum
:ref:`fe_status <fe-status>` values on a bitmask
+.. tabularcolumns:: |p{3.5cm}|p{14.0cm}|
.. _fe-status:
.. _fe-type:
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. flat-table:: Frontend types
:header-rows: 1
:stub-columns: 0
Note: Truth table for ``DTV_ISDBT_SOUND_BROADCASTING`` and
``DTV_ISDBT_PARTIAL_RECEPTION`` and ``LAYER[A-C]_SEGMENT_COUNT``
-
.. _isdbt-layer_seg-cnt-table:
-.. flat-table::
+.. flat-table:: Truth table for ISDB-T Sound Broadcasting
:header-rows: 0
:stub-columns: 0
.. _isdbt-layer-interleaving-table:
-.. flat-table::
+.. flat-table:: ISDB-T time interleaving modes
:header-rows: 0
:stub-columns: 0
Possible values are:
+.. tabularcolumns:: |p{5.0cm}|p{12.5cm}|
.. _atscmh-rs-frame-mode:
Possible values are:
+.. tabularcolumns:: |p{4.5cm}|p{13.0cm}|
.. _atscmh-sccc-block-mode:
enum fe_transmit_mode: Number of carriers per channel
-----------------------------------------------------
+.. tabularcolumns:: |p{5.0cm}|p{12.5cm}|
.. _fe-transmit-mode:
Data types and ioctl definitions can be accessed by including
``linux/dvb/frontend.h`` in your application.
-.. note:: Transmission via the internet (DVB-IP) is not yet handled by this
+.. note::
+
+ Transmission via the internet (DVB-IP) is not yet handled by this
API but a future extension is possible.
On Satellite systems, the API support for the Satellite Equipment
Return Value
------------
+.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
.. _gen-errors:
+.. tabularcolumns:: |p{2.5cm}|p{15.0cm}|
+
.. flat-table:: Generic error codes
:header-rows: 0
:stub-columns: 0
.. _media-device-info:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct media_device_info
:header-rows: 0
:stub-columns: 0
.. _media-entity-desc:
+.. tabularcolumns:: |p{1.5cm}|p{1.5cm}|p{1.5cm}|p{1.5cm}|p{11.5cm}|
+
.. flat-table:: struct media_entity_desc
:header-rows: 0
:stub-columns: 0
.. _media-links-enum:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct media_links_enum
:header-rows: 0
:stub-columns: 0
.. _media-pad-desc:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct media_pad_desc
:header-rows: 0
:stub-columns: 0
.. _media-link-desc:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct media_link_desc
:header-rows: 0
:stub-columns: 0
If the ``topology_version`` remains the same, the ioctl should fill the
desired arrays with the media graph elements.
+.. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
.. _media-v2-topology:
won't store the links. It will just update ``num_links``
+.. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
.. _media-v2-entity:
this array to zero.
+.. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
.. _media-v2-interface:
:ref:`media-v2-intf-devnode` for details..
+.. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
.. _media-v2-intf-devnode:
- Device node minor number.
+.. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
.. _media-v2-pad:
this array to zero.
+.. tabularcolumns:: |p{1.6cm}|p{3.2cm}|p{12.7cm}|
.. _media-v2-link:
Types and flags used to represent the media graph elements
==========================================================
+.. tabularcolumns:: |p{8.0cm}|p{10.5cm}|
.. _media-entity-type:
+.. cssclass:: longtable
+
.. flat-table:: Media entity types
:header-rows: 0
:stub-columns: 0
- .. row 1
- .. _MEDIA-ENT-F-UNKNOWN:
+ .. _MEDIA-ENT-F-UNKNOWN:
.. _MEDIA-ENT-F-V4L2-SUBDEV-UNKNOWN:
- - ``MEDIA_ENT_F_UNKNOWN`` and ``MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN``
+ - ``MEDIA_ENT_F_UNKNOWN`` and
+
+ ``MEDIA_ENT_F_V4L2_SUBDEV_UNKNOWN``
- Unknown entity. That generally indicates that a driver didn't
initialize properly the entity, with is a Kernel bug
its source pad.
+.. tabularcolumns:: |p{5.5cm}|p{12.0cm}|
+
.. _media-entity-flag:
.. flat-table:: Media entity flags
- The entity represents a data conector
+.. tabularcolumns:: |p{6.5cm}|p{6.0cm}|p{5.0cm}|
.. _media-intf-type:
- typically, /dev/snd/timer
+.. tabularcolumns:: |p{5.5cm}|p{12.0cm}|
.. _media-pad-flag:
One and only one of ``MEDIA_PAD_FL_SINK`` and ``MEDIA_PAD_FL_SOURCE``
must be set for every pad.
+.. tabularcolumns:: |p{5.5cm}|p{12.0cm}|
.. _media-link-flag:
also be more precise. On the other hand its disadvantage it usually
reduced range of reception.
-.. note:: Wide band receiver might be implictly enabled if you enable
+.. note::
+
+ Wide band receiver might be implictly enabled if you enable
carrier reports. In that case it will be disabled as soon as you disable
carrier reports. Trying to disable wide band receiver while carrier
reports are active will do nothing.
.. _rc_standard_keymap:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: IR default keymapping
:header-rows: 0
:stub-columns: 0
:ref:`VIDIOC_G_AUDOUT <VIDIOC_G_AUDOUT>` ioctls report the current
audio input and output, respectively.
-.. note:: Note that, unlike :ref:`VIDIOC_G_INPUT <VIDIOC_G_INPUT>` and
+.. note::
+
+ Note that, unlike :ref:`VIDIOC_G_INPUT <VIDIOC_G_INPUT>` and
:ref:`VIDIOC_G_OUTPUT <VIDIOC_G_OUTPUT>` these ioctls return a
structure as :ref:`VIDIOC_ENUMAUDIO` and
:ref:`VIDIOC_ENUMAUDOUT <VIDIOC_ENUMAUDOUT>` do, not just an index.
struct v4l2_buffer
==================
+.. tabularcolumns:: |p{2.8cm}|p{2.5cm}|p{1.3cm}|p{10.5cm}|
+
+.. cssclass:: longtable
+
.. flat-table:: struct v4l2_buffer
:header-rows: 0
:stub-columns: 0
- :widths: 1 1 1 2
+ :widths: 1 2 1 10
- .. row 1
output device because the application did not pass new data in
time.
- .. note:: This may count the frames received e.g. over USB, without
+ .. note::
+
+ This may count the frames received e.g. over USB, without
taking into account the frames dropped by the remote hardware due
to limited compression throughput or bus bandwidth. These devices
identify by not enumerating any video standards, see
:ref:`standard`.
+
- .. row 10
- __u32
struct v4l2_plane
=================
+.. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{3.5cm}|p{7.0cm}|
+
+.. cssclass:: longtable
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
``bytesused`` will be set to the size of the plane (see the
``length`` field of this struct) by the driver.
- .. note:: Note that the actual image data starts at ``data_offset``
+ .. note::
+
+ Note that the actual image data starts at ``data_offset``
which may not be 0.
- .. row 2
field when ``type`` refers to a capture stream, applications when
it refers to an output stream.
- .. note:: That data_offset is included in ``bytesused``. So the
+ .. note::
+
+ That data_offset is included in ``bytesused``. So the
size of the image in the plane is ``bytesused``-``data_offset``
at offset ``data_offset`` from the start of the plane.
enum v4l2_buf_type
==================
+.. cssclass:: longtable
+
+.. tabularcolumns:: |p{7.2cm}|p{0.6cm}|p{9.7cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 3 1 4
+ :widths: 4 1 9
- .. row 1
Buffer Flags
============
+.. tabularcolumns:: |p{7.0cm}|p{2.2cm}|p{8.3cm}|
+
+.. cssclass:: longtable
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
enum v4l2_memory
================
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
struct v4l2_timecode
--------------------
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
Timecode Types
--------------
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
Timecode Flags
--------------
+.. tabularcolumns:: |p{6.6cm}|p{1.4cm}|p{9.5cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
+.. tabularcolumns:: |p{5.5cm}|p{12cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
+ :widths: 11 24
- .. row 1
Applications can use the following API to select an area in the video
signal, query the default area and the hardware limits.
-.. note:: Despite their name, the :ref:`VIDIOC_CROPCAP <VIDIOC_CROPCAP>`,
+.. note::
+
+ Despite their name, the :ref:`VIDIOC_CROPCAP <VIDIOC_CROPCAP>`,
:ref:`VIDIOC_G_CROP <VIDIOC_G_CROP>` and :ref:`VIDIOC_S_CROP
<VIDIOC_G_CROP>` ioctls apply to input as well as output devices.
:ref:`VIDIOC_S_CROP <VIDIOC_G_CROP>` ioctls. Their size (and position
where applicable) will be fixed in this case.
-.. note:: All capture and output devices must support the
+.. note::
+
+ All capture and output devices must support the
:ref:`VIDIOC_CROPCAP <VIDIOC_CROPCAP>` ioctl such that applications
can determine if scaling takes place.
work without special preparations. More advanced applications should
ensure the parameters are suitable before starting I/O.
-.. note:: On the next two examples, a video capture device is assumed;
+.. note::
+
+ On the next two examples, a video capture device is assumed;
change ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` for other types of device.
Example: Resetting the cropping parameters
Video compression codecs use the MPEG controls to setup their codec
parameters
-.. note:: The MPEG controls actually support many more codecs than
+.. note::
+
+ The MPEG controls actually support many more codecs than
just MPEG. See :ref:`mpeg-controls`.
Memory-to-memory devices can often be used as a shared resource: you can
The OSD function is accessible through the same character special file
as the :ref:`Video Output <capture>` function.
-.. note:: The default function of such a ``/dev/video`` device is video
+.. note::
+
+ The default function of such a ``/dev/video`` device is video
capturing or output. The OSD function is only available after calling
the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl.
``/dev/video`` is typically a symbolic link to the preferred video
device.
-..note:: The same device file names are used also for video capture devices.
+.. note:: The same device file names are used also for video capture devices.
Querying Capabilities
Video overlay devices are accessed through the same character special
files as :ref:`video capture <capture>` devices.
-.. note:: The default function of a ``/dev/video`` device is video
+.. note::
+
+ The default function of a ``/dev/video`` device is video
capturing. The overlay function is only available after calling
the :ref:`VIDIOC_S_FMT <VIDIOC_G_FMT>` ioctl.
:ref:`VIDIOC_S_FBUF <VIDIOC_G_FBUF>`,
:ref:`framebuffer-flags`).
- .. note:: This field was added in Linux 2.6.23, extending the
- structure. However the :ref:`VIDIOC_[G|S|TRY]_FMT <VIDIOC_G_FMT>`
- ioctls, which take a pointer to a :ref:`v4l2_format <v4l2-format>`
- parent structure with padding bytes at the end, are not affected.
+.. note::
+
+ This field was added in Linux 2.6.23, extending the
+ structure. However the :ref:`VIDIOC_[G|S|TRY]_FMT <VIDIOC_G_FMT>`
+ ioctls, which take a pointer to a :ref:`v4l2_format <v4l2-format>`
+ parent structure with padding bytes at the end, are not affected.
.. _v4l2-clip:
and always returns default parameters as :ref:`VIDIOC_G_FMT <VIDIOC_G_FMT>` does.
:ref:`VIDIOC_TRY_FMT <VIDIOC_G_FMT>` is optional.
+.. tabularcolumns:: |p{2.4cm}|p{4.4cm}|p{10.7cm}|
.. _v4l2-vbi-format:
+.. cssclass:: longtable
+
.. flat-table:: struct v4l2_vbi_format
:header-rows: 0
:stub-columns: 0
driver. Anyway, drivers may not support single field capturing and
return both count values non-zero.
- Both ``count`` values set to zero, or line numbers outside the
- bounds depicted in :ref:`vbi-525` and :ref:`vbi-625`, or a
- field image covering lines of two fields, are invalid and shall
- not be returned by the driver.
+ Both ``count`` values set to zero, or line numbers are outside the
+ bounds depicted\ [#f4]_, or a field image covering lines of two
+ fields, are invalid and shall not be returned by the driver.
To initialize the ``start`` and ``count`` fields, applications
must first determine the current video standard selection. The
applications must set it to zero.
+.. tabularcolumns:: |p{4.0cm}|p{1.5cm}|p{12.0cm}|
.. _vbifmt-flags:
Most VBI services transmit on both fields, but some have different
semantics depending on the field number. These cannot be reliable
decoded or encoded when ``V4L2_VBI_UNSYNC`` is set.
+
+.. [#f4]
+ The valid values ar shown at :ref:`vbi-525` and :ref:`vbi-625`.
For more information see the core RDS standard :ref:`iec62106` and the
RBDS standard :ref:`nrsc4`.
-.. note:: Note that the RBDS standard as is used in the USA is almost
+.. note::
+
+ Note that the RBDS standard as is used in the USA is almost
identical to the RDS standard. Any RDS decoder/encoder can also handle
RBDS. Only some of the fields have slightly different meanings. See the
RBDS standard for more information.
.. _v4l2-rds-data:
+.. tabularcolumns:: |p{2.5cm}|p{2.5cm}|p{12.5cm}|
+
.. flat-table:: struct v4l2_rds_data
:header-rows: 0
:stub-columns: 0
.. _v4l2-rds-block:
+.. tabularcolumns:: |p{2.9cm}|p{14.6cm}|
+
.. flat-table:: Block description
:header-rows: 0
:stub-columns: 0
.. _v4l2-rds-block-codes:
+.. tabularcolumns:: |p{5.6cm}|p{2.0cm}|p{1.5cm}|p{7.0cm}|
+
.. flat-table:: Block defines
:header-rows: 0
:stub-columns: 0
.. _v4l2-sdr-format:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_sdr_format
:header-rows: 0
:stub-columns: 0
struct v4l2_sliced_vbi_format
-----------------------------
+.. tabularcolumns:: |p{1.0cm}|p{4.5cm}|p{4.0cm}|p{4.0cm}|p{4.0cm}|
+
+.. cssclass:: longtable
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
service the driver chooses.
Data services are defined in :ref:`vbi-services2`. Array indices
- map to ITU-R line numbers (see also :ref:`vbi-525` and
- :ref:`vbi-625`) as follows:
+ map to ITU-R line numbers\ [#f2]_ as follows:
- .. row 3
- ``reserved``\ [2]
- :cspan:`2` This array is reserved for future extensions.
- Applications and drivers must set it to zero.
+ Applications and drivers must set it to zero.
.. _vbi-services2:
Sliced VBI services
-------------------
+.. raw:: latex
+
+ \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{5.0cm}|p{1.4cm}|p{3.0cm}|p{2.5cm}|p{9.0cm}|
+
.. flat-table::
:header-rows: 1
:stub-columns: 0
- 0x0001
- - :ref:`ets300706`, :ref:`itu653`
+ - :ref:`ets300706`,
+
+ :ref:`itu653`
- PAL/SECAM line 7-22, 320-335 (second field 7-22)
- 0x4000
- - :ref:`itu1119`, :ref:`en300294`
+ - :ref:`itu1119`,
+
+ :ref:`en300294`
- PAL/SECAM line 23
- :cspan:`2` Set of services applicable to 625 line systems.
+.. raw:: latex
+
+ \end{adjustbox}\newline\newline
+
Drivers may return an ``EINVAL`` error code when applications attempt to
read or write data without prior format negotiation, after switching the
struct v4l2_sliced_vbi_data
---------------------------
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
struct v4l2_mpeg_vbi_fmt_ivtv
-----------------------------
+.. tabularcolumns:: |p{1.0cm}|p{3.5cm}|p{1.0cm}|p{11.5cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
Magic Constants for struct v4l2_mpeg_vbi_fmt_ivtv magic field
-------------------------------------------------------------
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. flat-table::
:header-rows: 1
:stub-columns: 0
struct v4l2_mpeg_vbi_itv0
-------------------------
+.. tabularcolumns:: |p{4.4cm}|p{2.4cm}|p{10.7cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
::
linemask[0] b0: line 6 first field
- linemask[0] b17: line 23 first field
- linemask[0] b18: line 6 second field
- linemask[0] b31: line 19 second field
+ linemask[0] b17: line 23 first field
+ linemask[0] b18: line 6 second field
+ linemask[0] b31: line 19 second field
linemask[1] b0: line 20 second field
linemask[1] b3: line 23 second field
linemask[1] b4-b31: unused and set to 0
struct v4l2_mpeg_vbi_ITV0
-------------------------
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
struct v4l2_mpeg_vbi_itv0_line
------------------------------
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
Line Identifiers for struct v4l2_mpeg_vbi_itv0_line id field
------------------------------------------------------------
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. flat-table::
:header-rows: 1
:stub-columns: 0
.. [#f1]
According to :ref:`ETS 300 706 <ets300706>` lines 6-22 of the first
field and lines 5-22 of the second field may carry Teletext data.
+
+.. [#f2]
+ See also :ref:`vbi-525` and :ref:`vbi-625`.
list entity names and pad numbers).
+.. raw:: latex
+
+ \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{4.5cm}|p{4.5cm}|p{4.5cm}|p{4.5cm}|p{4.5cm}|p{4.5cm}|p{4.5cm}|
+
.. _sample-pipeline-config:
.. flat-table:: Sample Pipeline Configuration
:header-rows: 1
:stub-columns: 0
+ :widths: 5 5 5 5 5 5 5
- .. row 1
- *1280x960/SGRBG8_1X8*
+.. raw:: latex
+ \end{adjustbox}\newline\newline
1. Initial state. The sensor source pad format is set to its native 3MP
size and V4L2_MBUS_FMT_SGRBG8_1X8 media bus code. Formats on the
capturing, video overlay and VBI capturing. See :ref:`open` for an
introduction.
+.. tabularcolumns:: |p{5.5cm}|p{6.5cm}|p{5.5cm}
+.. cssclass:: longtable
.. flat-table::
:header-rows: 1
- .. row 1
- - struct :c:type:`struct video_capability` ``type``
+ - ``struct video_capability`` ``type``
- struct :ref:`v4l2_capability <v4l2-capability>`
``capabilities`` flags
Below all controls within the Codec control class are described. First
the generic controls, then controls specific for certain hardware.
-.. note:: These controls are applicable to all codecs and not just MPEG. The
+.. note::
+
+ These controls are applicable to all codecs and not just MPEG. The
defines are prefixed with V4L2_CID_MPEG/V4L2_MPEG as the controls
were originally made for MPEG codecs and later extended to cover all
encoding formats.
.. _v4l2-mpeg-stream-type:
-``V4L2_CID_MPEG_STREAM_TYPE (enum v4l2_mpeg_stream_type)``
+``V4L2_CID_MPEG_STREAM_TYPE``
+ (enum)
+
+enum v4l2_mpeg_stream_type -
The MPEG-1, -2 or -4 output stream type. One cannot assume anything
here. Each hardware MPEG encoder tends to support different subsets
of the available MPEG stream types. This control is specific to
.. _v4l2-mpeg-stream-vbi-fmt:
-``V4L2_CID_MPEG_STREAM_VBI_FMT (enum v4l2_mpeg_stream_vbi_fmt)``
+``V4L2_CID_MPEG_STREAM_VBI_FMT``
+ (enum)
+
+enum v4l2_mpeg_stream_vbi_fmt -
Some cards can embed VBI data (e. g. Closed Caption, Teletext) into
the MPEG stream. This control selects whether VBI data should be
embedded, and if so, what embedding method should be used. The list
+.. tabularcolumns:: |p{6 cm}|p{11.5cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
.. _v4l2-mpeg-audio-sampling-freq:
-``V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (enum v4l2_mpeg_audio_sampling_freq)``
+``V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ``
+ (enum)
+
+enum v4l2_mpeg_audio_sampling_freq -
MPEG Audio sampling frequency. Possible values are:
.. _v4l2-mpeg-audio-encoding:
-``V4L2_CID_MPEG_AUDIO_ENCODING (enum v4l2_mpeg_audio_encoding)``
+``V4L2_CID_MPEG_AUDIO_ENCODING``
+ (enum)
+
+enum v4l2_mpeg_audio_encoding -
MPEG Audio encoding. This control is specific to multiplexed MPEG
streams. Possible values are:
.. _v4l2-mpeg-audio-l1-bitrate:
-``V4L2_CID_MPEG_AUDIO_L1_BITRATE (enum v4l2_mpeg_audio_l1_bitrate)``
+``V4L2_CID_MPEG_AUDIO_L1_BITRATE``
+ (enum)
+
+enum v4l2_mpeg_audio_l1_bitrate -
MPEG-1/2 Layer I bitrate. Possible values are:
.. _v4l2-mpeg-audio-l2-bitrate:
-``V4L2_CID_MPEG_AUDIO_L2_BITRATE (enum v4l2_mpeg_audio_l2_bitrate)``
+``V4L2_CID_MPEG_AUDIO_L2_BITRATE``
+ (enum)
+
+enum v4l2_mpeg_audio_l2_bitrate -
MPEG-1/2 Layer II bitrate. Possible values are:
.. _v4l2-mpeg-audio-l3-bitrate:
-``V4L2_CID_MPEG_AUDIO_L3_BITRATE (enum v4l2_mpeg_audio_l3_bitrate)``
+``V4L2_CID_MPEG_AUDIO_L3_BITRATE``
+ (enum)
+
+enum v4l2_mpeg_audio_l3_bitrate -
MPEG-1/2 Layer III bitrate. Possible values are:
.. _v4l2-mpeg-audio-ac3-bitrate:
-``V4L2_CID_MPEG_AUDIO_AC3_BITRATE (enum v4l2_mpeg_audio_ac3_bitrate)``
+``V4L2_CID_MPEG_AUDIO_AC3_BITRATE``
+ (enum)
+
+enum v4l2_mpeg_audio_ac3_bitrate -
AC-3 bitrate. Possible values are:
.. _v4l2-mpeg-audio-mode:
-``V4L2_CID_MPEG_AUDIO_MODE (enum v4l2_mpeg_audio_mode)``
+``V4L2_CID_MPEG_AUDIO_MODE``
+ (enum)
+
+enum v4l2_mpeg_audio_mode -
MPEG Audio mode. Possible values are:
.. _v4l2-mpeg-audio-mode-extension:
-``V4L2_CID_MPEG_AUDIO_MODE_EXTENSION (enum v4l2_mpeg_audio_mode_extension)``
+``V4L2_CID_MPEG_AUDIO_MODE_EXTENSION``
+ (enum)
+
+enum v4l2_mpeg_audio_mode_extension -
Joint Stereo audio mode extension. In Layer I and II they indicate
which subbands are in intensity stereo. All other subbands are coded
in stereo. Layer III is not (yet) supported. Possible values are:
.. _v4l2-mpeg-audio-emphasis:
-``V4L2_CID_MPEG_AUDIO_EMPHASIS (enum v4l2_mpeg_audio_emphasis)``
+``V4L2_CID_MPEG_AUDIO_EMPHASIS``
+ (enum)
+
+enum v4l2_mpeg_audio_emphasis -
Audio Emphasis. Possible values are:
.. _v4l2-mpeg-audio-crc:
-``V4L2_CID_MPEG_AUDIO_CRC (enum v4l2_mpeg_audio_crc)``
+``V4L2_CID_MPEG_AUDIO_CRC``
+ (enum)
+
+enum v4l2_mpeg_audio_crc -
CRC method. Possible values are:
.. _v4l2-mpeg-audio-dec-playback:
-``V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK (enum v4l2_mpeg_audio_dec_playback)``
+``V4L2_CID_MPEG_AUDIO_DEC_PLAYBACK``
+ (enum)
+
+enum v4l2_mpeg_audio_dec_playback -
Determines how monolingual audio should be played back. Possible
values are:
+.. tabularcolumns:: |p{9.0cm}|p{8.5cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
.. _v4l2-mpeg-audio-dec-multilingual-playback:
-``V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK (enum v4l2_mpeg_audio_dec_playback)``
+``V4L2_CID_MPEG_AUDIO_DEC_MULTILINGUAL_PLAYBACK``
+ (enum)
+
+enum v4l2_mpeg_audio_dec_playback -
Determines how multilingual audio should be played back.
.. _v4l2-mpeg-video-encoding:
-``V4L2_CID_MPEG_VIDEO_ENCODING (enum v4l2_mpeg_video_encoding)``
+``V4L2_CID_MPEG_VIDEO_ENCODING``
+ (enum)
+
+enum v4l2_mpeg_video_encoding -
MPEG Video encoding method. This control is specific to multiplexed
MPEG streams. Possible values are:
.. _v4l2-mpeg-video-aspect:
-``V4L2_CID_MPEG_VIDEO_ASPECT (enum v4l2_mpeg_video_aspect)``
+``V4L2_CID_MPEG_VIDEO_ASPECT``
+ (enum)
+
+enum v4l2_mpeg_video_aspect -
Video aspect. Possible values are:
.. _v4l2-mpeg-video-bitrate-mode:
-``V4L2_CID_MPEG_VIDEO_BITRATE_MODE (enum v4l2_mpeg_video_bitrate_mode)``
+``V4L2_CID_MPEG_VIDEO_BITRATE_MODE``
+ (enum)
+
+enum v4l2_mpeg_video_bitrate_mode -
Video bitrate mode. Possible values are:
.. _v4l2-mpeg-video-h264-vui-sar-idc:
-``V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC (enum v4l2_mpeg_video_h264_vui_sar_idc)``
+``V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC``
+ (enum)
+
+enum v4l2_mpeg_video_h264_vui_sar_idc -
VUI sample aspect ratio indicator for H.264 encoding. The value is
defined in the table E-1 in the standard. Applicable to the H264
encoder.
.. _v4l2-mpeg-video-h264-level:
-``V4L2_CID_MPEG_VIDEO_H264_LEVEL (enum v4l2_mpeg_video_h264_level)``
+``V4L2_CID_MPEG_VIDEO_H264_LEVEL``
+ (enum)
+
+enum v4l2_mpeg_video_h264_level -
The level information for the H264 video elementary stream.
Applicable to the H264 encoder. Possible values are:
.. _v4l2-mpeg-video-mpeg4-level:
-``V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL (enum v4l2_mpeg_video_mpeg4_level)``
+``V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL``
+ (enum)
+
+enum v4l2_mpeg_video_mpeg4_level -
The level information for the MPEG4 elementary stream. Applicable to
the MPEG4 encoder. Possible values are:
.. _v4l2-mpeg-video-h264-profile:
-``V4L2_CID_MPEG_VIDEO_H264_PROFILE (enum v4l2_mpeg_video_h264_profile)``
+``V4L2_CID_MPEG_VIDEO_H264_PROFILE``
+ (enum)
+
+enum v4l2_mpeg_video_h264_profile -
The profile information for H264. Applicable to the H264 encoder.
Possible values are:
.. _v4l2-mpeg-video-mpeg4-profile:
-``V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE (enum v4l2_mpeg_video_mpeg4_profile)``
+``V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE``
+ (enum)
+
+enum v4l2_mpeg_video_mpeg4_profile -
The profile information for MPEG4. Applicable to the MPEG4 encoder.
Possible values are:
.. _v4l2-mpeg-video-multi-slice-mode:
-``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE (enum v4l2_mpeg_video_multi_slice_mode)``
+``V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE``
+ (enum)
+
+enum v4l2_mpeg_video_multi_slice_mode -
Determines how the encoder should handle division of frame into
slices. Applicable to the encoder. Possible values are:
+.. tabularcolumns:: |p{8.7cm}|p{8.8cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
.. _v4l2-mpeg-video-h264-loop-filter-mode:
-``V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE (enum v4l2_mpeg_video_h264_loop_filter_mode)``
+``V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE``
+ (enum)
+
+enum v4l2_mpeg_video_h264_loop_filter_mode -
Loop filter mode for H264 encoder. Possible values are:
+.. tabularcolumns:: |p{14.0cm}|p{3.5cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- .. row 1
- ``V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED``
.. _v4l2-mpeg-video-h264-entropy-mode:
-``V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE (enum v4l2_mpeg_video_h264_entropy_mode)``
+``V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE``
+ (enum)
+
+enum v4l2_mpeg_video_h264_entropy_mode -
Entropy coding mode for H264 - CABAC/CAVALC. Applicable to the H264
encoder. Possible values are:
.. _v4l2-mpeg-video-header-mode:
-``V4L2_CID_MPEG_VIDEO_HEADER_MODE (enum v4l2_mpeg_video_header_mode)``
+``V4L2_CID_MPEG_VIDEO_HEADER_MODE``
+ (enum)
+
+enum v4l2_mpeg_video_header_mode -
Determines whether the header is returned as the first buffer or is
it returned together with the first frame. Applicable to encoders.
Possible values are:
+.. tabularcolumns:: |p{10.3cm}|p{7.2cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
.. _v4l2-mpeg-video-h264-sei-fp-arrangement-type:
-``V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE (enum v4l2_mpeg_video_h264_sei_fp_arrangement_type)``
+``V4L2_CID_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE``
+ (enum)
+
+enum v4l2_mpeg_video_h264_sei_fp_arrangement_type -
Frame packing arrangement type for H264 SEI. Applicable to the H264
encoder. Possible values are:
-
+.. tabularcolumns:: |p{12cm}|p{5.5cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- .. row 1
- ``V4L2_MPEG_VIDEO_H264_SEI_FP_ARRANGEMENT_TYPE_CHEKERBOARD``
.. _v4l2-mpeg-video-h264-fmo-map-type:
-``V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE (enum v4l2_mpeg_video_h264_fmo_map_type)``
+``V4L2_CID_MPEG_VIDEO_H264_FMO_MAP_TYPE`` ````
+ (enum)
+
+enum v4l2_mpeg_video_h264_fmo_map_type -
When using FMO, the map type divides the image in different scan
patterns of macroblocks. Applicable to the H264 encoder. Possible
values are:
-
+.. tabularcolumns:: |p{12.5cm}|p{5.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- .. row 1
- ``V4L2_MPEG_VIDEO_H264_FMO_MAP_TYPE_INTERLEAVED_SLICES``
.. _v4l2-mpeg-video-h264-fmo-change-direction:
-``V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION (enum v4l2_mpeg_video_h264_fmo_change_dir)``
+``V4L2_CID_MPEG_VIDEO_H264_FMO_CHANGE_DIRECTION``
+ (enum)
+
+enum v4l2_mpeg_video_h264_fmo_change_dir -
Specifies a direction of the slice group change for raster and wipe
maps. Applicable to the H264 encoder. Possible values are:
.. _v4l2-mpeg-video-h264-hierarchical-coding-type:
-``V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE (enum v4l2_mpeg_video_h264_hierarchical_coding_type)``
+``V4L2_CID_MPEG_VIDEO_H264_HIERARCHICAL_CODING_TYPE``
+ (enum)
+
+enum v4l2_mpeg_video_h264_hierarchical_coding_type -
Specifies the hierarchical coding type. Applicable to the H264
encoder. Possible values are:
.. _v4l2-mpeg-mfc51-video-frame-skip-mode:
-``V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE (enum v4l2_mpeg_mfc51_video_frame_skip_mode)``
+``V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE``
+ (enum)
+
+enum v4l2_mpeg_mfc51_video_frame_skip_mode -
Indicates in what conditions the encoder should skip frames. If
encoding a frame would cause the encoded stream to be larger then a
chosen data limit then the frame will be skipped. Possible values
are:
+.. tabularcolumns:: |p{9.0cm}|p{8.5cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- .. row 1
- ``V4L2_MPEG_MFC51_FRAME_SKIP_MODE_DISABLED``
.. _v4l2-mpeg-mfc51-video-force-frame-type:
-``V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE (enum v4l2_mpeg_mfc51_video_force_frame_type)``
+``V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE``
+ (enum)
+
+enum v4l2_mpeg_mfc51_video_force_frame_type -
Force a frame type for the next queued buffer. Applicable to
encoders. Possible values are:
.. _v4l2-mpeg-cx2341x-video-spatial-filter-mode:
-``V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE (enum v4l2_mpeg_cx2341x_video_spatial_filter_mode)``
+``V4L2_CID_MPEG_CX2341X_VIDEO_SPATIAL_FILTER_MODE``
+ (enum)
+
+enum v4l2_mpeg_cx2341x_video_spatial_filter_mode -
Sets the Spatial Filter mode (default ``MANUAL``). Possible values
are:
.. _luma-spatial-filter-type:
-``V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE (enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type)``
+``V4L2_CID_MPEG_CX2341X_VIDEO_LUMA_SPATIAL_FILTER_TYPE``
+ (enum)
+
+enum v4l2_mpeg_cx2341x_video_luma_spatial_filter_type -
Select the algorithm to use for the Luma Spatial Filter (default
``1D_HOR``). Possible values:
+.. tabularcolumns:: |p{14.5cm}|p{3.0cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
.. _chroma-spatial-filter-type:
-``V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE (enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type)``
+``V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_SPATIAL_FILTER_TYPE``
+ (enum)
+
+enum v4l2_mpeg_cx2341x_video_chroma_spatial_filter_type -
Select the algorithm for the Chroma Spatial Filter (default
``1D_HOR``). Possible values are:
.. _v4l2-mpeg-cx2341x-video-temporal-filter-mode:
-``V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE (enum v4l2_mpeg_cx2341x_video_temporal_filter_mode)``
+``V4L2_CID_MPEG_CX2341X_VIDEO_TEMPORAL_FILTER_MODE``
+ (enum)
+
+enum v4l2_mpeg_cx2341x_video_temporal_filter_mode -
Sets the Temporal Filter mode (default ``MANUAL``). Possible values
are:
.. _v4l2-mpeg-cx2341x-video-median-filter-type:
-``V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE (enum v4l2_mpeg_cx2341x_video_median_filter_type)``
+``V4L2_CID_MPEG_CX2341X_VIDEO_MEDIAN_FILTER_TYPE``
+ (enum)
+
+enum v4l2_mpeg_cx2341x_video_median_filter_type -
Median Filter Type (default ``OFF``). Possible values are:
.. _v4l2-vpx-num-partitions:
-``V4L2_CID_MPEG_VIDEO_VPX_NUM_PARTITIONS (enum v4l2_vp8_num_partitions)``
+``V4L2_CID_MPEG_VIDEO_VPX_NUM_PARTITIONS``
+ (enum)
+
+enum v4l2_vp8_num_partitions -
The number of token partitions to use in VP8 encoder. Possible
values are:
.. _v4l2-vpx-num-ref-frames:
-``V4L2_CID_MPEG_VIDEO_VPX_NUM_REF_FRAMES (enum v4l2_vp8_num_ref_frames)``
+``V4L2_CID_MPEG_VIDEO_VPX_NUM_REF_FRAMES``
+ (enum)
+
+enum v4l2_vp8_num_ref_frames -
The number of reference pictures for encoding P frames. Possible
values are:
-
+.. tabularcolumns:: |p{7.9cm}|p{9.6cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- .. row 1
- ``V4L2_CID_MPEG_VIDEO_VPX_1_REF_FRAME``
.. _v4l2-vpx-golden-frame-sel:
-``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_SEL (enum v4l2_vp8_golden_frame_sel)``
+``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_SEL``
+ (enum)
+
+enum v4l2_vp8_golden_frame_sel -
Selects the golden frame for encoding. Possible values are:
+.. raw:: latex
+
+ \begin{adjustbox}{width=\columnwidth}
+.. tabularcolumns:: |p{11.0cm}|p{10.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- .. row 1
- ``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_PREV``
- ``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_USE_REF_PERIOD``
- Use the previous specific frame indicated by
- V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD as a
+ ``V4L2_CID_MPEG_VIDEO_VPX_GOLDEN_FRAME_REF_PERIOD`` as a
golden frame.
+.. raw:: latex
+
+ \end{adjustbox}
``V4L2_CID_MPEG_VIDEO_VPX_MIN_QP (integer)``
.. _v4l2-exposure-auto-type:
-``V4L2_CID_EXPOSURE_AUTO (enum v4l2_exposure_auto_type)``
+``V4L2_CID_EXPOSURE_AUTO``
+ (enum)
+
+enum v4l2_exposure_auto_type -
Enables automatic adjustments of the exposure time and/or iris
aperture. The effect of manual changes of the exposure time or iris
aperture while these features are enabled is undefined, drivers
.. _v4l2-exposure-metering:
-``V4L2_CID_EXPOSURE_METERING (enum v4l2_exposure_metering)``
+``V4L2_CID_EXPOSURE_METERING``
+ (enum)
+
+enum v4l2_exposure_metering -
Determines how the camera measures the amount of light available for
the frame exposure. Possible values are:
-
+.. tabularcolumns:: |p{8.5cm}|p{9.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- .. row 1
- ``V4L2_EXPOSURE_METERING_AVERAGE``
control may stop updates of the ``V4L2_CID_AUTO_FOCUS_STATUS``
control value.
-
+.. tabularcolumns:: |p{6.5cm}|p{11.0cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- .. row 1
- ``V4L2_AUTO_FOCUS_STATUS_IDLE``
.. _v4l2-auto-focus-range:
-``V4L2_CID_AUTO_FOCUS_RANGE (enum v4l2_auto_focus_range)``
- Determines auto focus distance range for which lens may be adjusted.
+``V4L2_CID_AUTO_FOCUS_RANGE``
+ (enum)
+enum v4l2_auto_focus_range -
+ Determines auto focus distance range for which lens may be adjusted.
+.. tabularcolumns:: |p{6.5cm}|p{11.0cm}|
.. flat-table::
:header-rows: 0
.. _v4l2-auto-n-preset-white-balance:
-``V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE (enum v4l2_auto_n_preset_white_balance)``
+``V4L2_CID_AUTO_N_PRESET_WHITE_BALANCE``
+ (enum)
+
+enum v4l2_auto_n_preset_white_balance -
Sets white balance to automatic, manual or a preset. The presets
determine color temperature of the light as a hint to the camera for
white balance adjustments resulting in most accurate color
representation. The following white balance presets are listed in
order of increasing color temperature.
-
+.. tabularcolumns:: |p{7.0 cm}|p{10.5cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- .. row 1
- ``V4L2_WHITE_BALANCE_MANUAL``
.. _v4l2-iso-sensitivity-auto-type:
-``V4L2_CID_ISO_SENSITIVITY_AUTO (enum v4l2_iso_sensitivity_type)``
+``V4L2_CID_ISO_SENSITIVITY_AUTO``
+ (enum)
+
+enum v4l2_iso_sensitivity_type -
Enables or disables automatic ISO sensitivity adjustments.
.. _v4l2-scene-mode:
-``V4L2_CID_SCENE_MODE (enum v4l2_scene_mode)``
+``V4L2_CID_SCENE_MODE``
+ (enum)
+
+enum v4l2_scene_mode -
This control allows to select scene programs as the camera automatic
modes optimized for common shooting scenes. Within these modes the
camera determines best exposure, aperture, focusing, light metering,
to ``V4L2_SCENE_MODE_NONE`` to make sure the other possibly related
controls are accessible. The following scene programs are defined:
-
+.. tabularcolumns:: |p{6.0cm}|p{11.5cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- .. row 1
- ``V4L2_SCENE_MODE_NONE``
Configures pilot tone frequency value. Unit is in Hz. The range and
step are driver-specific.
-``V4L2_CID_TUNE_PREEMPHASIS (enum v4l2_preemphasis)``
+``V4L2_CID_TUNE_PREEMPHASIS``
+ (enum)
+
+enum v4l2_preemphasis -
Configures the pre-emphasis value for broadcasting. A pre-emphasis
filter is applied to the broadcast to accentuate the high audio
frequencies. Depending on the region, a time constant of either 50
``V4L2_CID_FLASH_STROBE_SOURCE (menu)``
Defines the source of the flash LED strobe.
-
+.. tabularcolumns:: |p{7.0cm}|p{10.5cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
-
- .. row 1
- ``V4L2_FLASH_STROBE_SOURCE_SOFTWARE``
an effect is chip dependent. Reading the faults resets the control
and returns the chip to a usable state if possible.
-
+.. tabularcolumns:: |p{8.0cm}|p{9.5cm}|
.. flat-table::
:header-rows: 0
how Cb and Cr components are downsampled after coverting an input
image from RGB to Y'CbCr color space.
-
+.. tabularcolumns:: |p{7.0cm}|p{10.5cm}|
.. flat-table::
:header-rows: 0
EDIDs, then the bit for that pad will be 0. This read-only control
is applicable to VGA, DVI-A/D, HDMI and DisplayPort connectors.
-``V4L2_CID_DV_TX_MODE (enum v4l2_dv_tx_mode)``
+``V4L2_CID_DV_TX_MODE``
+ (enum)
+
+enum v4l2_dv_tx_mode -
HDMI transmitters can transmit in DVI-D mode (just video) or in HDMI
mode (video + audio + auxiliary data). This control selects which
mode to use: V4L2_DV_TX_MODE_DVI_D or V4L2_DV_TX_MODE_HDMI.
This control is applicable to HDMI connectors.
-``V4L2_CID_DV_TX_RGB_RANGE (enum v4l2_dv_rgb_range)``
+``V4L2_CID_DV_TX_RGB_RANGE``
+ (enum)
+
+enum v4l2_dv_rgb_range -
Select the quantization range for RGB output. V4L2_DV_RANGE_AUTO
follows the RGB quantization range specified in the standard for the
video interface (ie. :ref:`cea861` for HDMI).
the number of bits per component. This control is applicable to VGA,
DVI-A/D, HDMI and DisplayPort connectors.
-``V4L2_CID_DV_TX_IT_CONTENT_TYPE (enum v4l2_dv_it_content_type)``
+``V4L2_CID_DV_TX_IT_CONTENT_TYPE``
+ (enum)
+
+enum v4l2_dv_it_content_type -
Configures the IT Content Type of the transmitted video. This
information is sent over HDMI and DisplayPort connectors as part of
the AVI InfoFrame. The term 'IT Content' is used for content that
or an analog source. The enum v4l2_dv_it_content_type defines
the possible content types:
-
+.. tabularcolumns:: |p{7.0cm}|p{10.5cm}|
.. flat-table::
:header-rows: 0
will be 0. This read-only control is applicable to DVI-D, HDMI and
DisplayPort connectors.
-``V4L2_CID_DV_RX_RGB_RANGE (enum v4l2_dv_rgb_range)``
+``V4L2_CID_DV_RX_RGB_RANGE``
+ (enum)
+
+enum v4l2_dv_rgb_range -
Select the quantization range for RGB input. V4L2_DV_RANGE_AUTO
follows the RGB quantization range specified in the standard for the
video interface (ie. :ref:`cea861` for HDMI).
the number of bits per component. This control is applicable to VGA,
DVI-A/D, HDMI and DisplayPort connectors.
-``V4L2_CID_DV_RX_IT_CONTENT_TYPE (enum v4l2_dv_it_content_type)``
+``V4L2_CID_DV_RX_IT_CONTENT_TYPE``
+ (enum)
+
+enum v4l2_dv_it_content_type -
Reads the IT Content Type of the received video. This information is
sent over HDMI and DisplayPort connectors as part of the AVI
InfoFrame. The term 'IT Content' is used for content that originates
broadcasts speech. If the transmitter doesn't make this distinction,
then it will be set.
-``V4L2_CID_TUNE_DEEMPHASIS (enum v4l2_deemphasis)``
+``V4L2_CID_TUNE_DEEMPHASIS``
+ (enum)
+
+enum v4l2_deemphasis -
Configures the de-emphasis value for reception. A de-emphasis filter
is applied to the broadcast to accentuate the high audio
frequencies. Depending on the region, a time constant of either 50
``V4L2_CID_DETECT_MD_MODE (menu)``
Sets the motion detection mode.
-
+.. tabularcolumns:: |p{7.5cm}|p{10.0cm}|
.. flat-table::
:header-rows: 0
enum v4l2_field
===============
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
``MAP_SHARED`` allows applications to share the mapped memory with
other (e. g. child-) processes.
- .. note:: The Linux ``videobuf`` module which is used by some
+ .. note::
+
+ The Linux ``videobuf`` module which is used by some
drivers supports only ``MAP_SHARED``. ``MAP_PRIVATE`` requests
copy-on-write semantics. V4L2 applications should not set the
``MAP_PRIVATE``, ``MAP_DENYWRITE``, ``MAP_EXECUTABLE`` or ``MAP_ANON``
Single-planar format structure
******************************
+.. tabularcolumns:: |p{4.0cm}|p{2.5cm}|p{11.0cm}|
.. _v4l2-pix-format:
+.. cssclass:: longtable
+
.. flat-table:: struct v4l2_pix_format
:header-rows: 0
:stub-columns: 0
describing all planes of that format.
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. _v4l2-plane-pix-format:
.. flat-table:: struct v4l2_plane_pix_format
applications.
+.. tabularcolumns:: |p{4.4cm}|p{5.6cm}|p{7.5cm}|
.. _v4l2-pix-format-mplane:
or struct :ref:`v4l2_pix_format_mplane <v4l2-pix-format-mplane>`
needs to be filled in.
-.. note:: The default R'G'B' quantization is full range for all
+.. note::
+
+ The default R'G'B' quantization is full range for all
colorspaces except for BT.2020 which uses limited range R'G'B'
quantization.
+.. tabularcolumns:: |p{6.0cm}|p{11.5cm}|
.. _v4l2-colorspace:
.. _v4l2-ycbcr-encoding:
+.. tabularcolumns:: |p{6.5cm}|p{11.0cm}|
+
.. flat-table:: V4L2 Y'CbCr Encodings
:header-rows: 1
:stub-columns: 0
.. _v4l2-quantization:
+.. tabularcolumns:: |p{6.5cm}|p{11.0cm}|
+
.. flat-table:: V4L2 Quantization Methods
:header-rows: 1
:stub-columns: 0
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: SMPTE 170M Chromaticities
:header-rows: 1
:stub-columns: 0
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: Rec. 709 Chromaticities
:header-rows: 1
:stub-columns: 0
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: sRGB Chromaticities
:header-rows: 1
:stub-columns: 0
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: Adobe RGB Chromaticities
:header-rows: 1
:stub-columns: 0
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: BT.2020 Chromaticities
:header-rows: 1
:stub-columns: 0
is ``V4L2_XFER_FUNC_DCI_P3``. The default Y'CbCr encoding is
``V4L2_YCBCR_ENC_709``.
-.. note:: Note that this colorspace does not specify a
+.. note::
+
+ Note that this colorspace does not specify a
Y'CbCr encoding since it is not meant to be encoded to Y'CbCr. So this
default Y'CbCr encoding was picked because it is the HDTV encoding. The
default Y'CbCr quantization is limited range. The chromaticities of the
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: DCI-P3 Chromaticities
:header-rows: 1
:stub-columns: 0
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: SMPTE 240M Chromaticities
:header-rows: 1
:stub-columns: 0
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: NTSC 1953 Chromaticities
:header-rows: 1
:stub-columns: 0
- 0.316
-.. note:: This colorspace uses Illuminant C instead of D65 as the white
+.. note::
+
+ This colorspace uses Illuminant C instead of D65 as the white
reference. To correctly convert an image in this colorspace to another
that uses D65 you need to apply a chromatic adaptation algorithm such as
the Bradford method.
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: EBU Tech. 3213 Chromaticities
:header-rows: 1
:stub-columns: 0
with full range quantization where Y' is scaled to [0…255] and Cb/Cr are
scaled to [-128…128] and then clipped to [-128…127].
-.. note:: The JPEG standard does not actually store colorspace
+.. note::
+
+ The JPEG standard does not actually store colorspace
information. So if something other than sRGB is used, then the driver
will have to set that information explicitly. Effectively
``V4L2_COLORSPACE_JPEG`` can be considered to be an abbreviation for
.. _compressed-formats:
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. flat-table:: Compressed Image Formats
:header-rows: 1
:stub-columns: 0
V4L2_PIX_FMT_GREY ('GREY')
**************************
-*man V4L2_PIX_FMT_GREY(2)*
-
Grey-scale image
**Byte Order.**
Each cell is one byte.
-
-
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1
- .. row 1
V4L2_PIX_FMT_M420 ('M420')
**************************
-*man V4L2_PIX_FMT_M420(2)*
-
Format with ½ horizontal and vertical chroma resolution, also known as
YUV 4:2:0. Hybrid plane line-interleaved layout.
Each cell is one byte.
-
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1
- .. row 1
V4L2_PIX_FMT_NV12 ('NV12'), V4L2_PIX_FMT_NV21 ('NV21')
******************************************************
-*man V4L2_PIX_FMT_NV12(2)*
V4L2_PIX_FMT_NV21
Formats with ½ horizontal and vertical chroma resolution, also known as
Each cell is one byte.
-
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1
-
- .. row 1
V4L2_PIX_FMT_NV12M ('NM12'), V4L2_PIX_FMT_NV21M ('NM21'), V4L2_PIX_FMT_NV12MT_16X16
***********************************************************************************
-*man V4L2_PIX_FMT_NV12M(2)*
V4L2_PIX_FMT_NV21M
V4L2_PIX_FMT_NV12MT_16X16
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1
-
- .. row 1
V4L2_PIX_FMT_NV12MT ('TM12')
****************************
-*man V4L2_PIX_FMT_NV12MT(2)*
-
Formats with ½ horizontal and vertical chroma resolution. This format
has two planes - one for luminance and one for chrominance. Chroma
samples are interleaved. The difference to ``V4L2_PIX_FMT_NV12`` is the
.. _nv12mt:
.. figure:: pixfmt-nv12mt_files/nv12mt.*
- :alt: nv12mt.gif
+ :alt: nv12mt.png
:align: center
V4L2_PIX_FMT_NV12MT macroblock Z shape memory layout
.. _nv12mt_ex:
.. figure:: pixfmt-nv12mt_files/nv12mt_example.*
- :alt: nv12mt_example.gif
+ :alt: nv12mt_example.png
:align: center
Example V4L2_PIX_FMT_NV12MT memory layout of macroblocks
V4L2_PIX_FMT_NV16 ('NV16'), V4L2_PIX_FMT_NV61 ('NV61')
******************************************************
-*man V4L2_PIX_FMT_NV16(2)*
-
V4L2_PIX_FMT_NV61
Formats with ½ horizontal chroma resolution, also known as YUV 4:2:2.
One luminance and one chrominance plane with alternating chroma samples
Each cell is one byte.
-
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1
-
- .. row 1
V4L2_PIX_FMT_NV16M ('NM16'), V4L2_PIX_FMT_NV61M ('NM61')
********************************************************
-*man V4L2_PIX_FMT_NV16M(2)*
-
V4L2_PIX_FMT_NV61M
Variation of ``V4L2_PIX_FMT_NV16`` and ``V4L2_PIX_FMT_NV61`` with planes
non contiguous in memory.
Each cell is one byte.
-
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1
-
- .. row 1
V4L2_PIX_FMT_NV24 ('NV24'), V4L2_PIX_FMT_NV42 ('NV42')
******************************************************
-*man V4L2_PIX_FMT_NV24(2)*
-
V4L2_PIX_FMT_NV42
Formats with full horizontal and vertical chroma resolutions, also known
as YUV 4:4:4. One luminance and one chrominance plane with alternating
Each cell is one byte.
-
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1 1 1 1 1
-
- .. row 1
Packed RGB formats
******************
-*man Packed RGB formats(2)*
-
-Packed RGB formats
-
-
Description
===========
These are all packed-pixel formats, meaning all the data for a pixel lie
next to each other in memory.
+.. raw:: latex
+
+ \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{4.5cm}|p{3.3cm}|p{0.7cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.2cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.2cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.2cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{1.7cm}|
.. _rgb-formats:
-
- :cspan:`7` Byte 0 in memory
+ -
- :cspan:`7` Byte 1
+ -
- :cspan:`7` Byte 2
+ -
- :cspan:`7` Byte 3
- .. row 2
- b\ :sub:`0`
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- r\ :sub:`3`
- b\ :sub:`0`
-
- - -
+ -
- r\ :sub:`4`
- 'XR15' | (1 << 31)
-
- - -
+ -
- r\ :sub:`4`
- r\ :sub:`0`
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- .. _V4L2-PIX-FMT-ABGR32:
- r\ :sub:`0`
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- .. _V4L2-PIX-FMT-ARGB32:
- 'BX24'
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
-
- r\ :sub:`7`
- b\ :sub:`0`
+.. raw:: latex
+
+ \end{adjustbox}\newline\newline
-Bit 7 is the most significant bit.
+.. note:: Bit 7 is the most significant bit.
The usage and value of the alpha bits (a) in the ARGB and ABGR formats
(collectively referred to as alpha formats) depend on the device type
Each cell is one byte.
+.. raw:: latex
-.. flat-table::
+ \newline\newline\begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{4.1cm}|p{1.1cm}|p{1.1cm}|p{1.1cm}|p{1.1cm}|p{1.1cm}|p{1.1cm}|p{1.1cm}|p{1.1cm}|p{1.1cm}|p{1.1cm}|p{1.1cm}|p{1.3cm}|
+
+.. flat-table:: RGB byte order
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1 1 1 1 1 1 1 1 1
+ :widths: 11 3 3 3 3 3 3 3 3 3 3 3 3
- .. row 1
- R\ :sub:`33`
+.. raw:: latex
+
+ \end{adjustbox}\newline\newline
Formats defined in :ref:`rgb-formats-deprecated` are deprecated and
must not be used by new drivers. They are documented here for reference.
either the corresponding ARGB or XRGB format, depending on the driver.
+.. raw:: latex
+
+ \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{4.2cm}|p{1.0cm}|p{0.7cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.2cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.2cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.2cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{1.7cm}|
+
.. _rgb-formats-deprecated:
.. flat-table:: Deprecated Packed RGB Image Formats
-
- :cspan:`7` Byte 0 in memory
+ -
- :cspan:`7` Byte 1
+ -
- :cspan:`7` Byte 2
+ -
- :cspan:`7` Byte 3
- .. row 2
- b\ :sub:`0`
+.. raw:: latex
+
+ \end{adjustbox}\newline\newline
A test utility to determine which RGB formats a driver actually supports
is available from the LinuxTV v4l-dvb repository. See
Packed YUV formats
******************
-*man Packed YUV formats(2)*
-
-Packed YUV formats
-
-
Description
===========
Similar to the packed RGB formats these formats store the Y, Cb and Cr
component of each pixel in one 16 or 32 bit word.
+.. raw:: latex
+
+ \newline\newline\begin{adjustbox}{width=\columnwidth}
+.. _yuv-formats:
+
+.. tabularcolumns:: |p{4.5cm}|p{3.3cm}|p{0.7cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.2cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.2cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.2cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{0.4cm}|p{1.7cm}|
.. flat-table:: Packed YUV Image Formats
:header-rows: 2
- Cr\ :sub:`0`
+.. raw:: latex
+
+ \end{adjustbox}\newline\newline
+
+.. note::
+
+ #) Bit 7 is the most significant bit;
-Bit 7 is the most significant bit. The value of a = alpha bits is
-undefined when reading from the driver, ignored when writing to the
-driver, except when alpha blending has been negotiated for a
-:ref:`Video Overlay <overlay>` or :ref:`Video Output Overlay <osd>`.
+ #) The value of a = alpha bits is undefined when reading from the driver,
+ ignored when writing to the driver, except when alpha blending has
+ been negotiated for a :ref:`Video Overlay <overlay>` or
+ :ref:`Video Output Overlay <osd>`.
please make a proposal on the linux-media mailing list.
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _reserved-formats:
.. flat-table:: Reserved Image Formats
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _format-flags:
.. flat-table:: Format Flags
V4L2_PIX_FMT_SBGGR16 ('BYR2')
*****************************
-*man V4L2_PIX_FMT_SBGGR16(2)*
-
Bayer RGB format
has a depth of 16 bits. The least significant byte is stored at lower
memory addresses (little-endian).
-..note:: The actual sampling precision may be lower than 16 bits,
+.. note::
+
+ The actual sampling precision may be lower than 16 bits,
for example 10 bits per pixel with values in tange 0 to 1023.
**Byte Order.**
Each cell is one byte.
-
-
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1 1 1 1 1
-
- .. row 1
V4L2_PIX_FMT_SBGGR8 ('BA81')
****************************
-*man V4L2_PIX_FMT_SBGGR8(2)*
-
Bayer RGB format
Each cell is one byte.
-
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1
- .. row 1
V4L2_SDR_FMT_CS8 ('CS08')
*************************
-*man V4L2_SDR_FMT_CS8(2)*
-
Complex signed 8-bit IQ sample
**Byte Order.**
Each cell is one byte.
-
-
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1
- .. row 1
V4L2_SDR_FMT_CS14LE ('CS14')
****************************
-*man V4L2_SDR_FMT_CS14LE(2)*
-
Complex signed 14-bit little endian IQ sample
Each cell is one byte.
-
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1
-
- .. row 1
V4L2_SDR_FMT_CU8 ('CU08')
*************************
-*man V4L2_SDR_FMT_CU8(2)*
-
Complex unsigned 8-bit IQ sample
**Byte Order.**
Each cell is one byte.
-
-
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1
-
- .. row 1
V4L2_SDR_FMT_CU16LE ('CU16')
****************************
-*man V4L2_SDR_FMT_CU16LE(2)*
Complex unsigned 16-bit little endian IQ sample
Each cell is one byte.
-
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1
-
- .. row 1
V4L2_SDR_FMT_RU12LE ('RU12')
****************************
-*man V4L2_SDR_FMT_RU12LE(2)*
Real unsigned 12-bit little endian sample
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1
- .. row 1
V4L2_PIX_FMT_SGBRG8 ('GBRG')
****************************
-*man V4L2_PIX_FMT_SGBRG8(2)*
Bayer RGB format
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1
- .. row 1
V4L2_PIX_FMT_SGRBG8 ('GRBG')
****************************
-*man V4L2_PIX_FMT_SGRBG8(2)*
Bayer RGB format
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1
- .. row 1
V4L2_PIX_FMT_SRGGB10 ('RG10'), V4L2_PIX_FMT_SGRBG10 ('BA10'), V4L2_PIX_FMT_SGBRG10 ('GB10'), V4L2_PIX_FMT_SBGGR10 ('BG10'),
***************************************************************************************************************************
-*man V4L2_PIX_FMT_SRGGB10(2)*
V4L2_PIX_FMT_SGRBG10
V4L2_PIX_FMT_SGBRG10
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1 1 1 1 1
- .. row 1
V4L2_PIX_FMT_SBGGR10ALAW8 ('aBA8'), V4L2_PIX_FMT_SGBRG10ALAW8 ('aGA8'), V4L2_PIX_FMT_SGRBG10ALAW8 ('agA8'), V4L2_PIX_FMT_SRGGB10ALAW8 ('aRA8'),
***********************************************************************************************************************************************
-*man V4L2_PIX_FMT_SBGGR10ALAW8(2)*
-
V4L2_PIX_FMT_SGBRG10ALAW8
V4L2_PIX_FMT_SGRBG10ALAW8
V4L2_PIX_FMT_SRGGB10ALAW8
V4L2_PIX_FMT_SRGGB10P ('pRAA'), V4L2_PIX_FMT_SGRBG10P ('pgAA'), V4L2_PIX_FMT_SGBRG10P ('pGAA'), V4L2_PIX_FMT_SBGGR10P ('pBAA'),
*******************************************************************************************************************************
-*man V4L2_PIX_FMT_SRGGB10P(2)*
V4L2_PIX_FMT_SGRBG10P
V4L2_PIX_FMT_SGBRG10P
**Byte Order.**
Each cell is one byte.
+.. raw:: latex
+ \newline\newline\begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{2.0cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{1.3cm}|p{10.9cm}|
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1 1
-
+ :widths: 12 8 8 8 8 68
- .. row 1
- G\ :sub:`30low`\ (bits 7--6) R\ :sub:`31low`\ (bits 5--4)
G\ :sub:`32low`\ (bits 3--2) R\ :sub:`33low`\ (bits 1--0)
+
+.. raw:: latex
+
+ \end{adjustbox}\newline\newline
V4L2_PIX_FMT_SRGGB12 ('RG12'), V4L2_PIX_FMT_SGRBG12 ('BA12'), V4L2_PIX_FMT_SGBRG12 ('GB12'), V4L2_PIX_FMT_SBGGR12 ('BG12'),
***************************************************************************************************************************
-*man V4L2_PIX_FMT_SRGGB12(2)*
V4L2_PIX_FMT_SGRBG12
V4L2_PIX_FMT_SGBRG12
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1 1 1 1 1
- .. row 1
V4L2_PIX_FMT_SRGGB8 ('RGGB')
****************************
-*man V4L2_PIX_FMT_SRGGB8(2)*
Bayer RGB format
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1
- .. row 1
V4L2_PIX_FMT_UV8 ('UV8')
************************
-*man V4L2_PIX_FMT_UV8(2)*
UV plane interleaved
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1
- .. row 1
V4L2_PIX_FMT_UYVY ('UYVY')
**************************
-*man V4L2_PIX_FMT_UYVY(2)*
Variation of ``V4L2_PIX_FMT_YUYV`` with different order of samples in
memory
**Byte Order.**
Each cell is one byte.
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1 1 1 1 1
- .. row 1
V4L2_PIX_FMT_VYUY ('VYUY')
**************************
-*man V4L2_PIX_FMT_VYUY(2)*
Variation of ``V4L2_PIX_FMT_YUYV`` with different order of samples in
memory
**Byte Order.**
Each cell is one byte.
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1 1 1 1 1
- .. row 1
V4L2_PIX_FMT_Y10 ('Y10 ')
*************************
-*man V4L2_PIX_FMT_Y10(2)*
Grey-scale image
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1 1 1 1 1
- .. row 1
V4L2_PIX_FMT_Y10BPACK ('Y10B')
******************************
-*man V4L2_PIX_FMT_Y10BPACK(2)*
-
Grey-scale image as a bit-packed array
pixels cross the byte boundary and have a ratio of 5 bytes for each 4
pixels.
-
-
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1
-
- .. row 1
V4L2_PIX_FMT_Y12 ('Y12 ')
*************************
-*man V4L2_PIX_FMT_Y12(2)*
Grey-scale image
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1 1 1 1 1
- .. row 1
V4L2_PIX_FMT_Y12I ('Y12I')
**************************
-*man V4L2_PIX_FMT_Y12I(2)*
-
Interleaved grey-scale image, e.g. from a stereo-pair
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1
- .. row 1
V4L2_PIX_FMT_Y16_BE ('Y16 ' | (1 << 31))
****************************************
-*man V4L2_PIX_FMT_Y16_BE(2)*
Grey-scale image
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:: Tthe actual sampling precision may be lower than 16 bits, for
+.. note::
+
+ The actual sampling precision may be lower than 16 bits, for
example 10 bits per pixel with values in range 0 to 1023.
**Byte Order.**
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1 1 1 1 1
- .. row 1
V4L2_PIX_FMT_Y16 ('Y16 ')
*************************
-*man V4L2_PIX_FMT_Y16(2)*
Grey-scale image
This is a grey-scale image with a depth of 16 bits per pixel. The least
significant byte is stored at lower memory addresses (little-endian).
-.. note:: The actual sampling precision may be lower than 16 bits, for
+.. note::
+
+ The actual sampling precision may be lower than 16 bits, for
example 10 bits per pixel with values in range 0 to 1023.
**Byte Order.**
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1 1 1 1 1
- .. row 1
V4L2_PIX_FMT_Y41P ('Y41P')
**************************
-*man V4L2_PIX_FMT_Y41P(2)*
Format with ¼ horizontal chroma resolution, also known as YUV 4:1:1
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1 1 1 1 1 1 1 1 1
- .. row 1
V4L2_PIX_FMT_Y8I ('Y8I ')
*************************
-*man V4L2_PIX_FMT_Y8I(2)*
Interleaved grey-scale image, e.g. from a stereo-pair
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1 1 1 1 1
- .. row 1
V4L2_PIX_FMT_YVU410 ('YVU9'), V4L2_PIX_FMT_YUV410 ('YUV9')
**********************************************************
-*man V4L2_PIX_FMT_YVU410(2)*
V4L2_PIX_FMT_YUV410
Planar formats with ¼ horizontal and vertical chroma resolution, also
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1
- .. row 1
V4L2_PIX_FMT_YUV411P ('411P')
*****************************
-*man V4L2_PIX_FMT_YUV411P(2)*
Format with ¼ horizontal chroma resolution, also known as YUV 4:1:1.
Planar layout as opposed to ``V4L2_PIX_FMT_Y41P``
Each cell is one byte.
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1
- .. row 1
V4L2_PIX_FMT_YVU420 ('YV12'), V4L2_PIX_FMT_YUV420 ('YU12')
**********************************************************
-*man V4L2_PIX_FMT_YVU420(2)*
V4L2_PIX_FMT_YUV420
Planar formats with ½ horizontal and vertical chroma resolution, also
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1
- .. row 1
V4L2_PIX_FMT_YUV420M ('YM12'), V4L2_PIX_FMT_YVU420M ('YM21')
************************************************************
-*man V4L2_PIX_FMT_YUV420M(2)*
V4L2_PIX_FMT_YVU420M
Variation of ``V4L2_PIX_FMT_YUV420`` and ``V4L2_PIX_FMT_YVU420`` with
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1
- .. row 1
V4L2_PIX_FMT_YUV422M ('YM16'), V4L2_PIX_FMT_YVU422M ('YM61')
************************************************************
-*man V4L2_PIX_FMT_YUV422M(2)*
V4L2_PIX_FMT_YVU422M
Planar formats with ½ horizontal resolution, also known as YUV and YVU
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1
- .. row 1
V4L2_PIX_FMT_YUV422P ('422P')
*****************************
-*man V4L2_PIX_FMT_YUV422P(2)*
Format with ½ horizontal chroma resolution, also known as YUV 4:2:2.
Planar layout as opposed to ``V4L2_PIX_FMT_YUYV``
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1
- .. row 1
V4L2_PIX_FMT_YUV444M ('YM24'), V4L2_PIX_FMT_YVU444M ('YM42')
************************************************************
-*man V4L2_PIX_FMT_YUV444M(2)*
V4L2_PIX_FMT_YVU444M
Planar formats with full horizontal resolution, also known as YUV and
**Byte Order.**
Each cell is one byte.
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1
- .. row 1
V4L2_PIX_FMT_YUYV ('YUYV')
**************************
-*man V4L2_PIX_FMT_YUYV(2)*
Packed format with ½ horizontal chroma resolution, also known as YUV
4:2:2
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1 1 1 1 1
- .. row 1
V4L2_PIX_FMT_YVYU ('YVYU')
**************************
-*man V4L2_PIX_FMT_YVYU(2)*
Variation of ``V4L2_PIX_FMT_YUYV`` with different order of samples in
memory
**Byte Order.**
Each cell is one byte.
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1 1 1 1 1
- .. row 1
V4L2_PIX_FMT_Z16 ('Z16 ')
*************************
-*man V4L2_PIX_FMT_Z16(2)*
16-bit depth data with distance values at each pixel
+
.. flat-table::
:header-rows: 0
:stub-columns: 0
- :widths: 2 1 1 1 1 1 1 1 1
- .. row 1
*received* standard can be sensed with the
:ref:`VIDIOC_QUERYSTD` ioctl.
-..note:: The parameter of all these ioctls is a pointer to a
+.. note::
+
+ The parameter of all these ioctls is a pointer to a
:ref:`v4l2_std_id <v4l2-std-id>` type (a standard set), *not* an
index into the standard enumeration. Drivers must implement all video
standard ioctls when the device has one or more video inputs or outputs.
Media Bus Formats
=================
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
.. _v4l2-mbus-framefmt:
The following tables list existing packed RGB formats.
+.. HACK: ideally, we would be using adjustbox here. However, Sphinx
+.. is a very bad behaviored guy: if the table has more than 30 cols,
+.. it switches to long table, and there's no way to override it.
+
+
+.. tabularcolumns:: |p{4.0cm}|p{0.7cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|
.. _v4l2-mbus-pixelcode-rgb:
+.. raw:: latex
+
+ \begingroup
+ \tiny
+ \setlength{\tabcolsep}{2pt}
+
.. flat-table:: RGB formats
:header-rows: 2
:stub-columns: 0
-
+ :widths: 36 7 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
- .. row 1
- 0x1016
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- r\ :sub:`3`
- 0x1001
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- 0
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- g\ :sub:`3`
- 0x1002
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- g\ :sub:`3`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- 0
- 0x1003
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- 0
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- g\ :sub:`2`
- 0x1004
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- g\ :sub:`2`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- 0
- 0x1017
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- r\ :sub:`4`
- 0x1005
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- b\ :sub:`4`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- g\ :sub:`2`
- 0x1006
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- g\ :sub:`2`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- b\ :sub:`4`
- 0x1007
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- r\ :sub:`4`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- g\ :sub:`2`
- 0x1008
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- g\ :sub:`2`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- r\ :sub:`4`
- 0x1009
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- r\ :sub:`5`
- 0x100e
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- r\ :sub:`7`
- 0x1015
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- 0
- 0x1013
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- b\ :sub:`7`
- 0x1014
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- g\ :sub:`7`
- 0x100a
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- r\ :sub:`7`
- 0x100b
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- r\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- g\ :sub:`3`
- 0x100c
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- g\ :sub:`3`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- r\ :sub:`7`
- b\ :sub:`0`
+.. raw:: latex
+
+ \endgroup
On LVDS buses, usually each sample is transferred serialized in seven
time slots per pixel clock, on three (18-bit) or four (24-bit)
JEIDA defined bit mapping will be named
``MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA``, for example.
+.. raw:: latex
+
+ \begin{adjustbox}{width=\columnwidth}
.. _v4l2-mbus-pixelcode-rgb-lvds:
- 0
-
- - -
+ -
- d
- 1
-
- - -
+ -
- d
- 2
-
- - -
+ -
- d
- 3
-
- - -
+ -
- b\ :sub:`5`
- 4
-
- - -
+ -
- b\ :sub:`4`
- 5
-
- - -
+ -
- b\ :sub:`3`
- 6
-
- - -
+ -
- b\ :sub:`2`
- r\ :sub:`2`
+.. raw:: latex
+
+ \end{adjustbox}\newline\newline
Bayer Formats
organization is given as an example for the first pixel only.
+.. raw:: latex
+
+ \newline\newline\begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{7.6cm}|p{1.6cm}|p{0.7cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|
+
.. _v4l2-mbus-pixelcode-bayer:
+.. cssclass: longtable
+
.. flat-table:: Bayer Formats
:header-rows: 2
:stub-columns: 0
- 0x3001
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- b\ :sub:`7`
- 0x3013
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- g\ :sub:`7`
- 0x3002
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- g\ :sub:`7`
- 0x3014
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- r\ :sub:`7`
- 0x3015
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- b\ :sub:`7`
- 0x3016
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- g\ :sub:`7`
- 0x3017
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- g\ :sub:`7`
- 0x3018
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- r\ :sub:`7`
- 0x300b
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- b\ :sub:`7`
- 0x300c
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- g\ :sub:`7`
- 0x3009
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- g\ :sub:`7`
- 0x300d
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- r\ :sub:`7`
- 0x3003
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- 0
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- b\ :sub:`7`
- 0x3004
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- b\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- 0
- 0x3005
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- b\ :sub:`9`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- b\ :sub:`1`
- 0x3006
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- b\ :sub:`1`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- b\ :sub:`9`
- 0x3007
-
- - -
+ -
- - -
+ -
- b\ :sub:`9`
- 0x300e
-
- - -
+ -
- - -
+ -
- g\ :sub:`9`
- 0x300a
-
- - -
+ -
- - -
+ -
- g\ :sub:`9`
- 0x300f
-
- - -
+ -
- - -
+ -
- r\ :sub:`9`
- r\ :sub:`0`
+.. raw:: latex
+
+ \end{adjustbox}\newline\newline
Packed YUV Formats
- a\ :sub:`x` for alpha component bit number x
-- - for non-available bits (for positions higher than the bus width)
+- for non-available bits (for positions higher than the bus width)
- d for dummy bits
+.. tabularcolumns:: |p{4.0cm}|p{0.7cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|p{0.22cm}|
+
.. _v4l2-mbus-pixelcode-yuv8:
+
+.. HACK: ideally, we would be using adjustbox here. However, this
+.. will never work for this table, as, even with tiny font, it is
+.. to big for a single page. So, we need to manually adjust the
+.. size.
+
+.. raw:: latex
+
+ \begingroup
+ \tiny
+ \setlength{\tabcolsep}{2pt}
+
.. flat-table:: YUV Formats
:header-rows: 2
:stub-columns: 0
-
+ :widths: 36 7 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
- .. row 1
- 0x2001
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
- 0x2015
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`7`
- 0x2002
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
- 0x2003
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
- 0x2004
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`7`
- 0x2005
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`7`
- 0x2006
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
- 0x2007
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
- 0x2008
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`7`
- 0x2009
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`7`
- 0x200a
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`9`
- 0x2018
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`9`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`9`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`9`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`9`
- 0x2019
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`9`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`9`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`9`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`9`
- 0x200b
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`9`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`9`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`9`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`9`
- 0x200c
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`9`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`9`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`9`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`9`
- 0x2013
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`11`
- 0x201c
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`11`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`11`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`11`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`11`
- 0x201d
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`11`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`11`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`11`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`11`
- 0x201e
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`11`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`11`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`11`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`11`
- 0x201f
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`11`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`11`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`11`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`11`
- 0x200f
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`7`
- 0x2010
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`7`
- 0x2011
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
- 0x2012
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
- 0x2014
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
- 0x201a
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`9`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`9`
- 0x201b
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`9`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`9`
- 0x200d
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`9`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`9`
- 0x200e
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`9`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`9`
- 0x201a
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`7`
- 0x2025
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`7`
- 0x2020
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`11`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`11`
- 0x2021
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- v\ :sub:`11`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- u\ :sub:`11`
- 0x2022
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`11`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`11`
- 0x2023
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`11`
-
-
-
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- - -
+ -
- y\ :sub:`11`
- 0x2016
-
- - -
+ -
- - -
+ -
- y\ :sub:`9`
- v\ :sub:`0`
+.. raw:: latex
+
+ \endgroup
HSV/HSL Formats
^^^^^^^^^^^^^^^
The following table lists existing HSV/HSL formats.
+.. raw:: latex
+
+ \newline\newline\begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{6.2cm}|p{1.6cm}|p{0.7cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|p{0.5cm}|
.. _v4l2-mbus-pixelcode-hsv:
.. flat-table:: HSV/HSL formats
:header-rows: 2
:stub-columns: 0
-
+ :widths: 28 7 3 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2 2
- .. row 1
- v\ :sub:`0`
+.. raw:: latex
+
+ \end{adjustbox}\newline\newline
JPEG Compressed Formats
.. _v4l2-mbus-pixelcode-jpeg:
+.. tabularcolumns:: |p{5.6cm}|p{1.2cm}|p{10.7cm}|
+
.. flat-table:: JPEG Formats
:header-rows: 1
:stub-columns: 0
.. _v4l2-mbus-pixelcode-vendor-specific:
+.. tabularcolumns:: |p{6.6cm}|p{1.2cm}|p{9.7cm}|
+
.. flat-table:: Vendor and device specific formats
:header-rows: 1
:stub-columns: 0
also contains signal status information applicable when the tuner of the
current video or radio input is queried.
-.. note:: :ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` does not switch the
+.. note::
+
+ :ref:`VIDIOC_S_TUNER <VIDIOC_G_TUNER>` does not switch the
current tuner, when there is more than one at all. The tuner is solely
determined by the current video input. Drivers must support both ioctls
and set the ``V4L2_CAP_TUNER`` flag in the struct :ref:`v4l2_capability
:ref:`VIDIOC_STREAMON <VIDIOC_STREAMON>` and
:ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` ioctl.
-.. note:: ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` removes all buffers from
+.. note::
+
+ ref:`VIDIOC_STREAMOFF <VIDIOC_STREAMON>` removes all buffers from
both queues and unlocks all buffers as a side effect. Since there is no
notion of doing anything "now" on a multitasking system, if an
application needs to synchronize with another event it should examine
Selection flags
***************
+.. tabularcolumns:: |p{5.2cm}|p{2.0cm}|p{6.5cm}|p{1.2cm}|p{1.6cm}|
.. _v4l2-selection-flags-table:
.. _v4l2-selection-targets-table:
+.. tabularcolumns:: |p{5.8cm}|p{1.4cm}|p{6.5cm}|p{1.2cm}|p{1.6cm}|
+
.. flat-table:: Selection target definitions
:header-rows: 1
:stub-columns: 0
.. _v4l2-create-buffers:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_create_buffers
:header-rows: 0
:stub-columns: 0
.. _v4l2-cropcap:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_cropcap
:header-rows: 0
:stub-columns: 0
.. _v4l2-rect-crop:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_rect
:header-rows: 0
:stub-columns: 0
instructions.
+.. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{3.5cm}|p{7.0cm}|
+
.. _name-v4l2-dbg-match:
.. flat-table:: struct v4l2_dbg_match
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. _v4l2-dbg-chip-info:
.. flat-table:: struct v4l2_dbg_chip_info
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _name-chip-match-types:
.. flat-table:: Chip Match Types
instructions.
+.. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{3.5cm}|p{7.0cm}|
+
.. _v4l2-dbg-match:
.. flat-table:: struct v4l2_dbg_match
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _chip-match-types:
.. flat-table:: Chip Match Types
introduced in Linux 3.3.
+.. tabularcolumns:: |p{1.1cm}|p{2.4cm}|p{1.2cm}|p{1.6cm}|p{10.6cm}|
+
.. _v4l2-decoder-cmd:
+.. cssclass:: longtable
+
.. flat-table:: struct v4l2_decoder_cmd
:header-rows: 0
:stub-columns: 0
- :widths: 1 1 2 1 1
+ :widths: 11 24 12 16 106
- .. row 1
+.. tabularcolumns:: |p{5.6cm}|p{0.6cm}|p{11.3cm}|
+
.. _decoder-cmds:
.. flat-table:: Decoder Commands
:header-rows: 0
:stub-columns: 0
- :widths: 3 1 4
+ :widths: 56 6 113
- .. row 1
call.
+.. tabularcolumns:: |p{3.0cm}|p{4.3cm}|p{2.5cm}|p{7.7cm}|
+
.. _v4l2-event:
+.. cssclass: longtable
+
.. flat-table:: struct v4l2_event
:header-rows: 0
:stub-columns: 0
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
+.. cssclass:: longtable
+
.. _event-type:
.. flat-table:: Event Types
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. _v4l2-event-vsync:
.. flat-table:: struct v4l2_event_vsync
+.. tabularcolumns:: |p{3.5cm}|p{3.0cm}|p{1.8cm}|p{8.5cm}|
+
.. _v4l2-event-ctrl:
.. flat-table:: struct v4l2_event_ctrl
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. _v4l2-event-frame-sync:
.. flat-table:: struct v4l2_event_frame_sync
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. _v4l2-event-src-change:
.. flat-table:: struct v4l2_event_src_change
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. _v4l2-event-motion-det:
.. flat-table:: struct v4l2_event_motion_det
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _ctrl-changes-flags:
.. flat-table:: Control Changes
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _src-changes-flags:
.. flat-table:: Source Changes
``VIDIOC_DV_TIMINGS_CAP`` ioctl on a video node and the driver will fill
in the structure.
-.. note:: Drivers may return different values after
+.. note::
+
+ Drivers may return different values after
switching the video input or output.
When implemented by the driver DV capabilities of subdevices can be
that doesn't support them will return an ``EINVAL`` error code.
+.. tabularcolumns:: |p{1.2cm}|p{3.0cm}|p{13.3cm}|
+
.. _v4l2-bt-timings-cap:
.. flat-table:: struct v4l2_bt_timings_cap
- ``reserved``\ [16]
- - Reserved for future extensions. Drivers must set the array to
- zero.
+ - Reserved for future extensions.
+ Drivers must set the array to zero.
+
+.. tabularcolumns:: |p{1.0cm}|p{3.5cm}|p{3.5cm}|p{9.5cm}|
.. _v4l2-dv-timings-cap:
- ``reserved``\ [2]
- - Reserved for future extensions. Drivers and applications must set
- the array to zero.
+ - Reserved for future extensions.
+
+ Drivers and applications must set the array to zero.
- .. row 4
-
-
+.. tabularcolumns:: |p{7.0cm}|p{10.5cm}|
.. _dv-bt-cap-capabilities:
introduced in Linux 2.6.21.
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. _v4l2-encoder-cmd:
.. flat-table:: struct v4l2_encoder_cmd
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _encoder-cmds:
.. flat-table:: Encoder Commands
flags are defined for this command.
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
.. _encoder-flags:
DV timings, applications shall begin at index zero, incrementing by one
until the driver returns ``EINVAL``.
-.. note:: Drivers may enumerate a different set of DV timings after
+.. note::
+
+ Drivers may enumerate a different set of DV timings after
switching the video input or output.
When implemented by the driver DV timings of subdevices can be queried
.. _v4l2-enum-dv-timings:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_enum_dv_timings
:header-rows: 0
:stub-columns: 0
formats are enumerable by beginning at index zero and incrementing by
one until ``EINVAL`` is returned.
-.. note:: After switching input or output the list of enumerated image
+.. note::
+
+ After switching input or output the list of enumerated image
formats may be different.
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. _v4l2-fmtdesc:
.. flat-table:: struct v4l2_fmtdesc
:stub-columns: 0
:widths: 1 1 2
-
- .. row 1
- __u32
- :cspan:`2`
-
.. _v4l2-fourcc:
- .. code-block:: c
- #define v4l2_fourcc(a,b,c,d) (((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))
+ ``#define v4l2_fourcc(a,b,c,d)``
+
+ ``(((__u32)(a)<<0)|((__u32)(b)<<8)|((__u32)(c)<<16)|((__u32)(d)<<24))``
Several image formats are already defined by this specification in
:ref:`pixfmt`.
- .. attention:: These codes are not the same as those used
+ .. attention::
+
+ These codes are not the same as those used
in the Windows world.
- .. row 7
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _fmtdesc-flags:
.. flat-table:: Image Format Description Flags
does it make sense to increase the index value to receive more frame
intervals.
-.. note:: The order in which the frame intervals are returned has no
+.. note::
+
+ The order in which the frame intervals are returned has no
special meaning. In particular does it not say anything about potential
default frame intervals.
.. _v4l2-frmival-stepwise:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_frmival_stepwise
:header-rows: 0
:stub-columns: 0
.. _v4l2-frmivaltypes:
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. flat-table:: enum v4l2_frmivaltypes
:header-rows: 0
:stub-columns: 0
device supports. Only for the ``V4L2_FRMSIZE_TYPE_DISCRETE`` type does
it make sense to increase the index value to receive more frame sizes.
-.. note:: The order in which the frame sizes are returned has no special
+.. note::
+
+ The order in which the frame sizes are returned has no special
meaning. In particular does it not say anything about potential default
format sizes.
.. _v4l2-frmsize-discrete:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_frmsize_discrete
:header-rows: 0
:stub-columns: 0
.. _v4l2-frmsize-stepwise:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_frmsize_stepwise
:header-rows: 0
:stub-columns: 0
.. _v4l2-frmsizetypes:
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. flat-table:: enum v4l2_frmsizetypes
:header-rows: 0
:stub-columns: 0
of the corresponding tuner/modulator is set.
+.. tabularcolumns:: |p{2.9cm}|p{2.9cm}|p{5.8cm}|p{2.9cm}|p{3.0cm}|
+
.. _v4l2-frequency-band:
.. flat-table:: struct v4l2_frequency_band
- :cspan:`2` The supported modulation systems of this frequency
band. See :ref:`band-modulation`.
- .. note:: Currently only one modulation system per frequency band
+ .. note::
+
+ Currently only one modulation system per frequency band
is supported. More work will need to be done if multiple
modulation systems are possible. Contact the linux-media
mailing list
- ``reserved``\ [9]
- - Reserved for future extensions. Applications and drivers must set
- the array to zero.
+ - Reserved for future extensions.
+
+ Applications and drivers must set the array to zero.
+
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
.. _band-modulation:
bounds. To enumerate all audio outputs applications shall begin at index
zero, incrementing by one until the driver returns ``EINVAL``.
-.. note:: Connectors on a TV card to loop back the received audio signal
+.. note::
+
+ Connectors on a TV card to loop back the received audio signal
to a sound card are not audio outputs in this sense.
See :ref:`VIDIOC_G_AUDIOout <VIDIOC_G_AUDOUT>` for a description of struct
at index zero, incrementing by one until the driver returns ``EINVAL``.
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. _v4l2-input:
.. flat-table:: struct v4l2_input
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _input-type:
.. flat-table:: Input Types
+.. tabularcolumns:: |p{4.8cm}|p{2.6cm}|p{10.1cm}|
+
.. _input-status:
.. flat-table:: Input Status Flags
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _input-capabilities:
.. flat-table:: Input capabilities
EINVAL.
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. _v4l2-output:
.. flat-table:: struct v4l2_output
+.. tabularcolumns:: |p{7.0cm}|p{1.8cm}|p{8.7cm}|
+
.. _output-type:
.. flat-table:: Output Type
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _output-capabilities:
.. flat-table:: Output capabilities
.. _v4l2-standard:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_standard
:header-rows: 0
:stub-columns: 0
.. _v4l2-fract:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_fract
:header-rows: 0
:stub-columns: 0
-
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
.. _v4l2-std-id:
#define V4L2_STD_ALL (V4L2_STD_525_60 |
V4L2_STD_625_50)
+.. raw:: latex
+
+ \begin{adjustbox}{width=\columnwidth}
+
+.. NTSC/M PAL/M /N /B /D /H /I SECAM/B /D /K1 /L
+.. tabularcolumns:: |p{2.7cm}|p{2.6cm}|p{3.0cm}|p{3.2cm}|p{3.2cm}|p{2.2cm}|p{1.2cm}|p{3.2cm}|p{3.0cm}|p{2.0cm}|p{2.0cm}|p{2.0cm}|
.. _video-standards:
-.. flat-table:: Video Standards (based on [])
+.. flat-table:: Video Standards (based on :ref:`itu470`)
:header-rows: 1
:stub-columns: 0
- :cspan:`1` 525
- - :cspan:`9` 625
+ - :cspan:`8` 625
- .. row 3
- :cspan:`1` 1001/30000
- - :cspan:`9` 1/25
+ - :cspan:`8` 1/25
- .. row 4
- 3579611.49 ± 10
- - 4433618.75 ± 5 (3582056.25 ± 5)
+ - 4433618.75 ± 5
+
+ (3582056.25 ± 5)
- :cspan:`3` 4433618.75 ± 5
- 4433618.75 ± 1
- - :cspan:`3` f\ :sub:`OR` = 4406250 ± 2000, f\ :sub:`OB` = 4250000
- ± 2000
+ - :cspan:`2` f\ :sub:`OR` = 4406250 ± 2000,
+
+ f\ :sub:`OB` = 4250000 ± 2000
- .. row 5
- Sound carrier relative to vision carrier (MHz)
- - + 4.5
+ - 4.5
+
+ - 4.5
+
+ - 4.5
+
+ - 5.5 ± 0.001 [#f4]_ [#f5]_ [#f6]_ [#f7]_
- - + 4.5
+ - 6.5 ± 0.001
- - + 4.5
+ - 5.5
- - + 5.5 ± 0.001 [#f4]_ [#f5]_ [#f6]_ [#f7]_
+ - 5.9996 ± 0.0005
- - + 6.5 ± 0.001
+ - 5.5 ± 0.001
- - + 5.5
+ - 6.5 ± 0.001
- - + 5.9996 ± 0.0005
+ - 6.5
- - + 5.5 ± 0.001
+ - 6.5 [#f8]_
- - + 6.5 ± 0.001
+.. raw:: latex
- - + 6.5
+ \end{adjustbox}\newline\newline
- - + 6.5 [#f8]_
Return Value
.. _v4l2-exportbuffer:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_exportbuffer
:header-rows: 0
:stub-columns: 0
return the actual new audio mode.
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. _v4l2-audio:
.. flat-table:: struct v4l2_audio
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _audio-capability:
.. flat-table:: Audio Capability Flags
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _audio-mode:
.. flat-table:: Audio Mode Flags
write-only ioctl, it does not return the current audio output attributes
as ``VIDIOC_G_AUDOUT`` does.
-.. note:: Connectors on a TV card to loop back the received audio signal
+.. note::
+
+ Connectors on a TV card to loop back the received audio signal
to a sound card are not audio outputs in this sense.
.. _v4l2-audioout:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_audioout
:header-rows: 0
:stub-columns: 0
.. _v4l2-crop:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_crop
:header-rows: 0
:stub-columns: 0
.. _v4l2-control:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_control
:header-rows: 0
:stub-columns: 0
The device is busy and therefore can not change the timings.
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. _v4l2-bt-timings:
.. flat-table:: struct v4l2_bt_timings
+.. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{7.0cm}|p{3.5cm}|
+
.. _v4l2-dv-timings:
.. flat-table:: struct v4l2_dv_timings
-
-
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
.. _dv-timing-types:
- Description
- - .. row 2
-
- -
- -
-
- .. row 3
- ``V4L2_DV_BT_STD_CEA861``
- The timings follow the VESA Generalized Timings Formula standard
+.. tabularcolumns:: |p{6.0cm}|p{11.5cm}|
.. _dv-bt-flags:
- Description
- - .. row 2
-
- -
- -
-
- .. row 3
- ``V4L2_DV_FL_REDUCED_BLANKING``
copying any data. This is an easy way to discover how many EDID blocks
there are.
-.. note:: If there are no EDID blocks available at all, then
+.. note::
+
+ If there are no EDID blocks available at all, then
the driver will set ``blocks`` to 0 and it returns 0.
To set the EDID blocks of a receiver the application has to fill in the
.. _v4l2-edid:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_edid
:header-rows: 0
:stub-columns: 0
video elementary streams.
+.. tabularcolumns:: |p{3.5cm}|p{5.6cm}|p{8.4cm}|
+
.. _v4l2-enc-idx:
.. flat-table:: struct v4l2_enc_idx
:header-rows: 0
:stub-columns: 0
- :widths: 1 1 2 1 1
+ :widths: 1 3 8
- .. row 1
- ``reserved``\ [4]
- - :cspan:`2` Reserved for future extensions. Drivers must set the
+ - Reserved for future extensions. Drivers must set the
array to zero.
- .. row 4
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. _v4l2-enc-idx-entry:
.. flat-table:: struct v4l2_enc_idx_entry
zero.
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
.. _enc-idx-flags:
still cause this situation.
+.. tabularcolumns:: |p{1.2cm}|p{3.0cm}|p{1.5cm}|p{11.8cm}|
+
.. _v4l2-ext-control:
+.. cssclass: longtable
+
.. flat-table:: struct v4l2_ext_control
:header-rows: 0
:stub-columns: 0
to a value large enough to store the payload result and ``ENOSPC`` is
returned.
- .. note:: For string controls, this ``size`` field should
+ .. note::
+
+ For string controls, this ``size`` field should
not be confused with the length of the string. This field refers
to the size of the memory that contains the string. The actual
*length* of the string may well be much smaller.
``V4L2_CTRL_FLAG_HAS_PAYLOAD`` is set for this control.
+.. tabularcolumns:: |p{4.0cm}|p{2.0cm}|p{2.0cm}|p{8.5cm}|
.. _v4l2-ext-controls:
+.. cssclass:: longtable
+
.. flat-table:: struct v4l2_ext_controls
:header-rows: 0
:stub-columns: 0
control and ``V4L2_CTRL_WHICH_DEF_VAL`` will return the default
value of the control.
- .. note:: You can only get the default value of the control,
+ .. note::
+
+ You can only get the default value of the control,
you cannot set or try it.
For backwards compatibility you can also use a control class here
- ``reserved``\ [2]
- - Reserved for future extensions. Drivers and applications must set
- the array to zero.
+ - Reserved for future extensions.
+
+ Drivers and applications must set the array to zero.
- .. row 7
- ``controls``
- Pointer to an array of ``count`` v4l2_ext_control structures.
+
Ignored if ``count`` equals zero.
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
.. _ctrl-class:
destructive video overlay.
+.. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{3.5cm}|p{7.0cm}|
+
.. _v4l2-framebuffer:
+.. cssclass:: longtable
+
.. flat-table:: struct v4l2_framebuffer
:header-rows: 0
:stub-columns: 0
- Reserved. Drivers and applications must set this field to zero.
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
.. _framebuffer-cap:
exactly opposite of ``V4L2_FBUF_CAP_CHROMAKEY``
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
.. _framebuffer-flags:
+.. cssclass:: longtable
+
.. flat-table:: Frame Buffer Flags
:header-rows: 0
:stub-columns: 0
.. _v4l2-format:
+.. tabularcolumns:: |p{1.2cm}|p{4.3cm}|p{3.0cm}|p{9.0cm}|
+
.. flat-table:: struct v4l2_format
:header-rows: 0
:stub-columns: 0
write-only ioctl, it does not return the actual new frequency.
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. _v4l2-frequency:
.. flat-table:: struct v4l2_frequency
encoding. You usually do want to add them.
+.. tabularcolumns:: |p{1.2cm}|p{3.0cm}|p{13.3cm}|
+
.. _v4l2-jpegcompression:
.. flat-table:: struct v4l2_jpegcompression
and ignore this field.
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
.. _jpeg-markers:
:ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl is available.
+.. tabularcolumns:: |p{2.9cm}|p{2.9cm}|p{5.8cm}|p{2.9cm}|p{3.0cm}|
+
.. _v4l2-modulator:
.. flat-table:: struct v4l2_modulator
- ``name``\ [32]
- - Name of the modulator, a NUL-terminated ASCII string. This
- information is intended for the user.
+ - Name of the modulator, a NUL-terminated ASCII string.
+
+ This information is intended for the user.
- .. row 3
shall be modulated. It contains a set of flags as defined in
:ref:`modulator-txsubchans`.
- .. note:: The tuner ``rxsubchans`` flags are reused, but the
+ .. note::
+
+ The tuner ``rxsubchans`` flags are reused, but the
semantics are different. Video output devices
are assumed to have an analog or PCM audio input with 1-3
channels. The ``txsubchans`` flags select one or more channels
- ``reserved``\ [3]
- - Reserved for future extensions. Drivers and applications must set
- the array to zero.
+ - Reserved for future extensions.
+
+ Drivers and applications must set the array to zero.
+
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
.. _modulator-txsubchans:
union holding separate parameters for input and output devices.
+.. tabularcolumns:: |p{3.5cm}|p{3.5cm}|p{3.5cm}|p{7.0cm}|
+
.. _v4l2-streamparm:
.. flat-table:: struct v4l2_streamparm
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. _v4l2-captureparm:
.. flat-table:: struct v4l2_captureparm
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. _v4l2-outputparm:
.. flat-table:: struct v4l2_outputparm
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _parm-caps:
.. flat-table:: Streaming Parameters Capabilites
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _parm-flags:
.. flat-table:: Capture Parameters Flags
.. _v4l2-priority:
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. flat-table:: enum v4l2_priority
:header-rows: 0
:stub-columns: 0
.. _v4l2-selection:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_selection
:header-rows: 0
:stub-columns: 0
driver fills in the remaining fields or returns an ``EINVAL`` error code if
the sliced VBI API is unsupported or ``type`` is invalid.
-.. note:: The ``type`` field was added, and the ioctl changed from read-only
+.. note::
+
+ The ``type`` field was added, and the ioctl changed from read-only
to write-read, in Linux 2.6.19.
.. _v4l2-sliced-vbi-cap:
+.. tabularcolumns:: |p{1.2cm}|p{4.2cm}|p{4.1cm}|p{4.0cm}|p{4.0cm}|
+
.. flat-table:: struct v4l2_sliced_vbi_cap
:header-rows: 0
:stub-columns: 0
- ``service_set``
- :cspan:`2` A set of all data services supported by the driver.
+
Equal to the union of all elements of the ``service_lines`` array.
- .. row 2
- :cspan:`2` Each element of this array contains a set of data
services the hardware can look for or insert into a particular
scan line. Data services are defined in :ref:`vbi-services`.
- Array indices map to ITU-R line numbers (see also :ref:`vbi-525`
- and :ref:`vbi-625`) as follows:
+ Array indices map to ITU-R line numbers\ [#f1]_ as follows:
- .. row 3
- ``reserved``\ [3]
- :cspan:`2` This array is reserved for future extensions.
+
Applications and drivers must set it to zero.
+.. [#f1]
+
+ See also :ref:`vbi-525` and :ref:`vbi-625`.
+
+.. raw:: latex
+
+ \begin{adjustbox}{width=\columnwidth}
+
+.. tabularcolumns:: |p{5.0cm}|p{1.4cm}|p{3.0cm}|p{2.5cm}|p{9.0cm}|
.. _vbi-services:
- 0x0001
- - :ref:`ets300706`, :ref:`itu653`
+ - :ref:`ets300706`,
+
+ :ref:`itu653`
- PAL/SECAM line 7-22, 320-335 (second field 7-22)
- 0x4000
- - :ref:`en300294`, :ref:`itu1119`
+ - :ref:`en300294`,
+
+ :ref:`itu1119`
- PAL/SECAM line 23
- :cspan:`2` Set of services applicable to 625 line systems.
+.. raw:: latex
+
+ \end{adjustbox}\newline\newline
+
Return Value
============
:ref:`VIDIOC_S_FREQUENCY <VIDIOC_G_FREQUENCY>` ioctl is available.
+ .. tabularcolumns:: |p{1.3cm}|p{3.0cm}|p{6.6cm}|p{6.6cm}|
+
.. _v4l2-tuner:
+.. cssclass:: longtable
+
.. flat-table:: struct v4l2_tuner
:header-rows: 0
:stub-columns: 0
- :cspan:`1`
- Name of the tuner, a NUL-terminated ASCII string. This information
- is intended for the user.
+ Name of the tuner, a NUL-terminated ASCII string.
+
+ This information is intended for the user.
- .. row 3
- ``signal``
- - :cspan:`1` The signal strength if known, ranging from 0 to
- 65535. Higher values indicate a better signal.
+ - :cspan:`1` The signal strength if known.
+
+ Ranging from 0 to 65535. Higher values indicate a better signal.
- .. row 16
- ``afc``
- - :cspan:`1` Automatic frequency control: When the ``afc`` value
- is negative, the frequency is too low, when positive too high.
+ - :cspan:`1` Automatic frequency control.
+
+ When the ``afc`` value is negative, the frequency is too
+ low, when positive too high.
- .. row 17
- ``reserved``\ [4]
- - :cspan:`1` Reserved for future extensions. Drivers and
- applications must set the array to zero.
+ - :cspan:`1` Reserved for future extensions.
+ Drivers and applications must set the array to zero.
+
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _v4l2-tuner-type:
.. flat-table:: enum v4l2_tuner_type
:header-rows: 0
:stub-columns: 0
- :widths: 3 1 4
+ :widths: 3 1 6
- .. row 1
- 1
- -
+ - Tuner supports radio
- .. row 2
- 2
- -
+ - Tuner supports analog TV
- .. row 3
- 4
- -
+ - Tuner controls the A/D and/or D/A block of a
+ Sofware Digital Radio (SDR)
- .. row 4
- 5
- -
+ - Tuner controls the RF part of a Sofware Digital Radio (SDR)
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
.. _tuner-capability:
+.. cssclass:: longtable
+
.. flat-table:: Tuner and Modulator Capability Flags
:header-rows: 0
:stub-columns: 0
carrier for a monaural secondary language. Only
``V4L2_TUNER_ANALOG_TV`` tuners can have this capability.
- .. note:: The ``V4L2_TUNER_CAP_LANG2`` and ``V4L2_TUNER_CAP_SAP``
+ .. note::
+
+ The ``V4L2_TUNER_CAP_LANG2`` and ``V4L2_TUNER_CAP_SAP``
flags are synonyms. ``V4L2_TUNER_CAP_SAP`` applies when the tuner
supports the ``V4L2_STD_NTSC_M`` video standard.
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _tuner-rxsubchans:
.. flat-table:: Tuner Audio Reception Flags
- The tuner receives a Second Audio Program.
- .. note:: The ``V4L2_TUNER_SUB_LANG2`` and ``V4L2_TUNER_SUB_SAP``
+ .. note::
+
+ The ``V4L2_TUNER_SUB_LANG2`` and ``V4L2_TUNER_SUB_SAP``
flags are synonyms. The ``V4L2_TUNER_SUB_SAP`` flag applies
when the current video standard is ``V4L2_STD_NTSC_M``.
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _tuner-audmode:
.. flat-table:: Tuner Audio Modes
``MODE_MONO``. Only ``V4L2_TUNER_ANALOG_TV`` tuners support this
mode.
+.. raw:: latex
+ \begin{adjustbox}{width=\columnwidth}
.. _tuner-matrix:
- Lang1/Lang2 (preferred) or Lang1/Lang1
+.. raw:: latex
+
+ \end{adjustbox}\newline\newline
Return Value
============
``VIDIOC_DQBUF`` failed due to an internal error. Can also indicate
temporary problems like signal loss.
- .. note:: The driver might dequeue an (empty) buffer despite returning
+ .. note::
+
+ The driver might dequeue an (empty) buffer despite returning
an error, or even stop capturing. Reusing such buffer may be unsafe
though and its details (e.g. ``index``) may not be returned either.
It is recommended that drivers indicate recoverable errors by setting
:ref:`v4l2_dv_timings <v4l2-dv-timings>`. Once the hardware detects
the timings, it will fill in the timings structure.
-.. note:: Drivers shall *not* switch timings automatically if new
+.. note::
+
+ Drivers shall *not* switch timings automatically if new
timings are detected. Instead, drivers should send the
``V4L2_EVENT_SOURCE_CHANGE`` event (if they support this) and expect
that userspace will take action by calling :ref:`VIDIOC_QUERY_DV_TIMINGS`.
specification the ioctl returns an ``EINVAL`` error code.
+.. tabularcolumns:: |p{1.5cm}|p{2.5cm}|p{13cm}|
+
.. _v4l2-capability:
.. flat-table:: struct v4l2_capability
:header-rows: 0
:stub-columns: 0
- :widths: 1 1 2
-
+ :widths: 3 4 20
- .. row 1
- :cspan:`2`
+ ``#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))``
- .. code-block:: c
-
- #define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
+ ``__u32 version = KERNEL_VERSION(0, 8, 1);``
- __u32 version = KERNEL_VERSION(0, 8, 1);
+ ``printf ("Version: %u.%u.%u\\n",``
- printf ("Version: %u.%u.%u\\n",
- (version >> 16) & 0xFF,
- (version >> 8) & 0xFF,
- version & 0xFF);
+ ``(version >> 16) & 0xFF, (version >> 8) & 0xFF, version & 0xFF);``
- .. row 6
+.. tabularcolumns:: |p{6cm}|p{2.2cm}|p{8.8cm}|
+
.. _device-capabilities:
+.. cssclass:: longtable
+
.. flat-table:: Device Capabilities Flags
:header-rows: 0
:stub-columns: 0
:widths: 3 1 4
-
- .. row 1
- ``V4L2_CAP_VIDEO_CAPTURE``
:ref:`v4l2_queryctrl <v4l2-queryctrl>` ``minimum`` to ``maximum``,
inclusive.
-.. note:: It is possible for ``VIDIOC_QUERYMENU`` to return
+.. note::
+
+ It is possible for ``VIDIOC_QUERYMENU`` to return
an ``EINVAL`` error code for some indices between ``minimum`` and
``maximum``. In that case that particular menu item is not supported by
this driver. Also note that the ``minimum`` value is not necessarily 0.
See also the examples in :ref:`control`.
+.. tabularcolumns:: |p{1.2cm}|p{3.6cm}|p{12.7cm}|
+
.. _v4l2-queryctrl:
+.. cssclass:: longtable
+
.. flat-table:: struct v4l2_queryctrl
:header-rows: 0
:stub-columns: 0
``_BITMASK``, ``_MENU`` or ``_INTEGER_MENU`` control. Not valid
for other types of controls.
- .. note:: Drivers reset controls to their default value only when
+ .. note::
+
+ Drivers reset controls to their default value only when
the driver is first loaded, never afterwards.
- .. row 8
+.. tabularcolumns:: |p{1.2cm}|p{5.0cm}|p{11.3cm}|
+
.. _v4l2-query-ext-ctrl:
+.. cssclass:: longtable
+
.. flat-table:: struct v4l2_query_ext_ctrl
:header-rows: 0
:stub-columns: 0
``_BOOLEAN``, ``_BITMASK``, ``_MENU``, ``_INTEGER_MENU``, ``_U8``
or ``_U16`` control. Not valid for other types of controls.
- .. note:: Drivers reset controls to their default value only when
+ .. note::
+
+ Drivers reset controls to their default value only when
the driver is first loaded, never afterwards.
- .. row 8
+.. tabularcolumns:: |p{1.2cm}|p{0.6cm}|p{1.6cm}|p{13.5cm}|
+
.. _v4l2-querymenu:
.. flat-table:: struct v4l2_querymenu
+.. tabularcolumns:: |p{5.8cm}|p{1.4cm}|p{1.0cm}|p{1.4cm}|p{6.9cm}|
+
.. _v4l2-ctrl-type:
+.. cssclass:: longtable
+
.. flat-table:: enum v4l2_ctrl_type
:header-rows: 1
:stub-columns: 0
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _control-flags:
+.. cssclass:: longtable
+
.. flat-table:: Control Flags
:header-rows: 0
:stub-columns: 0
case the hardware calculates the gain value based on the lighting
conditions which can change over time.
- .. note:: Setting a new value for a volatile control will have no
+ .. note::
+
+ Setting a new value for a volatile control will have no
effect and no ``V4L2_EVENT_CTRL_CH_VALUE`` will be sent, unless
the ``V4L2_CTRL_FLAG_EXECUTE_ON_WRITE`` flag (see below) is
also set. Otherwise the new value will just be ignored.
the set must contain all standards supported by the current video input
or output.
-.. note:: Drivers shall *not* switch the video standard
+.. note::
+
+ Drivers shall *not* switch the video standard
automatically if a new video standard is detected. Instead, drivers
should send the ``V4L2_EVENT_SOURCE_CHANGE`` event (if they support
this) and expect that userspace will take action by calling
.. _v4l2-requestbuffers:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_requestbuffers
:header-rows: 0
:stub-columns: 0
error code is returned and no seek takes place.
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. _v4l2-hw-freq-seek:
.. flat-table:: struct v4l2_hw_freq_seek
but ``VIDIOC_STREAMOFF`` will return queued buffers to their starting
state as mentioned above.
-.. note:: Applications can be preempted for unknown periods right before
+.. note::
+
+ Applications can be preempted for unknown periods right before
or after the ``VIDIOC_STREAMON`` or ``VIDIOC_STREAMOFF`` calls, there is
no notion of starting or stopping "now". Buffer timestamps can be used
to synchronize with other events.
.. _v4l2-subdev-frame-interval-enum:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_subdev_frame_interval_enum
:header-rows: 0
:stub-columns: 0
.. _v4l2-subdev-frame-size-enum:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_subdev_frame_size_enum
:header-rows: 0
:stub-columns: 0
.. _v4l2-subdev-mbus-code-enum:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_subdev_mbus_code_enum
:header-rows: 0
:stub-columns: 0
.. _v4l2-subdev-crop:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_subdev_crop
:header-rows: 0
:stub-columns: 0
should be as close as possible to the original request.
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. _v4l2-subdev-format:
.. flat-table:: struct v4l2_subdev_format
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _v4l2-subdev-format-whence:
.. flat-table:: enum v4l2_subdev_format_whence
.. _v4l2-subdev-frame-interval:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_subdev_frame_interval
:header-rows: 0
:stub-columns: 0
.. _v4l2-subdev-selection:
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. flat-table:: struct v4l2_subdev_selection
:header-rows: 0
:stub-columns: 0
using the :ref:`VIDIOC_DQEVENT` ioctl.
+.. tabularcolumns:: |p{4.4cm}|p{4.4cm}|p{8.7cm}|
+
.. _v4l2-event-subscription:
.. flat-table:: struct v4l2_event_subscription
- Type of the event, see :ref:`event-type`.
- .. note:: ``V4L2_EVENT_ALL`` can be used with
+ .. note::
+
+ ``V4L2_EVENT_ALL`` can be used with
:ref:`VIDIOC_UNSUBSCRIBE_EVENT <VIDIOC_SUBSCRIBE_EVENT>` for
unsubscribing all events at once.
+.. tabularcolumns:: |p{6.6cm}|p{2.2cm}|p{8.7cm}|
+
.. _event-flags:
.. flat-table:: Event Flags
-----
.. note::
+
For a more updated list, please check
https://linuxtv.org/wiki/index.php/Hardware_Device_Information
Driver options
~~~~~~~~~~~~~~
+.. tabularcolumns:: |p{13ex}|L|
+
+
============== ========================================================
Option Description
============== ========================================================
information. The contents of the file is binary data of the
following layout:
+ .. tabularcolumns:: |p{7ex}|p{12ex}|L|
+
============= ============== ====================================
- Offset Name Description
+ Offset Name Description
============= ============== ====================================
- 0x00 blend_int Flag, set when stereo separation has
+ 0x00 blend_int Flag, set when stereo separation has
crossed below the blend threshold
- 0x01 hblend_int Flag, set when HiBlend cutoff
+ 0x01 hblend_int Flag, set when HiBlend cutoff
frequency is lower than threshold
- 0x02 hicut_int Flag, set when HiCut cutoff
+ 0x02 hicut_int Flag, set when HiCut cutoff
frequency is lower than threshold
- 0x03 chbw_int Flag, set when channel filter
+ 0x03 chbw_int Flag, set when channel filter
bandwidth is less than threshold
- 0x04 softmute_int Flag indicating that softmute
+ 0x04 softmute_int Flag indicating that softmute
attenuation has increased above
softmute threshold
0x05 smute 0 - Audio is not soft muted
1 - Audio is soft muted
- 0x06 smattn Soft mute attenuation level in dB
- 0x07 chbw Channel filter bandwidth in kHz
- 0x08 hicut HiCut cutoff frequency in units of
+ 0x06 smattn Soft mute attenuation level in dB
+ 0x07 chbw Channel filter bandwidth in kHz
+ 0x08 hicut HiCut cutoff frequency in units of
100Hz
- 0x09 hiblend HiBlend cutoff frequency in units
+ 0x09 hiblend HiBlend cutoff frequency in units
of 100 Hz
- 0x10 pilot 0 - Stereo pilot is not present
+ 0x10 pilot 0 - Stereo pilot is not present
1 - Stereo pilot is present
- 0x11 stblend Stereo blend in %
+ 0x11 stblend Stereo blend in %
============= ============== ====================================
This file contains statistics about RDS receptions. It's binary data
has the following layout:
+ .. tabularcolumns:: |p{7ex}|p{12ex}|L|
+
============= ============== ====================================
- Offset Name Description
+ Offset Name Description
============= ============== ====================================
- 0x00 expected Number of expected RDS blocks
- 0x02 received Number of received RDS blocks
- 0x04 uncorrectable Number of uncorrectable RDS blocks
+ 0x00 expected Number of expected RDS blocks
+ 0x02 received Number of received RDS blocks
+ 0x04 uncorrectable Number of uncorrectable RDS blocks
============= ============== ====================================
* /sys/kernel/debug/<device-name>/agc
The layout is:
+ .. tabularcolumns:: |p{7ex}|p{12ex}|L|
+
============= ============== ====================================
- Offset Name Description
+ Offset Name Description
============= ============== ====================================
- 0x00 mxhi 0 - FM Mixer PD high threshold is
+ 0x00 mxhi 0 - FM Mixer PD high threshold is
not tripped
1 - FM Mixer PD high threshold is
tripped
- 0x01 mxlo ditto for FM Mixer PD low
- 0x02 lnahi ditto for FM LNA PD high
- 0x03 lnalo ditto for FM LNA PD low
- 0x04 fmagc1 FMAGC1 attenuator resistance
+ 0x01 mxlo ditto for FM Mixer PD low
+ 0x02 lnahi ditto for FM LNA PD high
+ 0x03 lnalo ditto for FM LNA PD low
+ 0x04 fmagc1 FMAGC1 attenuator resistance
(see datasheet for more detail)
- 0x05 fmagc2 ditto for FMAGC2
- 0x06 pgagain PGA gain in dB
- 0x07 fmwblang FM/WB LNA Gain in dB
+ 0x05 fmagc2 ditto for FMAGC2
+ 0x06 pgagain PGA gain in dB
+ 0x07 fmwblang FM/WB LNA Gain in dB
============= ============== ====================================
* /sys/kernel/debug/<device-name>/rsq
The layout is:
+ .. tabularcolumns:: |p{7ex}|p{12ex}|p{60ex}|
+
============= ============== ====================================
- Offset Name Description
+ Offset Name Description
============= ============== ====================================
- 0x00 multhint 0 - multipath value has not crossed
+ 0x00 multhint 0 - multipath value has not crossed
the Multipath high threshold
1 - multipath value has crossed
the Multipath high threshold
- 0x01 multlint ditto for Multipath low threshold
- 0x02 snrhint 0 - received signal's SNR has not
+ 0x01 multlint ditto for Multipath low threshold
+ 0x02 snrhint 0 - received signal's SNR has not
crossed high threshold
1 - received signal's SNR has
crossed high threshold
- 0x03 snrlint ditto for low threshold
- 0x04 rssihint ditto for RSSI high threshold
- 0x05 rssilint ditto for RSSI low threshold
- 0x06 bltf Flag indicating if seek command
+ 0x03 snrlint ditto for low threshold
+ 0x04 rssihint ditto for RSSI high threshold
+ 0x05 rssilint ditto for RSSI low threshold
+ 0x06 bltf Flag indicating if seek command
reached/wrapped seek band limit
- 0x07 snr_ready Indicates that SNR metrics is ready
- 0x08 rssiready ditto for RSSI metrics
- 0x09 injside 0 - Low-side injection is being used
+ 0x07 snr_ready Indicates that SNR metrics is ready
+ 0x08 rssiready ditto for RSSI metrics
+ 0x09 injside 0 - Low-side injection is being used
1 - High-side injection is used
- 0x10 afcrl Flag indicating if AFC rails
- 0x11 valid Flag indicating if channel is valid
- 0x12 readfreq Current tuned frequency
- 0x14 freqoff Signed frequency offset in units of
+ 0x10 afcrl Flag indicating if AFC rails
+ 0x11 valid Flag indicating if channel is valid
+ 0x12 readfreq Current tuned frequency
+ 0x14 freqoff Signed frequency offset in units of
2ppm
- 0x15 rssi Signed value of RSSI in dBuV
- 0x16 snr Signed RF SNR in dB
- 0x17 issi Signed Image Strength Signal
+ 0x15 rssi Signed value of RSSI in dBuV
+ 0x16 snr Signed RF SNR in dB
+ 0x17 issi Signed Image Strength Signal
indicator
- 0x18 lassi Signed Low side adjacent Channel
+ 0x18 lassi Signed Low side adjacent Channel
Strength indicator
- 0x19 hassi ditto fpr High side
- 0x20 mult Multipath indicator
- 0x21 dev Frequency deviation
- 0x24 assi Adjacent channel SSI
- 0x25 usn Ultrasonic noise indicator
- 0x26 pilotdev Pilot deviation in units of 100 Hz
- 0x27 rdsdev ditto for RDS
- 0x28 assidev ditto for ASSI
- 0x29 strongdev Frequency deviation
- 0x30 rdspi RDS PI code
+ 0x19 hassi ditto fpr High side
+ 0x20 mult Multipath indicator
+ 0x21 dev Frequency deviation
+ 0x24 assi Adjacent channel SSI
+ 0x25 usn Ultrasonic noise indicator
+ 0x26 pilotdev Pilot deviation in units of 100 Hz
+ 0x27 rdsdev ditto for RDS
+ 0x28 assidev ditto for ASSI
+ 0x29 strongdev Frequency deviation
+ 0x30 rdspi RDS PI code
============= ============== ====================================
* /sys/kernel/debug/<device-name>/rsq_primary
mail: royale@zerezo.com
-.. note:
+.. note::
This documentation is outdated
S: Supported
F: arch/microblaze/
+MICROCHIP / ATMEL ISC DRIVER
+M: Songjun Wu <songjun.wu@microchip.com>
+L: linux-media@vger.kernel.org
+S: Supported
+F: drivers/media/platform/atmel/atmel-isc.c
+F: drivers/media/platform/atmel/atmel-isc-regs.h
+F: devicetree/bindings/media/atmel-isc.txt
+
MICROSOFT SURFACE PRO 3 BUTTON DRIVER
M: Chen Yu <yu.c.chen@intel.com>
L: platform-driver-x86@vger.kernel.org
source "drivers/media/platform/am437x/Kconfig"
source "drivers/media/platform/xilinx/Kconfig"
source "drivers/media/platform/rcar-vin/Kconfig"
+source "drivers/media/platform/atmel/Kconfig"
config VIDEO_TI_CAL
tristate "TI CAL (Camera Adaptation Layer) driver"
obj-$(CONFIG_VIDEO_RCAR_VIN) += rcar-vin/
+obj-$(CONFIG_VIDEO_ATMEL_ISC) += atmel/
+
ccflags-y += -I$(srctree)/drivers/media/i2c
obj-$(CONFIG_VIDEO_MEDIATEK_VPU) += mtk-vpu/
--- /dev/null
+config VIDEO_ATMEL_ISC
+ tristate "ATMEL Image Sensor Controller (ISC) support"
+ depends on VIDEO_V4L2 && COMMON_CLK && VIDEO_V4L2_SUBDEV_API && HAS_DMA
+ depends on ARCH_AT91 || COMPILE_TEST
+ select VIDEOBUF2_DMA_CONTIG
+ select REGMAP_MMIO
+ help
+ This module makes the ATMEL Image Sensor Controller available
+ as a v4l2 device.
\ No newline at end of file
--- /dev/null
+obj-$(CONFIG_VIDEO_ATMEL_ISC) += atmel-isc.o
--- /dev/null
+#ifndef __ATMEL_ISC_REGS_H
+#define __ATMEL_ISC_REGS_H
+
+#include <linux/bitops.h>
+
+/* ISC Control Enable Register 0 */
+#define ISC_CTRLEN 0x00000000
+
+/* ISC Control Disable Register 0 */
+#define ISC_CTRLDIS 0x00000004
+
+/* ISC Control Status Register 0 */
+#define ISC_CTRLSR 0x00000008
+
+#define ISC_CTRL_CAPTURE BIT(0)
+#define ISC_CTRL_UPPRO BIT(1)
+#define ISC_CTRL_HISREQ BIT(2)
+#define ISC_CTRL_HISCLR BIT(3)
+
+/* ISC Parallel Front End Configuration 0 Register */
+#define ISC_PFE_CFG0 0x0000000c
+
+#define ISC_PFE_CFG0_HPOL_LOW BIT(0)
+#define ISC_PFE_CFG0_VPOL_LOW BIT(1)
+#define ISC_PFE_CFG0_PPOL_LOW BIT(2)
+
+#define ISC_PFE_CFG0_MODE_PROGRESSIVE (0x0 << 4)
+#define ISC_PFE_CFG0_MODE_MASK GENMASK(6, 4)
+
+#define ISC_PFE_CFG0_BPS_EIGHT (0x4 << 28)
+#define ISC_PFG_CFG0_BPS_NINE (0x3 << 28)
+#define ISC_PFG_CFG0_BPS_TEN (0x2 << 28)
+#define ISC_PFG_CFG0_BPS_ELEVEN (0x1 << 28)
+#define ISC_PFG_CFG0_BPS_TWELVE (0x0 << 28)
+#define ISC_PFE_CFG0_BPS_MASK GENMASK(30, 28)
+
+/* ISC Clock Enable Register */
+#define ISC_CLKEN 0x00000018
+
+/* ISC Clock Disable Register */
+#define ISC_CLKDIS 0x0000001c
+
+/* ISC Clock Status Register */
+#define ISC_CLKSR 0x00000020
+
+#define ISC_CLK(n) BIT(n)
+
+/* ISC Clock Configuration Register */
+#define ISC_CLKCFG 0x00000024
+#define ISC_CLKCFG_DIV_SHIFT(n) ((n)*16)
+#define ISC_CLKCFG_DIV_MASK(n) GENMASK(((n)*16 + 7), (n)*16)
+#define ISC_CLKCFG_SEL_SHIFT(n) ((n)*16 + 8)
+#define ISC_CLKCFG_SEL_MASK(n) GENMASK(((n)*17 + 8), ((n)*16 + 8))
+
+/* ISC Interrupt Enable Register */
+#define ISC_INTEN 0x00000028
+
+/* ISC Interrupt Disable Register */
+#define ISC_INTDIS 0x0000002c
+
+/* ISC Interrupt Mask Register */
+#define ISC_INTMASK 0x00000030
+
+/* ISC Interrupt Status Register */
+#define ISC_INTSR 0x00000034
+
+#define ISC_INT_DDONE BIT(8)
+
+/* ISC White Balance Control Register */
+#define ISC_WB_CTRL 0x00000058
+
+/* ISC White Balance Configuration Register */
+#define ISC_WB_CFG 0x0000005c
+
+/* ISC Color Filter Array Control Register */
+#define ISC_CFA_CTRL 0x00000070
+
+/* ISC Color Filter Array Configuration Register */
+#define ISC_CFA_CFG 0x00000074
+
+#define ISC_BAY_CFG_GRGR 0x0
+#define ISC_BAY_CFG_RGRG 0x1
+#define ISC_BAY_CFG_GBGB 0x2
+#define ISC_BAY_CFG_BGBG 0x3
+#define ISC_BAY_CFG_MASK GENMASK(1, 0)
+
+/* ISC Color Correction Control Register */
+#define ISC_CC_CTRL 0x00000078
+
+/* ISC Gamma Correction Control Register */
+#define ISC_GAM_CTRL 0x00000094
+
+/* Color Space Conversion Control Register */
+#define ISC_CSC_CTRL 0x00000398
+
+/* Contrast And Brightness Control Register */
+#define ISC_CBC_CTRL 0x000003b4
+
+/* Subsampling 4:4:4 to 4:2:2 Control Register */
+#define ISC_SUB422_CTRL 0x000003c4
+
+/* Subsampling 4:2:2 to 4:2:0 Control Register */
+#define ISC_SUB420_CTRL 0x000003cc
+
+/* Rounding, Limiting and Packing Configuration Register */
+#define ISC_RLP_CFG 0x000003d0
+
+#define ISC_RLP_CFG_MODE_DAT8 0x0
+#define ISC_RLP_CFG_MODE_DAT9 0x1
+#define ISC_RLP_CFG_MODE_DAT10 0x2
+#define ISC_RLP_CFG_MODE_DAT11 0x3
+#define ISC_RLP_CFG_MODE_DAT12 0x4
+#define ISC_RLP_CFG_MODE_DATY8 0x5
+#define ISC_RLP_CFG_MODE_DATY10 0x6
+#define ISC_RLP_CFG_MODE_ARGB444 0x7
+#define ISC_RLP_CFG_MODE_ARGB555 0x8
+#define ISC_RLP_CFG_MODE_RGB565 0x9
+#define ISC_RLP_CFG_MODE_ARGB32 0xa
+#define ISC_RLP_CFG_MODE_YYCC 0xb
+#define ISC_RLP_CFG_MODE_YYCC_LIMITED 0xc
+#define ISC_RLP_CFG_MODE_MASK GENMASK(3, 0)
+
+/* DMA Configuration Register */
+#define ISC_DCFG 0x000003e0
+#define ISC_DCFG_IMODE_PACKED8 0x0
+#define ISC_DCFG_IMODE_PACKED16 0x1
+#define ISC_DCFG_IMODE_PACKED32 0x2
+#define ISC_DCFG_IMODE_YC422SP 0x3
+#define ISC_DCFG_IMODE_YC422P 0x4
+#define ISC_DCFG_IMODE_YC420SP 0x5
+#define ISC_DCFG_IMODE_YC420P 0x6
+#define ISC_DCFG_IMODE_MASK GENMASK(2, 0)
+
+#define ISC_DCFG_YMBSIZE_SINGLE (0x0 << 4)
+#define ISC_DCFG_YMBSIZE_BEATS4 (0x1 << 4)
+#define ISC_DCFG_YMBSIZE_BEATS8 (0x2 << 4)
+#define ISC_DCFG_YMBSIZE_BEATS16 (0x3 << 4)
+#define ISC_DCFG_YMBSIZE_MASK GENMASK(5, 4)
+
+#define ISC_DCFG_CMBSIZE_SINGLE (0x0 << 8)
+#define ISC_DCFG_CMBSIZE_BEATS4 (0x1 << 8)
+#define ISC_DCFG_CMBSIZE_BEATS8 (0x2 << 8)
+#define ISC_DCFG_CMBSIZE_BEATS16 (0x3 << 8)
+#define ISC_DCFG_CMBSIZE_MASK GENMASK(9, 8)
+
+/* DMA Control Register */
+#define ISC_DCTRL 0x000003e4
+
+#define ISC_DCTRL_DVIEW_PACKED (0x0 << 1)
+#define ISC_DCTRL_DVIEW_SEMIPLANAR (0x1 << 1)
+#define ISC_DCTRL_DVIEW_PLANAR (0x2 << 1)
+#define ISC_DCTRL_DVIEW_MASK GENMASK(2, 1)
+
+#define ISC_DCTRL_IE_IS (0x0 << 4)
+
+/* DMA Descriptor Address Register */
+#define ISC_DNDA 0x000003e8
+
+/* DMA Address 0 Register */
+#define ISC_DAD0 0x000003ec
+
+/* DMA Stride 0 Register */
+#define ISC_DST0 0x000003f0
+
+#endif
--- /dev/null
+/*
+ * Atmel Image Sensor Controller (ISC) driver
+ *
+ * Copyright (C) 2016 Atmel
+ *
+ * Author: Songjun Wu <songjun.wu@microchip.com>
+ *
+ * This program is free software; you may redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * Sensor-->PFE-->WB-->CFA-->CC-->GAM-->CSC-->CBC-->SUB-->RLP-->DMA
+ *
+ * ISC video pipeline integrates the following submodules:
+ * PFE: Parallel Front End to sample the camera sensor input stream
+ * WB: Programmable white balance in the Bayer domain
+ * CFA: Color filter array interpolation module
+ * CC: Programmable color correction
+ * GAM: Gamma correction
+ * CSC: Programmable color space conversion
+ * CBC: Contrast and Brightness control
+ * SUB: This module performs YCbCr444 to YCbCr420 chrominance subsampling
+ * RLP: This module performs rounding, range limiting
+ * and packing of the incoming data
+ */
+
+#include <linux/clk.h>
+#include <linux/clkdev.h>
+#include <linux/clk-provider.h>
+#include <linux/delay.h>
+#include <linux/interrupt.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
+#include <linux/regmap.h>
+#include <linux/videodev2.h>
+
+#include <media/v4l2-device.h>
+#include <media/v4l2-image-sizes.h>
+#include <media/v4l2-ioctl.h>
+#include <media/v4l2-of.h>
+#include <media/v4l2-subdev.h>
+#include <media/videobuf2-dma-contig.h>
+
+#include "atmel-isc-regs.h"
+
+#define ATMEL_ISC_NAME "atmel_isc"
+
+#define ISC_MAX_SUPPORT_WIDTH 2592
+#define ISC_MAX_SUPPORT_HEIGHT 1944
+
+#define ISC_CLK_MAX_DIV 255
+
+enum isc_clk_id {
+ ISC_ISPCK = 0,
+ ISC_MCK = 1,
+};
+
+struct isc_clk {
+ struct clk_hw hw;
+ struct clk *clk;
+ struct regmap *regmap;
+ u8 id;
+ u8 parent_id;
+ u32 div;
+ struct device *dev;
+};
+
+#define to_isc_clk(hw) container_of(hw, struct isc_clk, hw)
+
+struct isc_buffer {
+ struct vb2_v4l2_buffer vb;
+ struct list_head list;
+};
+
+struct isc_subdev_entity {
+ struct v4l2_subdev *sd;
+ struct v4l2_async_subdev *asd;
+ struct v4l2_async_notifier notifier;
+ struct v4l2_subdev_pad_config *config;
+
+ u32 pfe_cfg0;
+
+ struct list_head list;
+};
+
+/*
+ * struct isc_format - ISC media bus format information
+ * @fourcc: Fourcc code for this format
+ * @mbus_code: V4L2 media bus format code.
+ * @bpp: Bytes per pixel (when stored in memory)
+ * @reg_bps: reg value for bits per sample
+ * (when transferred over a bus)
+ * @support: Indicates format supported by subdev
+ */
+struct isc_format {
+ u32 fourcc;
+ u32 mbus_code;
+ u8 bpp;
+
+ u32 reg_bps;
+ u32 reg_rlp_mode;
+ u32 reg_dcfg_imode;
+ u32 reg_dctrl_dview;
+
+ bool support;
+};
+
+#define ISC_PIPE_LINE_NODE_NUM 11
+
+struct isc_device {
+ struct regmap *regmap;
+ struct clk *hclock;
+ struct clk *ispck;
+ struct isc_clk isc_clks[2];
+
+ struct device *dev;
+ struct v4l2_device v4l2_dev;
+ struct video_device video_dev;
+
+ struct vb2_queue vb2_vidq;
+ spinlock_t dma_queue_lock;
+ struct list_head dma_queue;
+ struct isc_buffer *cur_frm;
+ unsigned int sequence;
+ bool stop;
+ struct completion comp;
+
+ struct v4l2_format fmt;
+ struct isc_format **user_formats;
+ unsigned int num_user_formats;
+ const struct isc_format *current_fmt;
+
+ struct mutex lock;
+
+ struct regmap_field *pipeline[ISC_PIPE_LINE_NODE_NUM];
+
+ struct isc_subdev_entity *current_subdev;
+ struct list_head subdev_entities;
+};
+
+static struct isc_format isc_formats[] = {
+ { V4L2_PIX_FMT_SBGGR8, MEDIA_BUS_FMT_SBGGR8_1X8,
+ 1, ISC_PFE_CFG0_BPS_EIGHT, ISC_RLP_CFG_MODE_DAT8,
+ ISC_DCFG_IMODE_PACKED8, ISC_DCTRL_DVIEW_PACKED, false },
+ { V4L2_PIX_FMT_SGBRG8, MEDIA_BUS_FMT_SGBRG8_1X8,
+ 1, ISC_PFE_CFG0_BPS_EIGHT, ISC_RLP_CFG_MODE_DAT8,
+ ISC_DCFG_IMODE_PACKED8, ISC_DCTRL_DVIEW_PACKED, false },
+ { V4L2_PIX_FMT_SGRBG8, MEDIA_BUS_FMT_SGRBG8_1X8,
+ 1, ISC_PFE_CFG0_BPS_EIGHT, ISC_RLP_CFG_MODE_DAT8,
+ ISC_DCFG_IMODE_PACKED8, ISC_DCTRL_DVIEW_PACKED, false },
+ { V4L2_PIX_FMT_SRGGB8, MEDIA_BUS_FMT_SRGGB8_1X8,
+ 1, ISC_PFE_CFG0_BPS_EIGHT, ISC_RLP_CFG_MODE_DAT8,
+ ISC_DCFG_IMODE_PACKED8, ISC_DCTRL_DVIEW_PACKED, false },
+
+ { V4L2_PIX_FMT_SBGGR10, MEDIA_BUS_FMT_SBGGR10_1X10,
+ 2, ISC_PFG_CFG0_BPS_TEN, ISC_RLP_CFG_MODE_DAT10,
+ ISC_DCFG_IMODE_PACKED16, ISC_DCTRL_DVIEW_PACKED, false },
+ { V4L2_PIX_FMT_SGBRG10, MEDIA_BUS_FMT_SGBRG10_1X10,
+ 2, ISC_PFG_CFG0_BPS_TEN, ISC_RLP_CFG_MODE_DAT10,
+ ISC_DCFG_IMODE_PACKED16, ISC_DCTRL_DVIEW_PACKED, false },
+ { V4L2_PIX_FMT_SGRBG10, MEDIA_BUS_FMT_SGRBG10_1X10,
+ 2, ISC_PFG_CFG0_BPS_TEN, ISC_RLP_CFG_MODE_DAT10,
+ ISC_DCFG_IMODE_PACKED16, ISC_DCTRL_DVIEW_PACKED, false },
+ { V4L2_PIX_FMT_SRGGB10, MEDIA_BUS_FMT_SRGGB10_1X10,
+ 2, ISC_PFG_CFG0_BPS_TEN, ISC_RLP_CFG_MODE_DAT10,
+ ISC_DCFG_IMODE_PACKED16, ISC_DCTRL_DVIEW_PACKED, false },
+
+ { V4L2_PIX_FMT_SBGGR12, MEDIA_BUS_FMT_SBGGR12_1X12,
+ 2, ISC_PFG_CFG0_BPS_TWELVE, ISC_RLP_CFG_MODE_DAT12,
+ ISC_DCFG_IMODE_PACKED16, ISC_DCTRL_DVIEW_PACKED, false },
+ { V4L2_PIX_FMT_SGBRG12, MEDIA_BUS_FMT_SGBRG12_1X12,
+ 2, ISC_PFG_CFG0_BPS_TWELVE, ISC_RLP_CFG_MODE_DAT12,
+ ISC_DCFG_IMODE_PACKED16, ISC_DCTRL_DVIEW_PACKED, false },
+ { V4L2_PIX_FMT_SGRBG12, MEDIA_BUS_FMT_SGRBG12_1X12,
+ 2, ISC_PFG_CFG0_BPS_TWELVE, ISC_RLP_CFG_MODE_DAT12,
+ ISC_DCFG_IMODE_PACKED16, ISC_DCTRL_DVIEW_PACKED, false },
+ { V4L2_PIX_FMT_SRGGB12, MEDIA_BUS_FMT_SRGGB12_1X12,
+ 2, ISC_PFG_CFG0_BPS_TWELVE, ISC_RLP_CFG_MODE_DAT12,
+ ISC_DCFG_IMODE_PACKED16, ISC_DCTRL_DVIEW_PACKED, false },
+
+ { V4L2_PIX_FMT_YUYV, MEDIA_BUS_FMT_YUYV8_2X8,
+ 2, ISC_PFE_CFG0_BPS_EIGHT, ISC_RLP_CFG_MODE_DAT8,
+ ISC_DCFG_IMODE_PACKED8, ISC_DCTRL_DVIEW_PACKED, false },
+};
+
+static int isc_clk_enable(struct clk_hw *hw)
+{
+ struct isc_clk *isc_clk = to_isc_clk(hw);
+ u32 id = isc_clk->id;
+ struct regmap *regmap = isc_clk->regmap;
+
+ dev_dbg(isc_clk->dev, "ISC CLK: %s, div = %d, parent id = %d\n",
+ __func__, isc_clk->div, isc_clk->parent_id);
+
+ regmap_update_bits(regmap, ISC_CLKCFG,
+ ISC_CLKCFG_DIV_MASK(id) | ISC_CLKCFG_SEL_MASK(id),
+ (isc_clk->div << ISC_CLKCFG_DIV_SHIFT(id)) |
+ (isc_clk->parent_id << ISC_CLKCFG_SEL_SHIFT(id)));
+
+ regmap_write(regmap, ISC_CLKEN, ISC_CLK(id));
+
+ return 0;
+}
+
+static void isc_clk_disable(struct clk_hw *hw)
+{
+ struct isc_clk *isc_clk = to_isc_clk(hw);
+ u32 id = isc_clk->id;
+
+ regmap_write(isc_clk->regmap, ISC_CLKDIS, ISC_CLK(id));
+}
+
+static int isc_clk_is_enabled(struct clk_hw *hw)
+{
+ struct isc_clk *isc_clk = to_isc_clk(hw);
+ u32 status;
+
+ regmap_read(isc_clk->regmap, ISC_CLKSR, &status);
+
+ return status & ISC_CLK(isc_clk->id) ? 1 : 0;
+}
+
+static unsigned long
+isc_clk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate)
+{
+ struct isc_clk *isc_clk = to_isc_clk(hw);
+
+ return DIV_ROUND_CLOSEST(parent_rate, isc_clk->div + 1);
+}
+
+static int isc_clk_determine_rate(struct clk_hw *hw,
+ struct clk_rate_request *req)
+{
+ struct isc_clk *isc_clk = to_isc_clk(hw);
+ long best_rate = -EINVAL;
+ int best_diff = -1;
+ unsigned int i, div;
+
+ for (i = 0; i < clk_hw_get_num_parents(hw); i++) {
+ struct clk_hw *parent;
+ unsigned long parent_rate;
+
+ parent = clk_hw_get_parent_by_index(hw, i);
+ if (!parent)
+ continue;
+
+ parent_rate = clk_hw_get_rate(parent);
+ if (!parent_rate)
+ continue;
+
+ for (div = 1; div < ISC_CLK_MAX_DIV + 2; div++) {
+ unsigned long rate;
+ int diff;
+
+ rate = DIV_ROUND_CLOSEST(parent_rate, div);
+ diff = abs(req->rate - rate);
+
+ if (best_diff < 0 || best_diff > diff) {
+ best_rate = rate;
+ best_diff = diff;
+ req->best_parent_rate = parent_rate;
+ req->best_parent_hw = parent;
+ }
+
+ if (!best_diff || rate < req->rate)
+ break;
+ }
+
+ if (!best_diff)
+ break;
+ }
+
+ dev_dbg(isc_clk->dev,
+ "ISC CLK: %s, best_rate = %ld, parent clk: %s @ %ld\n",
+ __func__, best_rate,
+ __clk_get_name((req->best_parent_hw)->clk),
+ req->best_parent_rate);
+
+ if (best_rate < 0)
+ return best_rate;
+
+ req->rate = best_rate;
+
+ return 0;
+}
+
+static int isc_clk_set_parent(struct clk_hw *hw, u8 index)
+{
+ struct isc_clk *isc_clk = to_isc_clk(hw);
+
+ if (index >= clk_hw_get_num_parents(hw))
+ return -EINVAL;
+
+ isc_clk->parent_id = index;
+
+ return 0;
+}
+
+static u8 isc_clk_get_parent(struct clk_hw *hw)
+{
+ struct isc_clk *isc_clk = to_isc_clk(hw);
+
+ return isc_clk->parent_id;
+}
+
+static int isc_clk_set_rate(struct clk_hw *hw,
+ unsigned long rate,
+ unsigned long parent_rate)
+{
+ struct isc_clk *isc_clk = to_isc_clk(hw);
+ u32 div;
+
+ if (!rate)
+ return -EINVAL;
+
+ div = DIV_ROUND_CLOSEST(parent_rate, rate);
+ if (div > (ISC_CLK_MAX_DIV + 1) || !div)
+ return -EINVAL;
+
+ isc_clk->div = div - 1;
+
+ return 0;
+}
+
+static const struct clk_ops isc_clk_ops = {
+ .enable = isc_clk_enable,
+ .disable = isc_clk_disable,
+ .is_enabled = isc_clk_is_enabled,
+ .recalc_rate = isc_clk_recalc_rate,
+ .determine_rate = isc_clk_determine_rate,
+ .set_parent = isc_clk_set_parent,
+ .get_parent = isc_clk_get_parent,
+ .set_rate = isc_clk_set_rate,
+};
+
+static int isc_clk_register(struct isc_device *isc, unsigned int id)
+{
+ struct regmap *regmap = isc->regmap;
+ struct device_node *np = isc->dev->of_node;
+ struct isc_clk *isc_clk;
+ struct clk_init_data init;
+ const char *clk_name = np->name;
+ const char *parent_names[3];
+ int num_parents;
+
+ num_parents = of_clk_get_parent_count(np);
+ if (num_parents < 1 || num_parents > 3)
+ return -EINVAL;
+
+ if (num_parents > 2 && id == ISC_ISPCK)
+ num_parents = 2;
+
+ of_clk_parent_fill(np, parent_names, num_parents);
+
+ if (id == ISC_MCK)
+ of_property_read_string(np, "clock-output-names", &clk_name);
+ else
+ clk_name = "isc-ispck";
+
+ init.parent_names = parent_names;
+ init.num_parents = num_parents;
+ init.name = clk_name;
+ init.ops = &isc_clk_ops;
+ init.flags = CLK_SET_RATE_GATE | CLK_SET_PARENT_GATE;
+
+ isc_clk = &isc->isc_clks[id];
+ isc_clk->hw.init = &init;
+ isc_clk->regmap = regmap;
+ isc_clk->id = id;
+ isc_clk->dev = isc->dev;
+
+ isc_clk->clk = clk_register(isc->dev, &isc_clk->hw);
+ if (IS_ERR(isc_clk->clk)) {
+ dev_err(isc->dev, "%s: clock register fail\n", clk_name);
+ return PTR_ERR(isc_clk->clk);
+ } else if (id == ISC_MCK)
+ of_clk_add_provider(np, of_clk_src_simple_get, isc_clk->clk);
+
+ return 0;
+}
+
+static int isc_clk_init(struct isc_device *isc)
+{
+ unsigned int i;
+ int ret;
+
+ for (i = 0; i < ARRAY_SIZE(isc->isc_clks); i++)
+ isc->isc_clks[i].clk = ERR_PTR(-EINVAL);
+
+ for (i = 0; i < ARRAY_SIZE(isc->isc_clks); i++) {
+ ret = isc_clk_register(isc, i);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
+}
+
+static void isc_clk_cleanup(struct isc_device *isc)
+{
+ unsigned int i;
+
+ of_clk_del_provider(isc->dev->of_node);
+
+ for (i = 0; i < ARRAY_SIZE(isc->isc_clks); i++) {
+ struct isc_clk *isc_clk = &isc->isc_clks[i];
+
+ if (!IS_ERR(isc_clk->clk))
+ clk_unregister(isc_clk->clk);
+ }
+}
+
+static int isc_queue_setup(struct vb2_queue *vq,
+ unsigned int *nbuffers, unsigned int *nplanes,
+ unsigned int sizes[], struct device *alloc_devs[])
+{
+ struct isc_device *isc = vb2_get_drv_priv(vq);
+ unsigned int size = isc->fmt.fmt.pix.sizeimage;
+
+ if (*nplanes)
+ return sizes[0] < size ? -EINVAL : 0;
+
+ *nplanes = 1;
+ sizes[0] = size;
+
+ return 0;
+}
+
+static int isc_buffer_prepare(struct vb2_buffer *vb)
+{
+ struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
+ struct isc_device *isc = vb2_get_drv_priv(vb->vb2_queue);
+ unsigned long size = isc->fmt.fmt.pix.sizeimage;
+
+ if (vb2_plane_size(vb, 0) < size) {
+ v4l2_err(&isc->v4l2_dev, "buffer too small (%lu < %lu)\n",
+ vb2_plane_size(vb, 0), size);
+ return -EINVAL;
+ }
+
+ vb2_set_plane_payload(vb, 0, size);
+
+ vbuf->field = isc->fmt.fmt.pix.field;
+
+ return 0;
+}
+
+static inline void isc_start_dma(struct regmap *regmap,
+ struct isc_buffer *frm, u32 dview)
+{
+ dma_addr_t addr;
+
+ addr = vb2_dma_contig_plane_dma_addr(&frm->vb.vb2_buf, 0);
+
+ regmap_write(regmap, ISC_DCTRL, dview | ISC_DCTRL_IE_IS);
+ regmap_write(regmap, ISC_DAD0, addr);
+ regmap_write(regmap, ISC_CTRLEN, ISC_CTRL_CAPTURE);
+}
+
+static void isc_set_pipeline(struct isc_device *isc, u32 pipeline)
+{
+ u32 val;
+ unsigned int i;
+
+ for (i = 0; i < ISC_PIPE_LINE_NODE_NUM; i++) {
+ val = pipeline & BIT(i) ? 1 : 0;
+ regmap_field_write(isc->pipeline[i], val);
+ }
+}
+
+static int isc_configure(struct isc_device *isc)
+{
+ struct regmap *regmap = isc->regmap;
+ const struct isc_format *current_fmt = isc->current_fmt;
+ struct isc_subdev_entity *subdev = isc->current_subdev;
+ u32 val, mask;
+ int counter = 10;
+
+ val = current_fmt->reg_bps | subdev->pfe_cfg0 |
+ ISC_PFE_CFG0_MODE_PROGRESSIVE;
+ mask = ISC_PFE_CFG0_BPS_MASK | ISC_PFE_CFG0_HPOL_LOW |
+ ISC_PFE_CFG0_VPOL_LOW | ISC_PFE_CFG0_PPOL_LOW |
+ ISC_PFE_CFG0_MODE_MASK;
+
+ regmap_update_bits(regmap, ISC_PFE_CFG0, mask, val);
+
+ regmap_update_bits(regmap, ISC_RLP_CFG, ISC_RLP_CFG_MODE_MASK,
+ current_fmt->reg_rlp_mode);
+
+ regmap_update_bits(regmap, ISC_DCFG, ISC_DCFG_IMODE_MASK,
+ current_fmt->reg_dcfg_imode);
+
+ /* Disable the pipeline */
+ isc_set_pipeline(isc, 0x0);
+
+ /* Update profile */
+ regmap_write(regmap, ISC_CTRLEN, ISC_CTRL_UPPRO);
+
+ regmap_read(regmap, ISC_CTRLSR, &val);
+ while ((val & ISC_CTRL_UPPRO) && counter--) {
+ usleep_range(1000, 2000);
+ regmap_read(regmap, ISC_CTRLSR, &val);
+ }
+
+ if (counter < 0)
+ return -ETIMEDOUT;
+
+ return 0;
+}
+
+static int isc_start_streaming(struct vb2_queue *vq, unsigned int count)
+{
+ struct isc_device *isc = vb2_get_drv_priv(vq);
+ struct regmap *regmap = isc->regmap;
+ struct isc_buffer *buf;
+ unsigned long flags;
+ int ret;
+ u32 val;
+
+ /* Enable stream on the sub device */
+ ret = v4l2_subdev_call(isc->current_subdev->sd, video, s_stream, 1);
+ if (ret && ret != -ENOIOCTLCMD) {
+ v4l2_err(&isc->v4l2_dev, "stream on failed in subdev\n");
+ goto err_start_stream;
+ }
+
+ pm_runtime_get_sync(isc->dev);
+
+ /* Disable all the interrupts */
+ regmap_write(isc->regmap, ISC_INTDIS, (u32)~0UL);
+
+ /* Clean the interrupt status register */
+ regmap_read(regmap, ISC_INTSR, &val);
+
+ ret = isc_configure(isc);
+ if (unlikely(ret))
+ goto err_configure;
+
+ /* Enable DMA interrupt */
+ regmap_write(regmap, ISC_INTEN, ISC_INT_DDONE);
+
+ spin_lock_irqsave(&isc->dma_queue_lock, flags);
+
+ isc->sequence = 0;
+ isc->stop = false;
+ reinit_completion(&isc->comp);
+
+ isc->cur_frm = list_first_entry(&isc->dma_queue,
+ struct isc_buffer, list);
+ list_del(&isc->cur_frm->list);
+
+ isc_start_dma(regmap, isc->cur_frm, isc->current_fmt->reg_dctrl_dview);
+
+ spin_unlock_irqrestore(&isc->dma_queue_lock, flags);
+
+ return 0;
+
+err_configure:
+ pm_runtime_put_sync(isc->dev);
+
+ v4l2_subdev_call(isc->current_subdev->sd, video, s_stream, 0);
+
+err_start_stream:
+ spin_lock_irqsave(&isc->dma_queue_lock, flags);
+ list_for_each_entry(buf, &isc->dma_queue, list)
+ vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_QUEUED);
+ INIT_LIST_HEAD(&isc->dma_queue);
+ spin_unlock_irqrestore(&isc->dma_queue_lock, flags);
+
+ return ret;
+}
+
+static void isc_stop_streaming(struct vb2_queue *vq)
+{
+ struct isc_device *isc = vb2_get_drv_priv(vq);
+ unsigned long flags;
+ struct isc_buffer *buf;
+ int ret;
+
+ isc->stop = true;
+
+ /* Wait until the end of the current frame */
+ if (isc->cur_frm && !wait_for_completion_timeout(&isc->comp, 5 * HZ))
+ v4l2_err(&isc->v4l2_dev,
+ "Timeout waiting for end of the capture\n");
+
+ /* Disable DMA interrupt */
+ regmap_write(isc->regmap, ISC_INTDIS, ISC_INT_DDONE);
+
+ pm_runtime_put_sync(isc->dev);
+
+ /* Disable stream on the sub device */
+ ret = v4l2_subdev_call(isc->current_subdev->sd, video, s_stream, 0);
+ if (ret && ret != -ENOIOCTLCMD)
+ v4l2_err(&isc->v4l2_dev, "stream off failed in subdev\n");
+
+ /* Release all active buffers */
+ spin_lock_irqsave(&isc->dma_queue_lock, flags);
+ if (unlikely(isc->cur_frm)) {
+ vb2_buffer_done(&isc->cur_frm->vb.vb2_buf,
+ VB2_BUF_STATE_ERROR);
+ isc->cur_frm = NULL;
+ }
+ list_for_each_entry(buf, &isc->dma_queue, list)
+ vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR);
+ INIT_LIST_HEAD(&isc->dma_queue);
+ spin_unlock_irqrestore(&isc->dma_queue_lock, flags);
+}
+
+static void isc_buffer_queue(struct vb2_buffer *vb)
+{
+ struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
+ struct isc_buffer *buf = container_of(vbuf, struct isc_buffer, vb);
+ struct isc_device *isc = vb2_get_drv_priv(vb->vb2_queue);
+ unsigned long flags;
+
+ spin_lock_irqsave(&isc->dma_queue_lock, flags);
+ list_add_tail(&buf->list, &isc->dma_queue);
+ spin_unlock_irqrestore(&isc->dma_queue_lock, flags);
+}
+
+static struct vb2_ops isc_vb2_ops = {
+ .queue_setup = isc_queue_setup,
+ .wait_prepare = vb2_ops_wait_prepare,
+ .wait_finish = vb2_ops_wait_finish,
+ .buf_prepare = isc_buffer_prepare,
+ .start_streaming = isc_start_streaming,
+ .stop_streaming = isc_stop_streaming,
+ .buf_queue = isc_buffer_queue,
+};
+
+static int isc_querycap(struct file *file, void *priv,
+ struct v4l2_capability *cap)
+{
+ struct isc_device *isc = video_drvdata(file);
+
+ strcpy(cap->driver, ATMEL_ISC_NAME);
+ strcpy(cap->card, "Atmel Image Sensor Controller");
+ snprintf(cap->bus_info, sizeof(cap->bus_info),
+ "platform:%s", isc->v4l2_dev.name);
+
+ return 0;
+}
+
+static int isc_enum_fmt_vid_cap(struct file *file, void *priv,
+ struct v4l2_fmtdesc *f)
+{
+ struct isc_device *isc = video_drvdata(file);
+ u32 index = f->index;
+
+ if (index >= isc->num_user_formats)
+ return -EINVAL;
+
+ f->pixelformat = isc->user_formats[index]->fourcc;
+
+ return 0;
+}
+
+static int isc_g_fmt_vid_cap(struct file *file, void *priv,
+ struct v4l2_format *fmt)
+{
+ struct isc_device *isc = video_drvdata(file);
+
+ *fmt = isc->fmt;
+
+ return 0;
+}
+
+static struct isc_format *find_format_by_fourcc(struct isc_device *isc,
+ unsigned int fourcc)
+{
+ unsigned int num_formats = isc->num_user_formats;
+ struct isc_format *fmt;
+ unsigned int i;
+
+ for (i = 0; i < num_formats; i++) {
+ fmt = isc->user_formats[i];
+ if (fmt->fourcc == fourcc)
+ return fmt;
+ }
+
+ return NULL;
+}
+
+static int isc_try_fmt(struct isc_device *isc, struct v4l2_format *f,
+ struct isc_format **current_fmt)
+{
+ struct isc_format *isc_fmt;
+ struct v4l2_pix_format *pixfmt = &f->fmt.pix;
+ struct v4l2_subdev_format format = {
+ .which = V4L2_SUBDEV_FORMAT_TRY,
+ };
+ int ret;
+
+ if (f->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+ return -EINVAL;
+
+ isc_fmt = find_format_by_fourcc(isc, pixfmt->pixelformat);
+ if (!isc_fmt) {
+ v4l2_warn(&isc->v4l2_dev, "Format 0x%x not found\n",
+ pixfmt->pixelformat);
+ isc_fmt = isc->user_formats[isc->num_user_formats - 1];
+ pixfmt->pixelformat = isc_fmt->fourcc;
+ }
+
+ /* Limit to Atmel ISC hardware capabilities */
+ if (pixfmt->width > ISC_MAX_SUPPORT_WIDTH)
+ pixfmt->width = ISC_MAX_SUPPORT_WIDTH;
+ if (pixfmt->height > ISC_MAX_SUPPORT_HEIGHT)
+ pixfmt->height = ISC_MAX_SUPPORT_HEIGHT;
+
+ v4l2_fill_mbus_format(&format.format, pixfmt, isc_fmt->mbus_code);
+ ret = v4l2_subdev_call(isc->current_subdev->sd, pad, set_fmt,
+ isc->current_subdev->config, &format);
+ if (ret < 0)
+ return ret;
+
+ v4l2_fill_pix_format(pixfmt, &format.format);
+
+ pixfmt->field = V4L2_FIELD_NONE;
+ pixfmt->bytesperline = pixfmt->width * isc_fmt->bpp;
+ pixfmt->sizeimage = pixfmt->bytesperline * pixfmt->height;
+
+ if (current_fmt)
+ *current_fmt = isc_fmt;
+
+ return 0;
+}
+
+static int isc_set_fmt(struct isc_device *isc, struct v4l2_format *f)
+{
+ struct v4l2_subdev_format format = {
+ .which = V4L2_SUBDEV_FORMAT_ACTIVE,
+ };
+ struct isc_format *current_fmt;
+ int ret;
+
+ ret = isc_try_fmt(isc, f, ¤t_fmt);
+ if (ret)
+ return ret;
+
+ v4l2_fill_mbus_format(&format.format, &f->fmt.pix,
+ current_fmt->mbus_code);
+ ret = v4l2_subdev_call(isc->current_subdev->sd, pad,
+ set_fmt, NULL, &format);
+ if (ret < 0)
+ return ret;
+
+ isc->fmt = *f;
+ isc->current_fmt = current_fmt;
+
+ return 0;
+}
+
+static int isc_s_fmt_vid_cap(struct file *file, void *priv,
+ struct v4l2_format *f)
+{
+ struct isc_device *isc = video_drvdata(file);
+
+ if (vb2_is_streaming(&isc->vb2_vidq))
+ return -EBUSY;
+
+ return isc_set_fmt(isc, f);
+}
+
+static int isc_try_fmt_vid_cap(struct file *file, void *priv,
+ struct v4l2_format *f)
+{
+ struct isc_device *isc = video_drvdata(file);
+
+ return isc_try_fmt(isc, f, NULL);
+}
+
+static int isc_enum_input(struct file *file, void *priv,
+ struct v4l2_input *inp)
+{
+ if (inp->index != 0)
+ return -EINVAL;
+
+ inp->type = V4L2_INPUT_TYPE_CAMERA;
+ inp->std = 0;
+ strcpy(inp->name, "Camera");
+
+ return 0;
+}
+
+static int isc_g_input(struct file *file, void *priv, unsigned int *i)
+{
+ *i = 0;
+
+ return 0;
+}
+
+static int isc_s_input(struct file *file, void *priv, unsigned int i)
+{
+ if (i > 0)
+ return -EINVAL;
+
+ return 0;
+}
+
+static int isc_g_parm(struct file *file, void *fh, struct v4l2_streamparm *a)
+{
+ struct isc_device *isc = video_drvdata(file);
+
+ if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+ return -EINVAL;
+
+ return v4l2_subdev_call(isc->current_subdev->sd, video, g_parm, a);
+}
+
+static int isc_s_parm(struct file *file, void *fh, struct v4l2_streamparm *a)
+{
+ struct isc_device *isc = video_drvdata(file);
+
+ if (a->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
+ return -EINVAL;
+
+ return v4l2_subdev_call(isc->current_subdev->sd, video, s_parm, a);
+}
+
+static int isc_enum_framesizes(struct file *file, void *fh,
+ struct v4l2_frmsizeenum *fsize)
+{
+ struct isc_device *isc = video_drvdata(file);
+ const struct isc_format *isc_fmt;
+ struct v4l2_subdev_frame_size_enum fse = {
+ .index = fsize->index,
+ .which = V4L2_SUBDEV_FORMAT_ACTIVE,
+ };
+ int ret;
+
+ isc_fmt = find_format_by_fourcc(isc, fsize->pixel_format);
+ if (!isc_fmt)
+ return -EINVAL;
+
+ fse.code = isc_fmt->mbus_code;
+
+ ret = v4l2_subdev_call(isc->current_subdev->sd, pad, enum_frame_size,
+ NULL, &fse);
+ if (ret)
+ return ret;
+
+ fsize->type = V4L2_FRMSIZE_TYPE_DISCRETE;
+ fsize->discrete.width = fse.max_width;
+ fsize->discrete.height = fse.max_height;
+
+ return 0;
+}
+
+static int isc_enum_frameintervals(struct file *file, void *fh,
+ struct v4l2_frmivalenum *fival)
+{
+ struct isc_device *isc = video_drvdata(file);
+ const struct isc_format *isc_fmt;
+ struct v4l2_subdev_frame_interval_enum fie = {
+ .index = fival->index,
+ .width = fival->width,
+ .height = fival->height,
+ .which = V4L2_SUBDEV_FORMAT_ACTIVE,
+ };
+ int ret;
+
+ isc_fmt = find_format_by_fourcc(isc, fival->pixel_format);
+ if (!isc_fmt)
+ return -EINVAL;
+
+ fie.code = isc_fmt->mbus_code;
+
+ ret = v4l2_subdev_call(isc->current_subdev->sd, pad,
+ enum_frame_interval, NULL, &fie);
+ if (ret)
+ return ret;
+
+ fival->type = V4L2_FRMIVAL_TYPE_DISCRETE;
+ fival->discrete = fie.interval;
+
+ return 0;
+}
+
+static const struct v4l2_ioctl_ops isc_ioctl_ops = {
+ .vidioc_querycap = isc_querycap,
+ .vidioc_enum_fmt_vid_cap = isc_enum_fmt_vid_cap,
+ .vidioc_g_fmt_vid_cap = isc_g_fmt_vid_cap,
+ .vidioc_s_fmt_vid_cap = isc_s_fmt_vid_cap,
+ .vidioc_try_fmt_vid_cap = isc_try_fmt_vid_cap,
+
+ .vidioc_enum_input = isc_enum_input,
+ .vidioc_g_input = isc_g_input,
+ .vidioc_s_input = isc_s_input,
+
+ .vidioc_reqbufs = vb2_ioctl_reqbufs,
+ .vidioc_querybuf = vb2_ioctl_querybuf,
+ .vidioc_qbuf = vb2_ioctl_qbuf,
+ .vidioc_expbuf = vb2_ioctl_expbuf,
+ .vidioc_dqbuf = vb2_ioctl_dqbuf,
+ .vidioc_create_bufs = vb2_ioctl_create_bufs,
+ .vidioc_prepare_buf = vb2_ioctl_prepare_buf,
+ .vidioc_streamon = vb2_ioctl_streamon,
+ .vidioc_streamoff = vb2_ioctl_streamoff,
+
+ .vidioc_g_parm = isc_g_parm,
+ .vidioc_s_parm = isc_s_parm,
+ .vidioc_enum_framesizes = isc_enum_framesizes,
+ .vidioc_enum_frameintervals = isc_enum_frameintervals,
+};
+
+static int isc_open(struct file *file)
+{
+ struct isc_device *isc = video_drvdata(file);
+ struct v4l2_subdev *sd = isc->current_subdev->sd;
+ int ret;
+
+ if (mutex_lock_interruptible(&isc->lock))
+ return -ERESTARTSYS;
+
+ ret = v4l2_fh_open(file);
+ if (ret < 0)
+ goto unlock;
+
+ if (!v4l2_fh_is_singular_file(file))
+ goto unlock;
+
+ ret = v4l2_subdev_call(sd, core, s_power, 1);
+ if (ret < 0 && ret != -ENOIOCTLCMD)
+ v4l2_fh_release(file);
+ else
+ ret = 0;
+
+unlock:
+ mutex_unlock(&isc->lock);
+ return ret;
+}
+
+static int isc_release(struct file *file)
+{
+ struct isc_device *isc = video_drvdata(file);
+ struct v4l2_subdev *sd = isc->current_subdev->sd;
+ bool fh_singular;
+ int ret;
+
+ mutex_lock(&isc->lock);
+
+ fh_singular = v4l2_fh_is_singular_file(file);
+
+ ret = _vb2_fop_release(file, NULL);
+
+ if (fh_singular)
+ v4l2_subdev_call(sd, core, s_power, 0);
+
+ mutex_unlock(&isc->lock);
+
+ return ret;
+}
+
+static const struct v4l2_file_operations isc_fops = {
+ .owner = THIS_MODULE,
+ .open = isc_open,
+ .release = isc_release,
+ .unlocked_ioctl = video_ioctl2,
+ .read = vb2_fop_read,
+ .mmap = vb2_fop_mmap,
+ .poll = vb2_fop_poll,
+};
+
+static irqreturn_t isc_interrupt(int irq, void *dev_id)
+{
+ struct isc_device *isc = (struct isc_device *)dev_id;
+ struct regmap *regmap = isc->regmap;
+ u32 isc_intsr, isc_intmask, pending;
+ irqreturn_t ret = IRQ_NONE;
+
+ spin_lock(&isc->dma_queue_lock);
+
+ regmap_read(regmap, ISC_INTSR, &isc_intsr);
+ regmap_read(regmap, ISC_INTMASK, &isc_intmask);
+
+ pending = isc_intsr & isc_intmask;
+
+ if (likely(pending & ISC_INT_DDONE)) {
+ if (isc->cur_frm) {
+ struct vb2_v4l2_buffer *vbuf = &isc->cur_frm->vb;
+ struct vb2_buffer *vb = &vbuf->vb2_buf;
+
+ vb->timestamp = ktime_get_ns();
+ vbuf->sequence = isc->sequence++;
+ vb2_buffer_done(vb, VB2_BUF_STATE_DONE);
+ isc->cur_frm = NULL;
+ }
+
+ if (!list_empty(&isc->dma_queue) && !isc->stop) {
+ isc->cur_frm = list_first_entry(&isc->dma_queue,
+ struct isc_buffer, list);
+ list_del(&isc->cur_frm->list);
+
+ isc_start_dma(regmap, isc->cur_frm,
+ isc->current_fmt->reg_dctrl_dview);
+ }
+
+ if (isc->stop)
+ complete(&isc->comp);
+
+ ret = IRQ_HANDLED;
+ }
+
+ spin_unlock(&isc->dma_queue_lock);
+
+ return ret;
+}
+
+static int isc_async_bound(struct v4l2_async_notifier *notifier,
+ struct v4l2_subdev *subdev,
+ struct v4l2_async_subdev *asd)
+{
+ struct isc_device *isc = container_of(notifier->v4l2_dev,
+ struct isc_device, v4l2_dev);
+ struct isc_subdev_entity *subdev_entity =
+ container_of(notifier, struct isc_subdev_entity, notifier);
+
+ if (video_is_registered(&isc->video_dev)) {
+ v4l2_err(&isc->v4l2_dev, "only supports one sub-device.\n");
+ return -EBUSY;
+ }
+
+ subdev_entity->sd = subdev;
+
+ return 0;
+}
+
+static void isc_async_unbind(struct v4l2_async_notifier *notifier,
+ struct v4l2_subdev *subdev,
+ struct v4l2_async_subdev *asd)
+{
+ struct isc_device *isc = container_of(notifier->v4l2_dev,
+ struct isc_device, v4l2_dev);
+
+ video_unregister_device(&isc->video_dev);
+ if (isc->current_subdev->config)
+ v4l2_subdev_free_pad_config(isc->current_subdev->config);
+}
+
+static struct isc_format *find_format_by_code(unsigned int code, int *index)
+{
+ struct isc_format *fmt = &isc_formats[0];
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE(isc_formats); i++) {
+ if (fmt->mbus_code == code) {
+ *index = i;
+ return fmt;
+ }
+
+ fmt++;
+ }
+
+ return NULL;
+}
+
+static int isc_formats_init(struct isc_device *isc)
+{
+ struct isc_format *fmt;
+ struct v4l2_subdev *subdev = isc->current_subdev->sd;
+ int num_fmts = 0, i, j;
+ struct v4l2_subdev_mbus_code_enum mbus_code = {
+ .which = V4L2_SUBDEV_FORMAT_ACTIVE,
+ };
+
+ fmt = &isc_formats[0];
+ for (i = 0; i < ARRAY_SIZE(isc_formats); i++) {
+ fmt->support = false;
+ fmt++;
+ }
+
+ while (!v4l2_subdev_call(subdev, pad, enum_mbus_code,
+ NULL, &mbus_code)) {
+ mbus_code.index++;
+ fmt = find_format_by_code(mbus_code.code, &i);
+ if (!fmt)
+ continue;
+
+ fmt->support = true;
+ num_fmts++;
+ }
+
+ if (!num_fmts)
+ return -ENXIO;
+
+ isc->num_user_formats = num_fmts;
+ isc->user_formats = devm_kcalloc(isc->dev,
+ num_fmts, sizeof(struct isc_format *),
+ GFP_KERNEL);
+ if (!isc->user_formats) {
+ v4l2_err(&isc->v4l2_dev, "could not allocate memory\n");
+ return -ENOMEM;
+ }
+
+ fmt = &isc_formats[0];
+ for (i = 0, j = 0; i < ARRAY_SIZE(isc_formats); i++) {
+ if (fmt->support)
+ isc->user_formats[j++] = fmt;
+
+ fmt++;
+ }
+
+ return 0;
+}
+
+static int isc_set_default_fmt(struct isc_device *isc)
+{
+ struct v4l2_format f = {
+ .type = V4L2_BUF_TYPE_VIDEO_CAPTURE,
+ .fmt.pix = {
+ .width = VGA_WIDTH,
+ .height = VGA_HEIGHT,
+ .field = V4L2_FIELD_NONE,
+ .pixelformat = isc->user_formats[0]->fourcc,
+ },
+ };
+
+ return isc_set_fmt(isc, &f);
+}
+
+static int isc_async_complete(struct v4l2_async_notifier *notifier)
+{
+ struct isc_device *isc = container_of(notifier->v4l2_dev,
+ struct isc_device, v4l2_dev);
+ struct isc_subdev_entity *sd_entity;
+ struct video_device *vdev = &isc->video_dev;
+ struct vb2_queue *q = &isc->vb2_vidq;
+ int ret;
+
+ isc->current_subdev = container_of(notifier,
+ struct isc_subdev_entity, notifier);
+ sd_entity = isc->current_subdev;
+
+ mutex_init(&isc->lock);
+ init_completion(&isc->comp);
+
+ /* Initialize videobuf2 queue */
+ q->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
+ q->io_modes = VB2_MMAP | VB2_DMABUF | VB2_READ;
+ q->drv_priv = isc;
+ q->buf_struct_size = sizeof(struct isc_buffer);
+ q->ops = &isc_vb2_ops;
+ q->mem_ops = &vb2_dma_contig_memops;
+ q->timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC;
+ q->lock = &isc->lock;
+ q->min_buffers_needed = 1;
+ q->dev = isc->dev;
+
+ ret = vb2_queue_init(q);
+ if (ret < 0) {
+ v4l2_err(&isc->v4l2_dev,
+ "vb2_queue_init() failed: %d\n", ret);
+ return ret;
+ }
+
+ /* Init video dma queues */
+ INIT_LIST_HEAD(&isc->dma_queue);
+ spin_lock_init(&isc->dma_queue_lock);
+
+ sd_entity->config = v4l2_subdev_alloc_pad_config(sd_entity->sd);
+ if (sd_entity->config == NULL)
+ return -ENOMEM;
+
+ ret = isc_formats_init(isc);
+ if (ret < 0) {
+ v4l2_err(&isc->v4l2_dev,
+ "Init format failed: %d\n", ret);
+ return ret;
+ }
+
+ ret = v4l2_subdev_call(sd_entity->sd, core, s_power, 1);
+ if (ret < 0 && ret != -ENOIOCTLCMD)
+ return ret;
+
+ ret = isc_set_default_fmt(isc);
+ if (ret) {
+ v4l2_err(&isc->v4l2_dev, "Could not set default format\n");
+ return ret;
+ }
+
+ ret = v4l2_subdev_call(sd_entity->sd, core, s_power, 0);
+ if (ret < 0 && ret != -ENOIOCTLCMD)
+ return ret;
+
+ /* Register video device */
+ strlcpy(vdev->name, ATMEL_ISC_NAME, sizeof(vdev->name));
+ vdev->release = video_device_release_empty;
+ vdev->fops = &isc_fops;
+ vdev->ioctl_ops = &isc_ioctl_ops;
+ vdev->v4l2_dev = &isc->v4l2_dev;
+ vdev->vfl_dir = VFL_DIR_RX;
+ vdev->queue = q;
+ vdev->lock = &isc->lock;
+ vdev->ctrl_handler = isc->current_subdev->sd->ctrl_handler;
+ vdev->device_caps = V4L2_CAP_STREAMING | V4L2_CAP_VIDEO_CAPTURE;
+ video_set_drvdata(vdev, isc);
+
+ ret = video_register_device(vdev, VFL_TYPE_GRABBER, -1);
+ if (ret < 0) {
+ v4l2_err(&isc->v4l2_dev,
+ "video_register_device failed: %d\n", ret);
+ return ret;
+ }
+
+ return 0;
+}
+
+static void isc_subdev_cleanup(struct isc_device *isc)
+{
+ struct isc_subdev_entity *subdev_entity;
+
+ list_for_each_entry(subdev_entity, &isc->subdev_entities, list)
+ v4l2_async_notifier_unregister(&subdev_entity->notifier);
+
+ INIT_LIST_HEAD(&isc->subdev_entities);
+}
+
+static int isc_pipeline_init(struct isc_device *isc)
+{
+ struct device *dev = isc->dev;
+ struct regmap *regmap = isc->regmap;
+ struct regmap_field *regs;
+ unsigned int i;
+
+ /* WB-->CFA-->CC-->GAM-->CSC-->CBC-->SUB422-->SUB420 */
+ const struct reg_field regfields[ISC_PIPE_LINE_NODE_NUM] = {
+ REG_FIELD(ISC_WB_CTRL, 0, 0),
+ REG_FIELD(ISC_CFA_CTRL, 0, 0),
+ REG_FIELD(ISC_CC_CTRL, 0, 0),
+ REG_FIELD(ISC_GAM_CTRL, 0, 0),
+ REG_FIELD(ISC_GAM_CTRL, 1, 1),
+ REG_FIELD(ISC_GAM_CTRL, 2, 2),
+ REG_FIELD(ISC_GAM_CTRL, 3, 3),
+ REG_FIELD(ISC_CSC_CTRL, 0, 0),
+ REG_FIELD(ISC_CBC_CTRL, 0, 0),
+ REG_FIELD(ISC_SUB422_CTRL, 0, 0),
+ REG_FIELD(ISC_SUB420_CTRL, 0, 0),
+ };
+
+ for (i = 0; i < ISC_PIPE_LINE_NODE_NUM; i++) {
+ regs = devm_regmap_field_alloc(dev, regmap, regfields[i]);
+ if (IS_ERR(regs))
+ return PTR_ERR(regs);
+
+ isc->pipeline[i] = regs;
+ }
+
+ return 0;
+}
+
+static int isc_parse_dt(struct device *dev, struct isc_device *isc)
+{
+ struct device_node *np = dev->of_node;
+ struct device_node *epn = NULL, *rem;
+ struct v4l2_of_endpoint v4l2_epn;
+ struct isc_subdev_entity *subdev_entity;
+ unsigned int flags;
+ int ret;
+
+ INIT_LIST_HEAD(&isc->subdev_entities);
+
+ for (; ;) {
+ epn = of_graph_get_next_endpoint(np, epn);
+ if (!epn)
+ break;
+
+ rem = of_graph_get_remote_port_parent(epn);
+ if (!rem) {
+ dev_notice(dev, "Remote device at %s not found\n",
+ of_node_full_name(epn));
+ continue;
+ }
+
+ ret = v4l2_of_parse_endpoint(epn, &v4l2_epn);
+ if (ret) {
+ of_node_put(rem);
+ ret = -EINVAL;
+ dev_err(dev, "Could not parse the endpoint\n");
+ break;
+ }
+
+ subdev_entity = devm_kzalloc(dev,
+ sizeof(*subdev_entity), GFP_KERNEL);
+ if (subdev_entity == NULL) {
+ of_node_put(rem);
+ ret = -ENOMEM;
+ break;
+ }
+
+ subdev_entity->asd = devm_kzalloc(dev,
+ sizeof(*subdev_entity->asd), GFP_KERNEL);
+ if (subdev_entity->asd == NULL) {
+ of_node_put(rem);
+ ret = -ENOMEM;
+ break;
+ }
+
+ flags = v4l2_epn.bus.parallel.flags;
+
+ if (flags & V4L2_MBUS_HSYNC_ACTIVE_LOW)
+ subdev_entity->pfe_cfg0 = ISC_PFE_CFG0_HPOL_LOW;
+
+ if (flags & V4L2_MBUS_VSYNC_ACTIVE_LOW)
+ subdev_entity->pfe_cfg0 |= ISC_PFE_CFG0_VPOL_LOW;
+
+ if (flags & V4L2_MBUS_PCLK_SAMPLE_FALLING)
+ subdev_entity->pfe_cfg0 |= ISC_PFE_CFG0_PPOL_LOW;
+
+ subdev_entity->asd->match_type = V4L2_ASYNC_MATCH_OF;
+ subdev_entity->asd->match.of.node = rem;
+ list_add_tail(&subdev_entity->list, &isc->subdev_entities);
+ }
+
+ of_node_put(epn);
+ return ret;
+}
+
+/* regmap configuration */
+#define ATMEL_ISC_REG_MAX 0xbfc
+static const struct regmap_config isc_regmap_config = {
+ .reg_bits = 32,
+ .reg_stride = 4,
+ .val_bits = 32,
+ .max_register = ATMEL_ISC_REG_MAX,
+};
+
+static int atmel_isc_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct isc_device *isc;
+ struct resource *res;
+ void __iomem *io_base;
+ struct isc_subdev_entity *subdev_entity;
+ int irq;
+ int ret;
+
+ isc = devm_kzalloc(dev, sizeof(*isc), GFP_KERNEL);
+ if (!isc)
+ return -ENOMEM;
+
+ platform_set_drvdata(pdev, isc);
+ isc->dev = dev;
+
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+ io_base = devm_ioremap_resource(dev, res);
+ if (IS_ERR(io_base))
+ return PTR_ERR(io_base);
+
+ isc->regmap = devm_regmap_init_mmio(dev, io_base, &isc_regmap_config);
+ if (IS_ERR(isc->regmap)) {
+ ret = PTR_ERR(isc->regmap);
+ dev_err(dev, "failed to init register map: %d\n", ret);
+ return ret;
+ }
+
+ irq = platform_get_irq(pdev, 0);
+ if (IS_ERR_VALUE(irq)) {
+ ret = irq;
+ dev_err(dev, "failed to get irq: %d\n", ret);
+ return ret;
+ }
+
+ ret = devm_request_irq(dev, irq, isc_interrupt, 0,
+ ATMEL_ISC_NAME, isc);
+ if (ret < 0) {
+ dev_err(dev, "can't register ISR for IRQ %u (ret=%i)\n",
+ irq, ret);
+ return ret;
+ }
+
+ ret = isc_pipeline_init(isc);
+ if (ret)
+ return ret;
+
+ isc->hclock = devm_clk_get(dev, "hclock");
+ if (IS_ERR(isc->hclock)) {
+ ret = PTR_ERR(isc->hclock);
+ dev_err(dev, "failed to get hclock: %d\n", ret);
+ return ret;
+ }
+
+ ret = isc_clk_init(isc);
+ if (ret) {
+ dev_err(dev, "failed to init isc clock: %d\n", ret);
+ goto clean_isc_clk;
+ }
+
+ isc->ispck = isc->isc_clks[ISC_ISPCK].clk;
+
+ /* ispck should be greater or equal to hclock */
+ ret = clk_set_rate(isc->ispck, clk_get_rate(isc->hclock));
+ if (ret) {
+ dev_err(dev, "failed to set ispck rate: %d\n", ret);
+ goto clean_isc_clk;
+ }
+
+ ret = v4l2_device_register(dev, &isc->v4l2_dev);
+ if (ret) {
+ dev_err(dev, "unable to register v4l2 device.\n");
+ goto clean_isc_clk;
+ }
+
+ ret = isc_parse_dt(dev, isc);
+ if (ret) {
+ dev_err(dev, "fail to parse device tree\n");
+ goto unregister_v4l2_device;
+ }
+
+ if (list_empty(&isc->subdev_entities)) {
+ dev_err(dev, "no subdev found\n");
+ goto unregister_v4l2_device;
+ }
+
+ list_for_each_entry(subdev_entity, &isc->subdev_entities, list) {
+ subdev_entity->notifier.subdevs = &subdev_entity->asd;
+ subdev_entity->notifier.num_subdevs = 1;
+ subdev_entity->notifier.bound = isc_async_bound;
+ subdev_entity->notifier.unbind = isc_async_unbind;
+ subdev_entity->notifier.complete = isc_async_complete;
+
+ ret = v4l2_async_notifier_register(&isc->v4l2_dev,
+ &subdev_entity->notifier);
+ if (ret) {
+ dev_err(dev, "fail to register async notifier\n");
+ goto cleanup_subdev;
+ }
+
+ if (video_is_registered(&isc->video_dev))
+ break;
+ }
+
+ pm_runtime_enable(dev);
+
+ return 0;
+
+cleanup_subdev:
+ isc_subdev_cleanup(isc);
+
+unregister_v4l2_device:
+ v4l2_device_unregister(&isc->v4l2_dev);
+
+clean_isc_clk:
+ isc_clk_cleanup(isc);
+
+ return ret;
+}
+
+static int atmel_isc_remove(struct platform_device *pdev)
+{
+ struct isc_device *isc = platform_get_drvdata(pdev);
+
+ pm_runtime_disable(&pdev->dev);
+
+ isc_subdev_cleanup(isc);
+
+ v4l2_device_unregister(&isc->v4l2_dev);
+
+ isc_clk_cleanup(isc);
+
+ return 0;
+}
+
+static int isc_runtime_suspend(struct device *dev)
+{
+ struct isc_device *isc = dev_get_drvdata(dev);
+
+ clk_disable_unprepare(isc->ispck);
+ clk_disable_unprepare(isc->hclock);
+
+ return 0;
+}
+
+static int isc_runtime_resume(struct device *dev)
+{
+ struct isc_device *isc = dev_get_drvdata(dev);
+ int ret;
+
+ ret = clk_prepare_enable(isc->hclock);
+ if (ret)
+ return ret;
+
+ return clk_prepare_enable(isc->ispck);
+}
+
+static const struct dev_pm_ops atmel_isc_dev_pm_ops = {
+ SET_RUNTIME_PM_OPS(isc_runtime_suspend, isc_runtime_resume, NULL)
+};
+
+static const struct of_device_id atmel_isc_of_match[] = {
+ { .compatible = "atmel,sama5d2-isc" },
+ { }
+};
+MODULE_DEVICE_TABLE(of, atmel_isc_of_match);
+
+static struct platform_driver atmel_isc_driver = {
+ .probe = atmel_isc_probe,
+ .remove = atmel_isc_remove,
+ .driver = {
+ .name = ATMEL_ISC_NAME,
+ .pm = &atmel_isc_dev_pm_ops,
+ .of_match_table = of_match_ptr(atmel_isc_of_match),
+ },
+};
+
+module_platform_driver(atmel_isc_driver);
+
+MODULE_AUTHOR("Songjun Wu <songjun.wu@microchip.com>");
+MODULE_DESCRIPTION("The V4L2 driver for Atmel-ISC");
+MODULE_LICENSE("GPL v2");
+MODULE_SUPPORTED_DEVICE("video");
case -ESHUTDOWN:
return;
default: /* error */
- cx231xx_isocdbg("urb completition error %d.\n", urb->status);
+ cx231xx_isocdbg("urb completion error %d.\n", urb->status);
break;
}
case -ENOENT:
case -ESHUTDOWN:
return;
+ case -EPIPE: /* stall */
+ cx231xx_isocdbg("urb completion error - device is stalled.\n");
+ return;
default: /* error */
- cx231xx_isocdbg("urb completition error %d.\n", urb->status);
+ cx231xx_isocdbg("urb completion error %d.\n", urb->status);
break;
}
struct cx231xx_dmaqueue *dma_q = &dev->video_mode.vidq;
struct urb *urb;
int i;
+ bool broken_pipe = false;
cx231xx_isocdbg("cx231xx: called cx231xx_uninit_isoc\n");
transfer_buffer[i],
urb->transfer_dma);
}
+ if (urb->status == -EPIPE) {
+ broken_pipe = true;
+ }
usb_free_urb(urb);
dev->video_mode.isoc_ctl.urb[i] = NULL;
}
dev->video_mode.isoc_ctl.transfer_buffer[i] = NULL;
}
+ if (broken_pipe) {
+ cx231xx_isocdbg("Reset endpoint to recover broken pipe.");
+ usb_reset_endpoint(dev->udev, dev->video_mode.end_point_addr);
+ }
kfree(dev->video_mode.isoc_ctl.urb);
kfree(dev->video_mode.isoc_ctl.transfer_buffer);
kfree(dma_q->p_left_data);
struct cx231xx_dmaqueue *dma_q = &dev->video_mode.vidq;
struct urb *urb;
int i;
+ bool broken_pipe = false;
cx231xx_isocdbg("cx231xx: called cx231xx_uninit_bulk\n");
transfer_buffer[i],
urb->transfer_dma);
}
+ if (urb->status == -EPIPE) {
+ broken_pipe = true;
+ }
usb_free_urb(urb);
dev->video_mode.bulk_ctl.urb[i] = NULL;
}
dev->video_mode.bulk_ctl.transfer_buffer[i] = NULL;
}
+ if (broken_pipe) {
+ cx231xx_isocdbg("Reset endpoint to recover broken pipe.");
+ usb_reset_endpoint(dev->udev, dev->video_mode.end_point_addr);
+ }
kfree(dev->video_mode.bulk_ctl.urb);
kfree(dev->video_mode.bulk_ctl.transfer_buffer);
kfree(dma_q->p_left_data);