Skip to content

Trivial MIPI CCS support

Sakari Ailus linux-media 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest30 patches 0 repliesNew
  2. v130 patches 0 repliesSuperseded

Changes in v2 from the cover letter

- Reorder file names in CCS MAINTAINERS

- Use Linux integer types and __packed (instead of C99 integer types and __attribute__((packed))) in CCS static data library.

- Add documentation to the CCS static data library interface structs.

- Add a missing newline before a macro.

- Depend on the CCS preparation set here:

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/30ccs: Add MIPI CCS compatible stringsdrivers/media/i2c/ccs/ccs-core.c+3 -00 replies
2/30ccs: Add device compatible identifiers for telling SMIA and CCS apartdrivers/media/i2c/ccs/ccs-core.c+16 -40 replies
3/30ccs: Add CCS ACPI device IDdrivers/media/i2c/ccs/ccs-core.c+7 -00 replies
4/30ccs: Remove the I²C ID tabledrivers/media/i2c/ccs/ccs-core.c+0 -70 replies
5/30ccs: Remove remaining support for platform datadrivers/media/i2c/ccs/ccs-core.c+0 -30 replies
6/30ccs: Make hwcfg part of the device specific structdrivers/media/i2c/ccs/ccs-core.c drivers/media/i2c/ccs/ccs-quirk.c drivers/media/i2c/ccs/ccs.h+51 -490 replies
7/30ccs: Fix obtaining bus information from firmwaredrivers/media/i2c/ccs/ccs-core.c+6 -70 replies
8/30ccs: Add CCS static data parser librarydrivers/media/i2c/ccs/Makefile drivers/media/i2c/ccs/ccs-data-defs.h drivers/media/i2c/ccs/ccs-data.c +1 more+1402 -10 replies
9/30ccs: Combine revision number major and minor into onedrivers/media/i2c/ccs/ccs-core.c drivers/media/i2c/ccs/ccs-quirk.c drivers/media/i2c/ccs/ccs.h+16 -140 replies
10/30ccs: Read CCS static data from firmware binariesdrivers/media/i2c/ccs/ccs-core.c drivers/media/i2c/ccs/ccs.h+48 -10 replies
11/30ccs: Stop reading arrays after the first zerodrivers/media/i2c/ccs/ccs-core.c+3 -00 replies
12/30ccs: The functions to get compose or crop rectangle never return NULLdrivers/media/i2c/ccs/ccs-core.c+2 -60 replies
13/30ccs: Replace somewhat harsh internal checks based on BUG with WARN_ONdrivers/media/i2c/ccs/ccs-core.c+5 -40 replies
14/30ccs: Refactor register reading a littledrivers/media/i2c/ccs/ccs-reg-access.c+17 -200 replies
15/30ccs: Make real to integer number conversion optionaldrivers/media/i2c/ccs/ccs-reg-access.c drivers/media/i2c/ccs/ccs-reg-access.h+28 -90 replies
16/30ccs: Move limit value real to integer conversion from read to access timedrivers/media/i2c/ccs/ccs-core.c+12 -70 replies
17/30ccs: Read ireal numbers correctlydrivers/media/i2c/ccs/ccs-core.c drivers/media/i2c/ccs/ccs-reg-access.c drivers/media/i2c/ccs/ccs.h+32 -100 replies
18/30smiapp-pll: Rename as ccs-pllMAINTAINERS drivers/media/i2c/Kconfig drivers/media/i2c/Makefile +6 more+66 -680 replies
19/30ccs-pll: Fix MODULE_LICENSEdrivers/media/i2c/ccs-pll.c+1 -10 replies
20/30ccs: Change my e-mail addressdrivers/media/i2c/ccs-pll.c drivers/media/i2c/ccs-pll.h drivers/media/i2c/ccs/ccs-core.c +5 more+11 -110 replies
21/30ccs: Allow range in between I²C retriesdrivers/media/i2c/ccs/ccs-reg-access.c+2 -20 replies
22/30ccs: Add support for manufacturer regs from sensor and module filesdrivers/media/i2c/ccs/ccs-core.c drivers/media/i2c/ccs/ccs-reg-access.c drivers/media/i2c/ccs/ccs-reg-access.h+97 -220 replies
23/30ccs: Use static data read-only registersdrivers/media/i2c/ccs/ccs-reg-access.c+60 -40 replies
24/30ccs: Clean up runtime PM usagedrivers/media/i2c/ccs/ccs-core.c+2 -50 replies
25/30ccs: Wrap long lines, unwrap short onesdrivers/media/i2c/ccs/ccs-core.c+18 -270 replies
26/30ccs: Use longer pre-I²C sleep for CCS compliant devicesdrivers/media/i2c/ccs/ccs-core.c+6 -10 replies
27/30ccs: Remove unnecessary delays from power-up sequencedrivers/media/i2c/ccs/ccs-core.c+0 -20 replies
28/30dt-bindings: mipi,ccs: Don't mention vana voltageDocumentation/devicetree/bindings/media/i2c/mipi-ccs.yaml+1 -20 replies
29/30dt-bindings: mipi,ccs: Add vcore and vio suppliesDocumentation/devicetree/bindings/media/i2c/mipi-ccs.yaml+8 -00 replies
30/30ccs: Use all regulatorsdrivers/media/i2c/ccs/ccs-core.c drivers/media/i2c/ccs/ccs.h+24 -80 replies

Reviews trailers per patch

2 of 30 patches have a Reviewed-by or Acked-by.

PatchRob Herring
1/30
2/30
3/30
4/30
5/30
6/30
7/30
8/30
9/30
10/30
11/30
12/30
13/30
14/30
15/30
16/30
17/30
18/30
19/30
20/30
21/30
22/30
23/30
24/30
25/30
26/30
27/30
28/30R-b
29/30R-b
30/30

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 00/30] Trivial MIPI CCS support

Hello everyone,

Here's a set of patches that turn the existing SMIA driver into a MIPI CCS driver while maintaining SMIA support. A number of bugs in the existing code are fixed in this set, too.

The changes at this point are primarily focused on dealing with new mandatory driver features related to PLL configuration (as CCS allows for much more variation there) and things such as integer conversion from U16.U16 format instead of float. There are some other new features as well such as digital gain and support for getting device specific analogue gain coefficients.

A new feature in CCS is CCS static data which makes it possible to obtain sensor's capabilities and limits from a file chosen based on sensor identification. CCS static data is used also for storing MSR registers so supporting new, CCS compliant devices requires no driver changes.

Note that the library as well as the register definitions are dual licensed under GNU GPL v2 OR BSD 3-clause licenses for use outside the Linux kernel.

Also DT bindings are updated accordingly and converted to YAML format.

More information on MIPI CCS can be found here:

<URL:https://www.mipi.org/specifications/camera-command-set>

Comments are welcome.

since v1:

- Reorder file names in CCS MAINTAINERS

- Use Linux integer types and __packed (instead of C99 integer types and __attribute__((packed))) in CCS static data library.

- Add documentation to the CCS static data library interface structs.

- Add a missing newline before a macro.

- Depend on the CCS preparation set here:

<URL:https://patchwork.linuxtv.org/project/linux-media/patch/[email protected]/>

since the big, big patchset (v2):

- Split into more easily reviewable chunks (this is the second of maybe three). The cover page describes the entire big set. This set contains new DT compatible strings, CCS ACPI ID, rudimentary support for CCS (without PLL changes most sensors need, that's for later), including CCS static data.

- Fix SPDX tags. Some were left accidentally with BSD-3-Clause license only.

- Remove WARN_ON() from snprintf(), but return an error instead.

- Free loaded static data on error as well.

- Add descriptions to ccs-data-defs.h and ccs-data.h to document the difference between the two.

- Make the delay after I²C transfer error a range.

- Make better use of kernel support functions.

Sakari Ailus (30):
ccs: Add MIPI CCS compatible strings
ccs: Add device compatible identifiers for telling SMIA and CCS apart
ccs: Add CCS ACPI device ID
ccs: Remove the I²C ID table
ccs: Remove remaining support for platform data
ccs: Make hwcfg part of the device specific struct
ccs: Fix obtaining bus information from firmware
ccs: Add CCS static data parser library
ccs: Combine revision number major and minor into one
ccs: Read CCS static data from firmware binaries
ccs: Stop reading arrays after the first zero
ccs: The functions to get compose or crop rectangle never return NULL
ccs: Replace somewhat harsh internal checks based on BUG with WARN_ON
ccs: Refactor register reading a little
ccs: Make real to integer number conversion optional
ccs: Move limit value real to integer conversion from read to access
time
ccs: Read ireal numbers correctly
smiapp-pll: Rename as ccs-pll
ccs-pll: Fix MODULE_LICENSE
ccs: Change my e-mail address
ccs: Allow range in between I²C retries
ccs: Add support for manufacturer regs from sensor and module files
ccs: Use static data read-only registers
ccs: Clean up runtime PM usage
ccs: Wrap long lines, unwrap short ones
ccs: Use longer pre-I²C sleep for CCS compliant devices
ccs: Remove unnecessary delays from power-up sequence
dt-bindings: mipi,ccs: Don't mention vana voltage
dt-bindings: mipi,ccs: Add vcore and vio supplies
ccs: Use all regulators

 .../bindings/media/i2c/mipi-ccs.yaml          |  11 +-
 MAINTAINERS                                   |   4 +-
 drivers/media/i2c/Kconfig                     |   2 +-
 drivers/media/i2c/Makefile                    |   2 +-
 drivers/media/i2c/{smiapp-pll.c => ccs-pll.c} |  66 +-
 drivers/media/i2c/{smiapp-pll.h => ccs-pll.h} |  42 +-
 drivers/media/i2c/ccs/Kconfig                 |   2 +-
 drivers/media/i2c/ccs/Makefile                |   2 +-
 drivers/media/i2c/ccs/ccs-core.c              | 396 +++++---
 drivers/media/i2c/ccs/ccs-data-defs.h         | 221 ++++
 drivers/media/i2c/ccs/ccs-data.c              | 953 ++++++++++++++++++
 drivers/media/i2c/ccs/ccs-data.h              | 227 +++++
 drivers/media/i2c/ccs/ccs-quirk.c             |  10 +-
 drivers/media/i2c/ccs/ccs-quirk.h             |   2 +-
 drivers/media/i2c/ccs/ccs-reg-access.c        | 227 ++++-
 drivers/media/i2c/ccs/ccs-reg-access.h        |   6 +-
 drivers/media/i2c/ccs/ccs.h                   |  24 +-
 17 files changed, 1923 insertions(+), 274 deletions(-)
 rename drivers/media/i2c/{smiapp-pll.c => ccs-pll.c} (89%)
 rename drivers/media/i2c/{smiapp-pll.h => ccs-pll.h} (66%)
 create mode 100644 drivers/media/i2c/ccs/ccs-data-defs.h
 create mode 100644 drivers/media/i2c/ccs/ccs-data.c
 create mode 100644 drivers/media/i2c/ccs/ccs-data.h
Signature · 1 line
2.27.0