mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/3] media: i2c: Add Samsung S5K3L6 and Librem 5 rear camera
@ 2026-11-12  0:46 Vincent Cloutier
  2026-11-12  0:46 ` [PATCH v2 1/3] dt-bindings: media: i2c: Add Samsung S5K3L6 image sensor Vincent Cloutier
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Vincent Cloutier @ 2026-11-12  0:46 UTC (permalink / raw)
  To: linux-media
  Cc: devicetree, Mauro Carvalho Chehab, Sakari Ailus, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Frank Li, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, Philipp Zabel, imx,
	linux-arm-kernel, linux-kernel, Purism Kernel Team,
	Vincent Cloutier

From: Vincent Cloutier <vincent@cloutier.co>

Add initial support for the Samsung S5K3L6 raw Bayer image sensor and
describe the Purism Librem 5 rear camera and second CSI-2 capture path.

The driver targets the validated Librem 5 configuration: a 25 MHz input
clock, two CSI-2 lanes, and RAW8/RAW10 SGRBG modes at 1052x780, 2104x1560
and 4208x3120. It uses CCI regmap, runtime PM, endpoint validation and the
subdev stream API, with exposure, gain, blanking, link-frequency,
pixel-rate, test-pattern and firmware orientation controls.

The sensor driver is a rewrite of the Librem 5 downstream implementation,
not a direct forwarding of its bring-up history. Thanks to Martin
Kepplinger, Dorota Czaplejewicz and Sebastian Krzyszkowiak for the original
driver, mode tables, controls, power sequencing and tuning.

The Purism kernel team is Cc'd for review. Would you be willing to join as
maintainers of the S5K3L6 binding and driver? For now, only I am listed;
I will add you if you agree.

Focus-actuator and flash integration are deferred; this series adds the
sensor capture path only.

Changes since the RFC:
- Drop the media-driver reset workaround, as suggested by Philipp Zabel.
  The base already includes 71827776667f ("reset: imx7: Correct polarity
  of MIPI CSI resets on i.MX8MQ"), so no reset prerequisite is needed.
- Refresh onto media-committers.git next, fetched November 8, 2026, at
  v7.4-rc1 (6628e7d4c6b2).
- Remove redundant minItems/maxItems from the binding's fixed
  link-frequency item list, as required by current dtschema. The three
  frequencies and two-lane configuration are unchanged.
- Adapt set_fmt and get_selection to the V4L2 client-info API. The mode
  tables, requested-link-rate/line-length writes and PLL sequencing are
  unchanged from the actual mailed RFC driver.
- Reject active-format changes during streaming, retaining TRY negotiation.
- Recover failed stream stops with hardware reset before releasing the PM
  reference, and reset after failed starts. Reinitialize on an immediate
  restart and cache controls while reset is held. Require reset-gpios for
  this recovery path; the Librem 5 already supplies it.
- Clamp the exposure default when reducing its range, require a port
  endpoint, add MAINTAINERS coverage and document the register provenance
  and deliberate extra reset pulse.
- Support control setup and streaming with CONFIG_PM disabled.
- Propagate exposure-update errors before reducing frame length. Restore
  exposure-range metadata on VBLANK failure, and roll back mode-dependent
  controls and mode selection on a failed active-format change.

Previous version:
https://lore.kernel.org/all/20260626000715.1111803-1-vincent.cloutier@icloud.com/
Reset review:
https://lore.kernel.org/all/d80cecc3f317e4493207ea3c347dd144390d299f.camel@pengutronix.de/

Tested on Librem 5r4 on November 12 (UTC) with the v7.4-rc1 carry using the
sensor source from this series. All six size/bit-depth combinations pass
captures and sustained streaming, as do all 30 directed mode transitions,
controls, test patterns and runtime PM. Reducing VBLANK clamps exposure and
updates its range without interrupting capture. Active-format changes during
capture return EBUSY; TRY succeeds without changing active state. There are
no EOF timeouts. This is carry-based coverage, not a clean submission-base
boot. Error paths and PM-disabled setup have host-side coverage; no physical
I2C fault injection or new system-suspend cycle was performed.

Vincent Cloutier (3):
  dt-bindings: media: i2c: Add Samsung S5K3L6 image sensor
  media: i2c: Add Samsung S5K3L6 image sensor driver
  arm64: dts: imx8mq-librem5: Add rear camera

 .../bindings/media/i2c/samsung,s5k3l6.yaml         |  118 +++
 MAINTAINERS                                        |    7 +
 arch/arm64/boot/dts/freescale/imx8mq-librem5.dtsi  |   51 +
 drivers/media/i2c/Kconfig                          |   10 +
 drivers/media/i2c/Makefile                         |    1 +
 drivers/media/i2c/s5k3l6.c                         | 1192 ++++++++++++++++++++
 6 files changed, 1379 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/media/i2c/samsung,s5k3l6.yaml
 create mode 100644 drivers/media/i2c/s5k3l6.c


base-commit: 6628e7d4c6b25c8d18f1345e3a20d21829aae7e4
-- 
2.56.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-11-12 12:24 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-12  0:46 [PATCH v2 0/3] media: i2c: Add Samsung S5K3L6 and Librem 5 rear camera Vincent Cloutier
2026-11-12  0:46 ` [PATCH v2 1/3] dt-bindings: media: i2c: Add Samsung S5K3L6 image sensor Vincent Cloutier
2026-11-12 11:10   ` Krzysztof Kozlowski
2026-11-12  0:46 ` [PATCH v2 2/3] media: i2c: Add Samsung S5K3L6 image sensor driver Vincent Cloutier
2026-11-12 12:24   ` Sakari Ailus
2026-11-12  0:46 ` [PATCH v2 3/3] arm64: dts: imx8mq-librem5: Add rear camera Vincent Cloutier

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®