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

2018-03-26 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 Reviewed-by: Hans Verkuil --- drivers/media

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

2018-03-26 Thread Niklas Söderlund
Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Reviewed-by: Hans Verkuil --- 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/rca

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

2018-03-26 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 v13 26/33] rcar-vin: change name of video device

2018-03-26 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 Reviewed-by: Hans Verkuil --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 2

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

2018-03-26 Thread Niklas Söderlund
fixed values. Signed-off-by: Niklas Söderlund Reviewed-by: Hans Verkuil --- 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-v

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

2018-03-26 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 v13 10/33] rcar-vin: all Gen2 boards can scale simplify logic

2018-03-26 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 v13 19/33] rcar-vin: enable Gen3 hardware configuration

2018-03-26 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 v13 21/33] rcar-vin: add flag to switch to media controller mode

2018-03-26 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 v13 03/33] rcar-vin: add Gen3 devicetree bindings documentation

2018-03-26 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 v13 09/33] rcar-vin: move functions regarding scaling

2018-03-26 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 v13 27/33] rcar-vin: add chsel information to rvin_info

2018-03-26 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 Reviewed-by: Hans Verkuil --- * Changes since v11 - Fixed

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

2018-03-26 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 v13 24/33] rcar-vin: prepare for media controller mode initialization

2018-03-26 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 v13 31/33] rcar-vin: enable support for r8a7795

2018-03-26 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 Reviewed-by: Hans Verkuil --- drivers/media/platform/rcar-vin/Kconfig | 2 +- drivers/media/platform/rcar-vin/rcar-core.c | 120

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

2018-03-26 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 Reviewed-by: Hans Verkuil --- * Changes since v11 - Fixed spelling - Updated comment to clarify the intent that no link can be enabled if any video node is open. - Use contain

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

2018-03-26 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 v13 33/33] rcar-vin: enable support for r8a77970

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

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

2018-03-26 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 v13 02/33] dt-bindings: media: rcar_vin: add device tree support for r8a774[35]

2018-03-26 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 v13 01/33] dt-bindings: media: rcar_vin: Reverse SoC part number list

2018-03-26 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 v13 25/33] rcar-vin: add group allocator functions

2018-03-26 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 Reviewed-by: Hans Verkuil --- drivers/media/platform/rcar-vin/rcar-core.c | 174 +++- drivers/media/platform

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

2018-03-26 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 v13 06/33] rcar-vin: move subdevice handling to async callbacks

2018-03-26 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 v13 16/33] rcar-vin: simplify how formats are set and reset

2018-03-26 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 Reviewed-by: Hans Verkuil --- * Changes since v11 - This patch where 'rcar-vin: read subdevice format for crop only when needed' - Keep caching the s

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

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

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

2018-03-26 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 v3] i2c: adv748x: afe: fix sparse warning

2018-03-26 Thread Niklas Söderlund
signedness) Signed-off-by: Niklas Söderlund Reviewed-by: Kieran Bingham --- * Changes since v2 - Add review tag from Kieran. - Send to correct mail address for linux-media so it shows up in patchwork. * Changes since v1 - Use u32 instead of unsigned int as suggested by Geert. --- drivers/media

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

2018-04-05 Thread Niklas Söderlund
rsuit to get this series accepted! > > Regards, > > Hans > > On 03/04/18 14:30, Hans Verkuil wrote: > > On 26/03/18 23:44, Niklas Söderlund wrote: > >> Hi, > >> > >> This series adds Gen3 VIN support to rcar-vin driver for Ren

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

2018-04-05 Thread Niklas Söderlund
On Tuesday, 27 March 2018 00:44:39 EEST Niklas Söderlund wrote: > > With the recent cleanup of the format code to prepare for Gen3 it's > > possible to simplify the Gen2 format code path as well. Clean up the > > process by defining two functions to handle the set format and re

[PATCH] media: entity: fix spelling for media_entity_get_fwnode_pad()

2018-04-08 Thread Niklas Söderlund
From: Niklas Söderlund s/dose/does/ Fixes: d295c6a460cd2ac6 ("[media] media: entity: Add media_entity_get_fwnode_pad() function") Signed-off-by: Niklas Söderlund --- include/media/media-entity.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/media/medi

Re: [PATCH v5 1/3] ARM: dts: r8a7790: Convert to new LVDS DT bindings

2018-04-08 Thread Niklas Söderlund
bridge > driver") > Fixes: 4bdb7aa7dcd0 ("ARM: dts: r8a7790: add soc node") > Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund > --- > Changes since v3: > > - Added power-domains and resets properties to LVDS nodes > > Changes since v2

Re: [PATCH v5 2/3] ARM: dts: r8a7791: Convert to new LVDS DT bindings

2018-04-08 Thread Niklas Söderlund
-koelsch.dts > @@ -470,8 +470,7 @@ > > clocks = <&cpg CPG_MOD 724>, <&cpg CPG_MOD 723>, <&cpg CPG_MOD 726>, ><&x13_clk>, <&x2_clk>; I think you forgot to delete <&cpg CPG_MOD 726> from the clocks, with

Re: [PATCH v5 3/3] ARM: dts: r8a7793: Convert to new LVDS DT bindings

2018-04-08 Thread Niklas Söderlund
bridge > driver") > Fixes: bff8f8c2feb7 ("ARM: dts: r8a7793: add soc node") > Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund > --- > Changes since v3: > > - Added power-domains and resets properties to LVDS nodes > > Changes since v2

Re: [PATCH V2] PCI: rcar: Clean up the macros

2018-04-08 Thread Niklas Söderlund
Horman > Cc: Wolfram Sang > Cc: linux-renesas-soc@vger.kernel.org I like this cleanup! I have no input on Randy's comment about if you should include bitops.h or not. But for the macro changes themselves. Reviewed-by: Niklas Söderlund > --- > V2: Reword the commit messag

Re: [PATCH/RFT v2 0/3] thermal: add support for r8a77995

2018-04-09 Thread Niklas Söderlund
hen tests i do is to increasing the CPU load in order to generate heat and observe the temperature increasing. But 40C seems like a reasonable value during idle compared to other Gen3 SoCs I looked at. -- Regards, Niklas Söderlund

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

2018-04-10 Thread Niklas Söderlund
ometime next week. > > Thanks, > Fab > > > -Original Message----- > > From: Niklas Söderlund [mailto:niklas.soderlund+rene...@ragnatech.se] > > Sent: 26 March 2018 22:44 > > To: Laurent Pinchart ; Hans Verkuil > > ; linux-me...@vger.kernel.org >

Re: [PATCH] clk: renesas: rcar-gen2: Centralize quirks handling

2018-04-10 Thread Niklas Söderlund
> Signed-off-by: Geert Uytterhoeven Reviewed-by: Niklas Söderlund > --- > To be queued in clk-renesas-for-v4.18. > > drivers/clk/renesas/rcar-gen2-cpg.c | 20 > 1 file changed, 16 insertions(+), 4 deletions(-) > > diff --git a/drivers/clk/renesas/r

Potential problem with 31e77c93e432dec7 ("sched/fair: Update blocked load when newly idle")

2018-04-12 Thread Niklas Söderlund
.org/pub/scm/linux/kernel/git/davem/net")) 2. 31e77c93e432dec7 ("sched/fair: Update blocked load when newly idle") -- Regards, Niklas Söderlund

Re: Potential problem with 31e77c93e432dec7 ("sched/fair: Update blocked load when newly idle")

2018-04-12 Thread Niklas Söderlund
Hi Vincent, Thanks for your feedback. On 2018-04-12 12:33:27 +0200, Vincent Guittot wrote: > Hi Niklas, > > On 12 April 2018 at 11:18, Niklas Söderlund > wrote: > > Hi Vincent, > > > > I have observed issues running on linus/master from a few days back [1]. > &

Re: Potential problem with 31e77c93e432dec7 ("sched/fair: Update blocked load when newly idle")

2018-04-12 Thread Niklas Söderlund
I'm using arch/arm/configs/shmobile_defconfig for my tests. -- Regards, Niklas Söderlund

Re: Potential problem with 31e77c93e432dec7 ("sched/fair: Update blocked load when newly idle")

2018-04-12 Thread Niklas Söderlund
.7.4 > > > Thanks, > Vincent > > > > > > > > > > Regards, > > > Vincent > > > > > > > > 1. c18bb396d3d261eb ("Merge > > > > git://git.kernel.org/pub/scm/linux/kernel/git/davem/net")) > > > > 2. 31e77c93e432dec7 ("sched/fair: Update blocked load when newly idle") > > > > > > > > -- > > > > Regards, > > > > Niklas Söderlund > > > > -- > > Regards, > > Niklas Söderlund -- Regards, Niklas Söderlund

Re: Potential problem with 31e77c93e432dec7 ("sched/fair: Update blocked load when newly idle")

2018-04-13 Thread Niklas Söderlund
Hi Vincent, On 2018-04-12 13:15:19 +0200, Niklas Söderlund wrote: > Hi Vincent, > > Thanks for your feedback. > > On 2018-04-12 12:33:27 +0200, Vincent Guittot wrote: > > Hi Niklas, > > > > On 12 April 2018 at 11:18, Niklas Söderlund > > wrote: > &

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

2018-04-14 Thread Niklas Söderlund
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 list dt-bind

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

2018-04-14 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 v14 02/33] dt-bindings: media: rcar_vin: add device tree support for r8a774[35]

2018-04-14 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 v14 01/33] dt-bindings: media: rcar_vin: Reverse SoC part number list

2018-04-14 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 v14 04/33] rcar-vin: rename poorly named initialize and cleanup functions

2018-04-14 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 v14 05/33] rcar-vin: unregister video device on driver removal

2018-04-14 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 v14 06/33] rcar-vin: move subdevice handling to async callbacks

2018-04-14 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 v14 07/33] rcar-vin: move model information to own struct

2018-04-14 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 v14 09/33] rcar-vin: move functions regarding scaling

2018-04-14 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 v14 08/33] rcar-vin: move max width and height information to chip information

2018-04-14 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 v14 10/33] rcar-vin: all Gen2 boards can scale simplify logic

2018-04-14 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 v14 12/33] rcar-vin: fix handling of single field frames (top, bottom and alternate fields)

2018-04-14 Thread Niklas Söderlund
: Niklas Söderlund Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- * Changes since v13 - Spelling dose -> does - Add review tag from Laurent * Changes since v12 - Spelling where -> were. - Add review tag from Hans. --- drivers/media/platform/rcar-vin/rcar-dma.c

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

2018-04-14 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 v14 15/33] rcar-vin: break out format alignment and checking

2018-04-14 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 Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 85

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

2018-04-14 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 v14 14/33] rcar-vin: align pixelformat check

2018-04-14 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 Reviewed-by: Hans Verkuil --- drivers/media

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

2018-04-14 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 Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- * Changes since v13 - rvin_reset_format() always returns 0, make it a void function and updat

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

2018-04-14 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 Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- drivers/media/platform

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

2018-04-14 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 v14 20/33] rcar-vin: add function to manipulate Gen3 chsel value

2018-04-14 Thread Niklas Söderlund
Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart Reviewed-by: Hans Verkuil --- * Changes since v13 - Do not set the VNCSI_IFMD_DES2 bit in the VNCSI_IFMD register as that bit have been removed from later versions of the datasheet. --- drivers/media/platform/rcar-vin/rcar-

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

2018-04-14 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 v14 22/33] rcar-vin: use different v4l2 operations in media controller mode

2018-04-14 Thread Niklas Söderlund
without directly interacting with the source subdevice. Signed-off-by: Niklas Söderlund Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- * Changes since v13 - Add review from Laurent. * Changes since v11 - Fixed error labels name in rvin_mc_open(). --- drivers/media/platform/rcar

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

2018-04-14 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 v14 24/33] rcar-vin: prepare for media controller mode initialization

2018-04-14 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 v14 23/33] rcar-vin: force default colorspace for media centric mode

2018-04-14 Thread Niklas Söderlund
fixed values. Signed-off-by: Niklas Söderlund Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 22 -- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/drivers/media/platform/rcar-vin/rcar-v4l2.c b/dr

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

2018-04-14 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 Reviewed-by: Hans Verkuil --- drivers/media/platform/rcar-vin/rcar-core.c | 174 +++- drivers/media/platform

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

2018-04-14 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 Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart

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

2018-04-14 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 Reviewed-by: Hans Verkuil --- drivers/media/platform/rcar-vin/rcar-v4l2.c | 2

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

2018-04-14 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 v14 30/33] rcar-vin: extend {start,stop}_streaming to work with media controller

2018-04-14 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 v14 29/33] rcar-vin: add link notify for Gen3

2018-04-14 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 Reviewed-by: Hans Verkuil Reviewed-by: Laurent Pinchart --- * Changes since v12 - Add review tag from Laurent. * Changes since v11 - Fixed spelling - Updated comment to cla

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

2018-04-14 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 Reviewed-by: Hans Verkuil --- drivers/media/platform/rcar-vin/Kconfig | 2 +- drivers/media/platform/rcar-vin/rcar-core.c | 120

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

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

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

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

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

2018-04-15 Thread Niklas Söderlund
Hi Kieran, Thanks for your feedback. On 2018-03-13 23:23:49 +0100, Kieran Bingham wrote: > Hi Niklas > > Thank you for this patch ... > I know it has been a lot of work getting this and the VIN together! > > On 13/02/18 00:01, Niklas Söderlund wrote: > > A V4L2 drive

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

2018-04-15 Thread Niklas Söderlund
0..c0c2a763151bc928 > > > --- /dev/null > > > +++ b/drivers/media/platform/rcar-vin/rcar-csi2.c > > > @@ -0,0 +1,884 @@ > > > +// SPDX-License-Identifier: GPL-2.0+ > > Do you intend making it GPL-2.0+ or did you mean GPL-2.0 ? Wops I intended to make it GPL-2.0 thanks for catching this. -- Regards, Niklas Söderlund

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

2018-04-15 Thread Niklas Söderlund
Hi Maxime, Thanks for your feedback. On 2018-03-29 13:30:39 +0200, Maxime Ripard wrote: > Hi Niklas, > > On Tue, Feb 13, 2018 at 12:01:32AM +0100, Niklas Söderlund wrote: > > + switch (priv->lanes) { > > + case 1: > > + phycnt = PHYC

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

2018-04-15 Thread Niklas Söderlund
> phycnt |= (1 << priv->lanes) - 1; > > If Niklas is fine with that, I like it too. I'm fine what that thanks for the suggestion Geert! -- Regards, Niklas Söderlund

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

2018-04-15 Thread Niklas Söderlund
and I no longer need to write to a register. 3. In remove() I call pm_runtime_disable(). Am I missing something obvious here? -- Regards, Niklas Söderlund

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

2018-04-15 Thread Niklas Söderlund
> > + return 0; > > + > > +error: > > + v4l2_async_notifier_unregister(&priv->notifier); > > + v4l2_async_notifier_cleanup(&priv->notifier); > > + > > + return ret; > > +} > > [snip] > > With these small issues fixed and Kieran's and Maxime's comments addressed as > you see fit, > > Reviewed-by: Laurent Pinchart Thanks, I will hold of adding it until you indicate if you are OK with the one comment I'm not fully agreeing with you on. -- Regards, Niklas Söderlund

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

2018-04-15 Thread Niklas Söderlund
ne (VIN?) would have to parse the full graph in DT and somehow with subdevice support helpers to traverse the DT port to MC pad mapping using helpers that do not exist yet (and are hard to use if the remote subdevice driver is not loaded) to build a full view of the pipeline and return -EPIPE if not all entities are present in the media graph :-) [snip] > > +static int rcar_csi2_parse_v4l2(struct rcar_csi2 *priv, > > + struct v4l2_fwnode_endpoint *vep) > > +{ > > + unsigned int i; > > + > > + /* Only port 0 endpoint 0 is valid */ > > + if (vep->base.port || vep->base.id) > > + return -ENOTCONN; > > + > > + if (vep->bus_type != V4L2_MBUS_CSI2) { > > + dev_err(priv->dev, "Unsupported bus: 0x%x\n", vep->bus_type); > > + return -EINVAL; > > + } > > + > > + priv->lanes = vep->bus.mipi_csi2.num_data_lanes; > > + if (priv->lanes != 1 && priv->lanes != 2 && priv->lanes != 4) { > > Is this an HW limitation? Like the 'data_lanes' comment, if it is, > shouldn't you mention in bindings that the accepted lane numbers is > limited to the [1,2,4] values. Yes, see chapter 25.4.8 Lane Setting. [snip] > > No serious issues though. So when fixed/clarified feel free to append my > Reviewed-by tag, if relevant at all. Thanks! I feel I managed to address all of your review comments but would still like your confirmation for me to add your tag. Thanks again for the review! -- Regards, Niklas Söderlund

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

2018-04-16 Thread Niklas Söderlund
Hi Jacopo, On 2018-04-16 01:16:35 +0200, Niklas Söderlund wrote: [snip] > > > + > > > + /* Set frequency range if we have it */ > > > + if (priv->info->csi0clkfreqrange) > > > + rcar_csi2_write(priv, CSI0CLKFCPR_REG, > > > +

[PATCH] dt-bindings: thermal: rcar-gen3-thermal: update register size in example

2018-04-17 Thread Niklas Söderlund
From: Niklas Söderlund The datasheet have been expanded with more registers and the DT files have been updated with the new size. This change updates the example so writing new DT files can use the enchanted driver which uses the new registers. Signed-off-by: Niklas Söderlund

[PATCH 2/2] arm64: dts: renesas: r8a7796: decrease temperature hysteresis

2018-04-17 Thread Niklas Söderlund
From: Niklas Söderlund To incorporate more tests by the hardware team decrease the hysteresis value to 1C. Signed-off-by: Niklas Söderlund --- arch/arm64/boot/dts/renesas/r8a7796.dtsi | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm64/boot/dts/renesas

[PATCH 1/2] arm64: dts: renesas: r8a7795: decrease temperature hysteresis

2018-04-17 Thread Niklas Söderlund
From: Niklas Söderlund To incorporate more tests by the hardware team decrease the hysteresis value to 1C. Signed-off-by: Niklas Söderlund --- arch/arm64/boot/dts/renesas/r8a7795.dtsi | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/arm64/boot/dts/renesas

[PATCH 0/2] arm64: dts: renesas: r8a779{5,6}: decrease temperature

2018-04-17 Thread Niklas Söderlund
From: Niklas Söderlund Hi Simon, This series decrease the hysteresis from 2C to 1C for the two boards we have described upstream. They have no dependencies and are ready to be accepted if the review is in favor of them. Niklas Söderlund (2): arm64: dts: renesas: r8a7795: decrease

[PATCH 1/2] thermal: rcar_gen3_thermal: Update calculation formula due to HW evaluation

2018-04-17 Thread Niklas Söderlund
From: Hien Dang Due to hardware evaluation result, Max temperature is changed from 96 to 116 degree Celsius. Also, calculation formula and pseudo FUSE values are changed accordingly. Signed-off-by: Dien Pham Signed-off-by: Hien Dang Signed-off-by: Niklas Söderlund --- drivers/thermal

[PATCH 2/2] thermal: rcar_gen3_thermal: update max temperature clamp

2018-04-17 Thread Niklas Söderlund
From: Niklas Söderlund Change the upper limit to clamp the high temperature value to 120C when setting trip points. Signed-off-by: Niklas Söderlund --- drivers/thermal/rcar_gen3_thermal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/thermal

[PATCH 0/2] thermal: rcar_gen3_thermal: update constants for calculation of temperature

2018-04-17 Thread Niklas Söderlund
From: Niklas Söderlund Hi, This series updates the constants used to convert the register values to degrease. It is based on feedback from the hardware team communicated through BSP patches and updated datasheets. :-) Hien Dang (1): thermal: rcar_gen3_thermal: Update calculation formula

[PATCH 1/2] dt-bindings: thermal: rcar-gen3-thermal: add r8a77965

2018-04-17 Thread Niklas Söderlund
From: Niklas Söderlund Based on previous work by Ryo Kataoka . Signed-off-by: Niklas Söderlund --- .../devicetree/bindings/thermal/rcar-gen3-thermal.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/thermal/rcar-gen3

[PATCH 2/2] thermal: rcar_gen3_thermal: add r8a77965 support

2018-04-17 Thread Niklas Söderlund
From: Niklas Söderlund Signed-off-by: Niklas Söderlund --- drivers/thermal/rcar_gen3_thermal.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c index 561a0a332208504a..c04182e1518cd613 100644 --- a/drivers/thermal

[PATCH 0/2] thermal: rcar_gen3_thermal: add r8a77965 support

2018-04-17 Thread Niklas Söderlund
From: Niklas Söderlund Hi, This series adds DT documentation and driver support to the rcar-gen3-thermal driver for r8a77965. Niklas Söderlund (2): dt-bindings: thermal: rcar-gen3-thermal: add r8a77965 thermal: rcar_gen3_thermal: add r8a77965 support .../devicetree/bindings/thermal/rcar

[PATCH] arm64: dts: r8a77965: Add R-Car Gen3 thermal support

2018-04-17 Thread Niklas Söderlund
From: Niklas Söderlund Based on previous work by Ryo Kataoka . Signed-off-by: Niklas Söderlund --- arch/arm64/boot/dts/renesas/r8a77965.dtsi | 59 +++ 1 file changed, 59 insertions(+) Hi Simon, This patch depends on '[PATCH 0/2] thermal: rcar_gen3_thermal: add r8a

Re: [PATCH] dt-bindings: thermal: rcar-gen3-thermal: update register size in example

2018-04-24 Thread Niklas Söderlund
Hi Rob, On 2018-04-24 09:28:41 -0500, Rob Herring wrote: > On Tue, Apr 17, 2018 at 10:49:58PM +0200, Niklas Söderlund wrote: > > From: Niklas Söderlund > > > > The datasheet have been expanded with more registers and the DT files > > have been updated with the new si

Re: [PATCH] media: i2c: adv748x: Fix pixel rate values

2018-04-24 Thread Niklas Söderlund
pixel rate for analog sources, mandated by the ADV748x to be > 28.63636 MHz. > > Signed-off-by: Laurent Pinchart Reviewed-by: Niklas Söderlund This patch uncovered a calculation error in rcar-csi2 which compensated for the removing of the blanking in the adv748x, thanks for that! Goo

[PATCH] rcar-vin: remove generic gen3 compatible string

2018-04-24 Thread Niklas Söderlund
The compatible string "renesas,rcar-gen3-vin" was added before the Gen3 driver code was added but it's not possible to use. Each SoC in the Gen3 series require SoC specific knowledge in the driver to function. Remove it before it is added to any device tree descriptions. Signed

[PATCH] rcar-vin: fix null pointer dereference in rvin_group_get()

2018-04-24 Thread Niklas Söderlund
Store the group pointer before disassociating the VIN from the group. Fixes: 3bb4c3bc85bf77a7 ("media: rcar-vin: add group allocator functions") Reported-by: Colin Ian King Signed-off-by: Niklas Söderlund --- drivers/media/platform/rcar-vin/rcar-core.c | 12 +++- 1 file

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