1.. SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
2
3.. include:: <isonum.txt>
4
5.. _media-ccs-driver:
6
7MIPI CCS camera sensor driver
8=============================
9
10The MIPI CCS camera sensor driver is a generic driver for `MIPI CCS
11<https://www.mipi.org/specifications/camera-command-set>`_ compliant
12camera sensors.
13
14Also see :ref:`the CCS driver UAPI documentation <media-ccs-uapi>`.
15
16CCS static data
17---------------
18
19The MIPI CCS driver supports CCS static data for all compliant devices,
20including not just those compliant with CCS 1.1 but also CCS 1.0 and SMIA(++).
21For CCS the file names are formed as
22
23	ccs/ccs-sensor-vvvv-mmmm-rrrr.fw (sensor) and
24	ccs/ccs-module-vvvv-mmmm-rrrr.fw (module).
25
26For SMIA++ compliant devices the corresponding file names are
27
28	ccs/smiapp-sensor-vv-mmmm-rr.fw (sensor) and
29	ccs/smiapp-module-vv-mmmm-rrrr.fw (module).
30
31For SMIA (non-++) compliant devices the static data file name is
32
33	ccs/smia-sensor-vv-mmmm-rr.fw (sensor).
34
35vvvv or vv denotes MIPI and SMIA manufacturer IDs respectively, mmmm model ID
36and rrrr or rr revision number.
37
38CCS tools
39~~~~~~~~~
40
41`CCS tools <https://github.com/MIPI-Alliance/ccs-tools/>`_ is a set of
42tools for working with CCS static data files. CCS tools includes a
43definition of the human-readable CCS static data YAML format and includes a
44program to convert it to a binary.
45
46Register definition generator
47-----------------------------
48
49The ccs-regs.asc file contains MIPI CCS register definitions that are used
50to produce C source code files for definitions that can be better used by
51programs written in C language. As there are many dependencies between the
52produced files, please do not modify them manually as it's error-prone and
53in vain, but instead change the script producing them.
54
55Usage
56~~~~~
57
58Conventionally the script is called this way to update the CCS driver
59definitions:
60
61.. code-block:: none
62
63	$ Documentation/driver-api/media/drivers/ccs/mk-ccs-regs -k \
64		-e drivers/media/i2c/ccs/ccs-regs.h \
65		-L drivers/media/i2c/ccs/ccs-limits.h \
66		-l drivers/media/i2c/ccs/ccs-limits.c \
67		-c Documentation/driver-api/media/drivers/ccs/ccs-regs.asc
68
69CCS PLL calculator
70==================
71
72The CCS PLL calculator is used to compute the PLL configuration, given sensor's
73capabilities as well as board configuration and user specified configuration. As
74the configuration space that encompasses all these configurations is vast, the
75PLL calculator isn't entirely trivial. Yet it is relatively simple to use for a
76driver.
77
78The PLL model implemented by the PLL calculator corresponds to MIPI CCS 1.1.
79
80.. kernel-doc:: drivers/media/i2c/ccs-pll.h
81
82**Copyright** |copy| 2020 Intel Corporation
83