MIPI CCS camera sensor driver
MIPI CCS camera sensor driver #
The MIPI CCS camera sensor driver is a generic driver for MIPI CCS compliant camera sensors.
Also see the CCS driver UAPI documentation.
CCS static data #
The MIPI CCS driver supports CCS static data for all compliant devices, including not just those compliant with CCS 1.1 but also CCS 1.0 and SMIA(++). For CCS the file names are formed as
ccs/ccs-sensor-vvvv-mmmm-rrrr.fw (sensor) and ccs/ccs-module-vvvv-mmmm-rrrr.fw (module).
For SMIA++ compliant devices the corresponding file names are
ccs/smiapp-sensor-vv-mmmm-rr.fw (sensor) and ccs/smiapp-module-vv-mmmm-rrrr.fw (module).
For SMIA (non-++) compliant devices the static data file name is
ccs/smia-sensor-vv-mmmm-rr.fw (sensor).
vvvv or vv denotes MIPI and SMIA manufacturer IDs respectively, mmmm model ID and rrrr or rr revision number.
CCS tools #
CCS tools is a set of tools for working with CCS static data files. CCS tools includes a definition of the human-readable CCS static data YAML format and includes a program to convert it to a binary.
Register definition generator #
The ccs-regs.asc file contains MIPI CCS register definitions that are used to produce C source code files for definitions that can be better used by programs written in C language. As there are many dependencies between the produced files, please do not modify them manually as it's error-prone and in vain, but instead change the script producing them.
Usage #
Conventionally the script is called this way to update the CCS driver definitions:
$ Documentation/driver-api/media/drivers/ccs/mk-ccs-regs -k \
-e drivers/media/i2c/ccs/ccs-regs.h \
-L drivers/media/i2c/ccs/ccs-limits.h \
-l drivers/media/i2c/ccs/ccs-limits.c \
-c Documentation/driver-api/media/drivers/ccs/ccs-regs.asc
CCS PLL calculator #
The CCS PLL calculator is used to compute the PLL configuration, given sensor's capabilities as well as board configuration and user specified configuration. As the configuration space that encompasses all these configurations is vast, the PLL calculator isn't entirely trivial. Yet it is relatively simple to use for a driver.
The PLL model implemented by the PLL calculator corresponds to MIPI CCS 1.1.
struct ccs_pll_branch_fr #
CCS PLL configuration (front)
Definition
;
Members
pre_pll_clk_div: Pre-PLL clock divisorpll_multiplier: PLL multiplierpll_ip_clk_freq_hz: PLL input clock frequencypll_op_clk_freq_hz: PLL output clock frequency
Description
A single branch front-end of the CCS PLL tree.
struct ccs_pll_branch_bk #
CCS PLL configuration (back)
Definition
;
Members
sys_clk_div: System clock dividerpix_clk_div: Pixel clock dividersys_clk_freq_hz: System clock frequencypix_clk_freq_hz: Pixel clock frequency
Description
A single branch back-end of the CCS PLL tree.
struct ccs_pll #
Full CCS PLL configuration
Definition
;
Members
bus_type: Type of the data bus, CCS_PLL_BUS_TYPE_* (input)op_lanes: Number of operational lanes (input)vt_lanes: Number of video timing lanes (input)csi2: CSI-2 related parameterscsi2.lanes: The number of the CSI-2 data lanes (input)binning_horizontal: Horizontal binning factor (input)binning_vertical: Vertical binning factor (input)scale_m: Downscaling factor, M component, [16, max] (input)scale_n: Downscaling factor, N component, typically 16 (input)bits_per_pixel: Bits per pixel on the output data bus (input)op_bits_per_lane: Number of bits per OP lane (input)flags: CCS_PLL_FLAG_* (input)link_freq: Chosen link frequency (input)ext_clk_freq_hz: External clock frequency, i.e. the sensor's input clock (input)vt_fr: Video timing front-end configuration (output)vt_bk: Video timing back-end configuration (output)op_fr: Operational timing front-end configuration (output)op_bk: Operational timing back-end configuration (output)pixel_rate_csi: Pixel rate on the output data bus (output)pixel_rate_pixel_array: Nominal pixel rate in the sensor's pixel array (output)
Description
All information required to calculate CCS PLL configuration.
struct ccs_pll_branch_limits_fr #
CCS PLL front-end limits
Definition
;
Members
min_pre_pll_clk_div: Minimum pre-PLL clock dividermax_pre_pll_clk_div: Maximum pre-PLL clock dividermin_pll_ip_clk_freq_hz: Minimum PLL input clock frequencymax_pll_ip_clk_freq_hz: Maximum PLL input clock frequencymin_pll_multiplier: Minimum PLL multipliermax_pll_multiplier: Maximum PLL multipliermin_pll_op_clk_freq_hz: Minimum PLL output clock frequencymax_pll_op_clk_freq_hz: Maximum PLL output clock frequency
struct ccs_pll_branch_limits_bk #
CCS PLL back-end limits
Definition
;
Members
min_sys_clk_div: Minimum system clock dividermax_sys_clk_div: Maximum system clock dividermin_sys_clk_freq_hz: Minimum system clock frequencymax_sys_clk_freq_hz: Maximum system clock frequencymin_pix_clk_div: Minimum pixel clock dividermax_pix_clk_div: Maximum pixel clock dividermin_pix_clk_freq_hz: Minimum pixel clock frequencymax_pix_clk_freq_hz: Maximum pixel clock frequency
struct ccs_pll_limits #
CCS PLL limits
Definition
;
Members
min_ext_clk_freq_hz: Minimum external clock frequencymax_ext_clk_freq_hz: Maximum external clock frequencyvt_fr: Video timing front-end limitsvt_bk: Video timing back-end limitsop_fr: Operational timing front-end limitsop_bk: Operational timing back-end limitsmin_line_length_pck_bin: Minimum line length in pixels, with binningmin_line_length_pck: Minimum line length in pixels without binning
ccs_pll_calculate() #
int Calculate CCS PLL configuration based on input parameters
Parameters
struct device *dev: Device pointer, used for printing messagesconst struct ccs_pll_limits *limits: Limits specific to the sensorstruct ccs_pll *pll: Given PLL configuration
Description
Calculate the CCS PLL configuration based on the limits as well as given device specific, system specific or user configured input data.
Copyright © 2020 Intel Corporation