platform/kernel/linux-rpi.git
2 years agomedia: i2c: ov5647: Parse and register properties
Laurent Pinchart [Fri, 3 Jul 2020 22:45:08 +0000 (01:45 +0300)]
media: i2c: ov5647: Parse and register properties

Parse device properties and register controls for them using the V4L2
fwnode properties helpers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2 years agomedia: ov5647: Fix return codes from ov5647_write/ov5647_read functions.
David Plowman [Wed, 15 Jan 2020 13:40:38 +0000 (13:40 +0000)]
media: ov5647: Fix return codes from ov5647_write/ov5647_read functions.

Previously they were returning positive non-zero codes for success,
which were getting passed up the call stack. Since release 4.19,
do_dentry_open (fs/open.c) has been catching these and flagging an
error. (So this driver has been broken since that date.)

Fixes: 3c2472a [media] media: i2c: Add support for OV5647 sensor
Signed-off-by: David Plowman <david.plowman@raspberrypi.org>
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2 years agoAdded hflip and vflip controls to ov9281
Mathias Anhalt [Wed, 3 Feb 2021 19:34:09 +0000 (20:34 +0100)]
Added hflip and vflip controls to ov9281

Signed-off-by: Mathias Anhalt <mathiasanhalt@web.de>
2 years agoFixed picture line bug in all ov9281 modes
Mathias Anhalt [Sun, 24 Jan 2021 14:15:01 +0000 (15:15 +0100)]
Fixed picture line bug in all ov9281 modes

Signed-off-by: Mathias Anhalt <mathiasanhalt@web.de>
2 years agomedia: ov9281: Add 1280x720 and 640x480 modes
Dave Stevenson [Sun, 22 Nov 2020 11:01:08 +0000 (11:01 +0000)]
media: ov9281: Add 1280x720 and 640x480 modes

Breaks out common register set and adds the different registers
for 1280x720 (cropped) and 640x480 (skipped) modes

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agomedia: i2c: ov9281: Add support for 8 bit readout
Dave Stevenson [Tue, 7 Jul 2020 17:29:10 +0000 (18:29 +0100)]
media: i2c: ov9281: Add support for 8 bit readout

The sensor supports 8 bit mode as well as 10bit, so add the
relevant code to allow selection of this.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agomedia: i2c: ov9281: Read chip ID via 2 reads
Dave Stevenson [Mon, 6 Jul 2020 16:51:32 +0000 (17:51 +0100)]
media: i2c: ov9281: Read chip ID via 2 reads

Vision Components have made an OV9281 module which blocks reading
back the majority of registers to comply with NDAs, and in doing
so doesn't allow auto-increment register reading as used when
reading the chip ID.

Use two reads and manually combine the results.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agomedia: i2c: ov9281: Fixup for recent kernel releases, and remove custom code
Dave Stevenson [Tue, 14 Apr 2020 15:12:33 +0000 (16:12 +0100)]
media: i2c: ov9281: Fixup for recent kernel releases, and remove custom code

The Rockchip driver was based on a 4.4 kernel, and had several custom
Rockchip parts.

Update to 5.4 kernel APIs, with the relevant controls required by
libcamera, and remove custom Rockchip parts.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agomedia: i2c: ov9281: add enum_frame_interval function for iq tool 2.2 and hal3
Dave Stevenson [Tue, 14 Apr 2020 14:51:50 +0000 (15:51 +0100)]
media: i2c: ov9281: add enum_frame_interval function for iq tool 2.2 and hal3

Adds the ov9281 parts of the Rockchip patch adding enum_frame_interval to
a large number of drivers.

Change-Id: I03344cd6cf278dd7c18fce8e97479089ef185a5c
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
2 years agomedia: i2c: ov9281: fix mclk issue when probe multiple camera.
Dave Stevenson [Tue, 14 Apr 2020 14:47:09 +0000 (15:47 +0100)]
media: i2c: ov9281: fix mclk issue when probe multiple camera.

Takes the ov9281 part only from the Rockchip's patch.

Change-Id: I30e833baf2c1bb07d6d87ddb3b00759ab45a90e4
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
2 years agomedia: i2c: add ov9281 driver.
Zefa Chen [Fri, 17 May 2019 10:23:03 +0000 (18:23 +0800)]
media: i2c: add ov9281 driver.

Change-Id: I7b77250bbc56d2f861450cf77271ad15f9b88ab1
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
2 years agohack: fixup bcm2835-unicam
Dom Cobley [Wed, 17 Mar 2021 12:45:53 +0000 (12:45 +0000)]
hack: fixup bcm2835-unicam

2 years agostaging/bcm2835-codec: Add VC-1 support.
Dave Stevenson [Wed, 10 Mar 2021 19:07:48 +0000 (19:07 +0000)]
staging/bcm2835-codec: Add VC-1 support.

Providing the relevant licence has been purchased, then Pi0-3
can decode VC-1.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agostaging/bcm2835-codec: Implement additional g_selection calls for decode
Dave Stevenson [Tue, 2 Feb 2021 16:46:39 +0000 (16:46 +0000)]
staging/bcm2835-codec: Implement additional g_selection calls for decode

v4l_cropcap calls our vidioc_g_pixelaspect function to get the pixel
aspect ratio, but also calls g_selection for V4L2_SEL_TGT_CROP_BOUNDS
and V4L2_SEL_TGT_CROP_DEFAULT. Whilst it allows for vidioc_g_pixelaspect
not to be implemented, it doesn't allow for either of the other two.

Add in support for the additional selection targets.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agostaging/bcm2835-codec: Add support for pixel aspect ratio
Dave Stevenson [Tue, 2 Feb 2021 15:50:18 +0000 (15:50 +0000)]
staging/bcm2835-codec: Add support for pixel aspect ratio

If the format is detected by the driver and a V4L2_EVENT_SOURCE_CHANGE
event is generated, then pass on the pixel aspect ratio as well.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agostaging/bcm2835-codec: Correct logging of size_t to %zu
Dave Stevenson [Mon, 1 Feb 2021 18:55:37 +0000 (18:55 +0000)]
staging/bcm2835-codec: Correct logging of size_t to %zu

Fixes: "staging/bcm2835-codec: Log the number of excess supported formats"
Which used %u for printing a size_t, and 64bit builds then log a warning.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agomedia/v4l2_m2m: In buffered mode run jobs if either port is streaming
Dave Stevenson [Mon, 1 Feb 2021 18:48:47 +0000 (18:48 +0000)]
media/v4l2_m2m: In buffered mode run jobs if either port is streaming

In order to get the intended behaviour of the stateful video
decoder API where only the OUTPUT queue needs to be enabled and fed
buffers in order to get the SOURCE_CHANGED event that configures the
CAPTURE queue, we want the device to run should either queue be
streaming.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agoAssign crypto aliases to different AES implementation modules
Ben Avison [Mon, 8 Mar 2021 15:32:25 +0000 (15:32 +0000)]
Assign crypto aliases to different AES implementation modules

The kernel modules aes-neon-blk and aes-neon-bs perform poorly, at least on
Cortex-A72 without crypto extensions. In fact, aes-arm64 outperforms them
on benchmarks, despite it being a simpler implementation (only accelerating
the single-block AES cipher).

For modes of operation where multiple cipher blocks can be processed in
parallel, aes-neon-bs outperforms aes-neon-blk by around 60-70% and aes-arm64
is another 10-20% faster still. But the difference is even more marked with
modes of operation with dependencies between neighbouring blocks, such as
CBC encryption, which defeat parallelism: in these cases, aes-arm64 is
typically around 250% faster than either aes-neon-blk or aes-neon-bs.

The key trade-off with aes-arm64 is that the look-up tables are situated in
RAM. This leaves them potentially open to cache timing attacks. The two other
modules, by contrast, load the look-up tables into NEON registers and so are
able to perform in constant time.

This patch aims to load aes-arm64 more often.

If none of the currently-loaded crypto modules implement a given algorithm,
a new one is typically selected for loading using a platform-neutral alias
describing the required algorithm. To enable users to still
load aes-neon-blk or aes-neon-bs if they really want them, while still
ensuring that aes-arm64 is usually selected, remove the aliases from
aes-neonbs-glue.c and aes-glue.c and apply them to aes-cipher-glue.c, but
still build the two NEON modules.

Since aes-glue.c can also be used to build aes-ce-blk, leave them enabled
if USE_V8_CRYPTO_EXTENSIONS is defined, to ensure they are selected if we
in future use a CPU which has the crypto extensions enabled.

Note that the algorithm priority specifiers are unchanged, so if
aes-neon-bs is loaded at the same time as aes-arm64, the former will be
used in preference. However, aes-neon-blk and aes-arm64 have tied priority,
so whichever module was loaded first will be used (assuming aes-neon-bs is
not loaded).

Signed-off-by: Ben Avison <bavison@riscosopen.org>
2 years agomedia: bcm2835-unicam: Fix bug in buffer swapping logic
Naushir Patuck [Fri, 5 Mar 2021 15:40:45 +0000 (15:40 +0000)]
media: bcm2835-unicam: Fix bug in buffer swapping logic

If multiple sets of interrupts occur simultaneously, it may be unsafe
to swap buffers, as the hardware may already be re-using the current
buffers. In such cases, avoid swapping buffers, and wait for the next
opportunity at the Frame End interrupt to signal completion.

Additionally, check the packet compare status when watching for frame
end for buffers swaps, as this could also signify a frame end event.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2 years agomedia: i2c: imx477: Remove unused function parameter
Naushir Patuck [Fri, 19 Feb 2021 11:06:40 +0000 (11:06 +0000)]
media: i2c: imx477: Remove unused function parameter

The struct imx477 *ctrl parameter is not used in the function
imx477_adjust_exposure_range(), so remove it.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2 years agomedia: i2c: imx477: Remove internal v4l2_mbus_framefmt from the state
Naushir Patuck [Fri, 19 Feb 2021 10:30:49 +0000 (10:30 +0000)]
media: i2c: imx477: Remove internal v4l2_mbus_framefmt from the state

The only field in this struct that is used is the format code, so
replace the struct with this single field.

Save the format code in imx477_set_pad_format() when setting up a new
mode so that imx477_get_pad_format() performs the right lookup.
Otherwise, this caused a bug where the mode lookup occurred on the
12-bit table rather than the 10-bit table.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2 years agomedia: i2c: imx477: Replace existing 1012x760 mode
Naushir Patuck [Thu, 18 Feb 2021 15:23:11 +0000 (15:23 +0000)]
media: i2c: imx477: Replace existing 1012x760 mode

The existing 1012x760 120 fps mode has significant IQ problem using
the internal sensor scaler. Replace this mode with a 1332x990 120 fps
mode instead. This new mode has a smaller field of view, but does not
suffer from the bad IQ of the original mode.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2 years agomedia: i2c: imx477: Fix crop height for 2028x1080 mode
Naushir Patuck [Thu, 18 Feb 2021 15:05:57 +0000 (15:05 +0000)]
media: i2c: imx477: Fix crop height for 2028x1080 mode

The crop height for this mode was set at 2600 lines, it should be 2160
lines instead.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2 years agomedia: i2c: imx290: Handle exposure correctly when vblank changes
David Plowman [Thu, 18 Feb 2021 11:58:29 +0000 (11:58 +0000)]
media: i2c: imx290: Handle exposure correctly when vblank changes

When vblank changes we must modify the exposure range. Also, with this
sensor, the effective exposure time implicitly changes when vblank
does, so we have to reset it after every vblank update.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
2 years agomedia: i2c: imx290: Fix up exposure calcuations and ranges
David Plowman [Wed, 17 Feb 2021 18:08:12 +0000 (18:08 +0000)]
media: i2c: imx290: Fix up exposure calcuations and ranges

Should now correspond exactly to the datasheet.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
2 years agomedia: i2c: imx477: Add very long exposure control to the driver
Naushir Patuck [Wed, 10 Feb 2021 10:50:32 +0000 (10:50 +0000)]
media: i2c: imx477: Add very long exposure control to the driver

Add support for very long exposures by using the exposure multiplier
register. Userland does not need to pass any additional controls to
enable long exposures, it simply requests a larger vblank to extend the
exposure control range appropriately.

Currently, since hblank is fixed, a maximum of approximately 124 seconds
of exposure time can be used. In a future change, hblank could also be
controlled in userland to give over 200 seconds of exposure time.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2 years agomedia: i2c: imx477: Remove auto frame length adjusting
Naushir Patuck [Wed, 10 Feb 2021 10:18:53 +0000 (10:18 +0000)]
media: i2c: imx477: Remove auto frame length adjusting

The V4L2_CID_EXPOSURE_AUTO_PRIORITY was used to let the sensor control
frame length (effectively framerate) based on the requested exposure
time requested. Remove this feature as it is never used, and goes
against how V4L2 likes to handle exposure and vblank controls.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2 years agostaging: rpivid: Fix crash when CMA alloc fails
John Cox [Mon, 8 Feb 2021 16:01:37 +0000 (16:01 +0000)]
staging: rpivid: Fix crash when CMA alloc fails

If realloc to increase coeff size fails then attempt to re-allocate
the original size.  If that also fails then flag a fatal error to abort
all further decode.

Signed-off-by: John Cox <jc@kynesim.co.uk>
2 years agobcm2835-isp: Allow formats with different colour spaces.
David Plowman [Tue, 12 Jan 2021 13:55:39 +0000 (13:55 +0000)]
bcm2835-isp: Allow formats with different colour spaces.

Each supported format now includes a mask showing the allowed colour
spaces, as well as a default colour space for when one was not
specified.

Additionally we translate the colour space to mmal format and pass it
over to the VideoCore.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
2 years agostaging:bcm2835-camera: Fix the cherry-pick of AWB Greyworld
Dave Stevenson [Mon, 8 Feb 2021 11:48:35 +0000 (11:48 +0000)]
staging:bcm2835-camera: Fix the cherry-pick of AWB Greyworld

The cherry-pick of the patch that added the greyworld AWB mode
was incomplete. Fix it up.

Fixes: b3ef481fe243 "staging: bcm2835-camera: Add greyworld AWB mode"
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agodt-binding: display: bcm2711-hdmi: Add CEC and hotplug interrupts
Maxime Ripard [Mon, 11 Jan 2021 14:23:07 +0000 (15:23 +0100)]
dt-binding: display: bcm2711-hdmi: Add CEC and hotplug interrupts

The CEC and hotplug interrupts were missing when that binding was
introduced, let's add them in now that we've figured out how it works.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Acked-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agomedia: i2c: imx290: Fix number of controls in v4l2_ctrl_handler_init
David Plowman [Thu, 4 Feb 2021 21:21:44 +0000 (21:21 +0000)]
media: i2c: imx290: Fix number of controls in v4l2_ctrl_handler_init

The number is only a hint, but may as well be correct.

Fixes: 471e0029e98aa ("media: i2c: imx290: Convert HMAX setting into V4L2_CID_HBLANK")
Fixes: be0b9b7ad1c27 ("media: i2c: imx290: Add support for V4L2_CID_VBLANK")
Fixes: 8483f0d7599aa ("media: i2c: imx290: Add exposure control to the driver.")
Fixes: 9764f3459c401 ("media: i2c: imx290: Add H and V flip controls")
Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
2 years agomedia: i2c: imx290: Replace V4L2_CID_GAIN with V4L2_CID_ANALOGUE_GAIN
David Plowman [Thu, 4 Feb 2021 17:29:32 +0000 (17:29 +0000)]
media: i2c: imx290: Replace V4L2_CID_GAIN with V4L2_CID_ANALOGUE_GAIN

Most software (including libcamera) requires V4L2_CID_ANALOGUE_GAIN,
not V4L2_CID_GAIN.

The range for the control is 0 to 100 for which the sensor uses only
analogue gain; higher values would involve digital gain which this
control should not apply.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
2 years agokbuild: Silence unavoidable dtc overlay warnings
Phil Elwell [Fri, 29 Jan 2021 10:34:11 +0000 (10:34 +0000)]
kbuild: Silence unavoidable dtc overlay warnings

Much effort has been put into finding ways to avoid warnings from dtc
about overlays, usually to do with the presence of #address-cells and
size-cells, but not exclusively so. Since the issues being warned about
are harmless, suppress the warnings to declutter the build output and
to avoid alarming users.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2 years agospi: bcm2835: Workaround/fix for zero-length transfers
Phil Elwell [Thu, 28 Jan 2021 11:30:04 +0000 (11:30 +0000)]
spi: bcm2835: Workaround/fix for zero-length transfers

A relatively recent commit ([1]) contained optimisation for the PIO
SPI FIFO-filling functions. The commit message includes the phrase
"[t]he blind and counted loops are always called with nonzero count".
This is technically true, but it is still possible for count to become
zero before the loop is entered - if tfr->len is zero. Moving the loop
exit condition to the end of the loop saves a few cycles, but results
in a near-infinite loop should the revised count be zero on entry.

Strangely, zero-lengthed transfers aren't filtered by the SPI framework
and, even more strangely, the Python3 spidev library is triggering them
for no obvious reason.

Avoid the problem completely by bailing out of the main transfer
function early if trf->len is zero, although there may be a case for
moving the mitigation into the framework.

See: https://github.com/raspberrypi/linux/issues/4100

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
[1] 26751de25d25 ("spi: bcm2835: Micro-optimise FIFO loops")

2 years agostaging: vc04_services: ISP: Add colour denoise control
Naushir Patuck [Thu, 14 Jan 2021 09:20:52 +0000 (09:20 +0000)]
staging: vc04_services: ISP: Add colour denoise control

Add colour denoise control to the bcm2835 driver through a new v4l2
control: V4L2_CID_USER_BCM2835_ISP_CDN.

Add the accompanying MMAL configuration structure definitions as well.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2 years agouapi: bcm2835-isp: Add colour denoise configuration
Naushir Patuck [Thu, 14 Jan 2021 09:18:42 +0000 (09:18 +0000)]
uapi: bcm2835-isp: Add colour denoise configuration

Add a configuration structure for colour denoise to the bcm2835_isp
driver.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2 years agobcm2835-dma: Add bcm2835-dma: Add DMA_WIDE_SOURCE and DMA_WIDE_DEST flags
Dom Cobley [Wed, 30 Dec 2020 14:51:29 +0000 (14:51 +0000)]
bcm2835-dma: Add bcm2835-dma: Add DMA_WIDE_SOURCE and DMA_WIDE_DEST flags

Use (reserved) bits 24 and 25 of the dreq value
(the second cell of the DT DMA descriptor) to request
that wide source reads or wide dest writes are required

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
2 years agoarch/arm: Add __memset alias to memset_rpi.S
Phil Elwell [Fri, 8 Jan 2021 13:37:25 +0000 (13:37 +0000)]
arch/arm: Add __memset alias to memset_rpi.S

memset_rpi.S is an optimised memset implementation, but doesn't define
__memset (which was just added to memset.S). As a result, building
for the BCM2835 platform causes a link failure.

Add __memset as yet another alias to our common implementation.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2 years agobcm2835-dma: Avoid losing CS flags after interrupt
Dom Cobley [Wed, 6 Jan 2021 18:16:10 +0000 (18:16 +0000)]
bcm2835-dma: Avoid losing CS flags after interrupt

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
2 years agostaging/bcm2835-isp: Log the number of excess supported formats
Dave Stevenson [Thu, 7 Jan 2021 11:43:22 +0000 (11:43 +0000)]
staging/bcm2835-isp: Log the number of excess supported formats

When logging that the firmware has provided more supported formats
than we had allocated storage for, log the number allocated and
returned.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agostaging/bcm2835-isp: Add the unpacked (16bpp) raw formats
Dave Stevenson [Thu, 7 Jan 2021 11:37:10 +0000 (11:37 +0000)]
staging/bcm2835-isp: Add the unpacked (16bpp) raw formats

Now that the firmware supports the unpacked (16bpp) variants
of the MIPI raw formats, add the mappings.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agostaging/bcm2835-codec: Log the number of excess supported formats
Dave Stevenson [Thu, 7 Jan 2021 11:41:26 +0000 (11:41 +0000)]
staging/bcm2835-codec: Log the number of excess supported formats

When logging that the firmware has provided more supported formats
than we had allocated storage for, log the number allocated and
returned.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agostaging/bcm2835-codec: Add the unpacked (16bpp) raw formats
Dave Stevenson [Thu, 7 Jan 2021 10:45:16 +0000 (10:45 +0000)]
staging/bcm2835-codec: Add the unpacked (16bpp) raw formats

Now that the firmware supports the unpacked (16bpp) variants
of the MIPI raw formats, add the mappings.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agostaging/vc04_services: Add additional unpacked raw formats
Dave Stevenson [Thu, 7 Jan 2021 10:43:20 +0000 (10:43 +0000)]
staging/vc04_services: Add additional unpacked raw formats

Support has been added for the unpacked (16bpp) versions of
the MIPI raw 10, 12, and 14 formats, so add the 4CCs for them.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agovc-sm-cma: fixed kbuild problem
gesangtome [Fri, 1 Jan 2021 10:03:17 +0000 (18:03 +0800)]
vc-sm-cma: fixed kbuild problem

error logs:
  drivers/staging/vc04_services/vc-sm-cma/Kconfig:1:error: recursive dependency detected!
  drivers/staging/vc04_services/vc-sm-cma/Kconfig:1:      symbol BCM_VC_SM_CMA is selected by BCM2835_VCHIQ_MMAL
  drivers/staging/vc04_services/vchiq-mmal/Kconfig:1:     symbol BCM2835_VCHIQ_MMAL depends on BCM2835_VCHIQ
  drivers/staging/vc04_services/Kconfig:14:       symbol BCM2835_VCHIQ is selected by BCM_VC_SM_CMA
  For a resolution refer to Documentation/kbuild/kconfig-language.rst
  subsection "Kconfig recursive dependency limitations"

Tested-by: make ARCH=arm64 bcm2711_defconfig
Test platform: fedora 33
Branch: rpi-5.10.y

2 years agomedia: i2c: imx477: Selection compliance fixes
Naushir Patuck [Wed, 9 Dec 2020 11:30:12 +0000 (11:30 +0000)]
media: i2c: imx477: Selection compliance fixes

To comply with the intended usage of the V4L2 selection target when
used to retrieve a sensor image properties, adjust the rectangles
returned by the imx477 driver.

The top/left crop coordinates of the TGT_CROP rectangle were set to
(0, 0) instead of (8, 16) which is the offset from the larger physical
pixel array rectangle. This was also a mismatch with the default values
crop rectangle value, so this is corrected. Found with v4l2-compliance.

While at it, add V4L2_SEL_TGT_CROP_BOUNDS support: CROP_DEFAULT and
CROP_BOUNDS have the same size as the non-active pixels are not readable
using the selection API. Found with v4l2-compliance.

This commit mirrors 543790f777ba1b3264c168c653db6d415e7c983f done for
the imx219 sensor.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2 years agonet: lan78xx: Ack pending PHY ints when resetting
Phil Elwell [Tue, 15 Dec 2020 16:38:37 +0000 (16:38 +0000)]
net: lan78xx: Ack pending PHY ints when resetting

lan78xx_link_reset explicitly clears the MAC's view of the PHY's IRQ
status. In doing so it potentially leaves the PHY with a pending
interrupt that will never be acknowledged, at which point no further
interrupts will be generated.

Avoid the problem by acknowledging any pending PHY interrupt after
clearing the MAC's status bit.

See: https://github.com/raspberrypi/linux/issues/2937

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2 years agoPCI: brcmstb: Advertise MSI-X support
Phil Elwell [Thu, 3 Dec 2020 13:44:42 +0000 (13:44 +0000)]
PCI: brcmstb: Advertise MSI-X support

Although the BRCMSTB PCIe interface doesn't technically support the
MSI-X spec, in practise it seems to work provided no more than 32
MSI-Xs are required. Add the required flag to the driver to allow
experimentation with devices that demand MSI-X support.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2 years agomedia: bcm2835-unicam: Clear clock state when stopping streaming
Naushir Patuck [Wed, 2 Dec 2020 16:48:41 +0000 (16:48 +0000)]
media: bcm2835-unicam: Clear clock state when stopping streaming

Commit 65e08c465020d4c5b51afb452efc2246d80fd66f failed to clear the
clock state when the device stopped streaming. Fix this, as it might
again cause the same problems when doing an unprepare.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2 years agomedia: bcm2835-unicam: Return early from stop_streaming() if stopped
Naushir Patuck [Wed, 2 Dec 2020 15:26:09 +0000 (15:26 +0000)]
media: bcm2835-unicam: Return early from stop_streaming() if stopped

clk_disable_unprepare() is called unconditionally in stop_streaming().
This is incorrect in the cases where start_streaming() fails, and
unprepares all clocks as part of the failure cleanup. To avoid this,
ensure that clk_disable_unprepare() is only called in stop_streaming()
if the clocks are in a prepared state.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2 years agomedia: bcm2835-unicam: Correctly handle error propagation for stream on
Naushir Patuck [Wed, 2 Dec 2020 15:22:23 +0000 (15:22 +0000)]
media: bcm2835-unicam: Correctly handle error propagation for stream on

On a failure in start_streaming(), the error code would not propagate to
the calling function on all conditions. This would cause the userland
caller to not know of the failure.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2 years agodt-bindings: Add compatible for BCM2711 DSI1
Dave Stevenson [Thu, 12 Nov 2020 17:01:52 +0000 (17:01 +0000)]
dt-bindings: Add compatible for BCM2711 DSI1

DSI1 on BCM2711 doesn't require the DMA workaround that is used
on BCM2835/6/7, therefore it needs a new compatible string.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agodrm/panel/raspberrypi-ts: Insert delay before polling for startup state
Dave Stevenson [Tue, 10 Nov 2020 11:21:56 +0000 (11:21 +0000)]
drm/panel/raspberrypi-ts: Insert delay before polling for startup state

In switching to the hardware I2C controller there is an issue
where we seem to not get back the correct state from the Pi
touchscreen.
Insert a delay before polling to avoid this condition.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agodrm/panel/raspberrypi-touchscreen: Use independent I2C actions with delay.
Dave Stevenson [Thu, 23 Apr 2020 09:17:18 +0000 (10:17 +0100)]
drm/panel/raspberrypi-touchscreen: Use independent I2C actions with delay.

We now have the hardware I2C controller pinmuxed to the drive the
display I2C, but this controller does not support clock stretching.
The Atmel micro-controller in the panel requires clock stretching
to allow it to prepare any data to be read.

Split the rpi_touchscreen_i2c_read into two independent transactions with
a delay between them for the Atmel to prepare the data.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agoInput: edt-ft5x06: Poll the device if no interrupt is configured.
Dave Stevenson [Fri, 6 Nov 2020 18:45:10 +0000 (18:45 +0000)]
Input: edt-ft5x06: Poll the device if no interrupt is configured.

Not all systems have the interrupt line wired up, so switch to
polling the touchscreen off a timer if no interrupt line is
configured.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agoPCI: brcmstb: Restore initial fundamental reset
Phil Elwell [Wed, 11 Nov 2020 17:08:33 +0000 (17:08 +0000)]
PCI: brcmstb: Restore initial fundamental reset

[1] replaced a single reset function with a pointer to one of two
implementations, but also removed the call asserting the reset
at the start of brcm_pcie_setup. Doing so breaks Raspberry Pis with
VL805 XHCI controllers lacking dedicated SPI EEPROMs, which have been
used for USB booting but then need to be reset so that the kernel
can reconfigure them. The lack of a reset causes the firmware's loading
of the EEPROM image to RAM to fail, breaking USB for the kernel.

See: https://www.raspberrypi.org/forums/viewtopic.php?p=1758157#p1758157

Fixes: 04356ac30771 ("PCI: brcmstb: Add bcm7278 PERST# support")

[1] 04356ac30771 ("PCI: brcmstb: Add bcm7278 PERST# support")

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2 years agophy: broadcom: Add bcm54213pe configuration
Phil Elwell [Thu, 29 Oct 2020 14:10:56 +0000 (14:10 +0000)]
phy: broadcom: Add bcm54213pe configuration

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2 years agophy: broadcom: split out the BCM54213PE from the BCM54210E IDs
Jonathan Bell [Tue, 14 May 2019 16:00:41 +0000 (17:00 +0100)]
phy: broadcom: split out the BCM54213PE from the BCM54210E IDs

The last nibble is a revision ID, and the 54213pe is a later rev
than the 54210e. Running the 54210e setup code on a 54213pe results
in a broken RGMII interface.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
2 years agofirmware: raspberrypi: Add support for tryonce reboot flag
Tim Gover [Tue, 20 Oct 2020 10:55:37 +0000 (11:55 +0100)]
firmware: raspberrypi: Add support for tryonce reboot flag

Define a new mailbox (SET_REBOOT_FLAGS) which may be used to
pass optional flags to the Raspberry Pi firmware that changes
the behaviour of the bootloader and firmware during a reboot.

Currently this just defines the 'tryboot' flag which causes
the firmware to load tryboot.txt instead config.txt. This
alternate configuration file can be used to specify the
path of an alternate firmware and kernels allowing a fallback
mechanism to be implemented for OS upgrades.

2 years agowatchdog: bcm2835: Ignore params after the partition number
Tim Gover [Thu, 22 Oct 2020 14:30:55 +0000 (15:30 +0100)]
watchdog: bcm2835: Ignore params after the partition number

Use sscanf to extract the partition number and ignore extra parameters
which are only relevant to other reboot notifiers.

2 years agobcm2708_fb: Fix a build warning
Phil Elwell [Tue, 27 Oct 2020 12:12:22 +0000 (12:12 +0000)]
bcm2708_fb: Fix a build warning

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2 years agorpivid_h625: Fix build warnings
Phil Elwell [Tue, 27 Oct 2020 12:10:40 +0000 (12:10 +0000)]
rpivid_h625: Fix build warnings

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2 years agodwc_otg: Minimise header and fix build warnings
Phil Elwell [Tue, 27 Oct 2020 09:59:49 +0000 (09:59 +0000)]
dwc_otg: Minimise header and fix build warnings

Delete a large amount of unused declaration from "usb.h", some of which
were causing build warnings, and get the module building cleanly.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2 years agorpisense-fb: Set pseudo_pallete to prevent crash on fbcon takeover
Serge Schneider [Mon, 26 Oct 2020 16:38:21 +0000 (16:38 +0000)]
rpisense-fb: Set pseudo_pallete to prevent crash on fbcon takeover

Signed-off-by: Serge Schneider <serge@raspberrypi.com>
2 years agostaging: bcm2835-audio: Add disable-headphones flag
Phil Elwell [Mon, 26 Oct 2020 10:23:22 +0000 (10:23 +0000)]
staging: bcm2835-audio: Add disable-headphones flag

Add a property to allow the headphone output to be disabled. Use an
integer property rather than a boolean so that an overlay can clear it.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2 years agogpio: Add gpio-fsm driver
Phil Elwell [Wed, 30 Sep 2020 11:00:54 +0000 (12:00 +0100)]
gpio: Add gpio-fsm driver

The gpio-fsm driver implements simple state machines that allow GPIOs
to be controlled in response to inputs from other GPIOs - real and
soft/virtual - and time delays. It can:
+ create dummy GPIOs for drivers that demand them,
+ drive multiple GPIOs from a single input, with optional delays,
+ add a debounce circuit to an input,
+ drive pattern sequences onto LEDs
etc.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
gpio-fsm: Fix a build warning

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
gpio-fsm: Rename 'num-soft-gpios' to avoid warning

As of 5.10, the Device Tree parser warns about properties that look
like references to "suppliers" of various services. "num-soft-gpios"
resembles a declaration of a GPIO called "num-soft", causing the value
to be interpreted as a phandle, the owner of which is checked for a
"#gpio-cells" property.

To avoid this warning, rename the gpio-fsm property to "num-swgpios".

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
gpio-fsm: Show state info in /sys/class/gpio-fsm

Add gpio-fsm sysfs entries under /sys/class/gpio-fsm. For each state
machine show the current state, which state (if any) will be entered
after a delay, and the current value of that delay.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
gpio-fsm: Fix shutdown timeout handling

The driver is intended to jump directly to a shutdown state in the
event of a timeout during shutdown, but the sense of the test was
inverted.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
gpio-fsm: Clamp the delay time to zero

The sysfs delay_ms value is calculated live, and it is possible for
the time left to appear to be negative briefly if the timer handling
hasn't completed. Ensure the displayed value never goes below zero,
for the sake of appearances.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2 years agostaging: vc04_services: ISP: Add a more complex ISP processing component
Naushir Patuck [Thu, 23 Apr 2020 09:17:37 +0000 (10:17 +0100)]
staging: vc04_services: ISP: Add a more complex ISP processing component

Driver for the BCM2835 ISP hardware block.  This driver uses the MMAL
component to program the ISP hardware through the VC firmware.

The ISP component can produce two video stream outputs, and Bayer
image statistics. This can't be encompassed in a simple V4L2
M2M device, so create a new device that registers 4 video nodes.

This patch squashes all the development patches from the earlier
rpi-5.4.y branch into one

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2 years agouapi: bcm2835-isp: Add bcm2835-isp uapi header file
Dave Stevenson [Mon, 12 Oct 2020 16:03:14 +0000 (17:03 +0100)]
uapi: bcm2835-isp: Add bcm2835-isp uapi header file

This file defines the userland interface to the bcm2835-isp driver
that will follow in a separate commit.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agobcm2835-dma: only reserve channel 0 if legacy dma driver is enabled
Matthias Reichl [Sat, 10 Oct 2020 22:48:55 +0000 (00:48 +0200)]
bcm2835-dma: only reserve channel 0 if legacy dma driver is enabled

If CONFIG_DMA_BCM2708 isn't enabled there's no need to mask out
one of the already scarce DMA channels.

Signed-off-by: Matthias Reichl <hias@horus.com>
2 years agostaging: vc04_services: Add a V4L2 M2M codec driver
Dave Stevenson [Thu, 8 Oct 2020 19:24:12 +0000 (20:24 +0100)]
staging: vc04_services: Add a V4L2 M2M codec driver

This adds a V4L2 memory to memory device that wraps the MMAL
video decode and video_encode components for H264 and MJPEG encode
and decode, MPEG4, H263, and VP8 decode (and MPEG2 decode
if the appropriate licence has been purchased).

This patch squashes all the work done in developing the driver
on the Raspberry Pi rpi-5.4.y kernel branch.
Thanks to Kieran Bingham, Aman Gupta, Chen-Yu Tsai, and
Marek BehĂșn for their contributions. Please refer to the
rpi-5.4.y branch for the full history.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
staging/bcm2835-codec: Ensure OUTPUT timestamps are always forwarded

The firmware by default tries to ensure that decoded frame
timestamps always increment. This is counter to the V4L2 API
which wants exactly the OUTPUT queue timestamps passed to the
CAPTURE queue buffers.

Disable the firmware option.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
staging/vc04_services/codec: Add support for CID MPEG_HEADER_MODE

Control V4L2_CID_MPEG_VIDEO_HEADER_MODE controls whether the encoder
is meant to emit the header bytes as a separate packet or with the
first encoded frame.
Add support for it.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
staging/vc04_services/codec: Clear last buf dequeued flag on START

It appears that the V4L2 M2M framework requires the driver to manually
call vb2_clear_last_buffer_dequeued on the CAPTURE queue during a
V4L2_DEC_CMD_START.
Add such a call.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
staging/vc04-services/codec: Fix logical precedence issue

Two issues identified with operator precedence in logical
expressions. Fix them.

https://github.com/raspberrypi/linux/issues/4040

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agostaging: mmal-vchiq: Use vc-sm-cma to support zero copy
Dave Stevenson [Tue, 25 Sep 2018 15:07:55 +0000 (16:07 +0100)]
staging: mmal-vchiq: Use vc-sm-cma to support zero copy

With the vc-sm-cma driver we can support zero copy of buffers between
the kernel and VPU. Add this support to mmal-vchiq.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agostaging: mmal-vchiq: Add monochrome image formats
Dave Stevenson [Wed, 6 May 2020 17:11:14 +0000 (18:11 +0100)]
staging: mmal-vchiq: Add monochrome image formats

Adds support for monochrome image formats in the various
MIPI packings.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agostaging: vchiq-mmal: Add support for 14bit Bayer
Dave Stevenson [Wed, 6 May 2020 17:09:04 +0000 (18:09 +0100)]
staging: vchiq-mmal: Add support for 14bit Bayer

Add in the missing defines.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agostaging: vc04_services: Add new vc-sm-cma driver
Dave Stevenson [Thu, 8 Oct 2020 17:49:52 +0000 (18:49 +0100)]
staging: vc04_services: Add new vc-sm-cma driver

Add Broadcom VideoCore Shared Memory support.

This new driver allows contiguous memory blocks to be imported
into the VideoCore VPU memory map, and manages the lifetime of
those objects, only releasing the source dmabuf once the VPU has
confirmed it has finished with it.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agostaging: bcm2835-camera: Replace deprecated V4L2_PIX_FMT_BGR32
Dave Stevenson [Thu, 8 Oct 2020 14:35:14 +0000 (15:35 +0100)]
staging: bcm2835-camera: Replace deprecated V4L2_PIX_FMT_BGR32

V4L2_PIX_FMT_BGR32 is deprecated as it is ambiguous over where
the alpha byte is. Cheese/GStreamer appear to get it wrong for
one, and qv4l2 gets red and blue swapped.

Swap to the newer V4L2_PIX_FMT_BGRX32 format.

https://www.raspberrypi.org/forums/viewtopic.php?f=38&t=267736&p=1738912

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agodwc_otg: initialise sched_frame for periodic QHs that were parked
Jonathan Bell [Wed, 7 Oct 2020 14:09:29 +0000 (15:09 +0100)]
dwc_otg: initialise sched_frame for periodic QHs that were parked

If a periodic QH has no remaining QTDs, then it is removed from all
periodic schedules. When re-adding, initialise the sched_frame and
start_split_frame from the current value of the frame counter.

See https://bugs.launchpad.net/raspbian/+bug/1819560
and
 https://github.com/raspberrypi/linux/issues/3883

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2 years agochar: Add broadcom char drivers back to build files
popcornmix [Mon, 28 Sep 2020 19:23:30 +0000 (20:23 +0100)]
char: Add broadcom char drivers back to build files

See: https://github.com/raspberrypi/linux/issues/3875
Signed-off-by: popcornmix <popcornmix@gmail.com>
2 years agonet: bcmgenet: Reset RBUF on first open
Phil Elwell [Fri, 25 Sep 2020 14:07:23 +0000 (15:07 +0100)]
net: bcmgenet: Reset RBUF on first open

If the RBUF logic is not reset when the kernel starts then there
may be some data left over from any network boot loader. If the
64-byte packet headers are enabled then this can be fatal.

Extend bcmgenet_dma_disable to do perform the reset, but not when
called from bcmgenet_resume in order to preserve a wake packet.

N.B. This different handling of resume is just based on a hunch -
why else wouldn't one reset the RBUF as well as the TBUF? If this
isn't the case then it's easy to change the patch to make the RBUF
reset unconditional.

See: https://github.com/raspberrypi/linux/issues/3850

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2 years agorpivid_h265: Fix width/height typo
popcornmix [Mon, 21 Sep 2020 13:02:44 +0000 (14:02 +0100)]
rpivid_h265: Fix width/height typo

Signed-off-by: popcornmix <popcornmix@gmail.com>
2 years agobrcmfmac: Increase power saving delay to 2s
Phil Elwell [Mon, 3 Feb 2020 09:32:22 +0000 (09:32 +0000)]
brcmfmac: Increase power saving delay to 2s

Increase the delay before entering the lower power state to 2 seconds
(the maximum allowed) in order to reduce the packet latencies,
particularly for inbound packets.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2 years agostaging/fbtft: Add support for display variants
Phil Elwell [Tue, 1 Sep 2020 17:15:27 +0000 (18:15 +0100)]
staging/fbtft: Add support for display variants

Display variants are intended as a replacement for the now-deleted
fbtft_device drivers. Drivers can register additional compatible
strings with a custom callback that can make the required changes
to the fbtft_display structure.

Start the ball rolling by adding adafruit18, adafruit18_green and
sainsmart18 displays.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2 years agomedia: bcm2835-unicam: change minimum number of vb2_queue buffers to 1
David Plowman [Thu, 28 May 2020 10:09:48 +0000 (11:09 +0100)]
media: bcm2835-unicam: change minimum number of vb2_queue buffers to 1

Since the unicam driver was modified to write to a dummy buffer when no
user-supplied buffer is available, it can now write to and return a
buffer even when there's only a single one. Enable this by changing the
min_buffers_needed in the vb2_queue; it will be useful for enabling
still captures without allocating more memory than absolutely necessary.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
2 years agomedia: bcm2835-unicam: Retain packing information on G_FMT
Dave Stevenson [Tue, 19 May 2020 10:46:47 +0000 (11:46 +0100)]
media: bcm2835-unicam: Retain packing information on G_FMT

The change to retrieve the pixel format always on g_fmt didn't
check whether the native or unpacked version of the format
had been requested, and always returned the packed one.
Correct this so that the packing setting is retained whereever
possible.

Fixes "9d59e89 media: bcm2835-unicam: Re-fetch mbus code from subdev
on a g_fmt call"

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agomedia: bcm2835-unicam: Fixup review comments from Hans.
Dave Stevenson [Tue, 23 Jun 2020 14:14:05 +0000 (15:14 +0100)]
media: bcm2835-unicam: Fixup review comments from Hans.

Updates the driver based on the upstream review comments from
Hans Verkuil at https://patchwork.linuxtv.org/patch/63531/

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agomedia: bcm2835: unicam: Fix uninitialized warning
Jacko Dirks [Tue, 5 May 2020 12:33:31 +0000 (14:33 +0200)]
media: bcm2835: unicam: Fix uninitialized warning

Signed-off-by: Jacko Dirks <jdirks.linuxdev@gmail.com>
2 years agomedia: bcm2835-unicam: Always service interrupts
Dave Stevenson [Wed, 13 May 2020 17:28:27 +0000 (18:28 +0100)]
media: bcm2835-unicam: Always service interrupts

From when bringing up the driver, there was a check in the isr
to ignore interrupts (claiming them handled) should the driver
not be streaming.

The VPU now will not register a camera driver if it finds a
CSI2 node enabled in device tree, therefore this flawed check is
redundant.

https://github.com/raspberrypi/linux/issues/3602

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agomedia: i2c: imx477: Parse and register properties
Laurent Pinchart [Fri, 3 Jul 2020 22:45:08 +0000 (01:45 +0300)]
media: i2c: imx477: Parse and register properties

Parse device properties and register controls for them using the V4L2
fwnode properties helpers.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
2 years agomedia: i2c: imx477: Return correct result on sensor id verification
Naushir Patuck [Tue, 19 May 2020 15:56:33 +0000 (16:56 +0100)]
media: i2c: imx477: Return correct result on sensor id verification

The test should return -EIO if the register read id does not match
the expected sensor id.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2 years agomedia: i2c: imx477: Add support for adaptive frame control
Naushir Patuck [Fri, 8 May 2020 08:41:17 +0000 (09:41 +0100)]
media: i2c: imx477: Add support for adaptive frame control

Use V4L2_CID_EXPOSURE_AUTO_PRIORITY to control if the driver should
automatically adjust the sensor frame length based on exposure time,
allowing variable frame rates and longer exposures.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2 years agomedia: i2c: Add driver for Sony IMX477 sensor
Naushir Patuck [Fri, 8 May 2020 09:00:12 +0000 (10:00 +0100)]
media: i2c: Add driver for Sony IMX477 sensor

Adds a driver for the 12MPix Sony IMX477 CSI2 sensor.
Whilst the sensor supports 2 or 4 CSI2 data lanes, this driver
currently only supports 2 lanes.

The following Bayer modes are currently available:

4056x3040 12-bit @ 10fps
2028x1520 12-bit (binned) @ 40fps
2028x1050 12-bit (cropped/binned) @ 50fps
1012x760 10-bit (scaled) @ 120 fps

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2 years agoinclude/firmware: Add enum for RPI_FIRMWARE_FRAMEBUFFER_GET_DISPLAY_ID
Dave Stevenson [Thu, 3 Sep 2020 16:09:07 +0000 (17:09 +0100)]
include/firmware: Add enum for RPI_FIRMWARE_FRAMEBUFFER_GET_DISPLAY_ID

Used by audio and FKMS.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agodwc_otg: whitelist_table is now productlist_table
popcornmix [Thu, 3 Sep 2020 13:02:41 +0000 (14:02 +0100)]
dwc_otg: whitelist_table is now productlist_table

2 years agomedia: i2c: tc358743: Only allow supported pixel fmts in set_fmt
Dave Stevenson [Fri, 10 Jul 2020 11:40:50 +0000 (12:40 +0100)]
media: i2c: tc358743: Only allow supported pixel fmts in set_fmt

Fix commit "media: tc358743: Return an appropriate colorspace from
tc358743_set_fmt" to ensure that the format passed in to set_fmt
is checked to be valid, and reset to the current format if not.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agomedia: bcm2835-unicam: Drop WARN on uing direct cache alias
Dave Stevenson [Thu, 27 Aug 2020 15:30:26 +0000 (16:30 +0100)]
media: bcm2835-unicam: Drop WARN on uing direct cache alias

Pi 0&1 pass all ARM accesses through the VPU L2 cache, therefore
the dma-ranges property sets the cache alias bits to other
than the direct alias, hence this WARN was firing.

It was overprotective coding, so assume that everything is OK
with the dma-ranges, and remove the WARN.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2 years agostaging: media: rpivid: Select MEDIA_CONTROLLER and MEDIA_CONTROLLER_REQUEST_API
Hristo Venev [Wed, 19 Aug 2020 14:05:53 +0000 (17:05 +0300)]
staging: media: rpivid: Select MEDIA_CONTROLLER and MEDIA_CONTROLLER_REQUEST_API

MEDIA_CONTROLLER_REQUEST_API is a hidden option. If rpivid depends on it,
the user would need to first enable another driver that selects
MEDIA_CONTROLLER_REQUEST_API, and only then rpivid would become available.

By selecting it instead of depending on it, it becomes possible to enable
rpivid without having to enable other potentially unnecessary drivers.

Signed-off-by: Hristo Venev <hristo@venev.name>
2 years agomedia: bcm2835: unicam: Select MEDIA_CONTROLLER and VIDEO_V4L2_SUBDEV_API
Hristo Venev [Wed, 19 Aug 2020 14:02:22 +0000 (17:02 +0300)]
media: bcm2835: unicam: Select MEDIA_CONTROLLER and VIDEO_V4L2_SUBDEV_API

That is what almost all other drivers appear to be doing.

Signed-off-by: Hristo Venev <hristo@venev.name>
2 years agobcm2835-dma: Advertise the full DMA range
Phil Elwell [Wed, 22 Jul 2020 16:59:31 +0000 (17:59 +0100)]
bcm2835-dma: Advertise the full DMA range

Unless the DMA mask is set wider than 32 bits, DMA mapping will use a
bounce buffer.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2 years agoleds: Add the actpwr trigger
Phil Elwell [Mon, 13 Jul 2020 09:33:19 +0000 (10:33 +0100)]
leds: Add the actpwr trigger

The actpwr trigger is a meta trigger that cycles between an inverted
mmc0 and default-on. It is written in a way that could fairly easily
be generalised to support alternative sets of source triggers.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2 years agodt-bindings: bcm2835-unicam: Update documentation with new clock params
Naushir Patuck [Mon, 11 May 2020 12:06:27 +0000 (13:06 +0100)]
dt-bindings: bcm2835-unicam: Update documentation with new clock params

Update the documentation to reflect the new "VPU" clock needed
by the bcm2835-unicam driver.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>