platform/kernel/linux-rpi.git
3 months agomedia: i2c: imx258: Remove unused defines
Dave Stevenson [Tue, 15 Jun 2021 17:18:42 +0000 (18:18 +0100)]
media: i2c: imx258: Remove unused defines

The IMX258_FLL_* defines are unused. Remove them.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agopinctrl: bcm2835: Workaround for edge IRQ loss
Phil Elwell [Fri, 5 May 2023 10:25:48 +0000 (11:25 +0100)]
pinctrl: bcm2835: Workaround for edge IRQ loss

It has been observed that edge events can be lost when GPIO edges occur
close to each other. Investigation suggests this is due to a hardware
bug, although no mechanism has been identified.

Work around the event loss by moving the IRQ acknowledgement into the
main ISR, adding missing events by explicit level-change detection.

See: https://forums.raspberrypi.com/viewtopic.php?t=350295

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agoBluetooth: hci_bcm: Add more invalid BDADDRs
Phil Elwell [Thu, 6 Apr 2023 09:38:40 +0000 (10:38 +0100)]
Bluetooth: hci_bcm: Add more invalid BDADDRs

The kernel needs to recognise the default BDADDRs used by the Bluetooth
modems, so add a few more that we care about.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agoBluetooth: hci_sync: Add fallback-bd-address prop
Phil Elwell [Tue, 25 Apr 2023 10:49:41 +0000 (11:49 +0100)]
Bluetooth: hci_sync: Add fallback-bd-address prop

The kernel Bluetooth framework understands that devices may not
be programmed with valid Bluetooth addresses. It also has the ability
to override a Bluetooth address with the value of the local-bd-address
DT property, but it ignores the validity of the existing address when
doing so.

Add a new boolean property, fallback-bd-address, which indicates that
the given local-bd-address property should only be used if the device
does not already have a valid BDADDR.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agoserial: 8250: Add NOMSI bug for bcm2835aux
Phil Elwell [Mon, 24 Apr 2023 10:48:31 +0000 (11:48 +0100)]
serial: 8250: Add NOMSI bug for bcm2835aux

The BCM2835 mini-UART has no modem status interrupt, causing all
transmission to stop, never to use, if a speed change ever happens
while the CTS signal is high.

Add a simple polling mechanism in order to allow recovery in that
situation.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agoinput: goodix: Add option to poll instead of relying on IRQ line
Dave Stevenson [Mon, 30 Jan 2023 14:46:16 +0000 (14:46 +0000)]
input: goodix: Add option to poll instead of relying on IRQ line

The interrupt line from the touch controller is not necessarily
connected to the SoC, so add the option to poll for touch info.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agodrm/panel: Add panel driver for Waveshare DSI touchscreens
Dave Stevenson [Fri, 14 Apr 2023 12:50:08 +0000 (13:50 +0100)]
drm/panel: Add panel driver for Waveshare DSI touchscreens

Waveshare sell a range of DSI panels of varying sizes, all
using a common MCU to control the panel and backlight.

Add a panel driver that supports these panels.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agomedia: bcm2835-unicam: Start and stop media_pipeline with same node
Dave Stevenson [Tue, 28 Mar 2023 12:43:43 +0000 (13:43 +0100)]
media: bcm2835-unicam: Start and stop media_pipeline with same node

media_pipeline_start and media_pipeline_stop now validate that
the pipeline is being started and stopped with the same pipe
and pad handles.
When running with embedded metadata (eg imx477 and imx708), the
start typically happens from the metadata pad, whilst stop is
always from the image pad.

Always pass the image pad to media_pipeline_start to ensure
that the calls are balanced.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agodrives: media: imx708: Put HFLIP and VFLIP controls in a cluster
Naushir Patuck [Fri, 31 Mar 2023 11:02:09 +0000 (12:02 +0100)]
drives: media: imx708: Put HFLIP and VFLIP controls in a cluster

Create a cluster for the HVLIP and VFLIP controls so they are treated
as a single composite control.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
3 months agodrivers: media: imx708: Follow the standard devicetree labels
Naushir Patuck [Fri, 31 Mar 2023 14:05:33 +0000 (15:05 +0100)]
drivers: media: imx708: Follow the standard devicetree labels

Switch the system clock name from "xclk" to "inclk".
Use lower case lables for all regulator names.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
3 months agodt-bindings: media: i2c: Replace IMX708 sensor binding documentation file
Naushir Patuck [Fri, 31 Mar 2023 10:52:25 +0000 (11:52 +0100)]
dt-bindings: media: i2c: Replace IMX708 sensor binding documentation file

Replace the existing imx708.yaml file with sony,imx708.yaml that follows
the latest devicetree conventions for camera sensors.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
3 months agodrivers: media: imx708: Tidy-ups to address upstream review comments
Naushir Patuck [Fri, 31 Mar 2023 09:33:51 +0000 (10:33 +0100)]
drivers: media: imx708: Tidy-ups to address upstream review comments

This commit addresses vaious tidy-ups requesed for upstreaming the
IMX708 driver. Notably:

- Remove #define IMX708_NUM_SUPPLIES and use ARRAY_SIZE() directly
- Use dev_err_probe where possible in imx708_probe()
- Fix error handling paths in imx708_probe()

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
3 months agodrivers: media: imx708: Remove unused control fields
Naushir Patuck [Fri, 31 Mar 2023 09:07:26 +0000 (10:07 +0100)]
drivers: media: imx708: Remove unused control fields

Remove unused and redundant control fields from the state structure.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
3 months agodrivers: media: imx708: Increase usable link frequencies
Naushir Patuck [Fri, 31 Mar 2023 13:56:09 +0000 (14:56 +0100)]
drivers: media: imx708: Increase usable link frequencies

Add support for three different usable link frequencies (default 450Mhz,
447Mhz, and 453MHz) for the IMX708 camera sensor. The choice of
frequency is handled thorugh the "link-frequency" overlay parameter.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
3 months agofbdev: Don't cancel deferred work if pagelist empty
Phil Elwell [Wed, 29 Mar 2023 08:49:36 +0000 (09:49 +0100)]
fbdev: Don't cancel deferred work if pagelist empty

Since [1], the fbdev deferred IO framework is careful to cancel
pending updates on close to prevent dirty pages being accessed after
they may have been reused. However, this is not necessary in the case
that the pagelist is empty, and drivers that don't make use of the
pagelist may have wanted updates cancelled for no good reason.

Avoid penalising fbdev drivers that don't make use of the pagelist by
making the cancelling of deferred IO on close conditional on there
being a non-empty pagelist.

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

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
[1] 3efc61d95259 ("fbdev: Fix invalid page access after closing deferred I/O devices")

3 months agohwrng: bcm2835 - sleep more intelligently
Phil Elwell [Wed, 22 Mar 2023 15:30:38 +0000 (15:30 +0000)]
hwrng: bcm2835 - sleep more intelligently

While waiting for random data, use sleeps that are proportional
to the amount of data expected. Prevent indefinite waits by
giving up if nothing is received for a second.

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

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agorpisense-fb: Add explicit fb_deferred_io_mmap hook
Phil Elwell [Mon, 27 Mar 2023 09:25:25 +0000 (10:25 +0100)]
rpisense-fb: Add explicit fb_deferred_io_mmap hook

As of commit [1], introduced in 5.18, fbdev drivers that use
deferred IO and need mmap support must include an explicit fb_mmap
pointer to the fb_deferred_io_mmap.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
[1] 590558510327 ("fbdev: Put mmap for deferred I/O into drivers")

3 months agodrivers: media: i2c: imx708: Fix WIDE_DYNAMIC_RANGE control with long exposure
David Plowman [Wed, 22 Mar 2023 12:01:57 +0000 (12:01 +0000)]
drivers: media: i2c: imx708: Fix WIDE_DYNAMIC_RANGE control with long exposure

Setting V4L2_CID_WIDE_DYNAMIC_RANGE was causing the long exposure
shift count to be reset, which is incorrect if the user has already
changed the frame length to cause it to have a non-zero value.

Because it only updates control ranges and doesn't set any registers,
the control can also be applied when the sensor is not powered on.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
3 months agomedia: i2c: Add PDAF support for IMX519
Lee Jackson [Wed, 22 Mar 2023 08:19:13 +0000 (16:19 +0800)]
media: i2c: Add PDAF support for IMX519

Add PDAF support for IMX519, and reduce the pixel rate to 426666667,
link freq to 408000000.

Signed-off-by: Lee Jackson <lee.jackson@arducam.com>
3 months agoclk: bcm: rpi: Create helper to retrieve private data
Maxime Ripard [Mon, 11 Jul 2022 13:58:36 +0000 (15:58 +0200)]
clk: bcm: rpi: Create helper to retrieve private data

The RaspberryPi firmware clocks driver uses in several instances a
container_of to retrieve the struct raspberrypi_clk_data from a pointer
to struct clk_hw. Let's create a small function to avoid duplicating it
all over the place.

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
3 months agoad5398_vcm: Fixup ad5398_probe prototype
Dom Cobley [Tue, 14 Mar 2023 16:54:37 +0000 (16:54 +0000)]
ad5398_vcm: Fixup ad5398_probe prototype

3 months agomedia: i2c: imx219: Correct the minimum vblanking value
David Plowman [Tue, 25 Jan 2022 15:48:53 +0000 (15:48 +0000)]
media: i2c: imx219: Correct the minimum vblanking value

The datasheet for this sensor documents the minimum vblanking as being
32 lines. It does fix some problems with occasional black lines at the
bottom of images (tested on Raspberry Pi).

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
3 months agoiio: light: veml6070: Add DT compatible string
Phil Elwell [Tue, 7 Mar 2023 21:49:30 +0000 (21:49 +0000)]
iio: light: veml6070: Add DT compatible string

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agoiio: light: tsl4531: Add DT compatible string
Phil Elwell [Tue, 7 Mar 2023 21:48:54 +0000 (21:48 +0000)]
iio: light: tsl4531: Add DT compatible string

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agohwmon: (sht3x) Add DT compatible string
Phil Elwell [Tue, 7 Mar 2023 21:47:58 +0000 (21:47 +0000)]
hwmon: (sht3x) Add DT compatible string

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agortc: ds3232: Add DT compatible string for ds3234
Phil Elwell [Tue, 7 Mar 2023 20:51:53 +0000 (20:51 +0000)]
rtc: ds3232: Add DT compatible string for ds3234

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agohwmon: (ds1621) Add DT compatible strings
Phil Elwell [Tue, 7 Mar 2023 12:12:36 +0000 (12:12 +0000)]
hwmon: (ds1621) Add DT compatible strings

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agohwmon: (aht10): Add DT compatible string
Phil Elwell [Tue, 7 Mar 2023 11:52:36 +0000 (11:52 +0000)]
hwmon: (aht10): Add DT compatible string

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agogpio: pca953x: Add ti,tca9554 compatible string
Phil Elwell [Mon, 6 Mar 2023 21:04:05 +0000 (21:04 +0000)]
gpio: pca953x: Add ti,tca9554 compatible string

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agoiio: adc: mcp3422: Add correct compatible strings
Phil Elwell [Mon, 6 Mar 2023 20:04:34 +0000 (20:04 +0000)]
iio: adc: mcp3422: Add correct compatible strings

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agodrm/panel/panel-sitronix-st7701: Support SPI config and RGB data
Dave Stevenson [Tue, 1 Feb 2022 15:27:01 +0000 (15:27 +0000)]
drm/panel/panel-sitronix-st7701: Support SPI config and RGB data

The ST7701 supports numerous different interface mechanisms for
MIPI DSI, RGB, or SPI. The driver was only implementing DSI input,
so add RGB parallel input with SPI configuration.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agomedia: bcm2835-unicam: Add support for RAW16 formats
Dave Stevenson [Fri, 20 Jan 2023 11:56:54 +0000 (11:56 +0000)]
media: bcm2835-unicam: Add support for RAW16 formats

With the RAW16 formats now having a defined CSI2 data type ID,
they can be added to the driver.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agomedia: bcm2835-unicam: Use mipi-csi2.h header for data type values
Dave Stevenson [Fri, 20 Jan 2023 11:50:28 +0000 (11:50 +0000)]
media: bcm2835-unicam: Use mipi-csi2.h header for data type values

The MIPI CSI2 data type ID values are now defined in the
mipi-csi2.h header, so use those defines instead of hard
coding them in the driver.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agodrivers: media: i2c: imx708: Fix crop information
David Plowman [Tue, 10 Jan 2023 13:14:27 +0000 (13:14 +0000)]
drivers: media: i2c: imx708: Fix crop information

The 1536x864 mode contained incorrect crop information.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
3 months agodrivers: media: imx708: Enable long exposure mode
Naushir Patuck [Thu, 5 Jan 2023 14:44:48 +0000 (14:44 +0000)]
drivers: media: imx708: Enable long exposure mode

Enable long exposure modes by using the long exposure shift register setting
in the imx708 sensor.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
3 months agonet: phy: broadcom: Make LEDs 3+4 shadow LEDs 1+2
Phil Elwell [Tue, 3 Jan 2023 16:00:21 +0000 (16:00 +0000)]
net: phy: broadcom: Make LEDs 3+4 shadow LEDs 1+2

CM4 uses BCM54210PE, which supports 2 additional LEDs, choosing LED3
for the amber LED because it shows activity by default (LED4 is not
connected). However, this makes it uncontrollable by the eth_led<n>
dtparams which target LEDs 1+2.

Solve the problem by making LEDs 3+4 mirror LEDs 1+2 (which is much
simpler than adding baseboard-specific overrides, but comes with a
risk of making one of the LEDs redundant).

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

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agomedia/i2c: Add a driver for the Sony IMX708 image sensor
Nick Hollinghurst [Thu, 22 Dec 2022 13:59:33 +0000 (13:59 +0000)]
media/i2c: Add a driver for the Sony IMX708 image sensor

The imx708 is a 12MP MIPI sensor with a 16:9 aspect ratio, here using
two CSI-2 lanes. It is a "quad Bayer" sensor with all 3 modes offering
10-bit output:

12MP: 4608x2592 up to 14.35fps (full FoV)
1080p: 2304x1296 up to 56.02fps (full FoV)
720p: 1536x864 up to 120.12fps (cropped)

This imx708 sensor driver is based heavily on the imx477 driver and
has been tested on the Raspberry Pi platform using libcamera.

Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agodtbindings: media: i2c: Add IMX708 CMOS sensor binding
Dave Stevenson [Thu, 22 Dec 2022 14:08:35 +0000 (14:08 +0000)]
dtbindings: media: i2c: Add IMX708 CMOS sensor binding

Add YAML devicetree binding for IMX708 CMOS image sensor.
Let's also add a MAINTAINERS entry for the binding and driver.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agomedia: dw9807-vcm: Smooth the first user movement of the lens
Dave Stevenson [Tue, 3 Jan 2023 16:53:37 +0000 (16:53 +0000)]
media: dw9807-vcm: Smooth the first user movement of the lens

The power up/down sequence is already ramped. Extend this to
the first user movement as well, as this will generally avoid
the "tick" noises due to rapid movements and overshooting.
Subsequent movements are generally smaller and so don't cause
issues.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agomedia: dw9807-vcm: Add regulator support to the driver
Dave Stevenson [Tue, 3 Jan 2023 16:35:59 +0000 (16:35 +0000)]
media: dw9807-vcm: Add regulator support to the driver

Uses the regulator notifier framework so that the current
focus position will be restored whenever any user of the
regulator powers it up. This means that should the VCM
and sensor share a common regulator then starting the sensor
will automatically restore the default position. If they
have independent regulators then it will behave be powered
up when the VCM subdev is opened.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agomedia: dt-bindings: Add regulator to dw9807-vcm
Dave Stevenson [Tue, 3 Jan 2023 16:41:08 +0000 (16:41 +0000)]
media: dt-bindings: Add regulator to dw9807-vcm

The VCM driver will often be controlled via a regulator,
therefore add in the relevant DT hooks.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agomedia: dw9807-vcm: Add support for DW9817 bidirectional VCM driver
Dave Stevenson [Tue, 3 Jan 2023 15:38:08 +0000 (15:38 +0000)]
media: dw9807-vcm: Add support for DW9817 bidirectional VCM driver

The DW9817 is effectively the same as DW9807 from a programming
interface, however it drives +/-100mA instead of 0-100mA. This means
that the power on ramp needs to take the lens from the midpoint, and
power off return it there. It also changes the default position for
the module.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agomedia: dt-bindings: Add DW9817 to DW9807 binding
Dave Stevenson [Tue, 3 Jan 2023 15:44:10 +0000 (15:44 +0000)]
media: dt-bindings: Add DW9817 to DW9807 binding

The DW9817 is programmatically the same as DW9807, but
the output drive is a bi-directional -100 to +100mA
instead of 0-100mA.

Add the appropriate compativle string.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agodrm/panel: simple: Add Innolux AT056tN53V1 5.6" VGA
Phil Elwell [Mon, 19 Dec 2022 16:32:33 +0000 (16:32 +0000)]
drm/panel: simple: Add Innolux AT056tN53V1 5.6" VGA

Add support for the Innolux AT056tN53V1 5.6" VGA (640x480) TFT LCD
panel.

Signed-off-by: Joerg Quinten <aBUGSworstnightmare@gmail.com>
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agonet: bcmgenet: Add 'eee' module parameter
Phil Elwell [Wed, 14 Dec 2022 15:00:51 +0000 (15:00 +0000)]
net: bcmgenet: Add 'eee' module parameter

On some switches, having EEE enabled causes the link to become
unstable. With this patch, adding 'genet.eee=N' to the kernel command
line will cause EEE to be disabled on the link.

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

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agodrm/panel: panel-ilitek9881c: Crystalfontz support
Mark Williams [Thu, 8 Dec 2022 02:55:15 +0000 (19:55 -0700)]
drm/panel: panel-ilitek9881c: Crystalfontz support

Add support for Crystalfontz CFAF7201280A0-050Tx panel.

Signed-off-by: Mark Williams <mwp@mwp.id.au>
3 months agodrm/panel: panel-ilitek9881c: Use cansleep methods
Mark Williams [Thu, 8 Dec 2022 01:20:40 +0000 (18:20 -0700)]
drm/panel: panel-ilitek9881c: Use cansleep methods

Use cansleep version of gpiod_set_value so external IO drivers (like
via I2C) can be used.

Signed-off-by: Mark Williams <mwp@mwp.id.au>
3 months agoREADME: Add README.md with CI kernel build status tags
Dave Stevenson [Mon, 14 Nov 2022 17:14:15 +0000 (17:14 +0000)]
README: Add README.md with CI kernel build status tags

This is a copy of README with the tags added.

You can not delete the file README as then checkpatch complains
you aren't in a kernel tree.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agomedia: i2c: ov7251: Add module param to select ext trig mode
Dave Stevenson [Thu, 1 Dec 2022 13:54:49 +0000 (13:54 +0000)]
media: i2c: ov7251: Add module param to select ext trig mode

As there isn't currently a defined mechanism for selecting an
external trigger mode on image sensors, copy the imx477
approach of using a module parameter to enable ext trig.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agomedia: adv7180: Nasty hack to allow input selection.
Dave Stevenson [Wed, 31 Oct 2018 15:00:04 +0000 (15:00 +0000)]
media: adv7180: Nasty hack to allow input selection.

Whilst the adv7180 driver support s_routing, nothing else
does, and there is a missing lump of framework code to
define the mapping from connectors on a board to the inputs
they represent on the ADV7180.

Add a nasty hack to take a module parameter that is passed in
to s_routing on any call to G_STD, or S_STD (or subdev
g_input_status call).

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 months agonet: phy: BCM54210PE does not support PTP
Phil Elwell [Sat, 5 Nov 2022 11:46:08 +0000 (11:46 +0000)]
net: phy: BCM54210PE does not support PTP

BCM54213PE is an Ethernet PHY that supports PTP hardware timestamping.
BCM54210PW ia another Ethernet PHY, but one without PTP support.
Unfortunately the two PHYs return the same ID when queried, so some
extra information is required to determine whether the PHY is PTP-
capable.

There are two Raspberry Pi products that use these PHYs - Pi 4B and
CM4 - and fortunately they use different PHY addresses, so use that as
a differentiator. Choose to treat a PHY with the same ID but another
address as a BCM54210PE, which seems more common.

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

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agodrivers: dwc_otg: stop GCC from patching FIQ functions
Jonathan Bell [Wed, 26 Oct 2022 16:46:44 +0000 (17:46 +0100)]
drivers: dwc_otg: stop GCC from patching FIQ functions

Configuring GCC to use task stack protector canaries means it will
insert calls to check functions in FIQ code. This is bad, as a) the
FIQ's stack is banked and b) the failure invokes __stack_chk_fail which
eventually tries to call printk(). Printing to the console inside the
FIQ is generally fatal.

Add CFLAGS to stop this happening in FIQ code.

Also catch one function where notrace wasn't specified.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
3 months agodrivers: usb: dwc_otg: fix reference passing when checking bandwidth
Jonathan Bell [Tue, 25 Oct 2022 09:50:10 +0000 (10:50 +0100)]
drivers: usb: dwc_otg: fix reference passing when checking bandwidth

The pointer (struct usb_host_endpoint *)->hcpriv should contain a
reference to dwc_otg_qh_t if the driver has already seen a URB submitted
to this endpoint.

It then checks whether the qh exists and is already in a schedule in
order to decide whether to allocate periodic bandwidth or not. Passing a
pointer to an offset inside of struct usb_host_endpoint instead of just
the pointer means it dereferences bogus addresses.

Rationalise (delete) a variable while we're at it.

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

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
3 months agomedia: bcm2835-unicam: Fix up start/stop api change
Dom Cobley [Mon, 24 Oct 2022 12:57:23 +0000 (13:57 +0100)]
media: bcm2835-unicam: Fix up start/stop api change

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
3 months agodrm/panel: Rename GEM CMA helpers GEM DMA helpers
Phil Elwell [Tue, 18 Oct 2022 15:36:47 +0000 (16:36 +0100)]
drm/panel: Rename GEM CMA helpers GEM DMA helpers

As a result of [1], DRM_GEM_CMA_HELPER has been replaced by
DRM_GEM_CMA_HELPER.

[1] 4a83c26a1d87 ("drm/gem: rename GEM CMA helpers to GEM DMA helpers")

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agobrcmfmac: Read alternative firmware names from DT
Phil Elwell [Thu, 28 Oct 2021 14:03:16 +0000 (15:03 +0100)]
brcmfmac: Read alternative firmware names from DT

Add the ability to load the names of alternative firmwares from the
Device Tree node. This permits separate firmwares for 43436s and 43438
and allows downstream firmwares to coexist with upstream.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agomedia: bcm2835-unicam: Fix for possible dummy buffer overrun
Naushir Patuck [Fri, 2 Sep 2022 07:35:35 +0000 (08:35 +0100)]
media: bcm2835-unicam: Fix for possible dummy buffer overrun

The Unicam hardware has been observed to cause a buffer overrun when using the
dummy buffer as a circular buffer. The conditions that cause the overrun are not
fully known, but it seems to occur when the memory bus is heavily loaded.

To avoid the overrun, program the hardware with a buffer size of 0 when using
the dummy buffer. This will cause overrun into the allocated dummy buffer, but
avoid out of bounds writes.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
3 months agomedia: i2c: arducam-pivariety: Add custom controls
Lee Jackson [Fri, 26 Aug 2022 03:41:49 +0000 (11:41 +0800)]
media: i2c: arducam-pivariety: Add custom controls

Add support for strobe_shift, strobe_width and mode custom controls.

Signed-off-by: Lee Jackson <info@arducam.com>
3 months agomedia: video-mux: Read CSI2 config from FW, and pass to receiver
Dave Stevenson [Fri, 29 Jul 2022 16:46:49 +0000 (17:46 +0100)]
media: video-mux: Read CSI2 config from FW, and pass to receiver

There is no obligation for all source devices on a video-mux to
require the same bus configuration, so read the configuration
from the sink ports, and relay via get_mbus_config on the source
port.
If the sources support get_mbus_config, then call that first.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agodrm/panel-simple: hack ignore orientation
Dom Cobley [Mon, 15 Aug 2022 18:42:38 +0000 (19:42 +0100)]
drm/panel-simple: hack ignore orientation

downstream removal of orientation plus upstream adding of new function

3 months agomedia: bcm2835-unicam: Correctly handle FS + FE ISR condtion
Naushir Patuck [Mon, 8 Aug 2022 09:01:41 +0000 (10:01 +0100)]
media: bcm2835-unicam: Correctly handle FS + FE ISR condtion

If we get a simultaneous FS + FE interrupt for the same frame, it cannot be
marked as completed and returned to userland as the framebuffer will be refilled
by Unicam on the next sensor frame. Additionally, the timestamp will be set to 0
as the FS interrupt handling code will not have run yet.

To avoid these problems, the frame is considered dropped in the FE handler,
and will be returned to userland on the subsequent sensor frame.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
3 months agoclk: bcm: rpi: Add the BCM283x pixel clock.
Dave Stevenson [Thu, 2 Dec 2021 13:53:36 +0000 (13:53 +0000)]
clk: bcm: rpi: Add the BCM283x pixel clock.

The clk-bcm2835 handling of the pixel clock does not function
correctly when the HDMI power domain is disabled.

The firmware supports it correctly, so add it to the
firmware clock driver.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agoPopulate phy driver block for BCM54213PE
Jonathan Lemon [Wed, 4 May 2022 21:33:05 +0000 (14:33 -0700)]
Populate phy driver block for BCM54213PE

The BCM54213PE identifier is a RPI-specific addition.
Populate the remainder of the driver functions, including the
required probe routine.

Add a version of bcm54xx_suspend, from upstream.

Signed-off-by: Jonathan Lemon <jonathan.lemon@gmail.com>
3 months agoAdd HDMI1 facility to the driver.
Dom Cobley [Wed, 8 Jun 2022 19:49:22 +0000 (20:49 +0100)]
Add HDMI1 facility to the driver.

Also check for which HDMI devices are connected and only create
devices for those that are present.

Signed-off-by: James Hughes <james.hughes@raspberrypi.org>
Signed-off-by: Dom Cobley <popcornmix@gmail.com>
snd_bcm2835: disable HDMI audio when vc4 is used (#3640)

Things don't work too well when both the vc4 driver and the firmware
driver are trying to control the same audio output:

[  763.569406] bcm2835_audio bcm2835_audio: vchi message timeout, msg=5

Hence, when the vc4 HDMI driver is used, let it control audio. This is done
by introducing a new device tree property to the audio node, and
extending the vc4-kms-v3d overlays to set it appropriately.

Signed-off-by: Hristo Venev <hristo@venev.name>
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>
staging: bcm2835-audio: Find compatible firmware node

Commit "ARM: dts: Adopt the upstream snd_bcm2835 handling" removed the
audio section from the DT and the driver can no longer access the
referenced firmware node 'brcm,firmware'. Fix that by searching for a
compatible firmware node instead, similar to drivers/gpu/drm/vc4.

Fixes: b9e62329e096 ("ARM: dts: Adopt the upstream snd_bcm2835 handling")
Signed-off-by: Juerg Haefliger <juergh@proton.me>
staging: bcm2835-audio: Fix firmware node refcounting

Decrement firmware node refcounts on all exit paths in set_hdmi_enables().

Signed-off-by: Juerg Haefliger <juergh@proton.me>
staging: bcm2835-audio: Log errors in case of firmware query failures

The driver queries the firmware for the number of detected HDMI displays
and their IDs. Log error messages if queries fail.

Signed-off-by: Juerg Haefliger <juergh@proton.me>
staging: bcm2835-audio: Fix unused enable_hdmi module parameter

The commit "Add HDMI1 facility to the driver." made the enable_hdmi module
parameter unused. Fix that by making it a global switch for all available
HDMI audio outputs.

Fixes: 755f3366084b ("Add HDMI1 facility to the driver.")
Signed-off-by: Juerg Haefliger <juergh@proton.me>
staging: bcm2835-audio: Fix unused enable_headphones module parameter

Since commit "staging: bcm2835-audio: Add disable-headphones flag" the
enabling/disabling of the headphones output is solely determined by the
presence of the DT property 'brcm,disable-headphones' and the
enable_headphones module parameter is unused. Fix that by making it a
global switch.

Fixes: ee90e47d8824 ("staging: bcm2835-audio: Add disable-headphones flag")
Signed-off-by: Juerg Haefliger <juergh@proton.me>
3 months agomedia: i2c: arducam_64mp: Advertise embedded data node on media pad 1
Lee Jackson [Wed, 18 May 2022 07:18:59 +0000 (15:18 +0800)]
media: i2c: arducam_64mp: Advertise embedded data node on media pad 1

This commit updates the arducam_64mp driver to adverise support for
embedded data streams.

The arducam_64mp sensor subdevice overloads the media pad to differentiate
between image stream (pad 0) and embedded data stream (pad 1) when
performing the v4l2_subdev_pad_ops functions.

Signed-off-by: Lee Jackson <info@arducam.com>
3 months agomedia: i2c: Add driver of Arducam 64MP camera
Lee Jackson [Fri, 13 May 2022 09:11:35 +0000 (17:11 +0800)]
media: i2c: Add driver of Arducam 64MP camera

Add a driver for the Arducam 64MP camera 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:

9152x6944 10-bit @ 2.7fps
4624x3472 10-bit (binned) @ 10fps
3840x2160 10-bit (cropped/binned) @ 20fps
2312x1736 10-bit (binned) @ 30fps
1920x1080 10-bit (cropped/binned) @ 60fps
1280x720 10-bit (cropped/binned) @ 120fps

Signed-off-by: Lee Jackson <info@arducam.com>
3 months agomedia: dt-bindings: media: i2c: Add Arducam 64MP CMOS sensor binding
Lee Jackson [Fri, 13 May 2022 09:21:42 +0000 (17:21 +0800)]
media: dt-bindings: media: i2c: Add Arducam 64MP CMOS sensor binding

Add YAML device tree binding for Arducam 64MP CMOS image sensor, and
the relevant MAINTAINERS entries.

Signed-off-by: Lee Jackson <info@arducam.com>
3 months agoclk-raspberrypi: Enable minimize for all firmware clocks
Dom Cobley [Wed, 20 Apr 2022 16:40:47 +0000 (17:40 +0100)]
clk-raspberrypi: Enable minimize for all firmware clocks

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
3 months agodrm/v3d: Switch clock setting to new api
Dom Cobley [Wed, 20 Apr 2022 17:08:38 +0000 (18:08 +0100)]
drm/v3d: Switch clock setting to new api

Signed-off-by: Dom Cobley <popcornmix@gmail.com>
drm/v3d: Convert to new clock range API

Signed-off-by: Maxime Ripard <maxime@cerno.tech>
3 months agorandom: do not use jump labels before they are initialized
Jason A. Donenfeld [Tue, 7 Jun 2022 10:02:10 +0000 (12:02 +0200)]
random: do not use jump labels before they are initialized

[ I would like to pursue fixing this more directly first before actually
  merging this, but I thought I'd send this to the list now anyway as a
  the "backup" plan. If I can't figure out how to make headway on the
  main plan in the next few days, it'll be easy to just do this. ]

Stephen reported that a static key warning splat appears during early
boot on systems that credit randomness from device trees that contain an
"rng-seed" property, because because setup_machine_fdt() is called
before jump_label_init() during setup_arch():

 static_key_enable_cpuslocked(): static key '0xffffffe51c6fcfc0' used before call to jump_label_init()
 WARNING: CPU: 0 PID: 0 at kernel/jump_label.c:166 static_key_enable_cpuslocked+0xb0/0xb8
 Modules linked in:
 CPU: 0 PID: 0 Comm: swapper Not tainted 5.18.0+ #224 44b43e377bfc84bc99bb5ab885ff694984ee09ff
 pstate: 600001c9 (nZCv dAIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
 pc : static_key_enable_cpuslocked+0xb0/0xb8
 lr : static_key_enable_cpuslocked+0xb0/0xb8
 sp : ffffffe51c393cf0
 x29: ffffffe51c393cf0 x28: 000000008185054c x27: 00000000f1042f10
 x26: 0000000000000000 x25: 00000000f10302b2 x24: 0000002513200000
 x23: 0000002513200000 x22: ffffffe51c1c9000 x21: fffffffdfdc00000
 x20: ffffffe51c2f0831 x19: ffffffe51c6fcfc0 x18: 00000000ffff1020
 x17: 00000000e1e2ac90 x16: 00000000000000e0 x15: ffffffe51b710708
 x14: 0000000000000066 x13: 0000000000000018 x12: 0000000000000000
 x11: 0000000000000000 x10: 00000000ffffffff x9 : 0000000000000000
 x8 : 0000000000000000 x7 : 61632065726f6665 x6 : 6220646573752027
 x5 : ffffffe51c641d25 x4 : ffffffe51c13142c x3 : ffff0a00ffffff05
 x2 : 40000000ffffe003 x1 : 00000000000001c0 x0 : 0000000000000065
 Call trace:
  static_key_enable_cpuslocked+0xb0/0xb8
  static_key_enable+0x2c/0x40
  crng_set_ready+0x24/0x30
  execute_in_process_context+0x80/0x90
  _credit_init_bits+0x100/0x154
  add_bootloader_randomness+0x64/0x78
  early_init_dt_scan_chosen+0x140/0x184
  early_init_dt_scan_nodes+0x28/0x4c
  early_init_dt_scan+0x40/0x44
  setup_machine_fdt+0x7c/0x120
  setup_arch+0x74/0x1d8
  start_kernel+0x84/0x44c
  __primary_switched+0xc0/0xc8
 ---[ end trace 0000000000000000 ]---
 random: crng init done
 Machine model: Google Lazor (rev1 - 2) with LTE

A trivial fix went in to address this on arm64, 73e2d827a501 ("arm64:
Initialize jump labels before setup_machine_fdt()"). But it appears that
fixing it on other platforms might not be so trivial. Instead, defer the
setting of the static branch until later in the boot process.

Fixes: f5bda35fba61 ("random: use static branch for crng_ready()")
Reported-by: Stephen Boyd <swboyd@chromium.org>
Cc: Ard Biesheuvel <ardb@kernel.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Russell King <linux@armlinux.org.uk>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Phil Elwell <phil@raspberrypi.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
3 months agovc04_services: vchiq-mmal: Add defines for mmal_es_format flags
Dave Stevenson [Mon, 16 May 2022 16:33:48 +0000 (17:33 +0100)]
vc04_services: vchiq-mmal: Add defines for mmal_es_format flags

There is a flags field in struct mmal_es_format, but the defines
for what the bits meant weren't included in the headers.
For V4L2_PIX_FMT_NV12_COL128 support we need them, so add them in.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agomedia: i2c: arducam-pivariety: Fixup for mainline API changes
Dave Stevenson [Thu, 12 May 2022 16:42:08 +0000 (17:42 +0100)]
media: i2c: arducam-pivariety: Fixup for mainline API changes

Mainline APIs have changed the way in which the bus flags and
number of active CSI2 data lanes is signalled, so fix the driver
up accordingly.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agomedia: i2c: Update irs1125 Kconfig entry
Phil Elwell [Thu, 12 May 2022 13:32:26 +0000 (14:32 +0100)]
media: i2c: Update irs1125 Kconfig entry

Bring the IRS1125 Kconfig declaration in line with upstream entries.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agohwmon: emc2305: fixups for driver submitted to mailing lists
Phil Elwell [Thu, 5 May 2022 14:46:07 +0000 (15:46 +0100)]
hwmon: emc2305: fixups for driver submitted to mailing lists

The driver had a number of issues, checkpatch warnings/errors,
and other limitations, so fix these up to make it usable.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
hwmon: emc2305: Add calls to initialise of cooling maps

Commit 46ef9d4ed26b ("hwmon: emc2305: fixups for driver submitted to
mailing lists") missed adding the call to thermal_of_cooling_device_register
required to configure any cooling maps for the device, hence stopping it
from actually ever changing speed.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
hwmon: emc2305: Change OF properties pwm-min & pwm-max to u8

There is no DT binding for emc2305 as mainline are still
discussing how to do a generic fan binding.
The 5.15 driver was reading the "emc2305," properties
"cooling-levels", "pwm-max", "pwm-min", and "pwm-channel" as u8.
The overlay was writing them as u16 (;) so it was working.

The 6.1 driver was reading as u32, which failed as there is
insufficient data.

As this is all downstream only, revert to u8 to match 5.15.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agodt-bindings: hwmon: add microchip,emc2305.yaml dt binding description.
Michael Shych [Sat, 30 Apr 2022 11:49:04 +0000 (14:49 +0300)]
dt-bindings: hwmon: add microchip,emc2305.yaml dt binding description.

Submitted to linux-hwmon mailing list at
https://patchwork.kernel.org/project/linux-hwmon/patch/20220430114905.53448-3-michaelsh@nvidia.com/

Add basic description of emc2305 driver device tree binding.

Signed-off-by: Michael Shych <michaelsh@nvidia.com>
Reviewed-by: Vadim Pasternak <vadimp@nvidia.com>
dtbindings: Fixup microchip,emc2305.yaml bindings

The bindings submitted to mainline had some issues, so fix them up.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agothermal: broadcom: Use dev_err_probe to suppress defer errors
Dave Stevenson [Fri, 6 May 2022 14:34:44 +0000 (15:34 +0100)]
thermal: broadcom: Use dev_err_probe to suppress defer errors

It is quite common for the devm_thermal_zone_of_sensor_register
to need to defer, so avoid spamming the log by using
dev_err_probe instead of dev_err.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agomedia: i2c: Add driver of Arducam Pivariety series camera
Lee Jackson [Thu, 14 Apr 2022 09:31:01 +0000 (17:31 +0800)]
media: i2c: Add driver of Arducam Pivariety series camera

Add a driver for the Arducam Pivariety series CSI2 camera sensor.

Signed-off-by: Lee Jackson <info@arducam.com>
SQUASH: Fix VIDEO_ARDUCAM_PIVARIETY Kconfig entry

The cherry-pick from rpi-5.17.y put it in the wrong section, and failed
to update it for 5.18.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agomedia: dt-bindings: media: i2c: Add Arducam Pivariety Series CMOS sensor binding
Lee Jackson [Thu, 21 Apr 2022 06:18:44 +0000 (14:18 +0800)]
media: dt-bindings: media: i2c: Add Arducam Pivariety Series CMOS sensor binding

Add YAML device tree binding for Arducam Pivariety CMOS image sensor, and
the relevant MAINTAINERS entries.

Signed-off-by: Lee Jackson <info@arducam.com>
3 months agodt-bindings: vendor-prefixes: Add Arducam
Lee Jackson [Thu, 21 Apr 2022 06:14:29 +0000 (14:14 +0800)]
dt-bindings: vendor-prefixes: Add Arducam

Add vendor prefix for Arducam (https://arducam.com).

Signed-off-by: Lee Jackson <info@arducam.com>
3 months agostaging: vchiq_arm: Add log_level module params
Phil Elwell [Fri, 29 Apr 2022 08:19:10 +0000 (09:19 +0100)]
staging: vchiq_arm: Add log_level module params

Add module parameters to control the logging levels for the various
vchiq logging categories.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agotpm_tis_spi_main: Force probe routine to run synchronously with driver and device...
Scovotto Davide [Wed, 20 Apr 2022 15:22:17 +0000 (17:22 +0200)]
tpm_tis_spi_main: Force probe routine to run synchronously with driver and device registration when IMA is enabled

Co-authored-by: Alberto Solavagione <albertosolavagione30@gmail.com>
Co-developed-by: Alberto Solavagione <albertosolavagione30@gmail.com>
Signed-off-by: Alberto Solavagione <albertosolavagione30@gmail.com>
Signed-off-by: Davide Scovotto <scovottodavide@gmail.com>
3 months agoclk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled
Alberto Solavagione [Wed, 20 Apr 2022 15:15:42 +0000 (17:15 +0200)]
clk-bcm2835: use subsys_initcall for the clock driver when IMA is enabled

Co-authored-by: Davide Scovotto <scovottodavide@gmail.com>
Co-developed-by: Davide Scovotto <scovottodavide@gmail.com>
Signed-off-by: Davide Scovotto <scovottodavide@gmail.com>
Signed-off-by: Alberto Solavagione <albertosolavagione30@gmail.com>
3 months agodrm/panel: panel-ilitek9881c: Add prepare_upstream_first flag
Dave Stevenson [Thu, 31 Mar 2022 11:05:04 +0000 (12:05 +0100)]
drm/panel: panel-ilitek9881c: Add prepare_upstream_first flag

The panel sends MIPI DCS commands during prepare and is expecting
the bus to remain in LP-11 state in-between.

Set the prepare_upstream_first flag so that the upstream DSI host
is prepared / pre_enabled first, and therefore the bus is in a
defined state.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agodrm/panel: ilitek-ili9881c: Clean up on mipi_dsi_attach failure
Dave Stevenson [Thu, 31 Mar 2022 11:03:36 +0000 (12:03 +0100)]
drm/panel: ilitek-ili9881c: Clean up on mipi_dsi_attach failure

mipi_dsi_attach is allowed to fail, and currently the probe
code doesn't clean up (mainly drm_panel_remove) if this happens.

Add cleanup code on failure.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agopinctrl: bcm2835: Only return non-GPIOs to inputs
Phil Elwell [Wed, 30 Mar 2022 08:48:41 +0000 (09:48 +0100)]
pinctrl: bcm2835: Only return non-GPIOs to inputs

Allowing GPIO state to persist allows the use of gpioset to control
GPIO levels without having to use the --mode=wait feature.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agomm,page_alloc,cma: introduce a customisable threshold for allocating pages in cma
David Plowman [Tue, 29 Mar 2022 15:10:06 +0000 (16:10 +0100)]
mm,page_alloc,cma: introduce a customisable threshold for allocating pages in cma

On some platforms the cma area can be half the entire system memory,
meaning that allocations start happening in the cma area immediately.
This leads to fragmentation and subsequent fatal cma_alloc failures.

We introduce an "alloc_in_cma_threshold" parameter which requires that
this many sixteenths of the free pages must be in cma before it will
try to use them. By default this is set to 12, but the previous
behaviour can be restored by setting it to 8 on startup.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
3 months agodrivers: staging: bcm2835-isp: Clear LS table handle in the firmware
Naushir Patuck [Tue, 22 Mar 2022 15:16:40 +0000 (15:16 +0000)]
drivers: staging: bcm2835-isp: Clear LS table handle in the firmware

When all nodes have stopped streaming, ensure the firmware has released its
handle on the LS table dmabuf. This is done by passing a null handle in the
LS params.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
3 months agomedia: i2c: Rename ad5398 to ad5398_vcm
Dave Stevenson [Thu, 17 Mar 2022 15:13:10 +0000 (15:13 +0000)]
media: i2c: Rename ad5398 to ad5398_vcm

There's already a regulator module called ad5398 that exposes
this device through the regulator API. That is meaningless in
the terms that it uses and how it maps to V4L2, so a new driver
was added. However the module name collision wasn't noted, so
rename it now.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agomedia: i2c: ov5647: Use v4l2_async_register_subdev_sensor for lens binding
Dave Stevenson [Wed, 16 Mar 2022 12:15:41 +0000 (12:15 +0000)]
media: i2c: ov5647: Use v4l2_async_register_subdev_sensor for lens binding

v4l2_async_register_subdev doesn't bind in lens or flash drivers,
but v4l2_async_register_subdev_sensor does.
Switch to using v4l2_async_register_subdev_sensor.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agomedia: i2c: Add driver for AD5398 VCM lens driver
Dave Stevenson [Wed, 29 Sep 2021 13:04:28 +0000 (14:04 +0100)]
media: i2c: Add driver for AD5398 VCM lens driver

Adds a driver for the Analog Devices AD5398 10 bit
I2C DAC which is commonly used for driving VCM lens
mechanisms.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agodt-bindings: media: i2c: Add binding for ad5398 VCM
Dave Stevenson [Wed, 29 Sep 2021 11:33:35 +0000 (12:33 +0100)]
dt-bindings: media: i2c: Add binding for ad5398 VCM

Add a binding for Analog Devices AD5398 10bit current
sinking DAC when used as a lens VCM driver.

FIXME: Convert to YAML

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agodrivers: staging: bcm2835-isp: Do not cleanup mmal vcsm buffer on stop_streaming
Naushir Patuck [Thu, 3 Mar 2022 16:45:53 +0000 (16:45 +0000)]
drivers: staging: bcm2835-isp: Do not cleanup mmal vcsm buffer on stop_streaming

On stop_streaming() the vcsm buffer handle gets released by the buffer cleanup
code.  This will subsequently cause and error if userland re-queues the same
buffer on the next start_streaming() call.

Remove this cleanup code and rely on the vb2_ops->buf_cleanup() call to do the
cleanups instead.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
3 months agostaging: vc04_services: isp: Permit all sRGB colour spaces on ISP outputs
David Plowman [Wed, 2 Mar 2022 16:47:37 +0000 (16:47 +0000)]
staging: vc04_services: isp: Permit all sRGB colour spaces on ISP outputs

ISP outputs actually support all colour spaces that are fundamentally
sRGB underneath, regardless of whether an RGB or YUV output format is
actually requested.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>
3 months agomedia/i2c: Add driver for Omnivision OV2311
Dave Stevenson [Fri, 25 Feb 2022 18:16:13 +0000 (18:16 +0000)]
media/i2c: Add driver for Omnivision OV2311

Omnivision OV2311 is a CSI2 1600x1300 global shutter image sensor.
Add a driver for it.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
media: i2c: Update ov2311 Kconfig entry

Bring the OV2311 Kconfig declaration in line with upstream entries.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
media: i2c: ov2311: Fix uninitialized variable usage

Signed-off-by: Alexander Winkowski <dereference23@outlook.com>
3 months agomedia: i2c: ov7251: Reinstate setting ov7251_global_init_setting
Dave Stevenson [Thu, 17 Feb 2022 14:48:30 +0000 (14:48 +0000)]
media: i2c: ov7251: Reinstate setting ov7251_global_init_setting

"media: i2c: Remove .s_power() from ov7251" removed the call that
sent ov7251_global_init_setting to the sensor. Send it when starting
streaming.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agomedia: bcm2835-unicam: Handle a repeated frame start with no end
Dave Stevenson [Fri, 4 Feb 2022 16:12:35 +0000 (16:12 +0000)]
media: bcm2835-unicam: Handle a repeated frame start with no end

In the case of 2 frame starts being received with no frame end
between, the queued buffer held in next_frm was lost as the
pointer was overwritten with the dummy buffer.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agospi: gpio: Add sck-idle-input property
Phil Elwell [Wed, 12 Jan 2022 08:23:28 +0000 (08:23 +0000)]
spi: gpio: Add sck-idle-input property

The sck-idle-input property indicates that the spi-gpio driver should
return the SCK line to an input when the chip select signals are
inactive.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agobindings: Add sck-idle-input to spi-gpio
Phil Elwell [Fri, 4 Feb 2022 11:33:28 +0000 (11:33 +0000)]
bindings: Add sck-idle-input to spi-gpio

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
3 months agodrm/panel: Add panel driver for TDO Y17B based panels
Dave Stevenson [Wed, 26 Jan 2022 16:02:31 +0000 (16:02 +0000)]
drm/panel: Add panel driver for TDO Y17B based panels

The Top DisplayOptoelectronics (TDO) T17B driver chip is used
in the TL040HDS20CT panel (found in the Pimoroni HyperPixel4
Square display) and potentially other displays.
The driver chip supports SPI for  configuration and DPI
video data.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
3 months agodrm/panel: Add panel driver for Ilitek ILI9806E panel
Dave Stevenson [Wed, 5 Jan 2022 19:14:48 +0000 (19:14 +0000)]
drm/panel: Add panel driver for Ilitek ILI9806E panel

The Ilitek ILI9806E driver is used in the Pimoroni HyperPixel4
and potentially other displays. Whilst it can support multiple
interfaces, this driver only accounts for SPI configuration and
DPI video data.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>