[PATCH] gpio: Add a reference to CEC on GPIO

2018-04-14 Thread Linus Walleij
This adds a pointer to the CEC GPIO driver from the GPIO list of examples of drivers on top of GPIO. Cc: Hans Verkuil Cc: linux-media@vger.kernel.org Signed-off-by: Linus Walleij --- Documentation/driver-api/gpio/drivers-on-gpio.rst | 4 1

Re: Smatch and sparse errors

2018-04-14 Thread Mauro Carvalho Chehab
Em Sat, 14 Apr 2018 03:18:20 +0200 "Jasmin J." escreveu: > Hello Mauro/Hans! > > > There is already an upstream patch for hidding it: > The patch from https://patchwork.kernel.org/patch/10334353 will not > apply at the smatch tree. > > Attached is an updated version for

Re: Smatch and sparse errors

2018-04-14 Thread Jasmin J.
Hello Mauro/Hans! > Then you're probably not using the right version Might be ... The build script from Hans uses the Versions from here: git://repo.or.cz/smatch.git git://git.kernel.org/pub/scm/devel/sparse/sparse.git > Yesterday, I added both trees I'm using here at: >

Re: [PATCH] gpio: Add a reference to CEC on GPIO

2018-04-14 Thread Hans Verkuil
On 04/14/2018 02:44 AM, Linus Walleij wrote: > This adds a pointer to the CEC GPIO driver from the GPIO list of > examples of drivers on top of GPIO. > > Cc: Hans Verkuil > Cc: linux-media@vger.kernel.org > Signed-off-by: Linus Walleij Acked-by:

Re: Smatch and sparse errors

2018-04-14 Thread Mauro Carvalho Chehab
Em Sat, 14 Apr 2018 12:06:34 +0200 "Jasmin J." escreveu: > Hello Mauro/Hans! > > > Then you're probably not using the right version > Might be ... > The build script from Hans uses the Versions from here: >git://repo.or.cz/smatch.git That's right. The last patch on this

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

2018-04-14 Thread Niklas Söderlund
Hi, This series adds Gen3 VIN support to rcar-vin driver for Renesas r8a7795, r8a7796 and r8a77970. It is based on the media-tree and depends on Fabrizio Castro patches as they touches the order of the compatible strings in the documentation to reduce merge conflicts. The dependencies are

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

2018-04-14 Thread Niklas Söderlund
In preparation for Gen3 support move the subdevice initialization and clean up from rvin_v4l2_{register,unregister}() directly to the async callbacks. This simplifies the addition of Gen3 support as the rvin_v4l2_register() can be shared for both Gen2 and Gen3 while direct subdevice control are

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

2018-04-14 Thread Niklas Söderlund
If the video device was registered by the complete() callback it should be unregistered when a device is unbound from the driver. Protect from printing an uninitialized video device node name by adding a check in rvin_v4l2_unregister() to identify that the video device is registered.

[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

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

2018-04-14 Thread Niklas Söderlund
Document the devicetree bindings for the CSI-2 inputs available on Gen3. There is a need to add a custom property 'renesas,id' and to define which CSI-2 input is described in which endpoint under the port@1 node. This information is needed since there are a set of predefined routes between each

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

2018-04-14 Thread Niklas Söderlund
From: Fabrizio Castro Add compatible strings for r8a7743 and r8a7745. No driver change is needed as "renesas,rcar-gen2-vin" will activate the right code. However, it is good practice to document compatible strings for the specific SoC as this allows SoC specific

[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

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

2018-04-14 Thread Niklas Söderlund
When Gen3 support is added to the driver more than model ID will be different for the different SoCs. To avoid a lot of if statements in the code create a struct rvin_info to store this information. While we are at it rename the poorly chosen enum which contains the different model IDs from

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

2018-04-14 Thread Niklas Söderlund
The logic to preserve the requested format width and height are too complex and come from a premature optimization for Gen3. All Gen2 SoC can scale and the Gen3 implementation will not use these functions at all so simply preserve the width and height when interacting with the subdevice much like

[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

[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

[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

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

2018-04-14 Thread Niklas Söderlund
There was never proper support in the VIN driver to deliver ALTERNATING field format to user-space, remove this field option. The problem is that ALTERNATING field order requires the sequence numbers of buffers returned to userspace to reflect if fields were dropped or not, something which is not

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

[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

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

2018-04-14 Thread Niklas Söderlund
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 reset of format when the standard is changed. While at it replace the driver local struct

[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

[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

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

2018-04-14 Thread Niklas Söderlund
On Gen3 the CSI-2 routing is controlled by the VnCSI_IFMD register. One feature of this register is that it's only present in the VIN0 and VIN4 instances. The register in VIN0 controls the routing for VIN0-3 and the register in VIN4 controls routing for VIN4-7. To be able to control routing from

[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

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

2018-04-14 Thread Niklas Söderlund
When the driver runs in media controller mode it should not directly control the subdevice instead userspace will be responsible for configuring the pipeline. To be able to run in this mode a different set of v4l2 operations needs to be used. Add a new set of v4l2 operations to support operation

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

2018-04-14 Thread Niklas Söderlund
On Gen3 a media controller API needs to be used to allow userspace to configure the subdevices in the pipeline instead of directly controlling a single source subdevice, which is and will continue to be the mode of operation on Gen2. Prepare for these two modes of operation by adding a flag to

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

2018-04-14 Thread Niklas Söderlund
Add the ability to process media device link change requests. Link enabling is a bit complicated on Gen3, whether or not it's possible to enable a link depends on what other links already are enabled. On Gen3 the 8 VINs are split into two subgroup's (VIN0-3 and VIN4-7) and from a routing

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

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

2018-04-14 Thread Niklas Söderlund
In media controller mode all VIN instances needs to be part of the same media graph. There is also a need for each VIN instance to know about and in some cases be able to communicate with other VIN instances. Add an allocator framework where the first VIN instance to be probed creates a shared

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

2018-04-14 Thread Niklas Söderlund
The parsing and registering CSI-2 subdevices with the v4l2 async framework is a collaborative effort shared between the VIN instances which are part of the group. When the last VIN in the group is probed it asks all other VINs to parse its share of OF and record the async subdevices it finds in

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

2018-04-14 Thread Niklas Söderlund
The V4L2 specification clearly documents the colorspace fields as being set by drivers for capture devices. Using the values supplied by userspace thus wouldn't comply with the API. Until the API is updated to allow for userspace to set these Hans wants the fields to be set by the driver to fixed

[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

[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

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

2018-04-14 Thread Niklas Söderlund
Prepare for media controller by calling a different initialization then when running in device centric mode. Add trivial configuration of the mbus and creation of the media pad for the video device entity. While we are at it clearly mark the digital device centric notifier functions with a

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

[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

cron job: media_tree daily build: OK

2018-04-14 Thread Hans Verkuil
This message is generated daily by a cron job that builds media_tree for the kernels and architectures in the list below. Results of the daily build of media_tree: date: Sun Apr 15 05:00:11 CEST 2018 media-tree git hash:b284d4d5a6785f8cd07eda2646a95782373cd01e media_build

[PATCH 1/2] media: rc: mce_kbd decoder: remove superfluous call to input_sync

2018-04-14 Thread Sean Young
There is nothing to sync in this code path. Reported-by: Matthias Reichl Signed-off-by: Sean Young --- drivers/media/rc/ir-mce_kbd-decoder.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/media/rc/ir-mce_kbd-decoder.c

[PATCH 2/2] media: rc: mce_kbd decoder: fix race condition

2018-04-14 Thread Sean Young
The MCE keyboard sends both key down and key up events. We have a timeout handler mce_kbd_rx_timeout() in case the keyup event is never received; however, this may race with new key down events from occurring. The race is that key down scancode arrives and key down events are generated. The

Re: [RFCv3 15/17] v4l2: document the request API interface

2018-04-14 Thread Randy Dunlap
Hi, A few comments below... On 02/06/2018 05:48 PM, Alexandre Courbot wrote: > Document how the request API can be used along with the existing V4L2 > interface. > > Signed-off-by: Alexandre Courbot > --- > Documentation/media/uapi/v4l/buffer.rst| 10 +- >