media: rcar-vin: Brush endpoint properties
Subsystems (4)
v5 cover media: rcar-vin: Brush endpoint properties
Hello,
based on Niklas', Laurent's and Sakari's comments on v4, here it is a new
version of this series brushing R-Car VIN interface device tree bindings description.
The interface supports the following configurable properties:
- hsync, vsync and data-enable signal polarities
- field signal polarity during even field
- parallel data bus widht and data shift.
As preferred by Niklas, I have listed the properties in the Gen2 section of the bindings documentation, and referred to them in the Gen3 one.
The series, as v4 did, does introduce a new properties in 'video-interfaces.txt' and for this reason the audiance is still a little larger than v3.
Thanks
j
Jacopo Mondi (6):
dt-bindings: media: rcar-vin: Align Gen2 and Gen3
dt-bindings: media: rcar-vin: Describe optional ep properties
dt-bindings: media: Document data-enable-active property
media: v4l2-fwnode: parse 'data-enable-active' prop
dt-bindings: media: rcar-vin: Add 'data-enable-active'
media: rcar-vin: Handle data-enable polarity
.../devicetree/bindings/media/rcar_vin.txt | 29 +++++++++++++++++++--- .../devicetree/bindings/media/video-interfaces.txt | 2 ++ drivers/media/platform/rcar-vin/rcar-dma.c | 5 ++++ drivers/media/v4l2-core/v4l2-fwnode.c | 4 +++ include/media/v4l2-mediabus.h | 2 ++ 5 files changed, 38 insertions(+), 4 deletions(-)
--
2.7.4
PATCH v5 1/6 dt-bindings: media: rcar-vin: Align Gen2 and Gen3
Align description of the Gen2 and Gen3 bindings for parallel input. This commit prepares for description of optional endpoint properties in ports subnodes accepting parallel video connections.
--- Documentation/devicetree/bindings/media/rcar_vin.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
Documentation/devicetree/bindings/media/rcar_vin.txt +6 -4
@@ -39,9 +39,11 @@ Additionally, an alias named vinX will need to be created to specify which video input device this is. The per-board settings Gen2 platforms: - - port sub-node describing a single endpoint connected to the vin - as described in video-interfaces.txt[1]. Only the first one will - be considered as each vin interface has one input port. + +- port - sub-node describing a single endpoint connected to the VIN + from external SoC pins as described in video-interfaces.txt[1]. + Only the first one will be considered as each vin interface has one + input port. The per-board settings Gen3 platforms:
@@ -52,7 +54,7 @@ from local SoC CSI-2 receivers (port at 1) depending on SoC. - renesas,id - ID number of the VIN, VINx in the documentation. - ports - port at 0 - sub-node describing a single endpoint connected to the VIN - from external SoC pins described in video-interfaces.txt[1]. + from external SoC pins as described in video-interfaces.txt[1]. Describing more than one endpoint in port at 0 is invalid. Only VIN instances that are connected to external pins should have port at 0. - port at 1 - sub-nodes describing one or more endpoints connected to
Signature · 1 line
2.7.4
Rob Herring
maintainerPATCH v5 1/6 dt-bindings: media: rcar-vin: Align Gen2 and Gen3
Quoted 8 lines · Jacopo Mondi
Align description of the Gen2 and Gen3 bindings for parallel input. This commit prepares for description of optional endpoint properties in ports subnodes accepting parallel video connections.
Signed-off-by Jacopo Mondi <[email protected]>--- Documentation/devicetree/bindings/media/rcar_vin.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
PATCH v5 1/6 dt-bindings: media: rcar-vin: Align Gen2 and Gen3
In reply to Jacopo MondiHi Jacopo,
Quoted 5 lines · Jacopo Mondi
Align description of the Gen2 and Gen3 bindings for parallel input. This commit prepares for description of optional endpoint properties in ports subnodes accepting parallel video connections.
Signed-off-by Jacopo Mondi <[email protected]>
Quoted 35 lines
--- Documentation/devicetree/bindings/media/rcar_vin.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)Documentation/devicetree/bindings/media/rcar_vin.txt +6
-4@@ -39,9 +39,11 @@ Additionally, an alias named vinX will need to be created to specify which video input device this is. The per-board settings Gen2 platforms: - - port sub-node describing a single endpoint connected to the vin - as described in video-interfaces.txt[1]. Only the first one will - be considered as each vin interface has one input port. + +- port - sub-node describing a single endpoint connected to the VIN + from external SoC pins as described in video-interfaces.txt[1]. + Only the first one will be considered as each vin interface has one + input port. The per-board settings Gen3 platforms:@@ -52,7 +54,7 @@ from local SoC CSI-2 receivers (port at 1) depending on SoC. - renesas,id - ID number of the VIN, VINx in the documentation. - ports - port at 0 - sub-node describing a single endpoint connected to the VIN - from external SoC pins described in video-interfaces.txt[1]. + from external SoC pins as described in video-interfaces.txt[1]. Describing more than one endpoint in port at 0 is invalid. Only VIN instances that are connected to external pins should have port at 0. - port at 1 - sub-nodes describing one or more endpoints connected toSignature · 1 line
2.7.4
Signature · 2 lines
Regards, Niklas S?derlund
PATCH v5 2/6 dt-bindings: media: rcar-vin: Describe optional ep properties
In reply to Jacopo MondiDescribe the optional endpoint properties for endpoint nodes of the R-Car VIN interface device tree bindings documentation.
--- Documentation/devicetree/bindings/media/rcar_vin.txt | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
Documentation/devicetree/bindings/media/rcar_vin.txt +17 -0
@@ -45,6 +45,17 @@ The per-board settings Gen2 platforms: Only the first one will be considered as each vin interface has one input port. + - Optional properties for endpoint nodes: + - hsync-active: see [1] for description. Default is active high. + - vsync-active: see [1] for description. Default is active high. + If both HSYNC and VSYNC polarities are not specified, embedded + synchronization is selected. + - field-active-even: see [1] for description. Default is active high. + - bus-width: see [1] for description. The selected bus width depends on + the SoC type and selected input image format. + Valid values are: 8, 10, 12, 16, 24 and 32. + - data-shift: see [1] for description. Valid values are 0 and 8. + The per-board settings Gen3 platforms: Gen3 platforms can support both a single connected parallel input source
@@ -57,6 +68,10 @@ from local SoC CSI-2 receivers (port at 1) depending on SoC. from external SoC pins as described in video-interfaces.txt[1]. Describing more than one endpoint in port at 0 is invalid. Only VIN instances that are connected to external pins should have port at 0. + + Endpoint nodes of port at 0 support the optional properties listed in + the Gen2 per-board settings description. + - port at 1 - sub-nodes describing one or more endpoints connected to the VIN from local SoC CSI-2 receivers. The endpoint numbers must use the following schema.
@@ -66,6 +81,8 @@ from local SoC CSI-2 receivers (port at 1) depending on SoC. - endpoint at 2 - sub-node describing the endpoint connected to CSI40 - endpoint at 3 - sub-node describing the endpoint connected to CSI41 + Endpoint nodes of port at 1 do not support any optional endpoint property. + Device node example for Gen2 platforms --------------------------------------
Signature · 1 line
2.7.4
PATCH v5 3/6 dt-bindings: media: Document data-enable-active property
In reply to Jacopo MondiAdd 'data-enable-active' property to endpoint node properties list.
The property allows to specify the polarity of the data-enable signal, which when in active state determinates when data lines have to sampled for valid pixel data.
--- Documentation/devicetree/bindings/media/video-interfaces.txt | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/media/video-interfaces.txt +2 -0
@@ -113,6 +113,8 @@ Optional endpoint properties Note, that if HSYNC and VSYNC polarities are not specified, embedded synchronization may be required, where supported. - data-active: similar to HSYNC and VSYNC, specifies data line polarity. +- data-enable-active: similar to HSYNC and VSYNC, specifies the data enable + signal polarity. - field-even-active: field signal level during the even field data transmission. - pclk-sample: sample data on rising (1) or falling (0) edge of the pixel clock signal.
Signature · 1 line
2.7.4
PATCH v5 3/6 dt-bindings: media: Document data-enable-active property
Hi Jacopo,
Quoted 8 lines · Jacopo Mondi
Add 'data-enable-active' property to endpoint node properties list.
The property allows to specify the polarity of the data-enable signal, which when in active state determinates when data lines have to sampled for valid pixel data.
Signed-off-by Jacopo Mondi <[email protected]>Reviewed-by Rob Herring <[email protected]>
Quoted 20 lines
--- Documentation/devicetree/bindings/media/video-interfaces.txt | 2 ++ 1 file changed, 2 insertions(+)Documentation/devicetree/bindings/media/video-interfaces.txt +2
-0@@ -113,6 +113,8 @@ Optional endpoint properties Note, that if HSYNC and VSYNC polarities are not specified, embedded synchronization may be required, where supported. - data-active: similar to HSYNC and VSYNC, specifies data line polarity. +- data-enable-active: similar to HSYNC and VSYNC, specifies the data enable + signal polarity. - field-even-active: field signal level during the even field data transmission. - pclk-sample: sample data on rising (1) or falling (0) edge of the pixel clock signal.Signature · 1 line
2.7.4
Signature · 2 lines
Regards, Niklas S?derlund
PATCH v5 4/6 media: v4l2-fwnode: parse 'data-enable-active' prop
In reply to Jacopo MondiParse the newly defined 'data-enable-active' property in parallel endpoint parsing function.
--- drivers/media/v4l2-core/v4l2-fwnode.c | 4 ++++ include/media/v4l2-mediabus.h | 2 ++ 2 files changed, 6 insertions(+)
drivers/media/v4l2-core/v4l2-fwnode.c +4 -0
@@ -154,6 +154,10 @@ static void v4l2_fwnode_endpoint_parse_parallel_bus( flags |= v ?V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH :V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW ; +if (!fwnode_property_read_u32 (fwnode,"data-enable-active" , &v)) + flags |= v ?V4L2_MBUS_DATA_ENABLE_HIGH : +V4L2_MBUS_DATA_ENABLE_LOW ; + bus->flags = flags; }
include/media/v4l2-mediabus.h +2 -0
@@ -45,6 +45,8 @@/* Active state of Sync-on-green (SoG) signal, 0/1 for LOW/HIGH respectively. */ #define V4L2_MBUS_VIDEO_SOG_ACTIVE_HIGH BIT(12)#define V4L2_MBUS_VIDEO_SOG_ACTIVE_LOW BIT(13) +#define V4L2_MBUS_DATA_ENABLE_HIGH BIT(14) +#define V4L2_MBUS_DATA_ENABLE_LOW BIT(15)/* Serial flags */ /* How many lanes the client can use */
--
2.7.4
PATCH v5 5/6 dt-bindings: media: rcar-vin: Add 'data-enable-active'
In reply to Jacopo MondiDescribe optional endpoint property 'data-enable-active' for R-Car VIN.
--- Documentation/devicetree/bindings/media/rcar_vin.txt | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/media/rcar_vin.txt +2 -0
@@ -55,6 +55,8 @@ The per-board settings Gen2 platforms: the SoC type and selected input image format. Valid values are: 8, 10, 12, 16, 24 and 32. - data-shift: see [1] for description. Valid values are 0 and 8. + - data-enable-active: polarity of CLKENB signal, see [1] for + description. Default is active high. The per-board settings Gen3 platforms:
Signature · 1 line
2.7.4
PATCH v5 6/6 media: rcar-vin: Handle data-enable polarity
In reply to Jacopo MondiHandle data-enable signal polarity. If the polarity is not specifically requested to be active low, use the active high default.
--- drivers/media/platform/rcar-vin/rcar-dma.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/media/platform/rcar-vin/rcar-dma.c +5 -0
@@ -123,6 +123,7 @@/* Video n Data Mode Register 2 bits */ #define VNDMR2_VPS (1 << 30)#define VNDMR2_HPS (1 << 29) +#define VNDMR2_CES (1 << 28)#define VNDMR2_FTEV (1 << 17)#define VNDMR2_VLV (n) ((n & 0xf) << 12)
@@ -698,6 +699,10 @@ static int rvin_setup(struct rvin_dev *vin)/* Vsync Signal Polarity Select */ if (!(vin->parallel->mbus_flags &V4L2_MBUS_VSYNC_ACTIVE_LOW )) dmr2 |=VNDMR2_VPS ; + +/* Data Enable Polarity Select */ +if (vin->parallel->mbus_flags &V4L2_MBUS_DATA_ENABLE_LOW ) + dmr2 |=VNDMR2_CES ; }/*
Signature · 1 line
2.7.4
PATCH v5 7/7 ARM: dts: rcar-gen2: Remove un-supported VIN properties
In reply to Jacopo MondiRemove from VIN interface description properties that are not listed as supported in bindings documentation, as their value is fixed in the hardware.
--- arch/arm/boot/dts/r8a7790-lager.dts | 2 -- arch/arm/boot/dts/r8a7791-koelsch.dts | 2 -- arch/arm/boot/dts/r8a7793-gose.dts | 2 -- 3 files changed, 6 deletions(-)
arch/arm/boot/dts/r8a7790-lager.dts +0 -2
@@ -888,8 +888,6 @@ bus-width = <24>; hsync-active = <0>; vsync-active = <0>; - pclk-sample = <1>; - data-active = <1>; }; }; };
arch/arm/boot/dts/r8a7791-koelsch.dts +0 -2
@@ -860,8 +860,6 @@ bus-width = <24>; hsync-active = <0>; vsync-active = <0>; - pclk-sample = <1>; - data-active = <1>; }; }; };
arch/arm/boot/dts/r8a7793-gose.dts +0 -2
@@ -768,8 +768,6 @@ bus-width = <24>; hsync-active = <0>; vsync-active = <0>; - pclk-sample = <1>; - data-active = <1>; }; }; };
Signature · 1 line
2.7.4
PATCH v5 7/7 ARM: dts: rcar-gen2: Remove un-supported VIN properties
Ah ups,
I initially had this one in the series (see, it's [7/7]), then I
dropped it not to sparkle any more debate, and re-generated patches, but forget to remove this one, which has been sent with the rest of the series.
So please ignore it.
Sorry for the noise.
j
Quoted 50 lines · Jacopo Mondi
Remove from VIN interface description properties that are not listed as supported in bindings documentation, as their value is fixed in the hardware.
Signed-off-by Jacopo Mondi <[email protected]>--- arch/arm/boot/dts/r8a7790-lager.dts | 2 -- arch/arm/boot/dts/r8a7791-koelsch.dts | 2 -- arch/arm/boot/dts/r8a7793-gose.dts | 2 -- 3 files changed, 6 deletions(-)arch/arm/boot/dts/r8a7790-lager.dts +0
-2@@ -888,8 +888,6 @@ bus-width = <24>; hsync-active = <0>; vsync-active = <0>; - pclk-sample = <1>; - data-active = <1>; }; }; };arch/arm/boot/dts/r8a7791-koelsch.dts +0
-2@@ -860,8 +860,6 @@ bus-width = <24>; hsync-active = <0>; vsync-active = <0>; - pclk-sample = <1>; - data-active = <1>; }; }; };arch/arm/boot/dts/r8a7793-gose.dts +0
-3@@ -768,8 +768,6 @@ bus-width = <24>; hsync-active = <0>; vsync-active = <0>; - pclk-sample = <1>; - data-active = <1>; }; }; }; --
Quoted 2 lines
2.7.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20180709/3fd4f3cf/attachment-0001.sig>