All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/4] media: v4l: fwnode: Add support for CSI-2 C-PHY line orders
@ 2024-11-19 22:12 Niklas Söderlund
  2024-11-19 22:12 ` [PATCH 1/4] media: dt-bindings: Add property to describe " Niklas Söderlund
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Niklas Söderlund @ 2024-11-19 22:12 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.

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      | 20 +++++
 .../boot/dts/renesas/white-hawk-csi-dsi.dtsi  |  6 ++
 drivers/media/platform/renesas/rcar-csi2.c    | 74 +++++++++++++++++--
 drivers/media/v4l2-core/v4l2-fwnode.c         | 56 +++++++++++++-
 include/dt-bindings/media/video-interfaces.h  |  7 ++
 include/media/v4l2-mediabus.h                 | 21 ++++++
 6 files changed, 176 insertions(+), 8 deletions(-)

-- 
2.47.0


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

end of thread, other threads:[~2024-11-20 10:18 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-19 22:12 [PATCH 0/4] media: v4l: fwnode: Add support for CSI-2 C-PHY line orders Niklas Söderlund
2024-11-19 22:12 ` [PATCH 1/4] media: dt-bindings: Add property to describe " Niklas Söderlund
2024-11-19 23:26   ` Rob Herring (Arm)
2024-11-20  8:06   ` Sakari Ailus
2024-11-20  9:47     ` Niklas Söderlund
2024-11-19 22:12 ` [PATCH 2/4] media: v4l: fwnode: Parse MiPI DisCo for C-PHY line-orders Niklas Söderlund
2024-11-20  8:10   ` Sakari Ailus
2024-11-20  9:50     ` Niklas Söderlund
2024-11-20 10:18       ` Sakari Ailus
2024-11-19 22:12 ` [PATCH 3/4] arm64: dts: renesas: white-hawk-csi-dsi: Define CSI-2 data line orders Niklas Söderlund
2024-11-19 22:12 ` [PATCH 4/4] media: rcar-csi2: Allow specifying C-PHY line order Niklas Söderlund

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.