Skip to content

media: Add MIPI CCI register access helper functions

Hans de Goede linux-media 4 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest5 patches 8 repliesIn review
  2. v35 patches 1 replySuperseded
  3. v25 patches 47 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v13 patches34 repliesSuperseded

Patches in v4 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5media: Add MIPI CCI register access helper functionsDocumentation/driver-api/media/v4l2-cci.rst Documentation/driver-api/media/v4l2-core.rst drivers/media/v4l2-core/Kconfig +3 more+307 -00 replies
2/5media: ov5693: Convert to new CCI register access helpersdrivers/media/i2c/Kconfig drivers/media/i2c/ov5693.c+229 -3570 replies
3/5media: imx290: Convert to new CCI register access helpersdrivers/media/i2c/Kconfig drivers/media/i2c/imx290.c+150 -2117 replies
4/5media: atomisp: ov2680: Convert to new CCI register access helpersdrivers/staging/media/atomisp/i2c/Kconfig drivers/staging/media/atomisp/i2c/atomisp-ov2680.c drivers/staging/media/atomisp/i2c/ov2680.h+121 -2170 replies
5/5media: Remove ov_16bit_addr_reg_helpers.hinclude/media/ov_16bit_addr_reg_helpers.h+0 -920 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchAndy ShevchenkoTommaso MerciaiLaurent Pinchart
1/5R-b T-b R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v4 thread

Cover letter [PATCH v4 0/5] media: Add MIPI CCI register access helper functions

Hi Laurent, Sakari, et al.,

Here is v4 of my MIPI CCI register access helper patches.

New in the CCI register access helpers in v4:
- Add V4L2_CCI_I2C Kconfig and wrap devm_cci_regmap_init_i2c() with if IS_ENABLED(CONFIG_V4L2_CCI_I2C)

New in the CCI register access helpers in v3:
- Use unsigned int instead of int in a couple of places
- Run + fix checkpatch.pl --strict --max-line-length=80
- Rename cci_regmap_init_i2c() to devm_cci_regmap_init_i2c()
- Some small kerneldoc text tweaks

Other changes in v3:
- Some small tweaks to some of the driver conversions, see individual patch changelogs

New in the CCI register access helpers in v2:
- Drop cci_reg_type enum
- Make having an encoded reg-width mandatory rather then using 0 to encode 8 bit width making reg-addresses without an encoded width default to a width of 8
- Add support for 64 bit wide registers
- Introduce a new cci_reg_sequence struct with 64 bit reg values for 64 bit support and without the delay_us field
- Various kerneldoc updates
- Stop supporting delays in cci_multi_reg_write()
- Some includes cleanups
- Disable regmap locking

Other changes in v2:
- Add a patch to convert the ov5693 driver (tested on Surface Go)
- Add a patch to convert the imx290 driver (untested)

Original (v1) cover-letter:

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:

Patches 2-4 are examples of how these helpers can be used and patch 5 removes the now no longer necessary ov_16bit_addr_reg_helpers.h which was the previous attempt to add common CCI access helpers.

Regards,

Hans

Hans de Goede (5):
media: Add MIPI CCI register access helper functions
media: ov5693: Convert to new CCI register access helpers
media: imx290: Convert to new CCI register access helpers
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/i2c/Kconfig                     |   2 +
 drivers/media/i2c/imx290.c                    | 360 +++++------
 drivers/media/i2c/ov5693.c                    | 585 +++++++-----------
 drivers/media/v4l2-core/Kconfig               |   9 +
 drivers/media/v4l2-core/Makefile              |   1 +
 drivers/media/v4l2-core/v4l2-cci.c            | 166 +++++
 drivers/staging/media/atomisp/i2c/Kconfig     |   1 +
 .../media/atomisp/i2c/atomisp-ov2680.c        | 251 ++++----
 drivers/staging/media/atomisp/i2c/ov2680.h    |  86 +--
 include/media/ov_16bit_addr_reg_helpers.h     |  92 ---
 include/media/v4l2-cci.h                      | 125 ++++
 13 files changed, 807 insertions(+), 877 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
Signature · 1 line
2.41.0