요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
.. SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
.. include:: <isonum.txt>
.. _media-ccs-driver:
MIPI CCS camera sensor driver
=============================
The MIPI CCS camera sensor driver is a generic driver for `MIPI CCS
<https://www.mipi.org/specifications/camera-command-set>`_ compliant
camera sensors.
Also see :ref:`the CCS driver UAPI documentation <media-ccs-uapi>`.
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 <https://github.com/MIPI-Alliance/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:
.. code-block:: none
$ 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.
.. kernel-doc:: drivers/media/i2c/ccs-pll.h
**Copyright** |copy| 2020 Intel Corporation
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
MIPI CCS camera sensor driver
1-15이 문서는 `GPL-2.0-only OR BSD-3-Clause` 이중 라이선스로 배포되며 `media-ccs-driver` reference target을 정의합니다.
MIPI CCS camera sensor driver는 `https://www.mipi.org/specifications/camera-command-set`에서 정의하는 MIPI Camera Command Set(CCS)을 준수하는 camera sensor를 위한 범용 driver입니다. Userspace API의 세부 내용은 `media-ccs-uapi` reference로 연결된 CCS driver UAPI 문서를 함께 참조합니다.
범용 kernel driver 설명과 userspace API 문서를 구분합니다.
CCS static data
16-37MIPI CCS driver는 모든 호환 장치의 CCS static data를 지원합니다. 대상은 CCS 1.1뿐 아니라 CCS 1.0과 SMIA(++) 장치까지 포함합니다.
CCS 장치는 sensor와 module firmware 이름을 다음 형식으로 구성합니다.
ccs/ccs-sensor-vvvv-mmmm-rrrr.fw (sensor) and
SMIA++ 호환 장치는 대응하는 sensor와 module 파일 이름을 다음 형식으로 구성합니다.
ccs/smiapp-sensor-vv-mmmm-rr.fw (sensor) and
ccs/smiapp-module-vv-mmmm-rrrr.fw (module).
SMIA(non-++) 호환 장치는 sensor static-data 파일 하나를 다음 형식으로 사용합니다.
ccs/smia-sensor-vv-mmmm-rr.fw (sensor).
파일명의 `vvvv` 또는 `vv`는 각각 MIPI와 SMIA manufacturer ID를, `mmmm`은 model ID를, `rrrr` 또는 `rr`은 revision number를 뜻합니다.
표준 세대와 대상 단위에 따라 manufacturer·model·revision 폭이 달라집니다.
CCS tools
38-45`CCS tools`(`https://github.com/MIPI-Alliance/ccs-tools/`)는 CCS static-data 파일을 다루는 도구 모음입니다. 사람이 읽을 수 있는 CCS static-data YAML 형식을 정의하며, 이 YAML을 binary firmware로 변환하는 program도 포함합니다.
CCS tools가 사람이 편집하는 정의를 driver가 읽는 binary로 변환합니다.
Register definition generator
46-54`ccs-regs.asc` 파일에는 MIPI CCS register definition이 들어 있습니다. 생성 script는 이 정의를 C 언어 program에서 더 편리하게 사용할 수 있는 C source-code 파일로 변환합니다.
생성된 파일들 사이에는 의존성이 많습니다. 직접 수정하면 오류가 나기 쉽고 다음 생성 때 덮어써져 소용이 없으므로, 생성 결과가 아니라 그 파일들을 만드는 script 또는 입력 정의를 변경해야 합니다.
수정 지점은 생성된 C 파일이 아니라 source definition과 generator입니다.
생성기 사용법
55-68관례적으로 CCS driver definition을 갱신할 때는 repository root에서 다음과 같이 script를 호출합니다. `-e`는 register header, `-L`은 limit header, `-l`은 limit C source, `-c`는 입력 `ccs-regs.asc` 경로를 지정합니다.
$ 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
이 명령으로 서로 의존하는 세 출력 파일을 같은 입력 definition에서 함께 다시 만들 수 있습니다.
CCS PLL calculator
69-82CCS PLL calculator는 sensor capability, board configuration, 사용자가 지정한 configuration을 입력으로 받아 PLL 구성을 계산합니다. 이 모든 조합을 포괄하는 configuration space가 매우 넓기 때문에 calculator 내부는 완전히 단순하지 않지만, driver에서 사용하는 interface는 비교적 간단합니다.
PLL calculator가 구현하는 PLL model은 MIPI CCS 1.1에 해당합니다. 실제 함수와 구조체 API는 `drivers/media/i2c/ccs-pll.h`의 kernel-doc에서 이 페이지로 가져옵니다.
문서 저작권은 2020 Intel Corporation에 있습니다.
세 종류의 제약을 합쳐 MIPI CCS 1.1 PLL model의 유효 구성을 구합니다.
요약과 해설
ccs.rst:1-82이 driver는 CCS·SMIA 세대의 sensor와 module을 하나의 범용 구현으로 다룹니다. 장치 식별자로 static-data firmware 이름을 구성하고, CCS tools로 YAML을 binary로 변환해 driver에 공급합니다.
Register 정의는 `ccs-regs.asc`와 `mk-ccs-regs`를 단일 source of truth로 사용하며 생성된 C 파일을 직접 편집하지 않습니다. PLL 설정은 sensor·board·user 제약을 모두 만족하도록 CCS 1.1 model로 계산합니다.