2.20. V4L2 Media Bus functions and data structures¶
- 
struct v4l2_mbus_config_mipi_csi2¶
 MIPI CSI-2 data bus configuration
Definition:
struct v4l2_mbus_config_mipi_csi2 {
    unsigned int flags;
    unsigned char data_lanes[V4L2_MBUS_CSI2_MAX_DATA_LANES];
    unsigned char clock_lane;
    unsigned char num_data_lanes;
    bool lane_polarities[1 + V4L2_MBUS_CSI2_MAX_DATA_LANES];
};
Members
flagsmedia bus (V4L2_MBUS_*) flags
data_lanesan array of physical data lane indexes
clock_lanephysical lane index of the clock lane
num_data_lanesnumber of data lanes
lane_polaritiespolarity of the lanes. The order is the same of the physical lanes.
- 
struct v4l2_mbus_config_parallel¶
 parallel data bus configuration
Definition:
struct v4l2_mbus_config_parallel {
    unsigned int flags;
    unsigned char bus_width;
    unsigned char data_shift;
};
Members
flagsmedia bus (V4L2_MBUS_*) flags
bus_widthbus width in bits
data_shiftdata shift in bits
- 
struct v4l2_mbus_config_mipi_csi1¶
 CSI-1/CCP2 data bus configuration
Definition:
struct v4l2_mbus_config_mipi_csi1 {
    unsigned char clock_inv:1;
    unsigned char strobe:1;
    bool lane_polarity[2];
    unsigned char data_lane;
    unsigned char clock_lane;
};
Members
clock_invpolarity of clock/strobe signal false - not inverted, true - inverted
strobefalse - data/clock, true - data/strobe
lane_polaritythe polarities of the clock (index 0) and data lanes index (1)
data_lanethe number of the data lane
clock_lanethe number of the clock lane
- 
enum v4l2_mbus_type¶
 media bus type
Constants
V4L2_MBUS_UNKNOWNunknown bus type, no V4L2 mediabus configuration
V4L2_MBUS_PARALLELparallel interface with hsync and vsync
V4L2_MBUS_BT656parallel interface with embedded synchronisation, can also be used for BT.1120
V4L2_MBUS_CSI1MIPI CSI-1 serial interface
V4L2_MBUS_CCP2CCP2 (Compact Camera Port 2)
V4L2_MBUS_CSI2_DPHYMIPI CSI-2 serial interface, with D-PHY
V4L2_MBUS_CSI2_CPHYMIPI CSI-2 serial interface, with C-PHY
V4L2_MBUS_DPIMIPI VIDEO DPI interface
V4L2_MBUS_INVALIDinvalid bus type (keep as last)
- 
struct v4l2_mbus_config¶
 media bus configuration
Definition:
struct v4l2_mbus_config {
    enum v4l2_mbus_type type;
    union {
        struct v4l2_mbus_config_parallel parallel;
        struct v4l2_mbus_config_mipi_csi1 mipi_csi1;
        struct v4l2_mbus_config_mipi_csi2 mipi_csi2;
    } bus;
};
Members
typeinterface type
busbus configuration data structure
bus.parallelembedded
struct v4l2_mbus_config_parallel. Used if the bus is parallel or BT.656.bus.mipi_csi1embedded
struct v4l2_mbus_config_mipi_csi1. Used if the bus is MIPI Alliance’s Camera Serial Interface version 1 (MIPI CSI1) or Standard Mobile Imaging Architecture’s Compact Camera Port 2 (SMIA CCP2).bus.mipi_csi2embedded
struct v4l2_mbus_config_mipi_csi2. Used if the bus is MIPI Alliance’s Camera Serial Interface version 2 (MIPI CSI2).
- 
void v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt, const struct v4l2_mbus_framefmt *mbus_fmt)¶
 Ancillary routine that fills a
struct v4l2_pix_formatfields from astruct v4l2_mbus_framefmt.
Parameters
struct v4l2_pix_format *pix_fmtpointer to
struct v4l2_pix_formatto be filledconst struct v4l2_mbus_framefmt *mbus_fmtpointer to
struct v4l2_mbus_framefmtto be used as model
- 
void v4l2_fill_mbus_format(struct v4l2_mbus_framefmt *mbus_fmt, const struct v4l2_pix_format *pix_fmt, u32 code)¶
 Ancillary routine that fills a
struct v4l2_mbus_framefmtfrom astruct v4l2_pix_formatand a data format code.
Parameters
struct v4l2_mbus_framefmt *mbus_fmtpointer to
struct v4l2_mbus_framefmtto be filledconst struct v4l2_pix_format *pix_fmtpointer to
struct v4l2_pix_formatto be used as modelu32 codedata format code (from
enum v4l2_mbus_pixelcode)
- 
void v4l2_fill_pix_format_mplane(struct v4l2_pix_format_mplane *pix_mp_fmt, const struct v4l2_mbus_framefmt *mbus_fmt)¶
 Ancillary routine that fills a
struct v4l2_pix_format_mplanefields from a media bus structure.
Parameters
struct v4l2_pix_format_mplane *pix_mp_fmtpointer to
struct v4l2_pix_format_mplaneto be filledconst struct v4l2_mbus_framefmt *mbus_fmtpointer to
struct v4l2_mbus_framefmtto be used as model
- 
void v4l2_fill_mbus_format_mplane(struct v4l2_mbus_framefmt *mbus_fmt, const struct v4l2_pix_format_mplane *pix_mp_fmt)¶
 Ancillary routine that fills a
struct v4l2_mbus_framefmtfrom astruct v4l2_pix_format_mplane.
Parameters
struct v4l2_mbus_framefmt *mbus_fmtpointer to
struct v4l2_mbus_framefmtto be filledconst struct v4l2_pix_format_mplane *pix_mp_fmtpointer to
struct v4l2_pix_format_mplaneto be used as model