Commit Graph

1399156 Commits

Author SHA1 Message Date
Phil Elwell
767c0e4712 misc: ws2812-pio-rp1: Add pass-through mode
Pass-through mode disables all gamma and brightness processing, sending
the raw pixel data directly to the LEDs. It is enabled by setting the
brightness to zero, either in Device Tree or using the runtime method of
writing a single byte (in this case 0) to the device.

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

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:43 +00:00
Phil Elwell
36f4e6d11b overlays: i2c-sensor: Add the ad799x ADC family
Add support for the AD799[1,2,3,4,5,7,8,9] ADCs to the i2c-sensor
overlay.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:43 +00:00
Phil Elwell
38d14fe82e configs: Add the AD799X driver module
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:43 +00:00
Naushir Patuck
61bd32f76b defconfig: Remove hailo driver from defconfigs
Remove CONFIG_MEDIA_PCI_HAILO from all the arm64 defconfig files as this
driver is no longer built in the kernel tree.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2025-11-24 14:23:43 +00:00
Naushir Patuck
6677154cb2 drivers: pcie: Hailo: Remove Hailo PCIe driver
This driver will be installed through DKMS going forward.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2025-11-24 14:23:43 +00:00
Lee Jackson
cbe9e7a96e media: i2c: Modify the datatype of PDAF data in the arducam_64mp driver
Modify the PDAF Datatype of the Arducam 64MP camera from 0x30 to 0x12
so that the Raspberry Pi 5 cfe driver can receive PDAF data.

Signed-off-by: Lee Jackson <info@arducam.com>
2025-11-24 14:23:43 +00:00
Dave Stevenson
50e3f26480 video: fbdev: simplefb: Add b8g8r8 and b5g6r5 formats
The mappings are the reverse of r8g8b8 and r5g6b5 respectively

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:43 +00:00
Dave Stevenson
2cd7efa28f fbcon: Add defensive coding to logo loader
There were various points where the loader was using uninitialised
data, had the potential to run off the end of an array, or was
handling core functions incorrectly. Fix these up.

Also handle 24bpp and 32bpp framebuffers.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:43 +00:00
macmpi
e726ee2001 Add RTW89 USB modules to Pi defconfigs
8851BU, 8852BU
2025-11-24 14:23:43 +00:00
Dave Stevenson
44099233ac Fixup c91c9f257d ("fbdev: Allow client to request a particular /dev/fbN node")
We lost a line in the forward port, which meant that it always used
/dev/fb0, and complained that the sysfs nodes already existed.

Fixes: c91c9f257d ("fbdev: Allow client to request a particular /dev/fbN node")

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:42 +00:00
Phil Elwell
4eb2c9fcfa overlays: i2c-sensor: Add the scd4x CO2 sensors
See: https://github.com/raspberrypi/linux/issues/7091

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:42 +00:00
Phil Elwell
922eb7c083 configs: Enable the SCD4X sensor driver
See: https://github.com/raspberrypi/linux/issues/7091

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:42 +00:00
Phil Elwell
108d06004a overlays: Update the README
Replace the use of vcdbg with vclog, and correct the documentation URL.

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

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:42 +00:00
Phil Elwell
2b3ff4941f misc: rp1-pio: Get burst size from DMA capabilities
Although the PIO throughput benefits from larger burst sizes, only the
first two DMA channels support a burst size of 8 - the others are capped
at 4. To avoid misconfiguring the PIO hardware, retrieve the actual
max_burst value from the DMA channel's capabilities.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:42 +00:00
Omer Faruk Edemen
fd2ef15d4b arm: dts: overlays: Add external trigger mode support
Adds DT property `trigger-mode` to enable FSIN-triggered frame capture.
Includes overlay and README update for ov9281_trig.

Signed-off-by: Omer Faruk Edemen <ofedemen@lectrontech.com>
2025-11-24 14:23:42 +00:00
Omer Faruk Edemen
a9dbd730e4 media: i2c: ov9282: Add external FSIN trigger snapshot mode
This patch adds support for external FSIN-triggered snapshot mode
to the OmniVision OV9282 sensor driver. It enables frame capture
synchronized with an external hardware trigger signal.

Signed-off-by: Omer Faruk Edemen <ofedemen@lectrontech.com>
2025-11-24 14:23:42 +00:00
Maxime Ripard
b52b2c5720 media: tc358743: Fix the RGB MBUS format
Upstream series https://lore.kernel.org/linux-media/20250917-csi-bgr-rgb-v3-0-0145571b3aa4@kernel.org/

The tc358743 is an HDMI to MIPI-CSI2 bridge. It can output all three
HDMI 1.4 video formats: RGB 4:4:4, YCbCr 4:2:2, and YCbCr 4:4:4.

RGB 4:4:4 is converted to the MIPI-CSI2 RGB888 video format, and listed
in the driver as MEDIA_BUS_FMT_RGB888_1X24.

Most CSI2 receiver drivers then map MEDIA_BUS_FMT_RGB888_1X24 to
V4L2_PIX_FMT_RGB24.

However, V4L2_PIX_FMT_RGB24 is defined as having its color components in
the R, G and B order, from left to right. MIPI-CSI2 however defines the
RGB888 format with blue first.

This essentially means that the R and B will be swapped compared to what
V4L2_PIX_FMT_RGB24 defines.

The proper MBUS format would be BGR888, so let's use that.

Fixes: d32d98642d ("[media] Driver for Toshiba TC358743 HDMI to CSI-2 bridge")
Signed-off-by: Maxime Ripard <mripard@kernel.org>
2025-11-24 14:23:42 +00:00
Maxime Ripard
8270057a6b media: uapi: Clarify MBUS color component order for serial buses
Upstream series https://lore.kernel.org/linux-media/20250917-csi-bgr-rgb-v3-0-0145571b3aa4@kernel.org/

The subdev format documentation has a subsection describing how to use
the media bus pixel codes for serial buses. While it describes the
sampling part well, it doesn't really describe the current convention
used for the components order.

Let's improve that.

Signed-off-by: Maxime Ripard <mripard@kernel.org>
2025-11-24 14:23:42 +00:00
Jonathan Bell
15fee9f5f0 usb: dwc2: masquerade split-interrupt transfers
Masquerading Interrupt split transfers as Control puts the transfer into
the non-periodic handler in the hub. This stops the hub dropping
complete-split data in the microframe after a CSPLIT should have
arrived, improving resilience to host IRQ latency. Devices are none
the wiser - the handshake tokens are the same.

Originally devised by Hans Petter Selasky @ FreeBSD.

(v2: dwc2 needs an un-masquerade prior to channel interrupt handling)

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2025-11-24 14:23:42 +00:00
Ram Chandrasekar
b2fcd07729 drivers: thermal: step_wise: add support for hysteresis
Step wise governor increases the mitigation level when the temperature
goes above a threshold and will decrease the mitigation when the
temperature falls below the threshold. If it were a case, where the
temperature hovers around a threshold, the mitigation will be applied
and removed at every iteration. This reaction to the temperature is
inefficient for performance.

The use of hysteresis temperature could avoid this ping-pong of
mitigation by relaxing the mitigation to happen only when the
temperature goes below this lower hysteresis value.

Signed-off-by: Ram Chandrasekar <rkumbako@codeaurora.org>
Signed-off-by: Lina Iyer <ilina@codeaurora.org>

drivers: thermal: step_wise: avoid throttling at hysteresis temperature after dropping below it

Signed-off-by: Serge Schneider <serge@raspberrypi.org>

Fix hysteresis support in gov_step_wise.c

Directly get hyst value instead of going through an
optional and, now, unimplemented function.

Signed-off-by: Jürgen Kreileder <jk@blackdown.de>
2025-11-24 14:23:42 +00:00
Phil Elwell
0c24562b11 net: phy: broadcom: Add led-swap property support
Extend the LED control features of the led-modes property by adding a
led-swap property. This allows the same led-modes values to be used
across designs where the LED assignments differ.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:41 +00:00
Dave Stevenson
1b20bd4b26 drm/tests: Add cmd line test for reflect_[xy] not being last param
To ensure we don't get a regression on handling reflect_[xy]
in the middle of the command line string, add a test for it.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:41 +00:00
Dave Stevenson
3b889d8570 drm/modes: Handle reflect_[xy] in the middle of the cmd line
The command line parser was looking for an "=" before the ","
separator.
If the command line had reflect_[xy] before another option
which took a parameter, it would find the "=" from the second
option and assume it was associated with the reflect option,
generally leading to a parsing failure.

Handle this case by looking for both "," and "=", and taking
the first instance.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:41 +00:00
Dave Stevenson
b67c756267 drm/vc4: hvs: Populate YUV to RGB matrices for GEN_6D
All the matrix entries for the YUV to RGB conversion matrices were
being filled with the same coefficients.
Compute the values for the BT601, BT709, and BT2020 matrices in
both full and limited range, and program those into the hardware.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:41 +00:00
Nicolai Buchwitz
4d6836e523 net: phy: broadcom: Remove conflicting ECR global interrupt mask in config_init
The driver previously set the global interrupt mask in the ECR register
in bcm54xx_config_init(), disabling all interrupts. This conflicts with
the configuration in bcm_phy_config_intr(), which enables or disables the
global interrupt mask as needed and is called earlier. As a result,
interrupts may remain globally disabled even when the IMR is configured
to unmask specific events.

Remove the ECR handling from bcm54xx_config_init() so that interrupt
enable/disable is managed exclusively by bcm_phy_config_intr().

Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
2025-11-24 14:23:41 +00:00
Nicolai Buchwitz
2ac53cf449 net: phy: broadcom: Preserve LED4 settings
On CM4/CM5, LED3 is used for ETH_LEDY, while LED4 may be unused or serve
as INT_N. Previously, both LEDs 3 and 4 were mirrored from LED1, which
overwrote the INT_N configuration on CM5.

Fix this by only shadowing LED1 to LED3, preserving the setting for
LED4/INT.

Fixes: 9704fab964 ("net: phy: broadcom: Allow ethernet LED mode to be set via device tree")
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
2025-11-24 14:23:41 +00:00
Nicolai Buchwitz
3b96c0ff0c net: phy: broadcom: Handle irqs on BCM54213PE
The phy specific structure is missing the pointers for handling
interrupts and link change notification. This results in interrupt's
being polled on CM5:

Fix this and copy the existing pointers from BCM54210E, which match the
implementation.

Before:
[3.501498] macb 1f00100000.ethernet eth0: PHY [1f00100000.ethernet-ffffffff:00] driver [Broadcom BCM54213PE] (irq=POLL)

After:
[3.597582] macb 1f00100000.ethernet eth0: PHY [1f00100000.ethernet-ffffffff:00] driver [Broadcom BCM54213PE] (irq=168)

Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
2025-11-24 14:23:41 +00:00
Ben Benson
d790ae4ba1 Fullscreen Splash Images
Enable by adding the following to cmdline.txt:
`fullscreen_logo_name=logo.tga fullscreen_logo=1`
Will show the logo file present in /lib/firmware/ on the screen.
This will be fullscreen and rendered early at boot.
Any remaining space is filled with solid color from the image border.
If TGA file is too big, image is clipped accordingly.

Signed-off-by: Ben Benson <ben.benson@raspberrypi.com>

Splash Screen: bug fix

Prevents fullscreen logos from being drawn multiple times.
With small enough logos, the image would be drawn multiple times across the screen.

Signed-off-by: Ben Benson <ben.benson@raspberrypi.com>
2025-11-24 14:23:41 +00:00
Nicolai Buchwitz
4622fe49a1 dmaengine: dw-axi-dmac: report per-channel max_burst via device_caps
The patch "dmaengine: dw-axi-dmac: add per-channel AXI burst length
support" programs ARLEN/AWLEN from the snps,axi-max-burst-len array but
still exposed a single max_burst value via dma_get_slave_caps(). As a
result all channels reported 8 even when limited to 4, leading to
warnings:

  dma dma2chan5: requested source burst length 8 exceeds supported 4

Add a .device_caps callback to return the correct per-channel max_burst.
This allows drivers like amba-pl011 to clamp burst lengths properly.

Fixes: 0e4e6a0c4f4e ("dmaengine: dw-axi-dmac: add per-channel AXI burst length support")
Signed-off-by: Nicolai Buchwitz <nb@tipi-net.de>
2025-11-24 14:23:41 +00:00
Phil Elwell
c5460f88a8 dmaengine: dw-axi-dmac: Add DMA channel selection
Add a mechanism to allow clients to prefer some DMA channels over
others. This is required to allow high-bandwidth clients to request
one of the two "heavy" channels, but could also be used to prevent
some clients from hogging all channels.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:41 +00:00
Phil Elwell
1926bdfb4d dmaengine: dw-axi-dmac: Per-channel burst limits
The DesignWare AXI DMAC IP can be configured with heterogeneous channel
parameters. Allow maximum burst length to be set per-channel by making
snps,axi-max-burst-len an array.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:41 +00:00
Phil Elwell
a7e733f289 config: Allow MFD_RP1 as well as MISC_RP1
While we continue to use the downstream RP1 driver, update some other
Kconfig settings to recognise MFD_RP1 as a valid RP1 driver.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:41 +00:00
Dom Cobley
d171997539 pinctrl: Reinstate the downstream pinctrl-rp1 driver
The upstream version has limited functionality.

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

Fixup downstream pinctrl-rp1 driver
2025-11-24 14:23:41 +00:00
Dave Stevenson
b04f20376a drm/connector: hdmi: Attempt YUV422 output if RGB isn't supported
Drop from RGB to YUV422 output if RGB couldn't be supported
within the defined max_bpc and TMDS rates, and then try
dropping max_bpc.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:40 +00:00
Jonathan Bell
70043133db PCI: pcie-brcmstb: fake MSIx support on internal MSI target
Apparently some NVMe SSD implementations don't fall back to MSI cleanly,
instead making the driver allocate one queue via the legacy interrupt.

There are still only 32 vectors available, but should be sufficient for
the majority of use-cases on BCM2711.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2025-11-24 14:23:40 +00:00
Phil Elwell
ebffaa4935 lan78xx: Return tx_lpi_timer even if disabled
Disabling tx_lpi or eee should not cause the value of tx_lpi_timer to
be lost, even though it is not useful until they are re-enabled.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:40 +00:00
Phil Elwell
9fcadf1424 lan78xx: Read initial EEE status from DT
Add two new DT properties:
* microchip,eee-enabled  - a boolean to enable EEE
* microchip,tx-lpi-timer - time in microseconds to wait before entering
                           low power state

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:40 +00:00
Phil Elwell
3efecfb9e2 lan78xx: Enable LEDs and auto-negotiation
For applications of the LAN78xx that don't have valid programmed
EEPROMs or OTPs, enabling both LEDs and auto-negotiation by default
seems reasonable.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
2025-11-24 14:23:40 +00:00
Phil Elwell
5b455d8d57 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>
2025-11-24 14:23:40 +00:00
Naushir Patuck
60fa5108ea media: pisp_be: Re-introduce multi-context support
Re-introduce multi-context support that was dropped from the mainline
driver version.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2025-11-24 14:23:40 +00:00
John Cox
5eb903dc0b arm64/dma-mapping: Fix arch_sync_dma_for_device to respect dir parameter
All other architectures do different cache operations depending on the
dir parameter. Fix arm64 to do the same.

This fixes udmabuf operations when syncing for read e.g. when the CPU
reads back a V4L2 decoded frame buffer.

Signed-off-by: John Cox <jc@kynesim.co.uk>
2025-11-24 14:23:40 +00:00
Naushir Patuck
01f12b5305 drivers: media: pisp_be: Add minimal alinment to the format structure
Add a new minimal alignment field to the format structure. This minimal
alignment will be used if a stride has been provided by userland. If no
stride has been provided by userland (bytesperline == 0), the optimal
alignemnt will be used in the stride calculation.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2025-11-24 14:23:40 +00:00
Naushir Patuck
08503a0f1f drivers: meida: pisp_be: Rename format align field
Rename the align field in the format structure to opt_align to indicate
the optimal alignment for the format.

There is no functional change in this commit.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
2025-11-24 14:23:40 +00:00
Dave Stevenson
f26f585c6c drm/vc4: plane: Add support for P01[026] and Q01[026] formats
There are now formats defined for 2-plane YUV420 at 10, 12,
and 16 bit depth using the most significant bits of the 16bit
word (P010, P012, and P016), and 3-plane YUV420 at those
depths using the least significant bits of the 16 bit word
(S010, S012, and S016).

VC4_GEN_6 can support all those formats although only composing
using at most 10bits of resolution, so add them as supported
formats for all planes.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:40 +00:00
Maíra Canal
67c20b9c29 drm/vc4: tests: Use the correct return type in vc4_mock_atomic_add_output()
The function vc4_mock_atomic_add_output() should return a pointer, even
during error treatment. Use the proper macros to create pointers from
the error code.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
2025-11-24 14:23:40 +00:00
Jonathan Bell
fd5d560355 drivers: dwc2: better handle hardware length & alignment issues
The version of the dwc-otg core used in BCM2835 through BCM2712 only does
whole-word writes, as well as needing the documented requirement for DMA
buffers to start on a word boundary.

Also, the alignment method used in the dwc2 driver doesn't handle the
case where the URB has the NO_TRANSFER_DMA_MAP flag set, so reject
buffers that have unaligned DMA start addresses. At least one whole page
should be mapped, so the BCM283x whole-word-write bug should be benign
in this case.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2025-11-24 14:23:39 +00:00
Jacopo Mondi
a2e4a71816 media: pisp_be: Fix pm_runtime underrun in probe
During the probe() routine, the PiSP BE driver needs to power up the
interface in order to identify and initialize the hardware.

The driver resumes the interface by calling the
pispbe_runtime_resume() function directly, without going
through the pm_runtime helpers, but later suspends it by calling
pm_runtime_put_autosuspend().

This causes a PM usage count imbalance at probe time, notified by the
runtime_pm framework with the below message in the system log:

 pispbe 1000880000.pisp_be: Runtime PM usage count underflow!

Fix this by resuming the interface using the pm runtime helpers instead
of calling the resume function directly and use the pm_runtime framework
in the probe() error path. While at it, remove manual suspend of the
interface in the remove() function. The driver cannot be unloaded if in
use, so simply disable runtime pm.

To simplify the implementation, make the driver depend on PM as the
RPI5 platform where the ISP is integrated in uses the PM framework by
default.

Fixes: 12187bd5d4 ("media: raspberrypi: Add support for PiSP BE")
Cc: stable@vger.kernel.org
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
2025-11-24 14:23:39 +00:00
Jonathan Bell
5dcb1bf3e8 drivers: dwc2: don't use shifted frame number internally
Shift it in the wrapper function, or scheduling periodic transfers breaks.

Signed-off-by: Jonathan Bell <jonathan@raspberrypi.com>
2025-11-24 14:23:39 +00:00
Richard Oliver
b007f52fc6 dt-bindings: clock: Add gpio-gate-clock-releasing
Document the gpio-gate-clock-releasing compatible string that enables
acquire/release GPIO semantics on gpio-gated clocks.

Signed-off-by: Richard Oliver <richard.oliver@raspberrypi.com>
2025-11-24 14:23:39 +00:00
Richard Oliver
c1a9acfef0 clk: clk-gpio: Support acquire/release semantics
Add support for the 'gpio-gate-clock-releasing' compatible string. The
behaviour is identical to that of 'gpio-gate-clock' but the gpio is
acquired on 'enable' and released on 'disable'.

Signed-off-by: Richard Oliver <richard.oliver@raspberrypi.com>
2025-11-24 14:23:39 +00:00