mbox series

[0/3] media: Add MIPI CCI register access helper functions

Message ID 20230606165808.70751-1-hdegoede@redhat.com
Headers show
Series media: Add MIPI CCI register access helper functions | expand

Message

Hans de Goede June 6, 2023, 4:58 p.m. UTC
Hi Laurent, Sakari, et al.,

The CSI2 specification specifies a standard method to access camera sensor
registers called "Camera Control Interface (CCI)".

Currently a lot of Linux camera sensor drivers all have their own custom
helpers for this, often copy and pasted from other drivers.

This adds a set of generic helpers for this so that all sensor drivers can
switch to a single common implementation.

This is based on / the result of our previous discussion on this here:
Link: https://lore.kernel.org/linux-media/59aefa7f-7bf9-6736-6040-39551329cd0a@redhat.com/

Patch 2/3 is an example of how these helpers can be used and 3/3 removes
the now no longer necessary ov_16bit_addr_reg_helpers.h which was
the previous attempt to add common CCI access helpers. As such
patch 2/3 and 3/3 are more of a RFC really. Please focus on reviewing
patch 1/3.

Regards,

Hans


Hans de Goede (3):
  media: Add MIPI CCI register access helper functions
  media: atomisp: ov2680: Convert to new CCI register access helpers
  media: Remove ov_16bit_addr_reg_helpers.h

 Documentation/driver-api/media/v4l2-cci.rst   |   5 +
 Documentation/driver-api/media/v4l2-core.rst  |   1 +
 drivers/media/v4l2-core/Kconfig               |   5 +
 drivers/media/v4l2-core/Makefile              |   1 +
 drivers/media/v4l2-core/v4l2-cci.c            | 142 +++++++++++
 drivers/staging/media/atomisp/i2c/Kconfig     |   1 +
 .../media/atomisp/i2c/atomisp-ov2680.c        | 233 ++++++++----------
 drivers/staging/media/atomisp/i2c/ov2680.h    |  73 +-----
 include/media/ov_16bit_addr_reg_helpers.h     |  92 -------
 include/media/v4l2-cci.h                      | 109 ++++++++
 10 files changed, 367 insertions(+), 295 deletions(-)
 create mode 100644 Documentation/driver-api/media/v4l2-cci.rst
 create mode 100644 drivers/media/v4l2-core/v4l2-cci.c
 delete mode 100644 include/media/ov_16bit_addr_reg_helpers.h
 create mode 100644 include/media/v4l2-cci.h