devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/4] media: v4l: fwnode: Add support for CSI-2 C-PHY line orders
@ 2024-11-21 13:41 Niklas Söderlund
  2024-11-21 13:41 ` [PATCH v2 1/4] media: dt-bindings: Add property to describe " Niklas Söderlund
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Niklas Söderlund @ 2024-11-21 13:41 UTC (permalink / raw)
  To: Sakari Ailus, Mauro Carvalho Chehab, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Geert Uytterhoeven,
	Laurent Pinchart, linux-media, devicetree, linux-renesas-soc
  Cc: Niklas Söderlund

Hello,

This series aims to extend the video interface bindings with a new
property to describe the CSI-2 C-PHY line orders. In comparison with
CSI-2 D-PHY where each data-lane is constructed from two lines making up
a differential pair the C-PHY uses three phase encoding constructed from
three lines to create a single data lane.

The three lines making up the C-PHY data lane are labeled A, B and C in
the specification and can be ordered in any combination (ABC, ACB, BAC,
BCA, CAB and CBA). This can be compared to the D-PHY model where the two
lines in the differential pair can be "normal" or "inverted" to do the
same thing.

For the D-PHY uses-case the exists a property 'lane-polarities' can be
used to describe this line wiring. However there are no property to
describe this ordering of the C-PHY lines in the video interfaces
definition nor in the V4L2 fwnode structures or parser.

Patch 1/4 extends the video bindings with a new property 'line-orders'
which can describe this property of the C-PHY. The property name and the
const values used for different line configurations are taken from the
MIPI Discovery and Configuration (DisCo) Specification for Imaging
document.

Patch 2/4 extends the V4L2 fwnode data structure and parser to consume
and exposes this property to drivers.

While patch 3/4 and 4/4 adds an example use of the property both in the
bindings and in the driver using the R-Car CSI-2 receiver driver on V4H.

A note on the changes to the R-Car driver not relevant to the core V4L2
or bindings work. The V4H WhiteHawk development platform is the only
model where the CSI-2 bus is used in a C-PHY configuration. Early
datasheets where used to add support for it and at that time the line
order registers where not documented so magic values where used as-is.
This have been addressed in later versions of the datasheet and this can
now be done properly.

The magic values used however configured one of the data lanes used in a
BCA configuration, which is required for proper operation on that
development platform. Thus the change in patch 4/4 breaks proper
operation with older DTS files lacking the new line-orders property.

I think this is fine as the only known use-case for this platform is
together with the MAX96712 CSI-2 transmitter and for this we only have a
staging driver capable of generating test patterns. To extend this to a
capture pipeline capable of capturing frames from a real source DTS
changes are needed to describe the video source, so an updated DTS are
need anyhow.

See individual patches for changelog.

Niklas Söderlund (4):
  media: dt-bindings: Add property to describe CSI-2 C-PHY line orders
  media: v4l: fwnode: Parse MiPI DisCo for C-PHY line-orders
  arm64: dts: renesas: white-hawk-csi-dsi: Define CSI-2 data line orders
  media: rcar-csi2: Allow specifying C-PHY line order

 .../bindings/media/video-interfaces.yaml      | 21 ++++++
 .../boot/dts/renesas/white-hawk-csi-dsi.dtsi  |  6 ++
 drivers/media/platform/renesas/rcar-csi2.c    | 74 +++++++++++++++++--
 drivers/media/v4l2-core/v4l2-fwnode.c         | 43 ++++++++++-
 include/dt-bindings/media/video-interfaces.h  |  7 ++
 include/media/v4l2-mediabus.h                 | 21 ++++++
 6 files changed, 164 insertions(+), 8 deletions(-)

-- 
2.47.0


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

end of thread, other threads:[~2025-01-06 10:47 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-21 13:41 [PATCH v2 0/4] media: v4l: fwnode: Add support for CSI-2 C-PHY line orders Niklas Söderlund
2024-11-21 13:41 ` [PATCH v2 1/4] media: dt-bindings: Add property to describe " Niklas Söderlund
2024-11-27 13:30   ` Rob Herring (Arm)
2024-11-21 13:41 ` [PATCH v2 2/4] media: v4l: fwnode: Parse MiPI DisCo for C-PHY line-orders Niklas Söderlund
2024-12-12  7:25   ` Sakari Ailus
2024-12-12 10:00     ` Niklas Söderlund
2024-12-27 13:31   ` Geert Uytterhoeven
2025-01-04 12:17     ` Niklas Söderlund
2024-11-21 13:41 ` [PATCH v2 3/4] arm64: dts: renesas: white-hawk-csi-dsi: Define CSI-2 data line orders Niklas Söderlund
2024-12-27 13:22   ` Geert Uytterhoeven
2025-01-04 12:17     ` Niklas Söderlund
2025-01-06  9:45       ` Geert Uytterhoeven
2025-01-06 10:02         ` Niklas Söderlund
2025-01-06 10:47           ` Niklas Söderlund
2024-11-21 13:41 ` [PATCH v2 4/4] media: rcar-csi2: Allow specifying C-PHY line order Niklas Söderlund

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).