Commit d8fdfc66 authored by Jacopo Mondi's avatar Jacopo Mondi Committed by Mauro Carvalho Chehab

media: imx: imx-mipi-csis: Add support for JPEG_1X8

Add support for MEDIA_BUS_FMT_JPEG_1X8 media bus code to the
CSIS driver.

The MEDIA_BUS_FMT_JPEG_1X8 code is mapped to the RAW8 CSI-2 Data Type,
while the CSI-2 specification suggests to use User Defined Data Type 1.

As reported in the comment, the CSIS interface captures arbitrary Data
Types by using a pixel sampling mode not supported by the IP core
connected to it on i.MX SoCs.

As some sensors, such as OV5640, support sending JPEG data on the RAW8
Data Type and capture operations work correcty with such configuration,
map MEDIA_BUS_FMT_JPEG_1X8 to Data Type 0x2a.
Signed-off-by: default avatarJacopo Mondi <jacopo@jmondi.org>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@kernel.org>
parent f1b57164
...@@ -470,6 +470,34 @@ static const struct csis_pix_format mipi_csis_formats[] = { ...@@ -470,6 +470,34 @@ static const struct csis_pix_format mipi_csis_formats[] = {
.output = MEDIA_BUS_FMT_SRGGB14_1X14, .output = MEDIA_BUS_FMT_SRGGB14_1X14,
.data_type = MIPI_CSI2_DATA_TYPE_RAW14, .data_type = MIPI_CSI2_DATA_TYPE_RAW14,
.width = 14, .width = 14,
},
/* JPEG */
{
.code = MEDIA_BUS_FMT_JPEG_1X8,
.output = MEDIA_BUS_FMT_JPEG_1X8,
/*
* Map JPEG_1X8 to the RAW8 datatype.
*
* The CSI-2 specification suggests in Annex A "JPEG8 Data
* Format (informative)" to transmit JPEG data using one of the
* Data Types aimed to represent arbitrary data, such as the
* "User Defined Data Type 1" (0x30).
*
* However, when configured with a User Defined Data Type, the
* CSIS outputs data in quad pixel mode regardless of the mode
* selected in the MIPI_CSIS_ISP_CONFIG_CH register. Neither of
* the IP cores connected to the CSIS in i.MX SoCs (CSI bridge
* or ISI) support quad pixel mode, so this will never work in
* practice.
*
* Some sensors (such as the OV5640) send JPEG data using the
* RAW8 data type. This is usable and works, so map the JPEG
* format to RAW8. If the CSIS ends up being integrated in an
* SoC that can support quad pixel mode, this will have to be
* revisited.
*/
.data_type = MIPI_CSI2_DATA_TYPE_RAW8,
.width = 8,
} }
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment