[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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] ravb: remove erroneous comment

2018-03-03 Thread Niklas Söderlund
ned-off-by: Niklas Söderlund --- drivers/net/ethernet/renesas/ravb_main.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 54a6265da7a06460..68f122140966d4de 100644 --- a/drivers/net/ethernet/renesas/ravb_ma

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 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

[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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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 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

Re: [PATCH v7 3/4 - variant 1] drm: rcar-du: Fix legacy DT to create LVDS encoder nodes

2018-03-01 Thread Niklas Söderlund
t, "remote-endpoint", > + &value[i], sizeof(value[i])); > + of_node_put(endpoint); > + if (ret < 0) > + goto done; > + } > + > + ret = of_changeset_apply(&rcar_du_l

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

Re: [PATCH v6 4/4] drm: rcar-du: Convert LVDS encoder code to bridge driver

2018-02-22 Thread Niklas Söderlund
tasheets and what the code looked before feel free to add. Reviewed-by: Niklas Söderlund > --- > Changes since v1: > > - Update the SPDX headers to use GPL-2.0 instead of GPL-2.0-only > - Update to the -lvds compatible string format > --- > drivers/gpu/drm/rcar-du/Kconfi

Re: [PATCH v6 2/4] dt-bindings: display: renesas: Deprecate LVDS support in the DU bindings

2018-02-22 Thread Niklas Söderlund
) ES2.0 DU > clocks = <&cpg CPG_MOD 724>, ><&cpg CPG_MOD 723>, ><&cpg CPG_MOD 722>, > - <&cpg CPG_MOD 721>, > - <&cpg CPG_MOD 727>; > - clock-names = "du.0", "du.1", "du.2", "du.3", "lvds.0"; > + <&cpg CPG_MOD 721>; > + clock-names = "du.0", "du.1", "du.2", "du.3"; > vsps = <&vspd0 0>, <&vspd1 0>, <&vspd2 0>, <&vspd0 1>; > > ports { > -- > Regards, > > Laurent Pinchart > -- Regards, Niklas Söderlund

Re: [PATCH v6 1/4] dt-bindings: display: renesas: Add R-Car LVDS encoder DT bindings

2018-02-22 Thread Niklas Söderlund
sas,r8a7743-lvds" for R8A7743 (RZ/G1M) compatible LVDS encoders > + - "renesas,r8a7790-lvds" for R8A7790 (R-Car H2) compatible LVDS encoders > + - "renesas,r8a7791-lvds" for R8A7791 (R-Car M2-W) compatible LVDS encoders > + - "renesas,r8a7793-lvds" for R8

[PATCH] pinctrl: sh-pfc: r8a7795: remove duplicate of CLKOUT pin in pinmux_pins[]

2018-02-21 Thread Niklas Söderlund
/0x140 [ 89.611010] vfs_read+0x90/0x170 [ 89.614269] SyS_read+0x60/0xd8 [ 89.617443] __sys_trace_return+0x0/0x4 [ 89.621314] ---[ end trace 99c8d0d39c13e794 ]--- Fixes: 82d2de5a4f646f72 ("pinctrl: sh-pfc: r8a7795: Add GP-1-28 port pin support") Signed-off-by: Niklas

[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] ravb: add support for changing MTU

2018-02-16 Thread Niklas Söderlund
Allow for changing the MTU within the limit of the maximum size of a descriptor (2048 bytes). Add the callback to change MTU from user-space and take the configurable MTU into account when configuring the hardware. Signed-off-by: Niklas Söderlund --- drivers/net/ethernet/renesas/ravb.h

Re: [PATCH] ravb: add support for changing MTU

2018-02-14 Thread Niklas Söderlund
Hi Sergei, Thanks for your feedback. On 2018-02-14 14:34:09 +0300, Sergei Shtylyov wrote: > Hello! > > On 02/13/2018 04:12 PM, Niklas Söderlund wrote: > > >> On 02/12/2018 11:00 PM, Niklas Söderlund wrote: > >> > >>> Allow for chancing the MTU

[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

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

2018-02-13 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 | 5 + 1 file

Re: [PATCH v10 13/30] rcar-vin: add function to manipulate Gen3 chsel value

2018-02-13 Thread Niklas Söderlund
Hi Laurent, On 2018-02-13 19:02:38 +0200, Laurent Pinchart wrote: > Hi Niklas, > > On Tuesday, 13 February 2018 18:58:09 EET Niklas Söderlund wrote: > > On 2018-02-13 18:41:33 +0200, Laurent Pinchart wrote: > > > On Monday, 29 January 2018 18:34:18 EET Niklas Söderlund wr

Re: [PATCH v10 13/30] rcar-vin: add function to manipulate Gen3 chsel value

2018-02-13 Thread Niklas Söderlund
Hi Laurent, On 2018-02-13 18:41:33 +0200, Laurent Pinchart wrote: > Hi Niklas, > > Thank you for the patch. > > On Monday, 29 January 2018 18:34:18 EET Niklas Söderlund wrote: > > On Gen3 the CSI-2 routing is controlled by the VnCSI_IFMD register. One > > feature of

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-13 18:26:34 +0200, Laurent Pinchart wrote: > Hi Niklas, > > Thank you for the patch. Thanks for your comments. > > On Monday, 29 January 2018 18:34:15 EET Niklas Söderlund wrote: > > There was never proper support in the VIN driver to deliver

Re: [PATCH] ARM: dts: lager: Move cec_clock to root node

2018-02-13 Thread Niklas Söderlund
gt; > Fixes: c5aa87977626e778 ("ARM: dts: lager: Add CEC clock for HDMI > transmitter") > Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund > --- > arch/arm/boot/dts/r8a7790-lager.dts | 12 ++-- > 1 file changed, 6 insertions(+), 6 deletions(-) >

Re: [PATCH] ravb: add support for changing MTU

2018-02-13 Thread Niklas Söderlund
Hi Sergei, Thanks for your feedback. On 2018-02-13 13:01:04 +0300, Sergei Shtylyov wrote: > Hello! > > On 02/12/2018 11:00 PM, Niklas Söderlund wrote: > > > Allow for chancing the MTU within the limit of the maximum size of a > >Changing. :-) Yes :-) > >

[PATCH v13 1/2] rcar-csi2: add Renesas R-Car MIPI CSI-2 receiver documentation

2018-02-12 Thread Niklas Söderlund
-by: Niklas Söderlund Acked-by: Rob Herring Acked-by: Sakari Ailus --- .../bindings/media/renesas,rcar-csi2.txt | 99 ++ MAINTAINERS| 1 + 2 files changed, 100 insertions(+) create mode 100644 Documentation/devicetree

[PATCH v13 2/2] rcar-csi2: add Renesas R-Car MIPI CSI-2 receiver driver

2018-02-12 Thread Niklas Söderlund
priv->pads[i].flags = MEDIA_PAD_FL_SOURCE; + + ret = media_entity_pads_init(&priv->subdev.entity, NR_OF_RCAR_CSI2_PAD, +priv->pads); + if (ret) + goto error; + + pm_runtime_enable(&pdev->dev); + +

[PATCH v13 0/2] rcar-csi2: add Renesas R-Car MIPI CSI-2

2018-02-12 Thread Niklas Söderlund
andler. - Fix media bus 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

Re: Warning for possible circular locking dependecy on v4.16-rc1

2018-02-12 Thread Niklas Söderlund
Hi again, On 2018-02-12 21:12:48 +0100, Niklas Söderlund wrote: > Hi Geert, > > When doing some testing on v4.16-rc1 I ran across this warning a couple > of times. I was using the renesas_config from the current master branch > of renesas-drivers at the time. It do not hit every

[PATCH] v4l: subdev: compat: update handling for VIDIOC_SUBDEV_[GS]_ROUTING

2018-02-12 Thread Niklas Söderlund
Implement compat IOCTL handling for VIDIOC_SUBDEV_G_ROUTING and VIDIOC_SUBDEV_S_ROUTING IOCTLs. Signed-off-by: Niklas Söderlund --- drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) Hi Sakari, With this fix on-top of your vc branch I

Warning for possible circular locking dependecy on v4.16-rc1

2018-02-12 Thread Niklas Söderlund
x20 [3.775747] do_one_initcall+0x9c/0x14c [3.779580] kernel_init_freeable+0x1dc/0x274 [ 3.783934] kernel_init+0x10/0x100 [3.787419] ret_from_fork+0x10/0x18 -- Regards, Niklas Söderlund

[PATCH] ravb: add support for changing MTU

2018-02-12 Thread Niklas Söderlund
Allow for chancing the MTU within the limit of the maximum size of a descriptor (2048 bytes). Add the callback to change MTU from user-space and take the configurable MTU into account when configuring the hardware. Signed-off-by: Niklas Söderlund --- drivers/net/ethernet/renesas/ravb.h

Re: [PATCH 2/2] media: i2c: adv748x: Add missing CBUS page.

2018-02-09 Thread Niklas Söderlund
his by > providing the missing CBUS page definition. > > Signed-off-by: Kieran Bingham I would drop the '.' from the subject line, with that fixed: Reviewed-by: Niklas Söderlund > --- > drivers/media/i2c/adv748x/adv748x-core.c | 3 +++ > drivers/media/i2c/adv748x/ad

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

2018-02-09 Thread Niklas Söderlund
+ ADV748X_REGMAP_CONF("hdmi"), > + ADV748X_REGMAP_CONF("edid"), > + ADV748X_REGMAP_CONF("repeater"), > + ADV748X_REGMAP_CONF("infoframe"), > + ADV748X_REGMAP_CONF("cec"), > + ADV748X_REGMAP_CONF("sdp"), > + ADV748X_REGMAP_CONF("txa"), > + ADV748X_REGMAP_CONF("txb"), > }; > > +#undef ADV748X_REGMAP_CONF > + Why is this macro undefined here? It have a rather limited scope as it's only local to this C file and it have a good prefix of ADV748X_ so conflicts are highly unlikely. Is there something I'm missing? Is it really customary to undefine helper macros like this once they are used to populate the structure? > static int adv748x_configure_regmap(struct adv748x_state *state, int region) > { > int err; > -- > 2.7.4 > -- Regards, Niklas Söderlund

Re: [PATCH] media: i2c: adv748x: Fix cleanup jump on chip identification

2018-02-09 Thread Niklas Söderlund
rrect this by jumping to the next (and correct) label in the cleanup > code: err_cleanup_dt. > > Fixes: 3e89586a64df ("media: i2c: adv748x: add adv748x driver") > > Signed-off-by: Kieran Bingham Reviewed-by: Niklas Söderlund > --- > drivers/media/i2c/adv748x/

[PATCH v2 4/5] arm64: dts: renesas: r8a77970: add the LVDS instance

2018-02-08 Thread Niklas Söderlund
Add the LVDS device to r8a77970.dtsi in a disabled state. Also connect the it to the LVDS output of the DU. While at it align the endpoint name of the du to du_out_lvds0 which is used in other Renesas DTS files to describe this link. Signed-off-by: Niklas Söderlund --- arch/arm64/boot/dts

[PATCH v2 5/5] arm64: dts: renesas: eagle: add HDMI output using the ADV7511W

2018-02-08 Thread Niklas Söderlund
Add the HDMI connector and the ADV7511W, also connect it to LVDS. Enable the DU and LVDS to be able to use the HDMI output. Signed-off-by: Niklas Söderlund --- arch/arm64/boot/dts/renesas/r8a77970-eagle.dts | 66 ++ 1 file changed, 66 insertions(+) diff --git a/arch

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