Re: [PATCH v6 2/2] v4l: cadence: Add Cadence MIPI-CSI2 TX driver

2018-03-15 Thread Niklas Söderlund
tform_set_drvdata(pdev, csi2tx); > + mutex_init(&csi2tx->lock); > + csi2tx->dev = &pdev->dev; > + > + ret = csi2tx_get_resources(csi2tx, pdev); > + if (ret) > + goto err_free_priv; > + > + v4l2_subdev_init(&csi2tx->subdev, &csi2tx_subdev_ops); > + csi2tx->subdev.owner = THIS_MODULE; > + csi2tx->subdev.dev = &pdev->dev; > + csi2tx->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; > + snprintf(csi2tx->subdev.name, V4L2_SUBDEV_NAME_SIZE, "%s.%s", > + KBUILD_MODNAME, dev_name(&pdev->dev)); > + > + ret = csi2tx_check_lanes(csi2tx); > + if (ret) > + goto err_free_priv; > + > + /* Create our media pads */ > + csi2tx->subdev.entity.function = MEDIA_ENT_F_VID_IF_BRIDGE; > + csi2tx->pads[CSI2TX_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE; > + for (i = CSI2TX_PAD_SINK_STREAM0; i < CSI2TX_PAD_MAX; i++) > + csi2tx->pads[i].flags = MEDIA_PAD_FL_SINK; > + > + for (i = 0; i < CSI2TX_PAD_MAX; i++) > + csi2tx->pad_fmts[i] = fmt_default; > + > + ret = media_entity_pads_init(&csi2tx->subdev.entity, CSI2TX_PAD_MAX, > + csi2tx->pads); > + if (ret) > + goto err_free_priv; > + > + ret = v4l2_async_register_subdev(&csi2tx->subdev); > + if (ret < 0) > + goto err_free_priv; > + > + dev_info(&pdev->dev, > + "Probed CSI2TX with %u/%u lanes, %u streams, %s D-PHY\n", > + csi2tx->num_lanes, csi2tx->max_lanes, csi2tx->max_streams, > + csi2tx->has_internal_dphy ? "internal" : "no"); > + > + return 0; > + > +err_free_priv: > + kfree(csi2tx); > + return ret; > +} > + > +static int csi2tx_remove(struct platform_device *pdev) > +{ > + struct csi2tx_priv *csi2tx = platform_get_drvdata(pdev); > + > + v4l2_async_unregister_subdev(&csi2tx->subdev); > + kfree(csi2tx); > + > + return 0; > +} > + > +static const struct of_device_id csi2tx_of_table[] = { > + { .compatible = "cdns,csi2tx" }, > + { }, > +}; > +MODULE_DEVICE_TABLE(of, csi2tx_of_table); > + > +static struct platform_driver csi2tx_driver = { > + .probe = csi2tx_probe, > + .remove = csi2tx_remove, > + > + .driver = { > + .name = "cdns-csi2tx", > + .of_match_table = csi2tx_of_table, > + }, > +}; > +module_platform_driver(csi2tx_driver); > -- > 2.14.3 > -- Regards, Niklas Söderlund

Re: [PATCH v6 1/2] dt-bindings: media: Add Cadence MIPI-CSI2 TX Device Tree bindings

2018-03-15 Thread Niklas Söderlund
operate with an external D-PHY, an internal one or no D-PHY at all > in some configurations. > > Acked-by: Rob Herring > Acked-by: Sakari Ailus > Signed-off-by: Maxime Ripard Reviewed-by: Niklas Söderlund > --- > .../devicetree/bindings/media/cdns,csi2tx.txt | 98 > +

Re: [PATCH 00/20] Add multiplexed media pads to support CSI-2 virtual channels

2018-03-15 Thread Niklas Söderlund
ultiplexed streams would be useful for you? > > Best regards, > Todor Tomov > > On 11.08.2017 12:56, Niklas Söderlund wrote: > > Hi, > > > > This series is a RFC for how I think one could add CSI-2 virtual channel > > support to the V4L2 framework. Th

Re: [PATCH 1/3] rcar-vin: remove duplicated check of state in irq handler

2018-03-14 Thread Niklas Söderlund
Hi Jacopo, On 2018-03-14 16:17:33 +0100, Jacopo Mondi wrote: > Hi Niklas, Kieran, > > On Tue, Mar 13, 2018 at 06:56:54PM +0100, Niklas Söderlund wrote: > > Hi Kieran, > > > > Thanks for your feedback. > > > > On 2018-03-13 17:42:25 +0100, Kieran Bingham wro

[PATCH v2 2/2] rcar-vin: use scratch buffer and always run in continuous mode

2018-03-13 Thread Niklas Söderlund
down and run in single mode until the capturing process where restarted. An additional effect of this change is that the capture logic can be made much simple as we know that continuous mode will always be used. Signed-off-by: Niklas Söderlund Reviewed-by: Jacopo Mondi --- drivers/media/platform

[PATCH v2 1/2] rcar-vin: allocate a scratch buffer at stream start

2018-03-13 Thread Niklas Söderlund
single capture mode if userspace can't queue buffers as fast as the VIN driver consumes them. Signed-off-by: Niklas Söderlund Reviewed-by: Jacopo Mondi Reviewed-by: Kieran Bingham --- drivers/media/platform/rcar-vin/rcar-dma.c | 19 +++ drivers/media/platform/rcar-vin/rcar-

[PATCH v2 0/2] rcar-vin: always run in continues mode

2018-03-13 Thread Niklas Söderlund
situations and no regressions in the vin-tests suite. * Changes since v1 - Dropped first patch in series as it removed a correct check due to my poor reading skills. - Corrected spelling in commit messages and comments. - Added review tags from Jacopo and Kieran, thanks! Niklas Söderlund (2

Re: [PATCH 1/3] rcar-vin: remove duplicated check of state in irq handler

2018-03-13 Thread Niklas Söderlund
Hi Kieran, Thanks for your feedback. On 2018-03-13 17:42:25 +0100, Kieran Bingham wrote: > Hi Niklas, > > Thanks for the patch series :) - I've been looking forward to seeing this one > ! > > On 10/03/18 01:09, Niklas Söderlund wrote: > > This is an error from wh

Re: [PATCH 3/3] rcar-vin: use scratch buffer and always run in continuous mode

2018-03-12 Thread Niklas Söderlund
Hi Jacopo, Thanks for your feedback. On 2018-03-12 15:38:12 +0100, Jacopo Mondi wrote: > Hi Niklas, > a few comments below > > On Sat, Mar 10, 2018 at 01:09:53AM +0100, Niklas Söderlund wrote: > > Instead of switching capture mode depending on how many buffers are > >

[PATCH 0/3] rcar-vin: always run in continues mode

2018-03-09 Thread Niklas Söderlund
patches have been tested with great improvement in capture speed for buffer strained situations and no regressions in the vin-tests suite. Niklas Söderlund (3): rcar-vin: remove duplicated check of state in irq handler rcar-vin: allocate a scratch buffer at stream start rcar-vin: use scratch

[PATCH 3/3] rcar-vin: use scratch buffer and always run in continuous mode

2018-03-09 Thread Niklas Söderlund
down and run in single mode until the capturing process where restarted. An additional effect of this change is that the capture logic can be made much simple as we know that continues mode will always be used. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-dma.c | 187

[PATCH 1/3] rcar-vin: remove duplicated check of state in irq handler

2018-03-09 Thread Niklas Söderlund
This is an error from when the driver where converted from soc-camera. There is absolutely no gain to check the state variable two times to be extra sure if the hardware is stopped. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-dma.c | 6 -- 1 file changed, 6

[PATCH 2/3] rcar-vin: allocate a scratch buffer at stream start

2018-03-09 Thread Niklas Söderlund
single capture mode if userspace don't queue buffers as fast as the VIN driver consumes them. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-dma.c | 19 +++ drivers/media/platform/rcar-vin/rcar-vin.h | 4 2 files changed, 23 insertions(+) diff --

Re: [PATCH v12 11/33] rcar-vin: set a default field to fallback on

2018-03-09 Thread Niklas Söderlund
Hi Hans, Thanks for your feedback. On 2018-03-09 17:28:39 +0100, Hans Verkuil wrote: > On 09/03/18 17:17, Niklas Söderlund wrote: > > Hi Hans, > > > > Thanks for your feedback, I don't think I can appreciate how happy I'm > > that you reviewed this patc

Re: [PATCH v12 11/33] rcar-vin: set a default field to fallback on

2018-03-09 Thread Niklas Söderlund
Hi Hans, Thanks for your feedback, I don't think I can appreciate how happy I'm that you reviewed this patch-set, Thank you! On 2018-03-09 16:25:23 +0100, Hans Verkuil wrote: > On 07/03/18 23:04, Niklas Söderlund wrote: > > If the field is not supported by the driver it sho

Re: [PATCH] dt-bindings: media: rcar_vin: Use status "okay"

2018-03-09 Thread Niklas Söderlund
gt; pinctrl-names = "default"; > > @@ -104,7 +104,7 @@ Board setup example for Gen2 platforms (vin1 composite > video input) > pinctrl-0 = <&vin1_pins>; > pinctrl-names = "default"; > > -status = "ok"; > +status = "okay"; > > port { > #address-cells = <1>; > -- > 2.7.4 > -- Regards, Niklas Söderlund

Re: [PATCH v2] i2c: adv748x: afe: fix sparse warning

2018-03-07 Thread Niklas Söderlund
CC linux-media. It's linux-media@vger.kernel.org not linux-me...@vger.kernel.or, sorry for the noise. On 2018-03-07 23:58:16 +0100, Niklas Söderlund wrote: > This fixes the following sparse warning: > > drivers/media/i2c/adv748x/adv748x-afe.c:294:34:expected unsigned in

[PATCH v12 14/33] rcar-vin: align pixelformat check

2018-03-07 Thread Niklas Söderlund
If the pixelformat is not supported it should not fail but be set to something that works. While we are at it move the two different checks of the pixelformat to the same statement. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-v4l2.c

[PATCH v12 05/33] rcar-vin: unregister video device on driver removal

2018-03-07 Thread Niklas Söderlund
-by: Niklas Söderlund Reviewed-by: Kieran Bingham Reviewed-by: Hans Verkuil Acked-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-core.c | 2 ++ drivers/media/platform/rcar-vin/rcar-v4l2.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/drivers/media/platform/rcar-vin/rcar

[PATCH v12 22/33] rcar-vin: use different v4l2 operations in media controller mode

2018-03-07 Thread Niklas Söderlund
without directly interacting with the source subdevice. Signed-off-by: Niklas Söderlund Reviewed-by: Hans Verkuil --- * Changes since v11 - Fixed error labels name in rvin_mc_open(). --- drivers/media/platform/rcar-vin/rcar-dma.c | 2 +- drivers/media/platform/rcar-vin/rcar-v4l2.c | 161

[PATCH v12 18/33] rcar-vin: move media bus configuration to struct rvin_dev

2018-03-07 Thread Niklas Söderlund
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_dev to show it's not always coupled to the parallel subdevice. Signed-off-by: Niklas Söderlund Reviewed-by: Hans Ve

[PATCH v12 10/33] rcar-vin: all Gen2 boards can scale simplify logic

2018-03-07 Thread Niklas Söderlund
the field is preserved simplifies the logic quite a bit. Signed-off-by: Niklas Söderlund Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-dma.c | 8 drivers/media/platform/rcar-vin/rcar-v4l2.c | 25 +++-- drivers

[PATCH v12 16/33] rcar-vin: simplify how formats are set and reset

2018-03-07 Thread Niklas Söderlund
truct rvin_source_fmt with a struct v4l2_rect as all it's used for is keep track of the source dimensions. Signed-off-by: Niklas Söderlund --- * Changes since v11 - This patch where 'rcar-vin: read subdevice format for crop only when needed' - Keep caching the source dimensions and

[PATCH v12 27/33] rcar-vin: add chsel information to rvin_info

2018-03-07 Thread Niklas Söderlund
Each Gen3 SoC has a limited set of predefined routing possibilities for which CSI-2 device and channel can be routed to which VIN instance. Prepare to store this information in the struct rvin_info. Signed-off-by: Niklas Söderlund --- * Changes since v11 - Fixed spelling. - Reorderd filed

[PATCH v12 04/33] rcar-vin: rename poorly named initialize and cleanup functions

2018-03-07 Thread Niklas Söderlund
The functions to register and unregister 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 Reviewed-by: Kieran Bingham Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- drivers

[PATCH v12 00/33] rcar-vin: Add Gen3 with media controller

2018-03-07 Thread Niklas Söderlund
elling and DT documentation as pointed out by Geert and Sergei, thanks! - Refresh patch 2/32 with an updated version, thanks Sakari for 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

[PATCH v12 26/33] rcar-vin: change name of video device

2018-03-07 Thread Niklas Söderlund
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 Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 2 +- 1 file changed, 1

[PATCH v12 29/33] rcar-vin: add link notify for Gen3

2018-03-07 Thread Niklas Söderlund
le a new link due to hardware constrains the link_notifier callback will return -EMLINK. Signed-off-by: Niklas Söderlund --- * Changes since v11 - Fixed spelling - Updated comment to clarify the intent that no link can be enabled if any video node is open. - Use container_of() instead of a loop to

[PATCH v12 32/33] rcar-vin: enable support for r8a7796

2018-03-07 Thread Niklas Söderlund
Add the SoC specific information for Renesas r8a7796. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-core.c | 44 + 1 file changed, 44 insertions(+) diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b

[PATCH v12 20/33] rcar-vin: add function to manipulate Gen3 chsel value

2018-03-07 Thread Niklas Söderlund
Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-dma.c | 38 ++ drivers/media/platform/rcar-vin/rcar-vin.h | 2 ++ 2 files changed, 40 insertions(+) diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/dri

[PATCH v12 28/33] rcar-vin: parse Gen3 OF and setup media graph

2018-03-07 Thread Niklas Söderlund
the notifier belonging to the last probed VIN. Once all CSI-2 subdevices in this notifier are bound proceed to register all VIN video devices of the group and crate media device links between all CSI-2 and VIN entities according to the SoC specific routing configuration. Signed-off-by: Niklas

[PATCH v12 24/33] rcar-vin: prepare for media controller mode initialization

2018-03-07 Thread Niklas Söderlund
comment. Signed-off-by: Niklas Söderlund Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-core.c | 20 ++-- drivers/media/platform/rcar-vin/rcar-vin.h | 4 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH v12 25/33] rcar-vin: add group allocator functions

2018-03-07 Thread Niklas Söderlund
data structure and registers a media device. Consecutive VINs insert themself into the global group. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-core.c | 174 +++- drivers/media/platform/rcar-vin/rcar-vin.h | 31

[PATCH v12 30/33] rcar-vin: extend {start,stop}_streaming to work with media controller

2018-03-07 Thread Niklas Söderlund
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

[PATCH v12 33/33] rcar-vin: enable support for r8a77970

2018-03-07 Thread Niklas Söderlund
Add the SoC specific information for Renesas r8a77970. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-core.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b

[PATCH v12 31/33] rcar-vin: enable support for r8a7795

2018-03-07 Thread Niklas Söderlund
Add the SoC specific information for Renesas r8a7795 ES1.x and ES2.0. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/Kconfig | 2 +- drivers/media/platform/rcar-vin/rcar-core.c | 120 2 files changed, 121

[PATCH v12 09/33] rcar-vin: move functions regarding scaling

2018-03-07 Thread Niklas Söderlund
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 Reviewed-by: Hans Verkuil

[PATCH v12 19/33] rcar-vin: enable Gen3 hardware configuration

2018-03-07 Thread Niklas Söderlund
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 Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart

[PATCH v12 23/33] rcar-vin: force default colorspace for media centric mode

2018-03-07 Thread Niklas Söderlund
fixed values. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 21 +++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/media/platform/rcar-vin/rcar-v4l2.c index 2280535ca98

[PATCH v12 12/33] rcar-vin: fix handling of single field frames (top, bottom and alternate fields)

2018-03-07 Thread Niklas Söderlund
: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-dma.c | 15 +-- drivers/media/platform/rcar-vin/rcar-v4l2.c | 40 +++-- 2 files changed, 10 insertions(+), 45 deletions(-) diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform

[PATCH v12 21/33] rcar-vin: add flag to switch to media controller mode

2018-03-07 Thread Niklas Söderlund
struct rvin_info which will control which mode to use. Signed-off-by: Niklas Söderlund Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-core.c | 6 +- drivers/media/platform/rcar-vin/rcar-vin.h | 2 ++ 2 files changed, 7 insertions(+), 1

[PATCH v12 15/33] rcar-vin: break out format alignment and checking

2018-03-07 Thread Niklas Söderlund
Part of the format alignment and checking can be shared with the Gen3 format handling. Break that part out to a separate function. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 85 - 1 file changed, 48 insertions(+), 37 deletions

[PATCH v12 11/33] rcar-vin: set a default field to fallback on

2018-03-07 Thread Niklas Söderlund
If the field is not supported by the driver it should not try to keep the current field. Instead it should set it to a default fallback. Since trying a format should always result in the same state regardless of the current state of the device. Signed-off-by: Niklas Söderlund Reviewed-by

[PATCH v12 17/33] rcar-vin: cache video standard

2018-03-07 Thread Niklas Söderlund
At stream on time the driver should not query the subdevice for which standard are used. Instead it should be cached when userspace sets the standard and used at stream on time. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-core.c | 6 ++ drivers/media/platform

[PATCH v12 13/33] rcar-vin: update bytesperline and sizeimage calculation

2018-03-07 Thread Niklas Söderlund
Remove over complicated logic to calculate the value for bytesperline and sizeimage that was carried over from the soc_camera port. There is no need to find the max value of bytesperline and sizeimage from user-space as they are set to 0 before the max_t() operation. Signed-off-by: Niklas

[PATCH v12 02/33] dt-bindings: media: rcar_vin: add device tree support for r8a774[35]

2018-03-07 Thread Niklas Söderlund
if needed, in addition to document SoC support and therefore allow checkpatch.pl to validate compatible string values. Signed-off-by: Fabrizio Castro Reviewed-by: Biju Das Reviewed-by: Simon Horman Acked-by: Rob Herring Reviewed-by: Geert Uytterhoeven Acked-by: Niklas Söderlund Reviewed-b

[PATCH v12 06/33] rcar-vin: move subdevice handling to async callbacks

2018-03-07 Thread Niklas Söderlund
only used on Gen2. While moving this code drop a large comment which is copied from the framework documentation and fold rvin_mbus_supported() into its only caller. Also move the initialization and cleanup code to separate functions to increase readability. Signed-off-by: Niklas Söderlund Reviewed

[PATCH v12 03/33] rcar-vin: add Gen3 devicetree bindings documentation

2018-03-07 Thread Niklas Söderlund
tween each 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 Acked-by: Rob Herring Reviewed-by: Laurent Pinchart --- .../devicetree/bindings/media/rcar_vin.txt

[PATCH v12 07/33] rcar-vin: move model information to own struct

2018-03-07 Thread Niklas Söderlund
chip_id to model_id. Also sort the compatible string entries and make use of of_device_get_match_data() which will always work as the driver is DT only, so there's always a valid match. Signed-off-by: Niklas Söderlund Reviewed-by: Kieran Bingham Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pin

[PATCH v12 08/33] rcar-vin: move max width and height information to chip information

2018-03-07 Thread Niklas Söderlund
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 Reviewed-by: Kieran Bingham Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin

[PATCH v12 01/33] dt-bindings: media: rcar_vin: Reverse SoC part number list

2018-03-07 Thread Niklas Söderlund
From: Fabrizio Castro Change the sorting of the part numbers from descending to ascending to match with other documentation. Signed-off-by: Fabrizio Castro Reviewed-by: Biju Das Reviewed-by: Simon Horman Acked-by: Rob Herring Reviewed-by: Geert Uytterhoeven Acked-by: Niklas Söderlund

Re: [PATCH v11 16/32] rcar-vin: read subdevice format for crop only when needed

2018-03-03 Thread Niklas Söderlund
Hi Laurent, Thanks for your feedback. On 2018-03-02 13:06:27 +0200, Laurent Pinchart wrote: > Hi Niklas, > > Thank you for the patch. > > On Friday, 2 March 2018 03:57:35 EET Niklas Söderlund wrote: > > Instead of caching the subdevice format each time the video device &

Re: [PATCH v11 12/32] rcar-vin: fix handling of single field frames (top, bottom and alternate fields)

2018-03-03 Thread Niklas Söderlund
Hi Laurent, Thanks for your comments. On 2018-03-02 12:48:55 +0200, Laurent Pinchart wrote: > Hi Niklas, > > Thank you for the patch. > > On Friday, 2 March 2018 03:57:31 EET Niklas Söderlund wrote: > > There was never proper support in the VIN driver to deliver ALTERNATIN

Re: [PATCH v11 15/32] rcar-vin: break out format alignment and checking

2018-03-03 Thread Niklas Söderlund
Hi Laurent, Thanks for your feedback. On 2018-03-02 11:53:54 +0200, Laurent Pinchart wrote: > Hi Niklas, > > Thank you for the patch. > > On Friday, 2 March 2018 03:57:34 EET Niklas Söderlund wrote: > > Part of the format alignment and checking can be shared with the Gen

Re: [PATCH v11 28/32] rcar-vin: add link notify for Gen3

2018-03-03 Thread Niklas Söderlund
;vdev == vdev) { > > + vin = group->vin[i]; > > + master_id = rvin_group_id_to_master(vin->id); > > + break; > > + } > > + } [snip] -- Regards, Niklas Söderlund

Re: [PATCH v11 22/32] rcar-vin: force default colorspace for media centric mode

2018-03-03 Thread Niklas Söderlund
Hi Laurent, Thanks for your feedback. On 2018-03-02 11:59:14 +0200, Laurent Pinchart wrote: > Hi Niklas, > > Thank you for the patch. > > On Friday, 2 March 2018 03:57:41 EET Niklas Söderlund wrote: > > When the VIN driver is running in media centric mode (on Gen3) the

Re: [PATCH v11 19/32] rcar-vin: add function to manipulate Gen3 chsel value

2018-03-03 Thread Niklas Söderlund
Hi Laurent, Thank you for your feedback. On 2018-03-02 13:31:47 +0200, Laurent Pinchart wrote: > Hi Niklas, > > Thank you for the patch. > > On Friday, 2 March 2018 03:57:38 EET Niklas Söderlund wrote: > > On Gen3 the CSI-2 routing is controlled by the VnCSI_IFMD registe

Re: [PATCH v11 17/32] rcar-vin: move media bus configuration to struct rvin_info

2018-03-03 Thread Niklas Söderlund
Hi Laurent, Thanks for your feedback. On 2018-03-02 13:26:58 +0200, Laurent Pinchart wrote: > Hi Niklas, > > Thank you for the patch. > > On Friday, 2 March 2018 03:57:36 EET Niklas Söderlund wrote: > > Bus configuration will once the driver is extended to support Gen3 &g

[PATCH v11 03/32] rcar-vin: add Gen3 devicetree bindings documentation

2018-03-01 Thread Niklas Söderlund
tween each 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 Acked-by: Rob Herring Reviewed-by: Laurent Pinchart --- .../devicetree/bindings/media/rcar_vin.txt

[PATCH v11 15/32] rcar-vin: break out format alignment and checking

2018-03-01 Thread Niklas Söderlund
Part of the format alignment and checking can be shared with the Gen3 format handling. Break that part out to a separate function. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 96 - 1 file changed, 54 insertions(+), 42 deletions

[PATCH v11 12/32] rcar-vin: fix handling of single field frames (top, bottom and alternate fields)

2018-03-01 Thread Niklas Söderlund
: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-dma.c | 15 +-- drivers/media/platform/rcar-vin/rcar-v4l2.c | 40 +++-- 2 files changed, 10 insertions(+), 45 deletions(-) diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform

[PATCH v11 13/32] rcar-vin: update bytesperline and sizeimage calculation

2018-03-01 Thread Niklas Söderlund
Remove over complicated logic to calculate the value for bytesperline and sizeimage that was carried over from the soc_camera port. There is no need to find the max value of bytesperline and sizeimage from user-space as they are set to 0 before the max_t() operation. Signed-off-by: Niklas

[PATCH v11 11/32] rcar-vin: set a default field to fallback on

2018-03-01 Thread Niklas Söderlund
If the field is not supported by the driver it should not try to keep the current field. Instead it should set it to a default fallback. Since trying a format should always result in the same state regardless of the current state of the device. Signed-off-by: Niklas Söderlund --- drivers/media

[PATCH v11 07/32] rcar-vin: move model information to own struct

2018-03-01 Thread Niklas Söderlund
chip_id to model_id. Also sort the compatible string entries and make use of of_device_get_match_data() which will always work as the driver is DT only, so there's always a valid match. Signed-off-by: Niklas Söderlund Reviewed-by: Kieran Bingham Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pin

[PATCH v11 19/32] rcar-vin: add function to manipulate Gen3 chsel value

2018-03-01 Thread Niklas Söderlund
Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-dma.c | 38 ++ drivers/media/platform/rcar-vin/rcar-vin.h | 2 ++ 2 files changed, 40 insertions(+) diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-d

[PATCH v11 08/32] rcar-vin: move max width and height information to chip information

2018-03-01 Thread Niklas Söderlund
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 Reviewed-by: Kieran Bingham Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin

[PATCH v11 05/32] rcar-vin: unregister video device on driver removal

2018-03-01 Thread Niklas Söderlund
-by: Niklas Söderlund Reviewed-by: Kieran Bingham Reviewed-by: Hans Verkuil Acked-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-core.c | 2 ++ drivers/media/platform/rcar-vin/rcar-v4l2.c | 3 +++ 2 files changed, 5 insertions(+) diff --git a/drivers/media/platform/rcar-vin/rcar

[PATCH v11 06/32] rcar-vin: move subdevice handling to async callbacks

2018-03-01 Thread Niklas Söderlund
only used on Gen2. While moving this code drop a large comment which is copied from the framework documentation and fold rvin_mbus_supported() into its only caller. Also move the initialization and cleanup code to separate functions to increase readability. Signed-off-by: Niklas Söderlund Reviewed

[PATCH v11 24/32] rcar-vin: add group allocator functions

2018-03-01 Thread Niklas Söderlund
data structure and registers a media device. Consecutive VINs insert themself into the global group. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-core.c | 174 +++- drivers/media/platform/rcar-vin/rcar-vin.h | 31

[PATCH v11 18/32] rcar-vin: enable Gen3 hardware configuration

2018-03-01 Thread Niklas Söderlund
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 Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart

[PATCH v11 14/32] rcar-vin: align pixelformat check

2018-03-01 Thread Niklas Söderlund
If the pixelformat is not supported it should not fail but be set to something that works. While we are at it move the two different checks of the pixelformat to the same statement. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-v4l2.c

[PATCH v11 25/32] rcar-vin: change name of video device

2018-03-01 Thread Niklas Söderlund
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 Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 2 +- 1 file changed, 1

[PATCH v11 23/32] rcar-vin: prepare for media controller mode initialization

2018-03-01 Thread Niklas Söderlund
comment. Signed-off-by: Niklas Söderlund Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-core.c | 20 ++-- drivers/media/platform/rcar-vin/rcar-vin.h | 4 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/drivers

[PATCH v11 26/32] rcar-vin: add chsel information to rvin_info

2018-03-01 Thread Niklas Söderlund
Each Gen3 SoC has a limited set of predefined routing possibilities for which CSI-2 device and channel can be routed to which VIN instance. Prepare to store this information in the struct rvin_info. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-vin.h | 42

[PATCH v11 27/32] rcar-vin: parse Gen3 OF and setup media graph

2018-03-01 Thread Niklas Söderlund
the notifier belonging to the last probed VIN. Once all CSI-2 subdevices in this notifier are bound proceed to register all VIN video devices of the group and crate media device links between all CSI-2 and VIN entities according to the SoC specific routing configuration. Signed-off-by: Niklas

[PATCH v11 09/32] rcar-vin: move functions regarding scaling

2018-03-01 Thread Niklas Söderlund
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 Reviewed-by: Hans Verkuil

[PATCH v11 30/32] rcar-vin: enable support for r8a7795

2018-03-01 Thread Niklas Söderlund
Add the SoC specific information for Renesas r8a7795 ES1.x and ES2.0. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/Kconfig | 2 +- drivers/media/platform/rcar-vin/rcar-core.c | 120 2 files changed, 121

[PATCH v11 32/32] rcar-vin: enable support for r8a77970

2018-03-01 Thread Niklas Söderlund
Add the SoC specific information for Renesas r8a77970. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-core.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b

[PATCH v11 28/32] rcar-vin: add link notify for Gen3

2018-03-01 Thread Niklas Söderlund
le a new link due to hardware constrains the link_notifier callback will return -EMLINK. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-core.c | 153 1 file changed, 153 insertions(+) diff --git a/drivers/media/platform/rcar-vin/rcar-cor

[PATCH v11 29/32] rcar-vin: extend {start,stop}_streaming to work with media controller

2018-03-01 Thread Niklas Söderlund
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

[PATCH v11 21/32] rcar-vin: use different v4l2 operations in media controller mode

2018-03-01 Thread Niklas Söderlund
without directly interacting with the source subdevice. Signed-off-by: Niklas Söderlund Reviewed-by: Hans Verkuil --- drivers/media/platform/rcar-vin/rcar-dma.c | 3 +- drivers/media/platform/rcar-vin/rcar-v4l2.c | 161 +++- 2 files changed, 160 insertions(+), 4

[PATCH v11 31/32] rcar-vin: enable support for r8a7796

2018-03-01 Thread Niklas Söderlund
Add the SoC specific information for Renesas r8a7796. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-core.c | 44 + 1 file changed, 44 insertions(+) diff --git a/drivers/media/platform/rcar-vin/rcar-core.c b

[PATCH v11 16/32] rcar-vin: read subdevice format for crop only when needed

2018-03-01 Thread Niklas Söderlund
igned-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 158 ++-- drivers/media/platform/rcar-vin/rcar-vin.h | 12 --- 2 files changed, 80 insertions(+), 90 deletions(-) diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/drivers/

[PATCH v11 20/32] rcar-vin: add flag to switch to media controller mode

2018-03-01 Thread Niklas Söderlund
struct rvin_info which will control which mode to use. Signed-off-by: Niklas Söderlund Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-core.c | 6 +- drivers/media/platform/rcar-vin/rcar-vin.h | 2 ++ 2 files changed, 7 insertions(+), 1

[PATCH v11 22/32] rcar-vin: force default colorspace for media centric mode

2018-03-01 Thread Niklas Söderlund
validation tools fail. Until the user requested colorspace can be validated lets force it to the driver default. Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/media

[PATCH v11 17/32] rcar-vin: move media bus configuration to struct rvin_info

2018-03-01 Thread Niklas Söderlund
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_dev to show it's not always coupled to the parallel subdevice. Signed-off-by: Niklas Söderlund Reviewed-by: Hans Ve

[PATCH v11 01/32] dt-bindings: media: rcar_vin: Reverse SoC part number list

2018-03-01 Thread Niklas Söderlund
From: Fabrizio Castro Change the sorting of the part numbers from descending to ascending to match with other documentation. Signed-off-by: Fabrizio Castro Reviewed-by: Biju Das Reviewed-by: Simon Horman Acked-by: Rob Herring Reviewed-by: Geert Uytterhoeven Acked-by: Niklas Söderlund

[PATCH v11 00/32] rcar-vin: Add Gen3 with media controller

2018-03-01 Thread Niklas Söderlund
h patch 2/32 with an updated version, thanks Sakari for 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. Fabrizio Castro (2): dt-bindings: media: rcar_vin: Reverse SoC part number

[PATCH v11 10/32] rcar-vin: all Gen2 boards can scale simplify logic

2018-03-01 Thread Niklas Söderlund
the field is preserved simplifies the logic quite a bit. Signed-off-by: Niklas Söderlund Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-dma.c | 8 drivers/media/platform/rcar-vin/rcar-v4l2.c | 25 +++-- drivers

[PATCH v11 02/32] dt-bindings: media: rcar_vin: add device tree support for r8a774[35]

2018-03-01 Thread Niklas Söderlund
if needed, in addition to document SoC support and therefore allow checkpatch.pl to validate compatible string values. Signed-off-by: Fabrizio Castro Reviewed-by: Biju Das Reviewed-by: Simon Horman Acked-by: Rob Herring Reviewed-by: Geert Uytterhoeven Acked-by: Niklas Söderlund --- Doc

[PATCH v11 04/32] rcar-vin: rename poorly named initialize and cleanup functions

2018-03-01 Thread Niklas Söderlund
The functions to register and unregister 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 Reviewed-by: Kieran Bingham Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- drivers

Re: [PATCH v5 2/2] v4l: cadence: Add Cadence MIPI-CSI2 TX driver

2018-03-01 Thread Niklas Söderlund
csi2tx->subdev.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE; > + v4l2_set_subdevdata(&csi2tx->subdev, &pdev->dev); Is this needed? > + snprintf(csi2tx->subdev.name, V4L2_SUBDEV_NAME_SIZE, "%s.%s", > + KBUILD_MODNAME, dev_name(&pdev->dev)); > + > + ret = csi2tx_check_lanes(csi2tx); > + if (ret) > + goto err_free_priv; > + > + /* Create our media pads */ > + csi2tx->subdev.entity.function = MEDIA_ENT_F_VID_IF_BRIDGE; > + csi2tx->pads[CSI2TX_PAD_SOURCE].flags = MEDIA_PAD_FL_SOURCE; > + for (i = CSI2TX_PAD_SINK_STREAM0; i < CSI2TX_PAD_MAX; i++) > + csi2tx->pads[i].flags = MEDIA_PAD_FL_SINK; > + > + for (i = 0; i < CSI2TX_PAD_MAX; i++) > + csi2tx->pad_fmts[i] = fmt_default; > + > + ret = media_entity_pads_init(&csi2tx->subdev.entity, CSI2TX_PAD_MAX, > + csi2tx->pads); > + if (ret) > + goto err_free_priv; > + > + ret = v4l2_async_register_subdev(&csi2tx->subdev); > + if (ret < 0) > + goto err_free_priv; > + > + dev_info(&pdev->dev, > + "Probed CSI2TX with %u/%u lanes, %u streams, %s D-PHY\n", > + csi2tx->num_lanes, csi2tx->max_lanes, csi2tx->max_streams, > + csi2tx->has_internal_dphy ? "internal" : "no"); > + > + return 0; > + > +err_free_priv: > + kfree(csi2tx); > + return ret; > +} > + > +static int csi2tx_remove(struct platform_device *pdev) > +{ > + struct csi2tx_priv *csi2tx = platform_get_drvdata(pdev); > + > + v4l2_async_unregister_subdev(&csi2tx->subdev); > + kfree(csi2tx); > + > + return 0; > +} > + > +static const struct of_device_id csi2tx_of_table[] = { > + { .compatible = "cdns,csi2tx" }, > + { }, > +}; > +MODULE_DEVICE_TABLE(of, csi2tx_of_table); > + > +static struct platform_driver csi2tx_driver = { > + .probe = csi2tx_probe, > + .remove = csi2tx_remove, > + > + .driver = { > + .name = "cdns-csi2tx", > + .of_match_table = csi2tx_of_table, > + }, > +}; > +module_platform_driver(csi2tx_driver); Are MODULE_LICENSE() not needed anymore with the introduction of the SPDX headers? > -- > 2.14.3 > -- Regards, Niklas Söderlund

Re: [PATCH v5 0/2] media: v4l: Add support for the Cadence MIPI-CSI2 TX controller

2018-03-01 Thread Niklas Söderlund
drivers/media/platform/cadence/cdns-csi2tx.c | 527 > +++++ > 4 files changed, 637 insertions(+) > create mode 100644 Documentation/devicetree/bindings/media/cdns,csi2tx.txt > create mode 100644 drivers/media/platform/cadence/cdns-csi2tx.c > > -- > 2.14.3 > -- Regards, Niklas Söderlund

Re: [PATCH v2 3/3] media: i2c: adv748x: Add support for i2c_new_secondary_device

2018-03-01 Thread Niklas Söderlund
bus. > > Allow a device tree node to override the default addresses so that > address conflicts with other devices on the same bus may be resolved at > the board description level. > > Signed-off-by: Kieran Bingham Reviewed-by: Niklas Söderlund > --- > driver

Re: [PATCH v2 1/3] media: i2c: adv748x: Simplify regmap configuration

2018-03-01 Thread Niklas Söderlund
epresented on a single line. > > Define ADV748X_REGMAP_CONF for this purpose use it to create the tables. > > Signed-off-by: Kieran Bingham Reviewed-by: Niklas Söderlund > > --- > v2: > - Remove unnecessary #undef > > drivers/media/i2c/adv748x/adv748x-core.c | 109

Re: [PATCH v2] v4l: vsp1: Print the correct blending unit name in debug messages

2018-02-23 Thread Niklas Söderlund
: "BRS"; > - > /* Prepare the display list. */ > dl = vsp1_dl_list_get(pipe->output->dlm); > > @@ -570,7 +565,7 @@ void vsp1_du_atomic_flush(struct device *dev, unsigned > int pipe_index) > rpf->entity.sink_pad = i; > > dev_dbg(vsp1->dev, "%s: connecting RPF.%u to %s:%u\n", > - __func__, rpf->entity.index, bru_name, i); > + __func__, rpf->entity.index, BRU_NAME(pipe->bru), i); > > ret = vsp1_du_setup_rpf_pipe(vsp1, pipe, rpf, i); > if (ret < 0) > -- > Regards, > > Laurent Pinchart > -- Regards, Niklas Söderlund

[PATCH] i2c: adv748x: afe: fix sparse warning

2018-02-21 Thread Niklas Söderlund
signedness) Signed-off-by: Niklas Söderlund --- drivers/media/i2c/adv748x/adv748x-afe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/i2c/adv748x/adv748x-afe.c b/drivers/media/i2c/adv748x/adv748x-afe.c index 5188178588c9067d..39a9996d0db08c31 100644 --- a

Re: [PATCH v2] videodev2.h: add helper to validate colorspace

2018-02-19 Thread Niklas Söderlund
ing able to validate input from user-space. But I'm even less excited about breaking v4l2-compliance compatibility so any path I can take here to keep the user being able to specify the colorspace and v4l2-compliance being happy would be a better solution for me :-) 1. https://patchwork.linuxtv.org/patch/46717/ 2. 432d9ebfcea65337 ("v4l2-compliance: ignore colorspace tests for passthu subdevs") -- Regards, Niklas Söderlund

[PATCH v2] videodev2.h: add helper to validate colorspace

2018-02-14 Thread Niklas Söderlund
There is no way for drivers to validate a colorspace value, which could be provided by user-space by VIDIOC_S_FMT for example. Add a helper to validate that the colorspace value is part of enum v4l2_colorspace. Signed-off-by: Niklas Söderlund --- include/uapi/linux/videodev2.h | 4 1 file

Re: [PATCH v10 10/30] rcar-vin: fix handling of single field frames (top, bottom and alternate fields)

2018-02-13 Thread Niklas Söderlund
Hi Laurent, On 2018-02-14 00:31:21 +0200, Laurent Pinchart wrote: > Hi Niklas, > > On Tuesday, 13 February 2018 18:47:04 EET Niklas Söderlund wrote: > > On 2018-02-13 18:26:34 +0200, Laurent Pinchart wrote: > > > On Monday, 29 January 2018 18:34:15 EET Niklas Söderlund

<    1   2   3   4   5   6   7   8   9   10   >