the field is preserved simplifies the logic quite a
bit.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by: Hans Verkuil <hans.verk...@cisco.com>
---
drivers/media/platform/rcar-vin/rcar-dma.c | 8
drivers/media/platform/rcar-vin/rcar
-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by: Hans Verkuil <hans.verk...@cisco.com>
---
drivers/media/platform/rcar-vin/rcar-dma.c | 25 +
drivers/media/platform/rcar-vin/rcar-vin.h | 2 ++
2 files changed, 27 insertions(+)
diff --g
In preparation of refactoring the scaling code move the code regarding
scaling to to the top of the file to avoid the need to add forward
declarations. No code is changed in this commit only whole functions
moved inside the same file.
Signed-off-by: Niklas Söderlund <niklas.soderlund+r
and only configure scaling and composing when the
stream starts.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by: Hans Verkuil <hans.verk...@cisco.com>
---
drivers/media/platform/rcar-vin/rcar-dma.c | 2 +-
drivers/media/platform/rcar-vin/rca
The procedure to start or stop streaming using the non-MC single
subdevice and the MC graph and multiple subdevices are quite different.
Create a new function to abstract which method is used based on which
mode the driver is running in and add logic to start the MC graph.
Signed-off-by: Niklas
to hardware constrains the link_notifier callback will return
-EMLINK.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by: Hans Verkuil <hans.verk...@cisco.com>
---
drivers/media/platform/rcar-vin/rcar-core.c | 205
1 file
On Gen3 the max supported width and height will be different from Gen2.
Move the limits to the struct rvin_info to prepare for Gen3 support.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham+rene...@ideasonboard.com&
best to scale the top or bottom to
the requested format and cropping and scaling do not work as expected.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by: Hans Verkuil <hans.verk...@cisco.com>
---
drivers/media/platform/rcar-vin/rcar-dma.c | 15 +-
Part of the format alignment and checking can be shared with the Gen3
format handling. Break that part out to its own function. While doing
this clean up the checking and add more checks.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by: Hans Verkuil <
to struct
rvin_info which will control which mode to use.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by: Hans Verkuil <hans.verk...@cisco.com>
---
drivers/media/platform/rcar-vin/rcar-core.c | 6 +-
drivers/media/platform/rcar-vin/rcar-vin.h | 2
Each Gen3 SoC has a limited set of predefined routing possibilities for
which CSI-2 device and virtual channel can be routed to which VIN
instance. Prepare to store this information in the struct rvin_info.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by
() which will always work as the driver is DT
only, so there's always a valid match.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham+rene...@ideasonboard.com>
Reviewed-by: Hans Verkuil <hans.verk...@cisco.com>
The rcar-vin driver needs to be part of a media controller to support
Gen3. Give each VIN instance a unique name so it can be referenced from
userspace.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bingham+rene...@ideason
VIN and CSI-2 block. This routing table will be kept
inside the driver but in order for it to act on it it must know which
VIN and CSI-2 is which.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Acked-by: Rob Herring <r...@kernel.org>
---
.../devicetree/bi
Bus configuration will once the driver is extended to support Gen3
contain information not specific to only the directly connected parallel
subdevice. Move it to struct rvin_info to show it's not always coupled
to the parallel subdevice.
Signed-off-by: Niklas Söderlund <niklas.soderlund+r
pointing
this out.
- Add Sakaris Ack to patch 1/32.
- Rebase on top of v4.9-rc1 instead of v4.9-rc3 to ease integration
testing together with renesas-drivers tree.
Niklas Söderlund (28):
rcar-vin: add Gen3 devicetree bindings documentation
rcar-vin: rename poorly named initialize and cleanup
Add the register needed to work with Gen3 hardware. This patch adds
the logic for how to work with the Gen3 hardware. More work is required
to enable the subdevice structure needed to configure capturing.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by
When running in media controller mode a media pad is needed, register
one. Also set the media bus format to CSI-2.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by: Hans Verkuil <hans.verk...@cisco.com>
---
drivers/media/platform/rcar-vin/rcar
Add the SoC specific information for Renesas r8a7796.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by: Hans Verkuil <hans.verk...@cisco.com>
Acked-by: Rob Herring <r...@kernel.org>
---
.../devicetree/bindings/media/rcar_vin.txt |
.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by: Hans Verkuil <hans.verk...@cisco.com>
---
drivers/media/platform/rcar-vin/rcar-core.c | 320 +++-
drivers/media/platform/rcar-vin/rcar-vin.h | 10 +-
2 files changed, 326 inse
structure and creates a media device.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by: Hans Verkuil <hans.verk...@cisco.com>
---
drivers/media/platform/rcar-vin/rcar-core.c | 179 +++-
drivers/media/platform/rcar-vin/rcar-
The functions to initialize and cleanup the hardware and video device
where poorly named from the start. Rename them to better describe their
intended function.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by: Kieran Bingham <kieran.bin
the running without directly
interacting with the source subdevice.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by: Hans Verkuil <hans.verk...@cisco.com>
---
drivers/media/platform/rcar-vin/rcar-dma.c | 3 +-
drivers/media/platform/rcar-vin/rcar-
Add the SoC specific information for Renesas r8a7795 ES1.x and ES2.0.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reviewed-by: Hans Verkuil <hans.verk...@cisco.com>
---
drivers/media/platform/rcar-vin/Kconfig | 2 +-
drivers/media/platform/rcar-vin
Add the SoC specific information for Renesas r8a77970.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Tested-by: Kieran Bingham <kieran.bingham+rene...@ideasonboard.com>
Acked-by: Rob Herring <r...@kernel.org>
Reviewed-by: Hans Verkuil <h
Hi Sakari,
Thanks for your patch.
On 2017-12-04 23:45:01 +0200, Sakari Ailus wrote:
> Print debug info as standard V4L2 endpoint are parsed.
>
> Signed-off-by: Sakari Ailus <sakari.ai...@linux.intel.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se&
Hi Laurent,
Thanks for your feedback.
On 2017-12-08 11:35:18 +0200, Laurent Pinchart wrote:
> Hi Niklas,
>
> Thank you for the patch.
>
> On Friday, 8 December 2017 03:08:27 EET Niklas Söderlund wrote:
> > There was never proper support in the VIN driver to deliver ALTERNA
Hi Laurent,
Thanks for your feedback.
On 2017-12-08 11:04:26 +0200, Laurent Pinchart wrote:
> Hi Niklas,
>
> Thank you for the patch.
>
> On Friday, 8 December 2017 03:08:25 EET Niklas Söderlund wrote:
> > It is possible on Gen2 to change the registers controlling comp
Hi Laurent,
Thanks for your comments!
On 2017-12-08 09:46:24 +0200, Laurent Pinchart wrote:
> Hi Niklas,
>
> Thank you for the patch.
>
> On Friday, 8 December 2017 03:08:15 EET Niklas Söderlund wrote:
> > Document the devicetree bindings for the CSI-2 inp
Hi Laurent,
Thanks for your comments.
On 2017-12-08 09:49:55 +0200, Laurent Pinchart wrote:
> Hi Niklas,
>
> Thank you for the patch.
>
> On Friday, 8 December 2017 03:08:16 EET Niklas Söderlund wrote:
> > The functions to initialize and cleanup the hardware and video de
Hi Laurent,
Thanks for your comments.
On 2017-12-08 09:54:31 +0200, Laurent Pinchart wrote:
> Hi Niklas,
>
> Thank you for the patch.
>
> On Friday, 8 December 2017 03:08:17 EET Niklas Söderlund wrote:
> > If the video device was registered by the complete
Hej Sakari,
Thanks for your feedback.
On 2017-12-02 16:05:08 +0200, Sakari Ailus wrote:
> Hejssan,
>
> On Sat, Dec 02, 2017 at 12:08:21PM +0100, Niklas Söderlund wrote:
> ...
> > > > +static int rcar_csi2_parse_dt(struct rcar_csi2 *priv)
> > > > +{
&g
Hi Hans,
On 2017-12-04 10:05:35 +0100, Hans Verkuil wrote:
> Hi Niklas,
>
> On 11/16/2017 01:27 AM, Laurent Pinchart wrote:
> > Hi Niklas,
> >
> > On Thursday, 16 November 2017 01:34:33 EET Niklas Söderlund wrote:
> >> On 2017-11-16 00:49:07 +0200, Lauren
ore/v4l2-async.c
> +++ b/drivers/media/v4l2-core/v4l2-async.c
> @@ -539,8 +539,12 @@ int v4l2_async_register_subdev(struct v4l2_subdev *sd)
>* (struct v4l2_subdev.dev), and async sub-device does not
>* exist independently of the device at any point of time.
>*/
> - if (!sd->fwnode && sd->dev)
> - sd->fwnode = dev_fwnode(sd->dev);
> + if (!sd->fwnode && sd->dev) {
> + sd->fwnode = fwnode_graph_get_next_endpoint(
> + dev_fwnode(sd->dev), NULL);
> + if (!sd->fwnode)
> + sd->fwnode = dev_fwnode(sd->dev);
> + }
>
> mutex_lock(_lock);
>
> diff --git a/drivers/media/v4l2-core/v4l2-fwnode.c
> b/drivers/media/v4l2-core/v4l2-fwnode.c
> index fb72c7ac04d4..9c17a26d544c 100644
> --- a/drivers/media/v4l2-core/v4l2-fwnode.c
> +++ b/drivers/media/v4l2-core/v4l2-fwnode.c
> @@ -360,7 +360,7 @@ static int v4l2_async_notifier_fwnode_parse_endpoint(
>
> asd->match_type = V4L2_ASYNC_MATCH_FWNODE;
> asd->match.fwnode.fwnode =
> - fwnode_graph_get_remote_port_parent(endpoint);
> + fwnode_graph_get_remote_endpoint(endpoint);
> if (!asd->match.fwnode.fwnode) {
> dev_warn(dev, "bad remote port parent\n");
> ret = -EINVAL;
> --
> 2.11.0
>
--
Regards,
Niklas Söderlund
8 December 2017 03:08:21 EET Niklas Söderlund wrote:
> > > > The rcar-vin driver needs to be part of a media controller to support
> > > > Gen3. Give each VIN instance a unique name so it can be referenced from
> > > > userspace.
> > > >
> &
Hi Laurent,
Thanks for your comments.
On 2017-12-08 21:30:20 +0200, Laurent Pinchart wrote:
> Hi Niklas,
>
> On Friday, 8 December 2017 16:06:58 EET Niklas Söderlund wrote:
> > On 2017-12-08 11:35:18 +0200, Laurent Pinchart wrote:
> > > On Friday, 8 December 2017 03:08
Hi Laurent,
Thanks for your comment.
On 2017-12-08 10:33:32 +0200, Laurent Pinchart wrote:
> Hi Niklas,
>
> Thank you for the patch.
>
> On Friday, 8 December 2017 03:08:23 EET Niklas Söderlund wrote:
> > The logic to preserve the requested format width and height are too
Hi Laurent,
On 2017-12-08 21:20:48 +0200, Laurent Pinchart wrote:
> Hi Niklas,
>
> On Friday, 8 December 2017 16:14:23 EET Niklas Söderlund wrote:
> > On 2017-12-08 11:04:26 +0200, Laurent Pinchart wrote:
> > > On Friday, 8 December 2017 03:08:25 EET Niklas Söderlund wrot
Hi Laurent,
On 2018-04-25 01:36:42 +0200, Niklas Söderlund wrote:
> Hi Laurent,
>
> Thanks for your patch.
>
> On 2018-04-21 15:44:44 +0300, Laurent Pinchart wrote:
> > The pixel rate, as reported by the V4L2_CID_PIXEL_RATE control, must
> > include both horizontal
Hi Laurent,
On 2018-05-05 12:48:58 +0300, Laurent Pinchart wrote:
> Hi Niklas,
>
> On Saturday, 5 May 2018 01:58:10 EEST Niklas Söderlund wrote:
> > On 2018-04-25 01:36:42 +0200, Niklas Söderlund wrote:
> > > On 2018-04-21 15:44:44 +0300, Laurent Pinchart wrot
Hi Jacopo,
Thanks for your feedback.
On 2018-05-14 15:14:48 +0200, Jacopo Mondi wrote:
> Hi Niklas,
>thanks for the patch
>
> On Sun, May 13, 2018 at 09:19:17PM +0200, Niklas Söderlund wrote:
> > A V4L2 driver for Renesas R-Car MIPI CSI-2 receiver. The driver
> >
priv->pads);
+ if (ret)
+ goto error;
+
+ pm_runtime_enable(>dev);
+
+ ret = v4l2_async_register_subdev(>subdev);
+ if (ret < 0)
+ goto error;
+
+ dev_info(priv->dev, "%d lanes found\n", priv->lanes);
+
+ return 0;
+
+error:
+ v4l2_async_notifier_unregister(>notifier);
+ v4l2_async_notifier_cleanup(>notifier);
+
+ return ret;
+}
+
+static int rcsi2_remove(struct platform_device *pdev)
+{
+ struct rcar_csi2 *priv = platform_get_drvdata(pdev);
+
+ v4l2_async_notifier_unregister(>notifier);
+ v4l2_async_notifier_cleanup(>notifier);
+ v4l2_async_unregister_subdev(>subdev);
+
+ pm_runtime_disable(>dev);
+
+ return 0;
+}
+
+static struct platform_driver rcar_csi2_pdrv = {
+ .remove = rcsi2_remove,
+ .probe = rcsi2_probe,
+ .driver = {
+ .name = "rcar-csi2",
+ .of_match_table = rcar_csi2_of_table,
+ },
+};
+
+module_platform_driver(rcar_csi2_pdrv);
+
+MODULE_AUTHOR("Niklas Söderlund <niklas.soderl...@ragnatech.se>");
+MODULE_DESCRIPTION("Renesas R-Car MIPI CSI-2 receiver driver");
+MODULE_LICENSE("GPL");
--
2.17.0
-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Acked-by: Rob Herring <r...@kernel.org>
Acked-by: Sakari Ailus <sakari.ai...@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo+rene...@jmondi.org
YUYV8/UYVY8/
Changes since v1:
- Drop dependency on a pad aware s_stream operation.
- Use the DT bindings format "renesas,-", thanks Geert
for pointing this out.
Niklas Söderlund (2):
rcar-csi2: add Renesas R-Car MIPI CSI-2 receiver documentation
rcar-csi2: add Renesas R-Car MIPI
l version of the driver. Fix
> it.
>
> Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu...@renesas.com>
> Cc: Kieran Bingham <kieran.bingham+rene...@ideasonboard.com>
> Cc: Sergei Shtylyov <sergei.shtyl...@cogentembedded.com>
> Cc: Niklas Söderlund <niklas.soderlund+rene...@ra
> > +// SPDX-License-Identifier: GPL-2.0
> > +/*
> > + * Driver for Renesas R-Car MIPI CSI-2 Receiver
> > + *
> > + * Copyright (C) 2018 Renesas Electronics Corp.
> > + */
[snip]
> > +MODULE_AUTHOR("Niklas Söderlund <niklas.soderl...@ragnatech.se>&
Hi Kieran,
Thanks for your feedback.
On 2018-05-12 09:04:18 +0100, Kieran Bingham wrote:
> Hi Niklas, Laurent,
>
> Thanks for the updated patch and detailed investigation to get this right.
>
> On 11/05/18 15:04, Niklas Söderlund wrote:
> > From: Laurent Pinchart &
Hi Simon,
Thanks for your patch.
On 2018-05-09 20:45:58 +0200, Simon Horman wrote:
> The example vin port node does not have an address and thus does not
> need address-cells or address size-properties.
>
> Signed-off-by: Simon Horman <horms+rene...@verge.net.au>
Acked-by
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
---
Documentation/devicetree/bindings/media/rcar_vin.txt | 1 +
1 file changed, 1 insertion(+)
diff --git a/Documentation/devicetree/bindings/media/rcar_vin.txt
b/Documentation/devicetree/bindings/media/rcar_vin.txt
Hi Laurent,
On 2018-04-28 19:01:37 +0300, Laurent Pinchart wrote:
> Hi Niklas,
>
> On Friday, 27 April 2018 02:28:32 EEST Niklas Söderlund wrote:
> > On 2018-04-27 00:30:25 +0300, Laurent Pinchart wrote:
> > > On Thursday, 26 April 2018 23:21:21 EEST Niklas Söderlund wro
NR_OF_RCAR_CSI2_PAD; i++)
+ priv->pads[i].flags = MEDIA_PAD_FL_SOURCE;
+
+ ret = media_entity_pads_init(>subdev.entity, NR_OF_RCAR_CSI2_PAD,
+priv->pads);
+ if (ret)
+ goto error;
+
+ pm_runtim
-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Acked-by: Rob Herring <r...@kernel.org>
Acked-by: Sakari Ailus <sakari.ai...@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinch...@ideasonboard.com>
---
* Changes since v14.
- Added compatible string f
format error s/YUYV8/UYVY8/
Changes since v1:
- Drop dependency on a pad aware s_stream operation.
- Use the DT bindings format "renesas,-", thanks Geert
for pointing this out.
Niklas Söderlund (2):
rcar-csi2: add Renesas R-Car MIPI CSI-2 receiver documentation
rcar-csi2: add Ren
Add the SoC specific information for Renesas r8a77965.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
---
drivers/media/platform/rcar-vin/rcar-core.c | 48 +
1 file changed, 48 insertions(+)
diff --git a/drivers/media/platform/rcar-vin/rcar-cor
Hi again,
On 2018-05-11 13:10:37 +0200, Niklas Söderlund wrote:
> Hi Jacopo,
>
> Thanks for your work.
>
> On 2018-05-11 11:59:40 +0200, Jacopo Mondi wrote:
> > The crop_scale routine uses the crop rectangle memebers to configure the
> > VIN clipping rectangle. When
; default:
> rvin_write(vin, vin->crop.top, VNSLPRC_REG);
> - rvin_write(vin, vin->crop.top + vin->crop.height - 1,
> -VNELPRC_REG);
> + rvin_write(vin, height - 1, VNELPRC_REG);
> break;
> }
>
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
urces are CSI-2 */
> - vin->mbus_cfg.type = V4L2_MBUS_CSI2;
> - vin->mbus_cfg.flags = 0;
> -
> vin->pad.flags = MEDIA_PAD_FL_SINK;
> ret = media_entity_pads_init(>vdev.entity, 1, >pad);
> if (ret)
> diff --git a/drivers/media/platform/rcar-vin/rcar-vin.h
> b/drivers/media/platform/rcar-vin/rcar-vin.h
> index c2aef78..a63f3c6 100644
> --- a/drivers/media/platform/rcar-vin/rcar-vin.h
> +++ b/drivers/media/platform/rcar-vin/rcar-vin.h
> @@ -52,6 +52,19 @@ enum rvin_csi_id {
> };
>
> /**
> + * enum rvin_port_id
> + *
> + * List the available VIN port functions.
> + *
> + * RVIN_PORT_DIGITAL - Input port for digital video connection
> + * RVIN_PORT_CSI2- Input port for CSI-2 video connection
> + */
> +enum rvin_port_id {
> + RVIN_PORT_DIGITAL,
> + RVIN_PORT_CSI2
> +};
This enum is never used in the patch-set is it used later by a different
patch-set or a left over from refactoring?
> +
> +/**
> * STOPPED - No operation in progress
> * RUNNING - Operation in progress have buffers
> * STOPPING - Stopping operation
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
n
that capture on R8A77995 is now ready to be used. But for the change
itself.
Reviewed-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
> ---
> drivers/media/platform/rcar-vin/rcar-core.c | 16
> 1 file changed, 16 insertions(+)
>
> diff --git a/drivers
.
This reverts commit 015060cb7795eac34454696cc9c9f8b76926a401.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
---
drivers/media/platform/rcar-vin/rcar-dma.c | 20 +---
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/drivers/media/platform/rc
: 5e7c623632fcf8f5 ("media: rcar-vin: use different v4l2 operations in
media controller mode")
Reported-by: Jacopo Mondi <jacopo+rene...@jmondi.org>
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
---
drivers/media/platform/rcar-vin/rcar-v4l2.c | 6 +++
ted format resulting in the DMA engine not properly stopping
before writing outside the buffer.
This series reverts the incorrect fix in 1/2 and applies a correct one
in 2/2. I think this should be picked up for v4.18.
* Changes since v1
- Add commit message to 1/2.
Niklas Söderlund (2):
Revert "
: 5e7c623632fcf8f5 ("media: rcar-vin: use different v4l2 operations in
media controller mode")
Reported-by: Jacopo Mondi <jacopo+rene...@jmondi.org>
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
---
drivers/media/platform/rcar-vin/rcar-v4l2.c | 6 +++
This reverts commit 015060cb7795eac34454696cc9c9f8b76926a401.
---
drivers/media/platform/rcar-vin/rcar-dma.c | 20 +---
1 file changed, 5 insertions(+), 15 deletions(-)
diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c
b/drivers/media/platform/rcar-vin/rcar-dma.c
index
requested format resulting in the DMA engine not properly stopping
before writing outside the buffer.
This series reverts the incorrect fix in 1/2 and applies a correct one
in 2/2. I think this should be picked up for v4.18.
Niklas Söderlund (2):
Revert "media: rcar-vin: enable field tog
80 MHz.
Signed-off-by: Laurent Pinchart <laurent.pinchart+rene...@ideasonboard.com>
[Niklas: Update AFE fixed pixel rate]
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
---
* Changes since v1
- Update AFE fixed pixel rate.
---
drivers/media/i2c/adv748x/a
Hi Jacopo,
On 2018-05-17 12:13:06 +0200, Jacopo Mondi wrote:
> Hi Niklas,
>thanks for review.
>
> On Wed, May 16, 2018 at 10:32:49PM +0200, Niklas Söderlund wrote:
> > Hi Jacopo,
> >
> > Thanks for your work!
> >
> > First let me apo
Hi Hans,
Thanks for your feedback.
On 2018-05-17 10:04:35 +0200, Hans Verkuil wrote:
> On 17/05/18 04:00, Niklas Söderlund wrote:
>
> Missing commit log.
I checked other commits doing the same thing, they had no commit log and
that was enough reason for me to be lazy. Will
Prepare for adding a new IOCTL VIDIOC_SUBDEV_ENUMSTD which would
enumerate the standards for a subdevice by breaking out the code which
could be shared between the video and subdevice versions of this IOCTL.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
---
d
://git.ragnatech.se/v4l-utils#subdev-std
* Changes since v1
- Add VIDIOC_SUBDEV_ENUMSTD.
Niklas Söderlund (2):
v4l2-ioctl: create helper to fill in v4l2_standard for ENUMSTD
v4l: Add support for STD ioctls on subdev nodes
.../media/uapi/v4l/vidioc-enumstd.rst | 11 ++--
Documentation
be controlled on the subdev device directly.
Add four new ioctls to be able to directly interact with subdevices and
control the video standard; VIDIOC_SUBDEV_ENUMSTD, VIDIOC_SUBDEV_G_STD,
VIDIOC_SUBDEV_S_STD and VIDIOC_SUBDEV_QUERYSTD.
Signed-off-by: Niklas Söderlund <niklas.soderlund+r
Instead of failing the set_fmt() if a unsupported format is requested
set a default one and return the changed format to the user.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reported-by: Sakari Ailus <sakari.ai...@iki.fi>
---
drivers/media/platform/rcar-v
turing so that the driver always returns buffers in the same order
they are queued and prepare for SEQ_TB/BT output.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
---
drivers/media/platform/rcar-vin/rcar-dma.c | 16 +++-
drivers/media/platform/rcar-vin/rcar-v
The style for referring to ports and endpoint are wrong. Refer to them
using lowercase and a unit address, port@x and endpoint@x.
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
Reported-by: Geert Uytterhoeven <ge...@linux-m68k.org>
---
.../devicetree/bi
di.org>
> Acked-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
> ---
> Documentation/devicetree/bindings/media/rcar_vin.txt | 13 -
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/media/rcar_vin.
the rest of the rcar_vin.txt file only spaces are used for
indentation.
> +
> - port 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.
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
eeded here. Would not something like this be much more readable?
/* Clock Enable signal polarity select. */
if (vin->parallel->mbus_flags & V4L2_MBUS_DATA_ACTIVE_LOW)
dmr2 |= VNDMR2_CES;
/* Use HSYNC as clock enable if VIn_CLKENB is not available. */
if (!(vin->parallel->mbus_flags & (V4L2_MBUS_DATA_ACTIVE_LOW |
V4L2_MBUS_DATA_ACTIVE_HIGH)))
dmr2 |= VNDMR2_CHS;
> + }
>
> /*
>* Output format
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
truct v4l2_async_subdev *asd)
> +static void rvin_parallel_notify_unbind(struct v4l2_async_notifier *notifier,
> + struct v4l2_subdev *subdev,
> + struct v4l2_async_subdev *asd)
When I run my indentation script this i
Hi Jacopo,
Thanks for your work.
On 2018-05-18 16:40:38 +0200, Jacopo Mondi wrote:
> Remove un-necessary empty lines.
>
> Signed-off-by: Jacopo Mondi <jacopo+rene...@jmondi.org>
Acked-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
> ---
> drivers/m
bled VIN instances found in DT
> - * @notifier:pointer to the notifier of a VIN which handles
> the
> - * groups async sub-devices.
> + * @notifier:group notifier for CSI-2 async subdevices
> * @vin: VIN instances which are part of the group
> * @csi: array of pairs of fwnode and subdev pointers
> * to all CSI-2 subdevices.
> @@ -238,7 +239,7 @@ struct rvin_group {
>
> struct mutex lock;
> unsigned int count;
> - struct v4l2_async_notifier *notifier;
> + struct v4l2_async_notifier notifier;
> struct rvin_dev *vin[RCAR_VIN_NUM];
>
> struct {
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
scriptor
> *
> * @group: Gen3 CSI group
> * @id: Gen3 group id for this VIN
> @@ -164,7 +171,8 @@ struct rvin_info {
> * @sequence:V4L2 buffers sequence number
> * @state: keeps track of operation state
> *
> - * @mbus_cfg:media bus configuration from DT
> + * @is_csi: flag to mark the VIN as using a CSI-2 subdevice
> + *
> * @mbus_code: media bus format code
> * @format: active V4L2 pixel format
> *
> @@ -182,7 +190,8 @@ struct rvin_dev {
> struct v4l2_device v4l2_dev;
> struct v4l2_ctrl_handler ctrl_handler;
> struct v4l2_async_notifier notifier;
> - struct rvin_graph_entity *parallel;
> +
> + struct rvin_parallel_entity *parallel;
>
> struct rvin_group *group;
> unsigned int id;
> @@ -199,7 +208,8 @@ struct rvin_dev {
> unsigned int sequence;
> enum rvin_dma_state state;
>
> - struct v4l2_mbus_config mbus_cfg;
> + bool is_csi;
> +
> u32 mbus_code;
> struct v4l2_pix_format format;
>
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
_init(vin);
> - else
> - ret = rvin_parallel_graph_init(vin);
> - if (ret < 0)
> +
> + if (vin->info->use_mc) {
> + vin->pad.flags = MEDIA_PAD_FL_SINK;
> + ret = media_entity_pads_init(>vdev.entity, 1, >pad);
> + if (ret)
> + return ret;
> +
> + ret = rvin_group_get(vin);
> + if (ret)
> + return ret;
> + }
> +
> + ret = rvin_parallel_init(vin);
> + if (ret < 0 && ret != -ENOTCONN)
> goto error;
>
> + ret = rvin_mc_init(vin);
> + if (ret)
> + return ret;
> +
I think that if you first call rvin_mc_init() and then
rvin_parallel_init() you can remove the delay of registering the VIN
local notifier as the media device will have then been created and there
is no reason to delay the notifier registration. And in the process this
patch becomes much simpler (I think).
> pm_suspend_ignore_children(>dev, true);
> pm_runtime_enable(>dev);
>
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
rst.
> Check if the device is already registered, to avoid double registrations.
>
> Signed-off-by: Jacopo Mondi <jacopo+rene...@jmondi.org>
Acked-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
> ---
> drivers/media/platform/rcar-vin/rcar-core.c | 26 +
oup_csi_pad_to_channel(link->source->index);
I think you should move the channel = ...; bellow the new if statement
the same way you do with mask_new.
> - mask_new = mask & rvin_group_get_mask(vin, csi_id, channel);
> + csi_id = rvin_group_entity_to_csi_id(group,
Hi Jacopo,
Thanks for your work.
On 2018-05-18 16:40:44 +0200, Jacopo Mondi wrote:
> Remove trailing underscore to align all rcar_group_route structure
> declarations.
>
> Signed-off-by: Jacopo Mondi <jacopo+rene...@jmondi.org>
With Sergei's comment addressed:
Acked-by
et)
> + return ret;
> +
> + ret = rvin_group_get(vin);
> + if (ret)
> + return ret;
> + }
I don't see why you need to move the media pad creation out of
rvin_mc_init(). With the reorder of the rvin_mc_init()
rvin_parallel_init() I would keep this in rvin_mc_init().
> +
> + ret = rvin_mc_init(vin);
> + if (ret)
> + return ret;
> +
> + ret = rvin_parallel_init(vin);
> + if (ret < 0 && ret != -ENOTCONN)
> goto error;
>
> pm_suspend_ignore_children(>dev, true);
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
Signed-off-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
---
Documentation/media/uapi/v4l/vidioc-g-std.rst| 14 ++
Documentation/media/uapi/v4l/vidioc-querystd.rst | 11 +++
drivers/media/v4l2-core/v4l2-subdev.c| 12
includ
/arm/boot/dts/r8a7794-alt.dts| 2 +-
> arch/arm/boot/dts/r8a7794-silk.dts | 2 +-
> drivers/media/platform/rcar-vin/rcar-core.c | 10 --
> drivers/media/platform/rcar-vin/rcar-dma.c | 11 +++
> 9 files changed, 42 insertions(+), 15 deletions(-)
>
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
t */
if (!(vin->mbus_cfg.flags & V4L2_MBUS_DATA_ACTIVE_LOW))
dmr2 |= VNDMR2_CES;
/* Use HSYNC as clock enable if VIn_CLKENB is not available. */
if (!(vin->mbus_cfg.flags & (V4L2_MBUS_DATA_ACTIVE_LOW |
V4L2_MBUS_DATA_ACTIVE_HIGH)))
dmr2 |= VNDMR2_CHS;
Or am I misunderstanding something?
> +
> + /*
>* Output format
>*/
> switch (vin->format.pixelformat) {
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
ne or more endpoints connected to
>the VIN from local SoC CSI-2 receivers. The endpoint numbers must
>use the following schema.
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
TIVE_LOW)) {
> + vin_err(vin,
> + "Missing data enable signal polarity
> property\n");
I fear this can't be an error as that would break backward comp ability
with existing dtb's.
> + return -EINVAL;
> + }
> break;
> default:
> vin_err(vin, "Unknown media bus type\n");
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
44
> --- a/arch/arm/boot/dts/r8a7794-alt.dts
> +++ b/arch/arm/boot/dts/r8a7794-alt.dts
> @@ -380,7 +380,6 @@
>
> vin0ep: endpoint {
> remote-endpoint = <>;
> - bus-width = <8>;
> };
> };
> };
> diff --git a/arch/arm/boot/dts/r8a7794-silk.dts
> b/arch/arm/boot/dts/r8a7794-silk.dts
> index 351cb3b..c0c5d31 100644
> --- a/arch/arm/boot/dts/r8a7794-silk.dts
> +++ b/arch/arm/boot/dts/r8a7794-silk.dts
> @@ -480,7 +480,6 @@
>
> vin0ep: endpoint {
> remote-endpoint = <>;
> - bus-width = <8>;
> };
> };
> };
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
> b/arch/arm/boot/dts/r8a7794-silk.dts
> index c0c5d31..ed17376 100644
> --- a/arch/arm/boot/dts/r8a7794-silk.dts
> +++ b/arch/arm/boot/dts/r8a7794-silk.dts
> @@ -480,6 +480,7 @@
>
> vin0ep: endpoint {
> remote-endpoint = <>;
> + data-active = <1>;
> };
> };
> };
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
Hi Jacopo,
On 2018-05-16 14:16:56 +0200, Jacopo Mondi wrote:
> Add R-Car R8A77995 SoC to the rcar-vin supported ones.
>
> Signed-off-by: Jacopo Mondi <jacopo+rene...@jmondi.org>
> Reviewed-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
> Reviewed-by: Laur
>
> /**
> + * enum rvin_port_id
> + *
> + * List the available VIN port functions.
> + *
> + * RVIN_PORT_DIGITAL - Input port for digital video connection
> + * RVIN_PORT_CSI2- Input port for CSI-2 video connection
> + */
> +enum rvin_port_id {
> + RVIN_PORT_DIGITAL,
> + RVIN_PORT_CSI2
> +};
> +
> +/**
> * STOPPED - No operation in progress
> * RUNNING - Operation in progress have buffers
> * STOPPING - Stopping operation
> @@ -225,6 +238,7 @@ struct rvin_dev {
> *
> * @lock:protects the count, notifier, vin and csi members
> * @count: number of enabled VIN instances found in DT
> + * @v4l2_dev:pointer to the group v4l2 device
I pray there is a away to avoid adding this here, it feels awkward :-(
> * @notifier:pointer to the notifier of a VIN which handles
> the
> * groups async sub-devices.
> * @vin: VIN instances which are part of the group
> @@ -238,6 +252,7 @@ struct rvin_group {
>
> struct mutex lock;
> unsigned int count;
> + struct v4l2_device *v4l2_dev;
> struct v4l2_async_notifier *notifier;
> struct rvin_dev *vin[RCAR_VIN_NUM];
>
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
e probed.
> + */
> + if (vin->info->use_mc)
> + return 0;
> +
> vin->notifier.ops = _digital_notify_ops;
> ret = v4l2_async_notifier_register(>v4l2_dev, >notifier);
> if (ret < 0) {
> @@ -596,7 +631,8 @@ static int rvin_group_notify_complete(struct
> v4l2_async_notifier *notifier)
>
> /* Register all video nodes for the group. */
> for (i = 0; i < RCAR_VIN_NUM; i++) {
> - if (vin->group->vin[i]) {
> + if (vin->group->vin[i] &&
> + !video_is_registered(>group->vin[i]->vdev)) {
> ret = rvin_v4l2_register(vin->group->vin[i]);
> if (ret)
> return ret;
> --
> 2.7.4
>
--
Regards,
Niklas Söderlund
ame);
> + ret = -ENODEV;
> + goto out;
> + }
I like this patch, you made it so simple. I feared this would be the
ugly part when adding parallel support to Gen3. All that is missing is
handling of vin->mbus_cfg or how you think we best handle that for the
e...@jmondi.org>
Acked-by: Niklas Söderlund <niklas.soderlund+rene...@ragnatech.se>
> ---
> Documentation/devicetree/bindings/media/rcar_vin.txt | 13 -
> 1 file changed, 12 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/media/rca
The style for referring to ports and endpoint are wrong. Refer to them
using lowercase and a unit address, port@x and endpoint@x.
Signed-off-by: Niklas Söderlund
Reported-by: Geert Uytterhoeven
Reviewed-by: Rob Herring
---
* Changes since v1.
- Fixed spelling reported by Sergei, s/then/than
turing so that the driver always returns buffers in the same order
they are queued and prepare for SEQ_TB/BT output.
Signed-off-by: Niklas Söderlund
---
* Changes since v1
- Fix spelling in commit message pointed out by Sergei.
s/writing/written/ and s/outputing/outputting/.
---
drivers/media
Add the SoC specific information for Renesas r8a77965.
Signed-off-by: Niklas Söderlund
Reviewed-by: Laurent Pinchart
---
* Changes since v1
- Fixed typo in variable name,
s/_rcar_info_r8a77965_routes/rcar_info_r8a77965_routes/.
- Collected Laurents tag.
---
drivers/media/platform/rcar-vin
601 - 700 of 984 matches
Mail list logo