]> git.ipfire.org Git - people/ms/linux.git/log
people/ms/linux.git
3 years agoleds: add help info about BCM63138 module name
Rafał Miłecki [Sun, 17 Jul 2022 12:42:47 +0000 (14:42 +0200)] 
leds: add help info about BCM63138 module name

It's what we do for all other LEDs drivers.

Reported-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
3 years agodt-bindings: leds: leds-bcm63138: unify full stops in descriptions
Rafał Miłecki [Sun, 17 Jul 2022 12:42:46 +0000 (14:42 +0200)] 
dt-bindings: leds: leds-bcm63138: unify full stops in descriptions

Description of "reg" doesn't have full stop at the end. It makes sense
as it's a one-sentence only. Use the same style for "active-low".

Reported-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
3 years agoMIPS: BMIPS: Utilize cfe_die() for invalid DTB
Florian Fainelli [Fri, 15 Jul 2022 21:37:47 +0000 (14:37 -0700)] 
MIPS: BMIPS: Utilize cfe_die() for invalid DTB

If we were not specified a correct DTB, we will not be able to print
anything useful with panic() which requires a working console of some
sort. Utilize cfe_die() to callback into the CFE default UART and print
some useful diagnostics.

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
3 years agoMIPS: CFE: Add cfe_die()
Florian Fainelli [Fri, 15 Jul 2022 21:37:46 +0000 (14:37 -0700)] 
MIPS: CFE: Add cfe_die()

Add a cfe_die() implementation which is useful when the kernel does an
early panic and no console is registered. This allows us to print
useful diagnostics such as an invalid DTB having been
configured/selected.

Since the BMIPS_GENERIC kernel can be built with support for multiple
processors, we need to do a runtime determination of the type of CPU
that we are executing on to perform the appropriate XKS01 disabling.

Since cfe_init() + cfe_die() could be conceivably called at very early
stages of the kernel boot, before cpu_probe(), we do not rely on the
structure(s) populated by cpu_probe().

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
3 years agodt-bindings: leds: lp50xx: fix LED children names
Krzysztof Kozlowski [Fri, 24 Jun 2022 11:13:25 +0000 (13:13 +0200)] 
dt-bindings: leds: lp50xx: fix LED children names

The lp50xx LEDs expects to have single-color LED children with unit
addresses.  This is required by the driver and provided by existing
DTSes.  Fix the binding to match actual usage.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
[This depends on previous schema-fixing patch, so I deleted Fixes; we
don't want to deal with this in stable]
Signed-off-by: Pavel Machek <pavel@ucw.cz>
3 years agodt-bindings: leds: class-multicolor: reference class directly in multi-led node
Krzysztof Kozlowski [Fri, 24 Jun 2022 11:21:06 +0000 (13:21 +0200)] 
dt-bindings: leds: class-multicolor: reference class directly in multi-led node

The leds/common.yaml is referenced directly in each LED node, which
leads to people doing the same with leds/leds-class-multicolor.yaml.
This is not correct because leds-class-multicolor.yaml defined multi-led
property and its children.  Some schemas implemented this incorrect.

Rework this to match same behavior common.yaml, so expect the multi-led
node to reference the leds-class-multicolor.yaml.  Fixing allows to add
unevaluatedProperties:false.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
3 years agoleds: bcm63138: add support for BCM63138 controller
Rafał Miłecki [Mon, 27 Dec 2021 14:59:05 +0000 (15:59 +0100)] 
leds: bcm63138: add support for BCM63138 controller

It's a new controller first introduced in BCM63138 SoC. Later it was
also used in BCM4908, some BCM68xx and some BCM63xxx SoCs.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
3 years agodt-bindings: leds: add Broadcom's BCM63138 controller
Rafał Miłecki [Mon, 27 Dec 2021 14:59:04 +0000 (15:59 +0100)] 
dt-bindings: leds: add Broadcom's BCM63138 controller

Broadcom used 2 LEDs hardware blocks for their BCM63xx SoCs:
1. Older one (BCM6318, BCM6328, BCM6362, BCM63268, BCM6838)
2. Newer one (BCM6848, BCM6858, BCM63138, BCM63148, BCM63381, BCM68360)

The newer one was also later also used on BCM4908 SoC.

Old block is already documented in the leds-bcm6328.yaml. This binding
documents the new one which uses different registers & programming. It's
first used in BCM63138 thus the binding name.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
3 years agomedia: rkisp1: debug: Add dump file in debugfs for MI main path registers
Paul Elder [Tue, 14 Jun 2022 19:10:33 +0000 (20:10 +0100)] 
media: rkisp1: debug: Add dump file in debugfs for MI main path registers

Add a register dump file in debugfs for some of the buffer-related
registers for the main path in MI (for the base address, the size, and
the offset). Also dump the corresponding shadow registers.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: Make the internal CSI-2 receiver optional
Laurent Pinchart [Tue, 14 Jun 2022 19:11:18 +0000 (20:11 +0100)] 
media: rkisp1: Make the internal CSI-2 receiver optional

Not all ISP versions integrate a MIPI CSI-2 receiver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: Add infrastructure to support ISP features
Laurent Pinchart [Tue, 14 Jun 2022 19:11:17 +0000 (20:11 +0100)] 
media: rkisp1: Add infrastructure to support ISP features

Different ISP versions implement different sets of features. The driver
already takes the version into account in several places, but this
approach won't scale well for features that are found in different
versions. Introduce a new mechanism using a features bitmask in the
rkisp1_info structure to indicate which features the ISP support.

The first feature bit tells if the ISP has an internal CSI-2 receiver,
which is not available in all ISP versions.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: Support the ISP parallel input
Paul Elder [Tue, 14 Jun 2022 19:11:16 +0000 (20:11 +0100)] 
media: rkisp1: Support the ISP parallel input

The ISP has a parallel input, exposed through port 1 in the device tree
node. While the driver supports configuring the ISP for the parallel and
BT.656 input modes, the DT parsing code, the subdev bound handler and
the ISP stream start handler only support the CSI input. Extend them to
support the parallel input.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: dt-bindings: media: rkisp1: Add port for parallel interface
Paul Elder [Tue, 14 Jun 2022 19:11:15 +0000 (20:11 +0100)] 
media: dt-bindings: media: rkisp1: Add port for parallel interface

The rkisp1 can take an input on the parallel interface. Add a port for
it, and update the required field. At least one port is required, and
both may be specified.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: Use fwnode_graph_for_each_endpoint
Paul Elder [Tue, 14 Jun 2022 19:11:14 +0000 (20:11 +0100)] 
media: rkisp1: Use fwnode_graph_for_each_endpoint

When registering the notifier, replace the manual while loop with
fwnode_graph_for_each_endpoint. This simplifies error handling.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: csi: Plumb the CSI RX subdev
Laurent Pinchart [Tue, 14 Jun 2022 19:11:13 +0000 (20:11 +0100)] 
media: rkisp1: csi: Plumb the CSI RX subdev

Connect the CSI receiver subdevice between the sensors and the ISP. This
includes:

- Calling the subdevice via the v4l2 subdev API
- Moving the async notifier for the sensor from the ISP to the CSI
  receiver
- In the ISP, create a media link to the CSI receiver, and remove the
  media link creation to the sensor
- In the CSI receiver, create a media link to the sensor

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: csi: Implement a V4L2 subdev for the CSI receiver
Paul Elder [Tue, 14 Jun 2022 19:11:12 +0000 (20:11 +0100)] 
media: rkisp1: csi: Implement a V4L2 subdev for the CSI receiver

The CSI receiver is a component separate from the ISP or the resizers.
It is actually optional, not all device model include a CSI receiver. On
some SoCs CSI-2 support can be provided through an external CSI-2
receiver, connected to the ISP's parallel input.

To support those use cases, create a V4L2 subdev to model the CSI
receiver. It will allow the driver to handle both internal and external
CSI receivers the same way.

The next commit will plumb the CSI subdev to the rest of the driver,
replacing direct function calls.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: isp: Disallow multiple active sources
Laurent Pinchart [Tue, 14 Jun 2022 19:11:11 +0000 (20:11 +0100)] 
media: rkisp1: isp: Disallow multiple active sources

The ISP supports multiple source subdevs, but can only capture from a
single one at a time. The source is selected through link setup. The
driver finds the active source in its .s_stream() handler using the
media_entity_remote_pad() function. This fails to reject invalid
configurations with multiple active sources. Fix it by using the
media_pad_remote_pad_unique() helper instead, and inline
rkisp1_isp_get_source() in rkisp1_isp_s_stream() as the function is
small and has a single caller.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: isp: Rename rkisp1_get_remote_source()
Laurent Pinchart [Tue, 14 Jun 2022 19:11:08 +0000 (20:11 +0100)] 
media: rkisp1: isp: Rename rkisp1_get_remote_source()

Rename the rkisp1_get_remote_source() function to
rkisp1_isp_get_source() to use a consistent rkisp1_isp_* prefix for all
ISP functions, and drop the "remote" as the source can't be local.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: isp: Constify various local variables
Laurent Pinchart [Tue, 14 Jun 2022 19:11:07 +0000 (20:11 +0100)] 
media: rkisp1: isp: Constify various local variables

A set of local variables point to structure that are not meant to be
modified. Constify them.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: isp: Fix whitespace issues
Laurent Pinchart [Tue, 14 Jun 2022 19:11:06 +0000 (20:11 +0100)] 
media: rkisp1: isp: Fix whitespace issues

Add missing blank lines after variable declaration blocks, and fix
indentation issues.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: isp: Initialize some variables at declaration time
Laurent Pinchart [Tue, 14 Jun 2022 19:11:05 +0000 (20:11 +0100)] 
media: rkisp1: isp: Initialize some variables at declaration time

Initialize the src_fmt and sink_fmt variable when declaring them in
rkisp1_config_isp().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: isp: Merge ISP_ACQ_PROP configuration in single variable
Laurent Pinchart [Tue, 14 Jun 2022 19:11:04 +0000 (20:11 +0100)] 
media: rkisp1: isp: Merge ISP_ACQ_PROP configuration in single variable

The rkisp1_config_isp() function stores the value of the input selection
and polarity configuration in two different local variables, OR'ed
together when writing the register. Merge them into a single acq_prop
variable.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: isp: Move input configuration to rkisp1_config_isp()
Laurent Pinchart [Tue, 14 Jun 2022 19:11:03 +0000 (20:11 +0100)] 
media: rkisp1: isp: Move input configuration to rkisp1_config_isp()

The ISP_ACQ_PROP register is set twice, once in rkisp1_config_isp() for
most of its fields, and once in rkisp1_config_dvp() (called from
rkisp1_config_path()) to configure the input selection field. Move the
latter to rkisp1_config_isp() to write the register once only, and drop
the now empty rkisp1_config_dvp() function.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: isp: Pass rkisp1_isp pointer to internal ISP functions
Laurent Pinchart [Tue, 14 Jun 2022 19:11:02 +0000 (20:11 +0100)] 
media: rkisp1: isp: Pass rkisp1_isp pointer to internal ISP functions

Replace the rkisp1_device pointer argument to the internal functions of
the ISP implementation with a rkisp1_isp object. This makes the code
flow more logical, as the functions operate on the ISP object.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: isp: Add rkisp1_device backpointer to rkisp1_isp
Laurent Pinchart [Tue, 14 Jun 2022 19:11:01 +0000 (20:11 +0100)] 
media: rkisp1: isp: Add rkisp1_device backpointer to rkisp1_isp

The rkisp1_isp structure documentation mentions a backpointer field to
rkisp1_device, but the field is missing. Add it, and use it to replace
more complicated constructs using container_of() on the v4l2_device.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: isp: Add container_of wrapper to cast subdev to rkisp1_isp
Laurent Pinchart [Tue, 14 Jun 2022 19:11:00 +0000 (20:11 +0100)] 
media: rkisp1: isp: Add container_of wrapper to cast subdev to rkisp1_isp

Replace manual container_of() calls with a static inline wrapper to
increase readability.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: isp: Rename rkisp1_device.active_sensor to source
Laurent Pinchart [Tue, 14 Jun 2022 19:10:59 +0000 (20:10 +0100)] 
media: rkisp1: isp: Rename rkisp1_device.active_sensor to source

The active_sensor field of the rkisp1_device structure points to the ASD
data for the active source. The source may however not be a sensor, so
the naming is a bit confusing. Furthermore, the driver doesn't need to
access the full ASD from the active_sensor field, only the subdev
pointer is needed, when stopping streaming.

Rename the field to source, and turn it into a v4l2_subdev pointer.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: isp: Pass mbus type and flags to rkisp1_config_cif()
Laurent Pinchart [Tue, 14 Jun 2022 19:10:58 +0000 (20:10 +0100)] 
media: rkisp1: isp: Pass mbus type and flags to rkisp1_config_cif()

To prepare for the removal of the active_sensor field from the
rkisp1_device structure, pass the media bus type of flag to the
rkisp1_config_cif() function instead of accessing them through
active_sensor.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: isp: Don't initialize ret to 0 in rkisp1_isp_s_stream()
Laurent Pinchart [Tue, 14 Jun 2022 19:10:57 +0000 (20:10 +0100)] 
media: rkisp1: isp: Don't initialize ret to 0 in rkisp1_isp_s_stream()

The ret variable doesn't need to be initialized in
rkisp1_isp_s_stream().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: csi: Constify argument to rkisp1_csi_start()
Laurent Pinchart [Tue, 14 Jun 2022 19:10:56 +0000 (20:10 +0100)] 
media: rkisp1: csi: Constify argument to rkisp1_csi_start()

The sensor argument to rkisp1_csi_start() isn't meant to be modified by
the function. Make it const.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: csi: Pass sensor pointer to rkisp1_csi_config()
Laurent Pinchart [Tue, 14 Jun 2022 19:10:55 +0000 (20:10 +0100)] 
media: rkisp1: csi: Pass sensor pointer to rkisp1_csi_config()

To prepare for the removal of the active_sensor field from the
rkisp1_device structure, pass the sensor pointer to the
rkisp1_csi_config() function instead of accessing it through
active_sensor.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: csi: Move start delay to rkisp1_csi_start()
Laurent Pinchart [Tue, 14 Jun 2022 19:10:54 +0000 (20:10 +0100)] 
media: rkisp1: csi: Move start delay to rkisp1_csi_start()

The delay in rkisp1_isp_start() is related to the CSI-2 receiver and
the camera sensor. Move it where it belongs, to rkisp1_csi_start().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: csi: Rename CSI functions with a common rkisp1_csi prefix
Laurent Pinchart [Tue, 14 Jun 2022 19:10:53 +0000 (20:10 +0100)] 
media: rkisp1: csi: Rename CSI functions with a common rkisp1_csi prefix

The CSI-related functions are not named consistently. Fix it by using a
common rkisp1_csi prefix.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: csi: Handle CSI-2 RX configuration fully in rkisp1-csi.c
Laurent Pinchart [Tue, 14 Jun 2022 19:10:52 +0000 (20:10 +0100)] 
media: rkisp1: csi: Handle CSI-2 RX configuration fully in rkisp1-csi.c

The ISP layer now calls multiple functions of the CSI-2 RX layer to
configure, start and stop it, with the steps for the last two
operations. Move those calls to rkisp1_mipi_csi2_start() and
rkisp1_mipi_csi2_stop() to simplify the ISP code and the API exposed by
the CSI-2 receiver component.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: isp: Start CSI-2 receiver before ISP
Laurent Pinchart [Tue, 14 Jun 2022 19:10:51 +0000 (20:10 +0100)] 
media: rkisp1: isp: Start CSI-2 receiver before ISP

Make sure the ISP is ready to receive data before starting the CSI-2
receiver by starting it first. Similarly, stop the CSI-2 receiver before
the ISP when stopping streaming.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: Split CSI handling to separate file
Paul Elder [Tue, 14 Jun 2022 19:10:50 +0000 (20:10 +0100)] 
media: rkisp1: Split CSI handling to separate file

Not all ISP instances include a MIPI CSI-2 receiver. To prepare for
making it optional, move code related to the CSI-2 receiver to a
separate file.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: Fix sensor source pad retrieval at bound time
Laurent Pinchart [Tue, 14 Jun 2022 19:10:49 +0000 (20:10 +0100)] 
media: rkisp1: Fix sensor source pad retrieval at bound time

When a sensor is bound, its source pad is retrieved in the .bound()
operation with a call to media_entity_get_fwnode_pad(). The function
should be called with the source endpoint fwnode of the sensor, but is
instead called with the sensor's device fwnode.

Fix this, which involves storing a reference to the source endpoint
fwnode in the rkisp1_sensor_async structure, and thus implementing the
subdev notifier .destroy() operation to release the reference.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: Rename rkisp1_subdev_notifier() to rkisp1_subdev_notifier_register()
Laurent Pinchart [Tue, 14 Jun 2022 19:10:47 +0000 (20:10 +0100)] 
media: rkisp1: Rename rkisp1_subdev_notifier() to rkisp1_subdev_notifier_register()

The function name isn't very clear, rename it to
rkisp1_subdev_notifier_register().

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: Create internal links at probe time
Laurent Pinchart [Tue, 14 Jun 2022 19:10:46 +0000 (20:10 +0100)] 
media: rkisp1: Create internal links at probe time

There's no need to wait until all async subdevs are bound before
creating internal links. Create them at probe time.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: Create link from sensor to ISP at notifier bound time
Laurent Pinchart [Tue, 14 Jun 2022 19:10:45 +0000 (20:10 +0100)] 
media: rkisp1: Create link from sensor to ISP at notifier bound time

Links from sensors to the ISP can be created as sensors are bound. Move
the link creation from rkisp1_create_links() to the bound notifier, and
clean up the rkisp1_create_links() function while at it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: Reject sensors without pixel rate control at bound time
Laurent Pinchart [Tue, 14 Jun 2022 19:10:44 +0000 (20:10 +0100)] 
media: rkisp1: Reject sensors without pixel rate control at bound time

The rkisp1 driver requires the sensor to implement the pixel rate
control. Trying to operate without it will cause an error when starting
streaming. Catch the issue earlier, at bound time.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: Move sensor .s_stream() call to ISP
Laurent Pinchart [Tue, 14 Jun 2022 19:10:43 +0000 (20:10 +0100)] 
media: rkisp1: Move sensor .s_stream() call to ISP

Move the calls to the active sensor's .s_stream() operation to the ISP
subdev's .s_stream(). This groups all handling of the active sensor in
one place, preparing for a rework of that code.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agoleds: clevo-mail: Mark as broken pending interface fix
Pavel Machek [Sun, 17 Jul 2022 10:59:48 +0000 (12:59 +0200)] 
leds: clevo-mail: Mark as broken pending interface fix

Setting blink rate using brightness is unusual and should be fixed.

Signed-off-by: Pavel Machek <pavel@ucw.cz>
3 years agoleds: pwm-multicolor: Support active-low LEDs
Emil Renner Berthing [Tue, 5 Jul 2022 21:01:42 +0000 (23:01 +0200)] 
leds: pwm-multicolor: Support active-low LEDs

Add support for LEDs wired up to light when the PWM output is low, just
like the regular PWM LEDs.

Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
3 years agomedia: rkisp1: cap: Print debug message on failed link validation
Laurent Pinchart [Tue, 14 Jun 2022 19:10:42 +0000 (20:10 +0100)] 
media: rkisp1: cap: Print debug message on failed link validation

When a link validation failure occurs, print a debug message to help
diagnosing the cause.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agodt-bindings: leds: pwm-multicolor: Add active-low property
Emil Renner Berthing [Tue, 5 Jul 2022 21:01:41 +0000 (23:01 +0200)] 
dt-bindings: leds: pwm-multicolor: Add active-low property

Add the active-low property to LEDs that are part of a multicolor LED
just like the regular PWM LEDs have.

Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
3 years agomedia: rkisp1: Make rkisp1_isp_mbus_info common
Paul Elder [Tue, 14 Jun 2022 19:10:41 +0000 (20:10 +0100)] 
media: rkisp1: Make rkisp1_isp_mbus_info common

The upcoming CSI receiver split from the ISP to a separate source file
will need to be able to access the list of formats supported by the
driver. Move it out of the ISP's header and into the common header, and
add helper functions for accessing it so that the format list doesn't
need to be stored in the header.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agoleds: pwm-multicolor: Don't show -EPROBE_DEFER as errors
Emil Renner Berthing [Tue, 5 Jul 2022 21:01:40 +0000 (23:01 +0200)] 
leds: pwm-multicolor: Don't show -EPROBE_DEFER as errors

When requesting a PWM it might return -EPROBE_DEFER if it hasn't probed
yet. This is not an error, so just propagate the -EPROBE_DEFER without
logging anything. There is already dev_err_probe for exactly this
situation.

Fixes: 9fa2762110dd ("leds: Add PWM multicolor driver")
Signed-off-by: Emil Renner Berthing <emil.renner.berthing@canonical.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Pavel Machek <pavel@ucw.cz>
3 years agomedia: rkisp1: Access ISP version from info pointer
Laurent Pinchart [Tue, 14 Jun 2022 19:10:40 +0000 (20:10 +0100)] 
media: rkisp1: Access ISP version from info pointer

The ISP version is stored in the media_device hw_revision field and
access from there in the driver. Now that we store a pointer to the
match data in the rkisp1_device structure, access the ISP version from
there to make the code clearer and avoid depending on the media_device.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: Save info pointer in rkisp1_device
Paul Elder [Tue, 14 Jun 2022 19:10:39 +0000 (20:10 +0100)] 
media: rkisp1: Save info pointer in rkisp1_device

To make it possible to use the rkisp1_info after probe time (for
instance to make code conditional on the ISP version), save it in the
main rkisp1_device structure. To achieve this, also move the info
structure into the common header, and document it.

While at it, drop a NULL check in rkisp1_probe() for the match data as
it can't happen.

Signed-off-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: Rename rkisp1_match_data to rkisp1_info
Laurent Pinchart [Tue, 14 Jun 2022 19:10:38 +0000 (20:10 +0100)] 
media: rkisp1: Rename rkisp1_match_data to rkisp1_info

The rkisp1_match_data structure contains device model-specific
information. It it referenced from OF match data, but that's an
implementation detail. Rename it to rkisp1_info to reflect its main
purpose.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agoMerge branch kvm-arm64/sysreg-cleanup-5.20 into kvmarm-master/next
Marc Zyngier [Sun, 17 Jul 2022 10:55:58 +0000 (11:55 +0100)] 
Merge branch kvm-arm64/sysreg-cleanup-5.20 into kvmarm-master/next

* kvm-arm64/sysreg-cleanup-5.20:
  : .
  : Long overdue cleanup of the sysreg userspace access,
  : with extra scrubbing on the vgic side of things.
  : From the cover letter:
  :
  : "Schspa Shi recently reported[1] that some of the vgic code interacting
  : with userspace was reading uninitialised stack memory, and although
  : that read wasn't used any further, it prompted me to revisit this part
  : of the code.
  :
  : Needless to say, this area of the kernel is pretty crufty, and shows a
  : bunch of issues in other parts of the KVM/arm64 infrastructure. This
  : series tries to remedy a bunch of them:
  :
  : - Sanitise the way we deal with sysregs from userspace: at the moment,
  :   each and every .set_user/.get_user callback has to implement its own
  :   userspace accesses (directly or indirectly). It'd be much better if
  :   that was centralised so that we can reason about it.
  :
  : - Enforce that all AArch64 sysregs are 64bit. Always. This was sort of
  :   implied by the code, but it took some effort to convince myself that
  :   this was actually the case.
  :
  : - Move the vgic-v3 sysreg userspace accessors to the userspace
  :   callbacks instead of hijacking the vcpu trap callback. This allows
  :   us to reuse the sysreg infrastructure.
  :
  : - Consolidate userspace accesses for both GICv2, GICv3 and common code
  :   as much as possible.
  :
  : - Cleanup a bunch of not-very-useful helpers, tidy up some of the code
  :   as we touch it.
  :
  : [1] https://lore.kernel.org/r/m2h740zz1i.fsf@gmail.com"
  : .
  KVM: arm64: Get rid or outdated comments
  KVM: arm64: Descope kvm_arm_sys_reg_{get,set}_reg()
  KVM: arm64: Get rid of find_reg_by_id()
  KVM: arm64: vgic: Tidy-up calls to vgic_{get,set}_common_attr()
  KVM: arm64: vgic: Consolidate userspace access for base address setting
  KVM: arm64: vgic-v2: Add helper for legacy dist/cpuif base address setting
  KVM: arm64: vgic: Use {get,put}_user() instead of copy_{from.to}_user
  KVM: arm64: vgic-v2: Consolidate userspace access for MMIO registers
  KVM: arm64: vgic-v3: Consolidate userspace access for MMIO registers
  KVM: arm64: vgic-v3: Use u32 to manage the line level from userspace
  KVM: arm64: vgic-v3: Convert userspace accessors over to FIELD_GET/FIELD_PREP
  KVM: arm64: vgic-v3: Make the userspace accessors use sysreg API
  KVM: arm64: vgic-v3: Push user access into vgic_v3_cpu_sysregs_uaccess()
  KVM: arm64: vgic-v3: Simplify vgic_v3_has_cpu_sysregs_attr()
  KVM: arm64: Get rid of reg_from/to_user()
  KVM: arm64: Consolidate sysreg userspace accesses
  KVM: arm64: Rely on index_to_param() for size checks on userspace access
  KVM: arm64: Introduce generic get_user/set_user helpers for system registers
  KVM: arm64: Reorder handling of invariant sysregs from userspace
  KVM: arm64: Add get_reg_by_id() as a sys_reg_desc retrieving helper

Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: Get rid or outdated comments
Marc Zyngier [Mon, 4 Jul 2022 17:11:04 +0000 (18:11 +0100)] 
KVM: arm64: Get rid or outdated comments

Once apon a time, the 32bit KVM/arm port was the reference, while
the arm64 version was the new kid on the block, without a clear
future... This was a long time ago.

"The times, they are a-changing."

Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: Descope kvm_arm_sys_reg_{get,set}_reg()
Marc Zyngier [Mon, 4 Jul 2022 17:25:41 +0000 (18:25 +0100)] 
KVM: arm64: Descope kvm_arm_sys_reg_{get,set}_reg()

Having kvm_arm_sys_reg_get_reg and co in kvm_host.h gives the
impression that these functions are free to be called from
anywhere.

Not quite. They really are tied to out internal sysreg handling,
and they would be better off in the sys_regs.h header, which is
private. kvm_host.h could also get a bit of a diet, so let's
just do that.

Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: Get rid of find_reg_by_id()
Marc Zyngier [Mon, 4 Jul 2022 09:03:33 +0000 (10:03 +0100)] 
KVM: arm64: Get rid of find_reg_by_id()

This helper doesn't have a user anymore, let's get rid of it.

Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: vgic: Tidy-up calls to vgic_{get,set}_common_attr()
Marc Zyngier [Thu, 14 Jul 2022 07:10:09 +0000 (08:10 +0100)] 
KVM: arm64: vgic: Tidy-up calls to vgic_{get,set}_common_attr()

The userspace accessors have an early call to vgic_{get,set}_common_attr()
that makes the code hard to follow. Move it to the default: clause of
the decoding switch statement, which results in a nice cleanup.

This requires us to move the handling of the pending table into the
common handling, even if it is strictly a GICv3 feature (it has the
benefit of keeping the whole control group handling in the same
function).

Also cleanup vgic_v3_{get,set}_attr() while we're at it, deduplicating
the calls to vgic_v3_attr_regs_access().

Suggested-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: vgic: Consolidate userspace access for base address setting
Marc Zyngier [Tue, 5 Jul 2022 13:39:24 +0000 (14:39 +0100)] 
KVM: arm64: vgic: Consolidate userspace access for base address setting

Align kvm_vgic_addr() with the rest of the code by moving the
userspace accesses into it. kvm_vgic_addr() is also made static.

Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: vgic-v2: Add helper for legacy dist/cpuif base address setting
Marc Zyngier [Tue, 5 Jul 2022 13:34:33 +0000 (14:34 +0100)] 
KVM: arm64: vgic-v2: Add helper for legacy dist/cpuif base address setting

We carry a legacy interface to set the base addresses for GICv2.
As this is currently plumbed into the same handling code as
the modern interface, it limits the evolution we can make there.

Add a helper dedicated to this handling, with a view of maybe
removing this in the future.

Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: vgic: Use {get,put}_user() instead of copy_{from.to}_user
Marc Zyngier [Tue, 5 Jul 2022 10:27:37 +0000 (11:27 +0100)] 
KVM: arm64: vgic: Use {get,put}_user() instead of copy_{from.to}_user

Tidy-up vgic_get_common_attr() and vgic_set_common_attr() to use
{get,put}_user() instead of the more complex (and less type-safe)
copy_{from,to}_user().

Reviewed-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: vgic-v2: Consolidate userspace access for MMIO registers
Marc Zyngier [Tue, 5 Jul 2022 09:26:07 +0000 (10:26 +0100)] 
KVM: arm64: vgic-v2: Consolidate userspace access for MMIO registers

Align the GICv2 MMIO accesses from userspace with the way the GICv3
code is now structured.

Reviewed-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: vgic-v3: Consolidate userspace access for MMIO registers
Marc Zyngier [Tue, 5 Jul 2022 09:26:07 +0000 (10:26 +0100)] 
KVM: arm64: vgic-v3: Consolidate userspace access for MMIO registers

For userspace accesses to GICv3 MMIO registers (and related data),
vgic_v3_{get,set}_attr are littered with {get,put}_user() calls,
making it hard to audit and reason about.

Consolidate all userspace accesses in vgic_v3_attr_regs_access(),
making the code far simpler to audit.

Reviewed-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: vgic-v3: Use u32 to manage the line level from userspace
Marc Zyngier [Tue, 5 Jul 2022 09:16:44 +0000 (10:16 +0100)] 
KVM: arm64: vgic-v3: Use u32 to manage the line level from userspace

Despite the userspace ABI clearly defining the bits dealt with by
KVM_DEV_ARM_VGIC_GRP_LEVEL_INFO as a __u32, the kernel uses a u64.

Use a u32 to match the userspace ABI, which will subsequently lead
to some simplifications.

Reviewed-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: vgic-v3: Convert userspace accessors over to FIELD_GET/FIELD_PREP
Marc Zyngier [Tue, 5 Jul 2022 07:11:54 +0000 (08:11 +0100)] 
KVM: arm64: vgic-v3: Convert userspace accessors over to FIELD_GET/FIELD_PREP

The GICv3 userspace accessors are all about dealing with conversion
between fields from architectural registers and internal representations.

However, and owing to the age of this code, the accessors use
a combination of shift/mask that is hard to read. It is nonetheless
easy to make it better by using the FIELD_{GET,PREP} macros that solely
rely on a mask.

This results in somewhat nicer looking code, and is probably easier
to maintain.

Reviewed-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: vgic-v3: Make the userspace accessors use sysreg API
Marc Zyngier [Mon, 4 Jul 2022 08:57:38 +0000 (09:57 +0100)] 
KVM: arm64: vgic-v3: Make the userspace accessors use sysreg API

The vgic-v3 sysreg accessors have been ignored as the rest of the
sysreg internal API was evolving, and are stuck with the .access
method (which is normally reserved to the guest's own access)
for the userspace accesses (which should use the .set/.get_user()
methods).

Catch up with the program and repaint all the accessors so that
they fit into the normal userspace model, and plug the result into
the helpers that have been introduced earlier.

Reviewed-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: vgic-v3: Push user access into vgic_v3_cpu_sysregs_uaccess()
Marc Zyngier [Mon, 4 Jul 2022 07:07:44 +0000 (08:07 +0100)] 
KVM: arm64: vgic-v3: Push user access into vgic_v3_cpu_sysregs_uaccess()

In order to start making the vgic sysreg access from userspace
similar to all the other sysregs, push the userspace memory
access one level down into vgic_v3_cpu_sysregs_uaccess().

The next step will be to rely on the sysreg infrastructure
to perform this task.

Reviewed-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: vgic-v3: Simplify vgic_v3_has_cpu_sysregs_attr()
Marc Zyngier [Sun, 3 Jul 2022 13:57:29 +0000 (14:57 +0100)] 
KVM: arm64: vgic-v3: Simplify vgic_v3_has_cpu_sysregs_attr()

Finding out whether a sysreg exists has little to do with that
register being accessed, so drop the is_write parameter.

Also, the reg pointer is completely unused, and we're better off
just passing the attr pointer to the function.

This result in a small cleanup of the calling site, with a new
helper converting the vGIC view of a sysreg into the canonical
one (this is purely cosmetic, as the encoding is the same).

Reviewed-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: Get rid of reg_from/to_user()
Marc Zyngier [Mon, 4 Jul 2022 16:55:43 +0000 (17:55 +0100)] 
KVM: arm64: Get rid of reg_from/to_user()

These helpers are only used by the invariant stuff now, and while
they pretend to support non-64bit registers, this only serves as
a way to scare the casual reviewer...

Replace these helpers with our good friends get/put_user(), and
don't look back.

Reviewed-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: Consolidate sysreg userspace accesses
Marc Zyngier [Mon, 4 Jul 2022 16:27:00 +0000 (17:27 +0100)] 
KVM: arm64: Consolidate sysreg userspace accesses

Until now, the .set_user and .get_user callbacks have to implement
(directly or not) the userspace memory accesses. Although this gives
us maximem flexibility, this is also a maintenance burden, making it
hard to audit, and I'd feel much better if it was all located in
a single place.

So let's do just that, simplifying most of the function signatures
in the process (the callbacks are now only concerned with the
data itself, and not with userspace).

Reviewed-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: Rely on index_to_param() for size checks on userspace access
Marc Zyngier [Mon, 4 Jul 2022 16:01:50 +0000 (17:01 +0100)] 
KVM: arm64: Rely on index_to_param() for size checks on userspace access

index_to_param() already checks that we use 64bit accesses for all
registers accessed from userspace.

However, we have extra checks in other places (such as index_to_params),
which is pretty confusing. Get rid off these redundant checks.

Reviewed-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: Introduce generic get_user/set_user helpers for system registers
Marc Zyngier [Sun, 3 Jul 2022 15:06:51 +0000 (16:06 +0100)] 
KVM: arm64: Introduce generic get_user/set_user helpers for system registers

The userspace access to the system registers is done using helpers
that hardcode the table that is looked up. extract some generic
helpers from this, moving the handling of hidden sysregs into
the core code.

Reviewed-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: Reorder handling of invariant sysregs from userspace
Marc Zyngier [Sun, 3 Jul 2022 14:11:50 +0000 (15:11 +0100)] 
KVM: arm64: Reorder handling of invariant sysregs from userspace

In order to allow some further refactor of the sysreg helpers,
move the handling of invariant sysreg to occur before we handle
all the other ones.

Reviewed-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: Add get_reg_by_id() as a sys_reg_desc retrieving helper
Marc Zyngier [Sun, 3 Jul 2022 13:08:46 +0000 (14:08 +0100)] 
KVM: arm64: Add get_reg_by_id() as a sys_reg_desc retrieving helper

find_reg_by_id() requires a sys_reg_param as input, which most
users provide as a on-stack variable, but don't make any use of
the result.

Provide a helper that doesn't have this requirement and simplify
the callers (all but one).

Reviewed-by: Reiji Watanabe <reijiw@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoMerge branch kvm-arm64/misc-5.20 into kvmarm-master/next
Marc Zyngier [Sun, 17 Jul 2022 10:45:22 +0000 (11:45 +0100)] 
Merge branch kvm-arm64/misc-5.20 into kvmarm-master/next

* kvm-arm64/misc-5.20:
  : .
  : Misc fixes for 5.20:
  :
  : - Tidy up the hyp/nvhe Makefile
  :
  : - Fix functions pointlessly returning a void value
  :
  : - Fix vgic_init selftest to handle the GICv3-on-v3 case
  :
  : - Fix hypervisor symbolisation when CONFIG_RANDOMIZE_BASE=y
  : .
  KVM: arm64: Fix hypervisor address symbolization
  KVM: arm64: selftests: Add support for GICv2 on v3
  KVM: arm64: Don't return from void function
  KVM: arm64: nvhe: Add intermediates to 'targets' instead of extra-y
  KVM: arm64: nvhe: Rename confusing obj-y

Signed-off-by: Marc Zyngier <maz@kernel.org>
3 years agoKVM: arm64: Fix hypervisor address symbolization
Kalesh Singh [Fri, 15 Jul 2022 23:58:24 +0000 (16:58 -0700)] 
KVM: arm64: Fix hypervisor address symbolization

With CONFIG_RANDOMIZE_BASE=y vmlinux addresses will resolve incorrectly
from kallsyms. Fix this by adding the KASLR offset before printing the
symbols.

Fixes: 6ccf9cb557bd ("KVM: arm64: Symbolize the nVHE HYP addresses")
Reported-by: Fuad Tabba <tabba@google.com>
Signed-off-by: Kalesh Singh <kaleshsingh@google.com>
Signed-off-by: Marc Zyngier <maz@kernel.org>
Link: https://lore.kernel.org/r/20220715235824.2549012-1-kaleshsingh@google.com
3 years agomedia: rkisp1: Read the ID register at probe time instead of streamon
Laurent Pinchart [Tue, 14 Jun 2022 19:10:37 +0000 (20:10 +0100)] 
media: rkisp1: Read the ID register at probe time instead of streamon

There's no need to read the ID register every time streaming is started.
Do it once, at probe time.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: Disable runtime PM in probe error path
Laurent Pinchart [Tue, 14 Jun 2022 19:10:36 +0000 (20:10 +0100)] 
media: rkisp1: Disable runtime PM in probe error path

If the v4l2_device_register() call fails, runtime PM is left enabled.
Fix it.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkisp1: Enable compilation on ARCH_MXC
Laurent Pinchart [Tue, 14 Jun 2022 19:10:34 +0000 (20:10 +0100)] 
media: rkisp1: Enable compilation on ARCH_MXC

The ISP used by the Rockchip RK3399 is also found in the NXP i.MX8MP.
Enable compilation of the driver for the MXC architecture in addition to
ARCH_ROCKCHIP.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Dafna Hirschfeld <dafna@fastmail.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: mc-entity: Add a new helper function to get a remote pad for a pad
Laurent Pinchart [Tue, 14 Jun 2022 19:11:10 +0000 (20:11 +0100)] 
media: mc-entity: Add a new helper function to get a remote pad for a pad

The newly added media_entity_remote_source_pad_unique() helper function
handles use cases where the entity has a link enabled uniqueness
constraint covering all pads. There are use cases where the constraint
covers a specific pad only. Add a new media_pad_remote_pad_unique()
function to handle this. It operates as
media_entity_remote_source_pad_unique(), but on a given pad instead of
on the entity.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: mc-entity: Add a new helper function to get a remote pad
Laurent Pinchart [Tue, 14 Jun 2022 19:11:09 +0000 (20:11 +0100)] 
media: mc-entity: Add a new helper function to get a remote pad

The media_entity_remote_pad_first() helper function returns the first
remote pad it finds connected to a given pad. Beside being possibly
non-deterministic (as it stops at the first enabled link), the fact that
it returns the first match makes it unsuitable for drivers that need to
guarantee that a single link is enabled, for instance when an entity can
process data from one of multiple sources at a time.

For those use cases, add a new helper function,
media_entity_remote_pad_unique(), that operates on an entity and returns
a remote pad, with a guarantee that only one link is enabled. To ease
its use in drivers, also add an inline wrapper that locates source pads
specifically. A wrapper that locates sink pads can easily be added when
needed.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: mc-entity: Rename media_entity_remote_pad() to media_pad_remote_pad_first()
Laurent Pinchart [Sat, 25 Jun 2022 17:02:24 +0000 (18:02 +0100)] 
media: mc-entity: Rename media_entity_remote_pad() to media_pad_remote_pad_first()

The media_entity_remote_pad() is misnamed, as it operates on a pad and
not an entity. Rename it to media_pad_remote_pad_first() to clarify its
behaviour.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: v4l2-async: Add notifier operation to destroy asd instances
Laurent Pinchart [Tue, 14 Jun 2022 19:10:48 +0000 (20:10 +0100)] 
media: v4l2-async: Add notifier operation to destroy asd instances

Drivers typically extend the v4l2_async_subdev structure by embedding it
in a driver-specific structure, to store per-subdev custom data. The
v4l2_async_subdev instances are freed by the v4l2-async framework, which
makes this mechanism cumbersome to use safely when custom data needs
special treatment to be destroyed (such as freeing additional memory, or
releasing references to kernel objects).

To ease this, add a .destroy() operation to the
v4l2_async_notifier_operations structure. The operation is called right
before the v4l2_async_subdev is freed, giving drivers a chance to
destroy data if needed.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: rkvdec: Use vb2_find_buffer
Ezequiel Garcia [Mon, 11 Jul 2022 21:11:39 +0000 (22:11 +0100)] 
media: rkvdec: Use vb2_find_buffer

Use the newly introduced vb2_find_buffer API to get a vb2_buffer
given a buffer timestamp.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Acked-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: hantro: Use vb2_find_buffer
Ezequiel Garcia [Mon, 11 Jul 2022 21:11:38 +0000 (22:11 +0100)] 
media: hantro: Use vb2_find_buffer

Use the newly introduced vb2_find_buffer API to get a vb2_buffer
given a buffer timestamp.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Acked-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: vicodec: Use vb2_find_buffer
Ezequiel Garcia [Mon, 11 Jul 2022 21:11:37 +0000 (22:11 +0100)] 
media: vicodec: Use vb2_find_buffer

Use the newly introduced vb2_find_buffer API to get a vb2_buffer
given a buffer timestamp.

Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Acked-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: tegra-vde: Use vb2_find_buffer
Ezequiel Garcia [Mon, 11 Jul 2022 21:11:36 +0000 (22:11 +0100)] 
media: tegra-vde: Use vb2_find_buffer

Use the newly introduced vb2_find_buffer API to get a vb2_buffer
given a buffer timestamp.

Cc: Dmitry Osipenko <digetx@gmail.com>
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Acked-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: mediatek: vcodec: Use vb2_find_buffer
Ezequiel Garcia [Mon, 11 Jul 2022 21:11:35 +0000 (22:11 +0100)] 
media: mediatek: vcodec: Use vb2_find_buffer

Use the newly introduced vb2_find_buffer API to get a vb2_buffer
given a buffer timestamp.

Cc: Tiffany Lin <tiffany.lin@mediatek.com>
Cc: Andrew-CT Chen <andrew-ct.chen@mediatek.com>
Cc: Yunfei Dong <yunfei.dong@mediatek.com>
Signed-off-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Acked-by: Tomasz Figa <tfiga@chromium.org>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: videobuf2: Introduce vb2_find_buffer()
Ezequiel Garcia [Mon, 11 Jul 2022 21:11:34 +0000 (22:11 +0100)] 
media: videobuf2: Introduce vb2_find_buffer()

All users of vb2_find_timestamp() combine it with vb2_get_buffer()
to retrieve a videobuf2 buffer, given a u64 timestamp.

Introduce an API for this use-case. Users will be converted to the new
API as follow-up commits.

Signed-off-by: Ezequiel Garcia <ezequiel@collabora.com>
Acked-by: Tomasz Figa <tfiga@chromium.org>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: cedrus: h265: Implement support for tiles
Jernej Skrabec [Mon, 20 Jun 2022 17:55:17 +0000 (18:55 +0100)] 
media: cedrus: h265: Implement support for tiles

Tiles are last remaining unimplemented functionality for HEVC. Implement
it.

[hverkuil: fix checkpatch warning, split long line in two]

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: cedrus: Add helper for determining number of elements
Jernej Skrabec [Mon, 20 Jun 2022 17:55:16 +0000 (18:55 +0100)] 
media: cedrus: Add helper for determining number of elements

Now that controls can be dynamic arrays, we need to know how many
elements are in such array. Add a helper for that.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: cedrus: h265: Add a couple of error checks
Jernej Skrabec [Mon, 20 Jun 2022 17:55:15 +0000 (18:55 +0100)] 
media: cedrus: h265: Add a couple of error checks

Now that we have infrastructure for reporting errors, let's add two
checks, which will make sure slice can be actually decoded.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: cedrus: Add error handling for failed setup
Jernej Skrabec [Mon, 20 Jun 2022 17:55:14 +0000 (18:55 +0100)] 
media: cedrus: Add error handling for failed setup

During decoding setup stage for complex codecs like HEVC driver can
detect inconsistent values in controls or some other task, like
allocating memory, can fail.

Currently setup stage has no way of signalling error. Change return type
of setup callback to int and if returned value is not zero, skip
decoding and finish job immediately with error flag.

While currently there is only one place when setup can fail, it's
expected that there will be more such cases in the future, when HEVC
decoding is improved.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: cedrus: Improve error messages for controls
Jernej Skrabec [Mon, 20 Jun 2022 17:55:13 +0000 (18:55 +0100)] 
media: cedrus: Improve error messages for controls

Currently error messages when control creation fails are very sparse.
Granted, user should never observe them. However, developer working on
codecs can. In such cases additional information like which control
creation failed and error number are very useful.

Expand error messages with additional info.

Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: cedrus: h265: Fix logic for not low delay flag
Jernej Skrabec [Mon, 20 Jun 2022 17:55:12 +0000 (18:55 +0100)] 
media: cedrus: h265: Fix logic for not low delay flag

Now that we know real purpose of "not low delay" flag, logic for
applying this flag should be fixed too. According to vendor and
reference implementation, low delay is signaled when POC of current
frame is lower than POC of at least one reference of a slice.

Implement mentioned logic and invert it to conform to flag meaning. Also
don't apply flag for I frames. They don't have any reference.

This fixes decoding of 3 reference bitstreams.

Fixes: 86caab29da78 ("media: cedrus: Add HEVC/H.265 decoding support")
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: cedrus: h265: Fix flag name
Jernej Skrabec [Mon, 20 Jun 2022 17:55:11 +0000 (18:55 +0100)] 
media: cedrus: h265: Fix flag name

Bit 21 in register 0x24 (slice header info 1) actually represents
negated version of low delay flag. This can be seen in vendor Cedar
library source code. While this flag is not part of the standard, it can
be found in reference HEVC implementation.

Fix macro name and change it to flag.

Fixes: 86caab29da78 ("media: cedrus: Add HEVC/H.265 decoding support")
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: hantro: sunxi: Enable 10-bit decoding
Jernej Skrabec [Wed, 6 Jul 2022 18:29:01 +0000 (19:29 +0100)] 
media: hantro: sunxi: Enable 10-bit decoding

Now that infrastructure for 10-bit decoding exists, enable it for
Allwinner H6.

Tested-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: hantro: Store VP9 bit depth in context
Jernej Skrabec [Wed, 6 Jul 2022 18:29:00 +0000 (19:29 +0100)] 
media: hantro: Store VP9 bit depth in context

Now that we have proper infrastructure for postprocessing 10-bit
formats, store VP9 bit depth in context.

Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Tested-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: hantro: postproc: Properly calculate chroma offset
Jernej Skrabec [Wed, 6 Jul 2022 18:28:59 +0000 (19:28 +0100)] 
media: hantro: postproc: Properly calculate chroma offset

Currently chroma offset calculation assumes only 1 byte per luma, with
no consideration for stride.

Take necessary information from destination pixel format which makes
calculation completely universal.

Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Tested-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: hantro: postproc: Fix legacy regs configuration
Jernej Skrabec [Wed, 6 Jul 2022 18:28:58 +0000 (19:28 +0100)] 
media: hantro: postproc: Fix legacy regs configuration

Some postproc legacy registers were set in VP9 code. Move them to
postproc and fix their value.

Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Tested-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: hantro: postproc: Fix buffer size calculation
Jernej Skrabec [Wed, 6 Jul 2022 18:28:57 +0000 (19:28 +0100)] 
media: hantro: postproc: Fix buffer size calculation

When allocating aux buffers for postprocessing, it's assumed that base
buffer size is the same as that of output. Coincidentally, that's true
most of the time, but not always. 10-bit source also needs aux buffer
size which is appropriate for 10-bit native format, even if the output
format is 8-bit. Similarly, mv sizes and other extra buffer size also
depends on source width/height, not destination.

Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Tested-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
3 years agomedia: hantro: Support format filtering by depth
Jernej Skrabec [Wed, 6 Jul 2022 18:28:56 +0000 (19:28 +0100)] 
media: hantro: Support format filtering by depth

In preparation for supporting 10-bit formats, add mechanism which will
filter formats based on pixel depth.

Hantro G2 supports only one decoding format natively and that is based
on bit depth of current video frame. Additionally, it makes no sense to
upconvert bitness, so filter those out too.

Reviewed-by: Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
Tested-by: Benjamin Gaignard <benjamin.gaignard@collabora.com>
Signed-off-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>