ccs.rst 3.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. .. SPDX-License-Identifier: GPL-2.0-only OR BSD-3-Clause
  2. .. include:: <isonum.txt>
  3. MIPI CCS camera sensor driver
  4. =============================
  5. The MIPI CCS camera sensor driver is a generic driver for `MIPI CCS
  6. <https://www.mipi.org/specifications/camera-command-set>`_ compliant
  7. camera sensors. It exposes three sub-devices representing the pixel array,
  8. the binner and the scaler.
  9. As the capabilities of individual devices vary, the driver exposes
  10. interfaces based on the capabilities that exist in hardware.
  11. Pixel Array sub-device
  12. ----------------------
  13. The pixel array sub-device represents the camera sensor's pixel matrix, as well
  14. as analogue crop functionality present in many compliant devices. The analogue
  15. crop is configured using the ``V4L2_SEL_TGT_CROP`` on the source pad (0) of the
  16. entity. The size of the pixel matrix can be obtained by getting the
  17. ``V4L2_SEL_TGT_NATIVE_SIZE`` target.
  18. Binner
  19. ------
  20. The binner sub-device represents the binning functionality on the sensor. For
  21. that purpose, selection target ``V4L2_SEL_TGT_COMPOSE`` is supported on the
  22. sink pad (0).
  23. Additionally, if a device has no scaler or digital crop functionality, the
  24. source pad (1) expses another digital crop selection rectangle that can only
  25. crop at the end of the lines and frames.
  26. Scaler
  27. ------
  28. The scaler sub-device represents the digital crop and scaling functionality of
  29. the sensor. The V4L2 selection target ``V4L2_SEL_TGT_CROP`` is used to
  30. configure the digital crop on the sink pad (0) when digital crop is supported.
  31. Scaling is configured using selection target ``V4L2_SEL_TGT_COMPOSE`` on the
  32. sink pad (0) as well.
  33. Additionally, if the scaler sub-device exists, its source pad (1) exposes
  34. another digital crop selection rectangle that can only crop at the end of the
  35. lines and frames.
  36. Digital and analogue crop
  37. -------------------------
  38. Digital crop functionality is referred to as cropping that effectively works by
  39. dropping some data on the floor. Analogue crop, on the other hand, means that
  40. the cropped information is never retrieved. In case of camera sensors, the
  41. analogue data is never read from the pixel matrix that are outside the
  42. configured selection rectangle that designates crop. The difference has an
  43. effect in device timing and likely also in power consumption.
  44. Register definition generator
  45. -----------------------------
  46. The ccs-regs.asc file contains MIPI CCS register definitions that are used
  47. to produce C source code files for definitions that can be better used by
  48. programs written in C language. As there are many dependencies between the
  49. produced files, please do not modify them manually as it's error-prone and
  50. in vain, but instead change the script producing them.
  51. Usage
  52. ~~~~~
  53. Conventionally the script is called this way to update the CCS driver
  54. definitions:
  55. .. code-block:: none
  56. $ Documentation/driver-api/media/drivers/ccs/mk-ccs-regs -k \
  57. -e drivers/media/i2c/ccs/ccs-regs.h \
  58. -L drivers/media/i2c/ccs/ccs-limits.h \
  59. -l drivers/media/i2c/ccs/ccs-limits.c \
  60. -c Documentation/driver-api/media/drivers/ccs/ccs-regs.asc
  61. CCS PLL calculator
  62. ==================
  63. The CCS PLL calculator is used to compute the PLL configuration, given sensor's
  64. capabilities as well as board configuration and user specified configuration. As
  65. the configuration space that encompasses all these configurations is vast, the
  66. PLL calculator isn't entirely trivial. Yet it is relatively simple to use for a
  67. driver.
  68. The PLL model implemented by the PLL calculator corresponds to MIPI CCS 1.1.
  69. .. kernel-doc:: drivers/media/i2c/ccs-pll.h
  70. **Copyright** |copy| 2020 Intel Corporation