The regulator compatible string changed, and implements the PWM
API instead of the backlight one, therefore requiring pwm-backlight
to sit inbetween.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
Switch the power management in the imx477 device driver to use auto-
suspend with a 5s timeout.
This improves mode switching time that avoids additional regulator
switch-on delays and common register I2C writes.
Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Fix these two smatch warnings for the vc-sm-cma driver, rest were false
positives:
../vc-sm-cma/vc_sm.c:413
vc_sm_dma_buf_attach() warn: inconsistent returns '&buf->lock'.
Locked on : 396
Unlocked on: 413
../vc-sm-cma/vc_sm.c:1225
vc_sm_cma_ioctl_alloc() error: we previously assumed 'buffer' could be
null (see line 1113)
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
The 4056x3040 mode appears to need more vertical blanking lines
than any other, leaving a black bar at the bottom of the image.
Increase IMX477_VBLANK_MIN from 4 to 48 to compensate. (It may be
possible to reduce it slightly further, but fix the regression
for now).
https://github.com/raspberrypi/linux/issues/7109
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
hvs6 appears to have dropped support for the component order
field in 3 plane YUV formats.
Support them by swapping the Cb and Cr planes over when
reading the image pointers.
Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>