Commit Graph

1398831 Commits

Author SHA1 Message Date
Phil Elwell
c8320e3349 pps: Compatibility hack should be X86-specific
As of [1], using PPS_FETCH on a 64-bit ARM kernel with a 32-bit userland
is broken, returning a timeout. This is because the requested 4-byte
alignment for struct pps_ktime_compat (illegal on arm64) results in the
timeout flags field being uninitialised.

Make the hack specific to X86_64 builds with CONFIG_COMPAT defined.

[1] commit c2a49fe8ee ("pps: fix padding issue with PPS_FETCH for
    ioctl_compat")

See: https://github.com/raspberrypi/linux/issues/5430
Fixes: c2a49fe8ee ("pps: fix padding issue with PPS_FETCH for ioctl_compat")
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:16 +00:00
Phil Elwell
759b8a0a02 spi: bcm2835: Use phys addresses for slave DMA config
Contrary to what struct snd_dmaengine_dai_dma_data suggests, the
configuration of addresses of DMA slave interfaces should be done in
CPU physical addresses.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:16 +00:00
Phil Elwell
0cfa290453 mmc: bcm2835: Use phys addresses for slave DMA config
Contrary to what struct snd_dmaengine_dai_dma_data suggests, the
configuration of addresses of DMA slave interfaces should be done in
CPU physical addresses.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:16 +00:00
Phil Elwell
cb8f6d50bb 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>
2025-11-24 14:23:15 +00:00
Phil Elwell
86074b1f03 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>
2025-11-24 14:23:15 +00:00
Phil Elwell
7f3fc3fc9f 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>
2025-11-24 14:23:15 +00:00
Phil Elwell
b6b2fa04ae 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>
2025-11-24 14:23:15 +00:00
Phil Elwell
269e4c7963 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] 3efc61d952 ("fbdev: Fix invalid page access after closing deferred I/O devices")
2025-11-24 14:23:15 +00:00
Phil Elwell
2a4f658b71 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>
2025-11-24 14:23:15 +00:00
Phil Elwell
b9b42dbcb5 iio: light: tsl4531: Add DT compatible string
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:15 +00:00
Phil Elwell
1fc66f34a1 hwmon: (sht3x) Add DT compatible string
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:15 +00:00
Phil Elwell
c0f88873d7 rtc: ds3232: Add DT compatible string for ds3234
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:15 +00:00
Phil Elwell
a80ea84d93 hwmon: (ds1621) Add DT compatible strings
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:15 +00:00
Phil Elwell
498233e01d hwmon: (aht10): Add DT compatible string
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:15 +00:00
Phil Elwell
1012924f47 gpio: pca953x: Add ti,tca9554 compatible string
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:15 +00:00
Phil Elwell
4734797c26 iio: adc: mcp3422: Add correct compatible strings
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:14 +00:00
Nick Hollinghurst
b5d16f9ca7 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>

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>

drivers: media: i2c: imx708: Fix crop information

The 1536x864 mode contained incorrect crop information.

Signed-off-by: David Plowman <david.plowman@raspberrypi.com>

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>

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>

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>

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>

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>

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>

drivers: media: imx708: Adjust broken line correction parameter

In full-resolution mode, the LPF_INTENSITY_EN and LPF_INTENSITY
registers control Quad Bayer Re-mosaic broken line correction.
Expose this as a module parameter "qbc_adjust": zero disables
the correction and values in the range 2 to 5 set its strength.

There is a trade-off between coloured and monochrome patterns.
The previous fixed value 4 could produce ladder/spots artefacts
in coloured textures. The new default value 2 may suit a wider
range of scenes.

Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>

media: i2c: imx708: Squash fixes

media: i2c: imx708: Fix lockdep issues.

The driver had a lockdep_assert_held in imx708_get_format_code,
but the calls from enum_mbus_code and enum_frame_size didn't take
the mutex.

Likewise imx708_set_framing_limits calling __v4l2_ctrl_modify_range
had a lockdep, but when going through the probe function the mutex
hadn't been taken.

Fix both cases.

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

media: i2c: Tweak default PDAF gain table in imx708 driver

After analyzing more Raspberry Pi V3 cameras, adjust the
default PDAF shield-pixel gain tables (they can still be
overridden by camera OTP where programmed).

Signed-off-by: Nick Hollinghurst <nick.hollinghurst@raspberrypi.com>
2025-11-24 14:23:14 +00:00
Naushir Patuck
8ecae14a7c 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>
2025-11-24 14:23:14 +00:00
Dave Stevenson
6fac455cdd 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>
2025-11-24 14:23:14 +00:00
Dave Stevenson
7b80591ac2 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>
2025-11-24 14:23:14 +00:00
Dave Stevenson
920459b8bb 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>
2025-11-24 14:23:14 +00:00
Dave Stevenson
a7a07a40ba 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>
2025-11-24 14:23:14 +00:00
Dave Stevenson
d1cabf2501 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>
2025-11-24 14:23:14 +00:00
Dave Stevenson
c50b1c2fea 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>
2025-11-24 14:23:14 +00:00
Phil Elwell
c18fc2b7a7 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>
2025-11-24 14:23:14 +00:00
Dave Stevenson
ee52d7ec93 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>
2025-11-24 14:23:14 +00:00
Dave Stevenson
598a86d4a5 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>
2025-11-24 14:23:13 +00:00
Dave Stevenson
cd8af393c1 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>
2025-11-24 14:23:13 +00:00
Jonathan Lemon
bb2e201e38 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>
2025-11-24 14:23:13 +00:00
Dom Cobley
e237ad0dd7 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: 755f336608 ("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: ee90e47d88 ("staging: bcm2835-audio: Add disable-headphones flag")
Signed-off-by: Juerg Haefliger <juergh@proton.me>
2025-11-24 14:23:13 +00:00
Lee Jackson
edea0f4b4c 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>

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>

media: i2c: arducam_64mp: Modify the line length of 1280x720 resolution

Arducam 64MP has specific requirements for the line length, and if these
conditions are not met, the camera will not function properly. Under the
previous configuration, once a stream off operation is performed, the
camera will not output any data, even if a stream on operation is
performed. This prevents us from switching from 1280x720 to another
resolution.

Signed-off-by: Lee Jackson <lee.jackson@arducam.com>

media: i2c: arducam_64mp: Add 8000x6000 resolution

Added 8000x6000 10-bit (cropped) @ 3fps mode for Arducam 64MP

Signed-off-by: Lee Jackson <lee.jackson@arducam.com>

media: i2c: arducam_64mp: Add PDAF support

Enable PDAF output for all modes, and also need to modify Embedded Line
Width to 11560 * 3 (two lines of Embedded Data + one line of PDAF).

Signed-off-by: Lee Jackson <lee.jackson@arducam.com>

drivers: media: arducam_64mp: Add V4L2_CID_LINK_FREQ control

Add V4L2_CID_LINK_FREQ as a read-only control with a value of 456 Mhz.
This will be used by the CFE driver to corretly setup the DPHY timing
parameters in the CSI-2 block.

Signed-off-by: Lee Jackson <lee.jackson@arducam.com>
2025-11-24 14:23:13 +00:00
Lee Jackson
7f087bc7e1 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>
2025-11-24 14:23:13 +00:00
Jason A. Donenfeld
64e074dfe1 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, 73e2d827a5 ("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: f5bda35fba ("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>
2025-11-24 14:23:13 +00:00
Phil Elwell
897bc0f481 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 46ef9d4ed2 ("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>
2025-11-24 14:23:13 +00:00
Dave Stevenson
5bd7cae880 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>
2025-11-24 14:23:13 +00:00
Lee Jackson
b7357f5551 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>

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>

media: i2c: arducam-pivariety: Fix mutex init and NULL pointer

The mutex used in arducam-pivariety was not properly initialized,
which could lead to undefined behavior. This also caused a NULL
pointer dereference under certain conditions.

This patch ensures the mutex is correctly initialized during probe
and prevents NULL pointer dereferences.

Signed-off-by: Yuriy Pasichnyk <yurijpasichnyk11@gmail.com>
2025-11-24 14:23:13 +00:00
Lee Jackson
330aa7d359 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>
2025-11-24 14:23:13 +00:00
Lee Jackson
61783b032f dt-bindings: vendor-prefixes: Add Arducam
Add vendor prefix for Arducam (https://arducam.com).

Signed-off-by: Lee Jackson <info@arducam.com>
2025-11-24 14:23:12 +00:00
Scovotto Davide
b3ade5e7d4 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>
2025-11-24 14:23:12 +00:00
David Plowman
707096ff46 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>
2025-11-24 14:23:12 +00:00
Dave Stevenson
88b9452c7c 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>

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>
2025-11-24 14:23:12 +00:00
Dave Stevenson
13d5862714 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>
2025-11-24 14:23:12 +00:00
Dave Stevenson
b11c142681 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>
2025-11-24 14:23:12 +00:00
Dave Stevenson
84b56d4ba6 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>
2025-11-24 14:23:12 +00:00
Phil Elwell
4056f9ec71 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>
2025-11-24 14:23:12 +00:00
Phil Elwell
410e5de35f bindings: Add sck-idle-input to spi-gpio
Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:12 +00:00
Dave Stevenson
a1edd1e59f uapi/v4l2-controls: Reset V4L2_CID_USER_BCM2835_ISP_BASE to same as 5.10
https://github.com/raspberrypi/linux/issues/4440

Upstream has added additional device specific controls, so the
V4L2_CID_USER_BASE + 0x10e0 value that had been defined for use with
the ISP has been taken by something else (and +0x10f0 has been used as
well)

Duplicate the use on V4L2_CID_USER_BASE + 0x10e0 so that userspace
(libcamera) doesn't need to change. Once the driver is upstream, then
we'll update libcamera to adopt the new value as it then won't change.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:12 +00:00
Dave Stevenson
646c7d0146 media: i2c: ov7251: Make the enable GPIO optional.
Not all implementations wire up the enable GPIO and may just tie
it to a supply rail.
Make it optional.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:12 +00:00
Phil Elwell
687f27361c rtc: pcf8523: Fix oscillator stop bit handling
See: https://github.com/raspberrypi/firmware/issues/1065

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
2025-11-24 14:23:12 +00:00
Dave Stevenson
b4742aeb55 regulator/rpi-panel-attiny: Don't read the LCD power status
The I2C to the Atmel is very fussy, and locks up easily on
Pi0-3 particularly on reads.

The LCD power status is controlled solely by this driver, so
rather than reading it back from the Atmel, use the cached
status last set.

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

regulator/rpi-panel: Power off display on shutdown

Adds a shutdown function to turn off the backlight, bridge, and
touch controller on shutdown.

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

regulator/rpi-panel: Remove the ID read

Reading from the Atmel has always been troublesome due to
clock stretching, and the driver does nothing with it anyway.

Remove the read and assume that if the overlay has been
configured (most likely through the firmware autodetection)
that the hardware is present.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
2025-11-24 14:23:11 +00:00