Vincent Knecht [Thu, 30 Oct 2025 07:59:12 +0000 (08:59 +0100)]
media: dt-bindings: Add qcom,msm8939-camss
Add bindings for qcom,msm8939-camss in order to support the camera
subsystem for MSM8939.
Signed-off-by: Vincent Knecht <vincent.knecht@mailoo.org>
[André: Make order of items the same as in 8916] Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: André Apitzsch <git@apitzsch.eu> Signed-off-by: Bryan O'Donoghue <bod@kernel.org> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Hangxiang Ma [Thu, 30 Oct 2025 23:38:28 +0000 (23:38 +0000)]
media: qcom: camss: Enable setting the rate to camnoc_rt_axi clock
On hardware architectures where a single CAMNOC module is split into
two, one for each of the real time (RT) and non real time (NRT) modules
within camera sub system, processing VFE output over the AXI bus
requires enabling and setting the appropriate clock rate for the RT
CAMNOC. This change lays the groundwork for supporting such
configurations.
Hangxiang Ma [Thu, 30 Oct 2025 23:24:56 +0000 (23:24 +0000)]
media: qcom: camss: Use a macro to specify the initial buffer count
Replace the hardcoded buffer count value with a macro to enable
operating on these buffers elsewhere in the CAMSS driver based on this
count. Some of the hardware architectures require deferring the AUP and
REG update until after the CSID configuration and this macro is expected
to be useful in such scenarios.
Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com> Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org> Signed-off-by: Bryan O'Donoghue <bod@kernel.org> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Wangao Wang [Mon, 27 Oct 2025 09:35:59 +0000 (17:35 +0800)]
media: iris: Add sanity check for stop streaming
Add sanity check in iris_vb2_stop_streaming. If inst->state is
already IRIS_INST_ERROR, we should skip the stream_off operation
because it would still send packets to the firmware.
In iris_kill_session, inst->state is set to IRIS_INST_ERROR and
session_close is executed, which will kfree(inst_hfi_gen2->packet).
If stop_streaming is called afterward, it will cause a crash.
media: iris: Refine internal buffer reconfiguration logic for resolution change
Improve the condition used to determine when input internal buffers need
to be reconfigured during streamon on the capture port. Previously, the
check relied on the INPUT_PAUSE sub-state, which was also being set
during seek operations. This led to input buffers being queued multiple
times to the firmware, causing session errors due to duplicate buffer
submissions.
This change introduces a more accurate check using the FIRST_IPSC and
DRC sub-states to ensure that input buffer reconfiguration is triggered
only during resolution change scenarios, such as streamoff/on on the
capture port. This avoids duplicate buffer queuing during seek
operations.
Fixes: c1f8b2cc72ec ("media: iris: handle streamoff/on from client in dynamic resolution change") Cc: stable@vger.kernel.org Reported-by: Val Packett <val@packett.cool> Closes: https://gitlab.freedesktop.org/gstreamer/gstreamer/-/issues/4700 Signed-off-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com> Reviewed-by: Vikash Garodia <vikash.garodia@oss.qualcomm.com> Signed-off-by: Bryan O'Donoghue <bod@kernel.org> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Laurent Pinchart [Sun, 26 Oct 2025 18:11:38 +0000 (20:11 +0200)]
media: iris: Constify iris_v4l2_file_ops
The iris_v4l2_file_ops structure is never modified. Make it const.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com> Reviewed-by: Abel Vesa <abel.vesa@linaro.org>
[bod: drop qcom from patch title for consistency with other patches] Signed-off-by: Bryan O'Donoghue <bod@kernel.org> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Dmitry Baryshkov [Tue, 28 Oct 2025 11:46:25 +0000 (13:46 +0200)]
media: iris: enable support for SC7280 platform
As a part of migrating code from the old Venus driver to the new Iris
one, add support for the SC7280 platform. It is very similar to SM8250,
but it (currently) uses no reset controls (there is an optional
GCC-generated reset, it will be added later) and no AON registers
region. Extend the VPU ops to support optional clocks and skip the AON
shutdown for this platform.
Dmitry Baryshkov [Tue, 28 Oct 2025 11:46:23 +0000 (13:46 +0200)]
media: iris: remove duplication between generic gen2 data and qcs8300
Now as we have removed PIPE value from inst_fw_caps_dec there should be
no difference between inst_fw_caps of QCS8300 and SM8550+. Drop the
QCS8300-specific tables and use generic one instead.
The differences between QCS8300 and SM8550 data comes from a
non-conflict merge of commit d22037f3fd33 ("media: iris: Set platform
capabilities to firmware for encoder video device") (which added .set
callbacks), and commit 6bdfa3f947a7 ("media: iris: Add platform-specific
capabilities for encoder video device") (which added QCS8300 data, but
not the callbacks).
Dmitry Baryshkov [Tue, 28 Oct 2025 11:46:22 +0000 (13:46 +0200)]
media: iris: stop encoding PIPE value into fw_caps
The value of the PIPE property depends on the number of pipes available
on the platform and is frequently the only difference between several
fw_caps. In order to reduce duplication, use num_vpp_pipe from the
iris_platform_data rather than hardcoding the value into the fw_cap.
media: iris: Add support for QC08C format for encoder
Introduce handling for the QC08C format in the encoder. QC08C
format is NV12 with UBWC compression. Update format checks and
configuration to enable encoding to QC08C streams.
media: iris: Add support for QC08C format for decoder
Introduce handling for the QC08C format in the decoder. QC08C format is
NV12 with UBWC compression. Update format checks and configuration to
enable decoding of QC08C streams.
media: iris: Add support for HFI_PROP_OPB_ENABLE to control split mode
Add handling for the HFI_PROP_OPB_ENABLE property, which allows enabling
or disabling split mode in the firmware. When HFI_PROP_OPB_ENABLE is set
to true, the firmware activates split mode for output picture buffers
(OPB). The OPB format is determined by the HFI_PROP_COLOR_FORMAT
property, supporting NV12 or QC08C formats.
Johan Hovold [Fri, 17 Oct 2025 05:58:09 +0000 (07:58 +0200)]
media: venus: drop bogus probe deferrals
The encoder and decoder platform devices are registered by the venus
driver as children of the venus device, but even if someone were to mess
this up no amount of probe deferring is going to conjure up a parent.
Relatedly, the venus driver sets its driver data before registering the
child devices and if this ever breaks we want to learn about it by
failing probe.
Reported-by: syzbot+480edd2cadb85ddb4bbe@syzkaller.appspotmail.com Closes: https://syzkaller.appspot.com/bug?extid=480edd2cadb85ddb4bbe Signed-off-by: Edward Adam Davis <eadavis@qq.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Martin Tůma [Wed, 29 Oct 2025 14:12:33 +0000 (15:12 +0100)]
media: pci: mgb4: Fix DV capabilities
Use the same value (4096) for the maximum height as used for width.
The HW limits are a 4K video, but the orientation does not matter. Fixes
issues with some portrait oriented Audi displays that exceed the old
height value (2160).
Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Haotian Zhang [Tue, 28 Oct 2025 06:44:43 +0000 (14:44 +0800)]
media: videobuf2: Fix device reference leak in vb2_dc_alloc error path
In vb2_dc_alloc(), get_device() is called to increment the device
reference count. However, if subsequent DMA allocation fails
(vb2_dc_alloc_coherent or vb2_dc_alloc_non_coherent returns error),
the function returns without calling put_device(), causing a device
reference leak.
Add put_device() call in the error path before kfree() to properly
release the device reference acquired earlier.
Laurent Pinchart [Sun, 26 Oct 2025 18:08:29 +0000 (20:08 +0200)]
media: saa7146: Replace saa7146_ext_vv.vbi_fops with write function
The vbi_fops stored in struct saa7146_ext_vv is a full
v4l2_file_operations, but only its .write field is used. Replace it with
a single vbi_write function pointer to save memory.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Johan Hovold [Fri, 17 Oct 2025 06:02:49 +0000 (08:02 +0200)]
media: exynos4-is: fimc-lite: drop unused module alias
The driver does not support anything but OF probing since
commit 47d1f33ff43e ("[media] exynos4-is: Drop drvdata handling in
fimc-lite for non-dt platforms") so drop the unused platform module alias.
Signed-off-by: Johan Hovold <johan@kernel.org> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Johan Hovold [Fri, 17 Oct 2025 05:33:21 +0000 (07:33 +0200)]
media: vpif_display: fix section mismatch
Platform drivers can be probed after their init sections have been
discarded (e.g. on probe deferral or manual rebind through sysfs) so the
probe function must not live in init.
Note that commit ffa1b391c61b ("V4L/DVB: vpif_cap/disp: Removed section
mismatch warning") incorrectly suppressed the modpost warning.
Johan Hovold [Fri, 17 Oct 2025 05:33:20 +0000 (07:33 +0200)]
media: vpif_capture: fix section mismatch
Platform drivers can be probed after their init sections have been
discarded (e.g. on probe deferral or manual rebind through sysfs) so the
probe function must not live in init.
Note that commit ffa1b391c61b ("V4L/DVB: vpif_cap/disp: Removed section
mismatch warning") incorrectly suppressed the modpost warning.
Brian Masney [Thu, 16 Oct 2025 16:16:29 +0000 (12:16 -0400)]
media: platform: ti: omap3isp: isp: convert from round_rate() to determine_rate()
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.
Signed-off-by: Brian Masney <bmasney@redhat.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Brian Masney [Thu, 16 Oct 2025 16:16:28 +0000 (12:16 -0400)]
media: i2c: tc358746: convert from round_rate() to determine_rate()
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.
Signed-off-by: Brian Masney <bmasney@redhat.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Brian Masney [Thu, 16 Oct 2025 16:16:27 +0000 (12:16 -0400)]
media: i2c: max96717: convert from round_rate() to determine_rate()
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.
Signed-off-by: Brian Masney <bmasney@redhat.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Brian Masney [Thu, 16 Oct 2025 16:16:26 +0000 (12:16 -0400)]
media: i2c: ds90ub953: convert from round_rate() to determine_rate()
The round_rate() clk ops is deprecated, so migrate this driver from
round_rate() to determine_rate() using the Coccinelle semantic patch
on the cover letter of this series.
Signed-off-by: Brian Masney <bmasney@redhat.com> Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Marek Szyprowski [Tue, 14 Oct 2025 10:46:43 +0000 (12:46 +0200)]
media: samsung: exynos4-is: fix potential ABBA deadlock on init
v4l2_device_register_subdev_nodes() must called without taking
media_dev->graph_mutex to avoid potential AB-BA deadlock on further
subdevice driver initialization.
Fixes: fa91f1056f17 ("[media] exynos4-is: Add support for asynchronous subdevices registration") Cc: stable@vger.kernel.org Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Acked-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Since commit 63d00be69348fda4 ("PM: runtime: Allow unassigned
->runtime_suspend|resume callbacks"), unassigned
.runtime_{suspend,resume}() callbacks are treated the same as dummy
callbacks that just return zero.
Unassigned system sleep callbacks were always treated the same as dummy
callbacks that just return zero.
As the driver has no other PM callbacks than dummy callbacks, all PM
handling can be removed.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be> Reviewed-by: Ming Qian <ming.qian@oss.nxp.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
media: rcar_jpu: Convert to DEFINE_SIMPLE_DEV_PM_OPS()
Convert the Renesas JPEG Processing Unit driver from an open-coded
dev_pm_ops structure to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr().
This lets us drop the check for CONFIG_PM_SLEEP, and reduces kernel size
in case CONFIG_PM or CONFIG_PM_SLEEP is disabled, while increasing build
coverage.
Miaoqian Lin [Wed, 3 Sep 2025 13:37:29 +0000 (21:37 +0800)]
media: renesas: rcar_drif: fix device node reference leak in rcar_drif_bond_enabled
The function calls of_parse_phandle() which returns
a device node with an incremented reference count. When the bonded device
is not available, the function
returns NULL without releasing the reference, causing a reference leak.
Add of_node_put(np) to release the device node reference.
The of_node_put function handles NULL pointers.
Found through static analysis by reviewing the doc of of_parse_phandle()
and cross-checking its usage patterns across the codebase.
Johan Hovold [Fri, 17 Oct 2025 06:00:49 +0000 (08:00 +0200)]
media: imx-mipi-csis: drop unused module alias
The driver does not support anything but OF probe since commit f0e7cfbb43f1 ("media: imx: imx7_mipi_csis: Add i.MX8MM support") so
drop the unused platform module alias.
Signed-off-by: Johan Hovold <johan@kernel.org> Reviewed-by: Frank Li <Frank.Li@nxp.com> Acked-by: Rui Miguel Silva <rui.silva@linaro.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://patch.msgid.link/20251017060051.8204-1-johan@kernel.org Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
The ISI module on i.MX91 implements only one channel and one parallel
camera input. As no input source selection is required, gasket ops are
unnecessary.
Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Guoniu Zhou <guoniu.zhou@nxp.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://patch.msgid.link/20250905-isi_imx93-v2-5-37db5f768c57@nxp.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Alice Yuan [Fri, 5 Sep 2025 06:56:00 +0000 (14:56 +0800)]
media: nxp: imx8-isi: Add parallel camera input support for i.MX93
The ISI module on i.MX93 implements one camera input which can be
connected to either of MIPI CSI-2 or parallel camera. The source
type can be selected by setting camera mux control register.
Signed-off-by: Alice Yuan <alice.yuan@nxp.com> Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Guoniu Zhou <guoniu.zhou@nxp.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://patch.msgid.link/20250905-isi_imx93-v2-3-37db5f768c57@nxp.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
The ISI module on i.MX91 is reused from i.MX93 and implements one channel
and one camera input which only can be connected to parallel camera input.
So needn't to select camera source like i.MX93 in gasket ops.
Signed-off-by: Alice Yuan <alice.yuan@nxp.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Frank Li <Frank.Li@nxp.com> Signed-off-by: Guoniu Zhou <guoniu.zhou@nxp.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://patch.msgid.link/20250905-isi_imx93-v2-1-37db5f768c57@nxp.com Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Stefan Klug [Mon, 22 Sep 2025 18:19:57 +0000 (20:19 +0200)]
media: rkisp1: Improve frame sequence correctness on stats and params buffers
On the rkisp1 (in my case on a NXP i.MX8 M Plus) the ISP interrupt
handler is sometimes called with RKISP1_CIF_ISP_V_START (start of frame)
and RKISP1_CIF_ISP_FRAME (end of frame) being set at the same time. In
commit 8524fa22fd2f ("media: staging: rkisp1: isp: add a warning and
debugfs var for irq delay") a warning was added for that. There are two
cases where this condition can occur:
1. The v-sync and the frame-end belong to the same frame. This means,
the irq was heavily delayed and the warning is likely appropriate.
2. The v-sync belongs to the next frame. This can happen if the vertical
blanking between two frames is very short.
The current code always handles case 1 although case 2 is in my
experience the more common case and happens in regular usage. This leads
to incorrect sequence numbers on stats and params buffers which in turn
breaks the regulation in user space. Fix that by adding a frame_active
flag to distinguish between these cases and handle the start of frame
either at the beginning or at the end of the rkisp1_isp_isr().
Daniel Scally [Tue, 28 Oct 2025 09:28:54 +0000 (09:28 +0000)]
MAINTAINERS: Update Daniel Scally's email address
Update my email address in MAINTAINERS from my personal account to
my work one.
Signed-off-by: Daniel Scally <dan.scally@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
The driver right now defaults to setting the vertical flip bit. This
conflicts with proper handling of the rotation property defined in
ACPI or device tree, so drop the VFLIP bit. It should be handled via
V4L2_CID_VFLIP instead.
Benjamin Mugnier [Tue, 19 Aug 2025 14:47:42 +0000 (16:47 +0200)]
media: i2c: vd55g1: Add support for vd65g4 RGB variant
The vd65g4 is the bayer version of the vd55g1.
As opposed to the vd55g1, the vd65g4 does not need any patch. Check the
sensor id at probe and choose to patch or not on power_on() according to
it.
It's bayer matrix's order is RGGB. This commit handles hflip and vflip
by switching the bayer pattern accordingly.
Signed-off-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Frank Li [Tue, 21 Oct 2025 15:49:22 +0000 (11:49 -0400)]
media: dt-bindings: video-interfaces: add video-interfaces.h information
Mention include/dt-bindings/media/video-interfaces.h in descriptions to
help avoid use hardcode in dts.
Signed-off-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
media: ov13b10: Add ACPI ID for ASUS Z13 Flow laptop
The ASUS ROG Flow Z13 2025 (GZ302) laptop uses an OV13B10 sensor with a
non-standard ACPI ID of OMNI13B1 instead of the expected OVTI13B1.
Add this ACPI ID to the driver to make the front-facing camera work on
these laptops.
Signed-off-by: Adam J. Sypniewski <ajsyp@syptech.net> Reviewed-by: Hans de Goede <hansg@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Jai Luthra [Fri, 17 Oct 2025 08:13:50 +0000 (13:43 +0530)]
media: i2c: imx219: Simplify imx219_get_binning() function
In imx219_set_pad_format() there is now a constraint to enforce hbin ==
vbin. So, simplify the logic in imx219_get_binning() function by
removing dead code that handles the case where hbin != vbin.
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Tested-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Dave Stevenson [Fri, 17 Oct 2025 08:13:49 +0000 (13:43 +0530)]
media: i2c: imx219: Fix 1920x1080 mode to use 1:1 pixel aspect ratio
Commit 0af46fbc333d ("media: i2c: imx219: Calculate crop rectangle
dynamically") meant that the 1920x1080 mode switched from using no
binning to using vertical binning but no horizontal binning, which
resulted in stretched pixels.
Until proper controls are available to independently select horizontal
and vertical binning, restore the original 1:1 pixel aspect ratio by
forcing binning to be uniform in both directions.
Cc: stable@vger.kernel.org Fixes: 0af46fbc333d ("media: i2c: imx219: Calculate crop rectangle dynamically") Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.com>
[Add comment & reword commit message] Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com> Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Frank Li [Wed, 15 Oct 2025 15:48:11 +0000 (11:48 -0400)]
dt-bindings: media: convert nxp,tda1997x.txt to yaml format
Convert nxp,tda1997x.txt to yaml format
Additional changes:
- update audio width to 8, 16, 24, 32.
- keep one example only.
Signed-off-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Frank Li [Tue, 14 Oct 2025 18:55:09 +0000 (14:55 -0400)]
dt-bindings: media: Convert ti,tvp5150.txt to yaml format.
Convert ti,tvp5150.txt to yaml format.
Signed-off-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Reviewed-by: David Heidelberg <david@ixit.cz>
[Sakari Ailus: Align the endpoint properties to the right column.] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
The DW9800K is a similar part to the DW9719. The method for operation is
the same as the DW9719, but the register set is different. Add support
for this part to the existing dw9719 driver.
Tested on the Fairphone 5 smartphone.
Tested-by: Luca Weiss <luca.weiss@fairphone.com> Signed-off-by: Griffin Kroah-Hartman <griffin.kroah@fairphone.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Val Packett [Sat, 20 Sep 2025 12:03:47 +0000 (14:03 +0200)]
media: i2c: dw9719: Fix power on/off sequence
The "jiggle" code was not actually expecting failure, which it should
because that's what actually happens when the device wasn't already woken
up by the regulator power-on (i.e. in the case of a shared regulator).
Also, do actually enter the internal suspend mode on shutdown, to save
power in the case of a shared regulator.
Also, wait a bit longer (2x tOPR) on waking up, 1x is not enough at least
on the DW9718S as found on the motorola-nora smartphone.
Signed-off-by: Val Packett <val@packett.cool> Signed-off-by: André Apitzsch <git@apitzsch.eu> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Val Packett [Sat, 20 Sep 2025 12:03:46 +0000 (14:03 +0200)]
media: i2c: dw9719: Update PM last busy time upon close
Update the close callback to match other similar drivers like dw9768.
Signed-off-by: Val Packett <val@packett.cool> Signed-off-by: André Apitzsch <git@apitzsch.eu> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Val Packett [Sat, 20 Sep 2025 12:03:45 +0000 (14:03 +0200)]
media: i2c: dw9719: Add DW9718S support
The DW9718S is a similar part that uses a different register set but
follows the same method of operation otherwise. Add support for it
to the existing dw9719 driver.
Tested on the Moto E5 (motorola-nora) smartphone.
Signed-off-by: Val Packett <val@packett.cool> Signed-off-by: André Apitzsch <git@apitzsch.eu> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Val Packett [Sat, 20 Sep 2025 12:03:44 +0000 (14:03 +0200)]
media: i2c: dw9719: Add driver_data matching
In preparation for adding models with different register sets, start
assigning the model based on the i2c match data.
Signed-off-by: Val Packett <val@packett.cool> Signed-off-by: André Apitzsch <git@apitzsch.eu> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Val Packett [Sat, 20 Sep 2025 12:03:43 +0000 (14:03 +0200)]
media: i2c: dw9719: Add an of_match_table
Allow the dw9719 driver to be attached via FDT.
Signed-off-by: Val Packett <val@packett.cool> Signed-off-by: André Apitzsch <git@apitzsch.eu> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
André Apitzsch [Sat, 20 Sep 2025 12:03:42 +0000 (14:03 +0200)]
media: i2c: dw9719: Remove unused i2c device id table
Nothing depends on the I²C device ID table, so remove it.
Signed-off-by: André Apitzsch <git@apitzsch.eu> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
André Apitzsch [Sat, 20 Sep 2025 12:03:41 +0000 (14:03 +0200)]
media: i2c: dw9719: Deprecate dongwoon,vcm-freq
The name of property "dongwoon,vcm-freq" doesn't match its purpose.
Change the name of the property to "dongwoon,vcm-prescale" to better
describe its purpose and deprecate the old one.
Signed-off-by: André Apitzsch <git@apitzsch.eu> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
André Apitzsch [Sat, 20 Sep 2025 12:03:40 +0000 (14:03 +0200)]
dt-bindings: media: i2c: Add DW9718S, DW9719 and DW9761 VCM
Document Dongwoon DW9718S, DW9719 and DW9761 VCM devicetree bindings.
Signed-off-by: André Apitzsch <git@apitzsch.eu> Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Ma Ke [Mon, 29 Sep 2025 01:30:07 +0000 (09:30 +0800)]
media: ivsc: Release csi_dev reference early in mei_ace_setup_dev_link()
Put the reference to csi_dev acquired during driver probe in
mei_ace_setup_dev_link() inside the same function, instead of during driver
unbind in mei_ace_remove(). This can be done as device_link_add() already
takes a reference to csi_dev.
Signed-off-by: Ma Ke <make24@iscas.ac.cn>
[Sakari Ailus: Rework commit message.] Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Pavan Bobba [Tue, 28 Oct 2025 06:26:23 +0000 (11:56 +0530)]
media: v4l2-ctrls: set AV1 sequence flags for testing
Initialize additional AV1 sequence parameters in std_init_compound()
to make the default AV1 sequence control compatible with compliance
and userspace testing tools.
Specifically, set:
- enable both SUBSAMPLING_X and SUBSAMPLING_Y flags
These defaults help ensure that V4L2_CID_AV1_SEQUENCE behaves
consistently during validation and v4l2-compliance tests.
Signed-off-by: Pavan Bobba <opensource206@gmail.com> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
[hverkuil: align everything a bit better]
[hverkuil: replaced Pavan's comment with comment suggested by Nicolas] Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Ricardo Ribalda [Mon, 20 Oct 2025 07:53:41 +0000 (07:53 +0000)]
media: renesas: fdp1: Use %pe format specifier
The %pe format specifier is designed to print error pointers. It prints
a symbolic error name (eg. -EINVAL) and it makes the code simpler by
omitting PTR_ERR()
This patch fixes this cocci report:
./platform/renesas/rcar_fdp1.c:2303:4-11: WARNING: Consider using %pe to print PTR_ERR()
media: allegro: fix race conditions in channel handling
Since the channel list is used in different contexts, it must be ensured
that it is always consistent. Also, the channels contained in the list may
only be released when they are no longer needed in any context.
Add a lock to protect the list and reference handling for the channels.
Signed-off-by: Matthias Fend <matthias.fend@emfend.at> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
media: allegro: process all pending status mbox messages
Under certain circumstances, not every message written by the MCU to the
status mailbox may trigger a corresponding interrupt. This is likely when
multiple messages are generated in a very short period of time. Since the
current implementation only processes one message per interrupt, even if
multiple messages are already available in the mailbox, expected messages
are either not received or are processed late. This leads to various
subsequent problems and causes the driver to no longer function properly.
The behavior has been adjusted so that after an interrupt, all messages
available in the mailbox are processed.
Signed-off-by: Matthias Fend <matthias.fend@emfend.at> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
media: allegro: print warning if channel creation timeout occurs
This message can be helpful for troubleshooting and there is already a
corresponding message in case of a channel destroy timeout.
Add a similar message for channel creation.
Signed-off-by: Matthias Fend <matthias.fend@emfend.at> Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
media: v4l2-ctrls: add full AV1 profile validation in validate_av1_sequence()
Complete the "TODO: PROFILES" by enforcing profile-specific and
monochrome constraints as defined by the AV1 specification
(Section 5.5.2, "Color config syntax").
The validator now checks:
- Flags: reject any unknown bits set in sequence->flags
- Profile range: only profiles 0..2 are valid
- Profile 0: 8/10-bit only, subsampling must be 4:2:0 (sx=1, sy=1),
monochrome allowed
- Profile 1: 8/10-bit only, subsampling must be 4:4:4 (sx=0, sy=0),
monochrome forbidden
- Profile 2:
* 8/10-bit: only 4:2:2 allowed (sx=1, sy=0)
* 12-bit: 4:4:4 (sx=0, sy=0), 4:2:2 (sx=1, sy=0), or 4:2:0 (sx=1, sy=1)
allowed
- Monochrome path (all profiles except 1): forces subsampling_x=1,
subsampling_y=1, separate_uv_delta_q=0
These checks prevent userspace from providing invalid AV1 sequence
headers that would otherwise be accepted, leading to undefined driver
or hardware behavior.
Signed-off-by: Pavan Bobba <opensource206@gmail.com> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Haoxiang Li [Mon, 15 Sep 2025 12:09:38 +0000 (20:09 +0800)]
media: mediatek: vcodec: Fix a reference leak in mtk_vcodec_fw_vpu_init()
vpu_get_plat_device() increases the reference count of the returned
platform device. However, when devm_kzalloc() fails, the reference
is not released, causing a reference leak.
Fix this by calling put_device() on fw_pdev->dev before returning
on the error path.
Fixes: e25a89f743b1 ("media: mtk-vcodec: potential dereference of null pointer") Cc: stable@vger.kernel.org Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Reviewed-by: Tzung-Bi Shih <tzungbi@kernel.org> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Ming Qian [Tue, 16 Sep 2025 06:10:07 +0000 (14:10 +0800)]
media: amphion: Cancel message work before releasing the VPU core
To avoid accessing the VPU register after release of the VPU core,
cancel the message work and destroy the workqueue that handles the
VPU message before release of the VPU core.
Fixes: 3cd084519c6f ("media: amphion: add vpu v4l2 m2m support") Cc: stable@vger.kernel.org Signed-off-by: Ming Qian <ming.qian@oss.nxp.com> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Nicolas Dufresne [Mon, 22 Sep 2025 18:43:39 +0000 (14:43 -0400)]
media: verisilicon: Protect G2 HEVC decoder against invalid DPB index
Fix the Hantro G2 HEVC decoder so that we use DPB index 0 whenever a
ninvalid index is received from user space. This protects the hardware
from doing faulty memory access which then leads to bus errors.
To be noted that when a reference is missing, userspace such as GStreamer
passes an invalid DPB index of 255. This issue was found by seeking to a
CRA picture using GStreamer. The framework is currently missing the code
to skip over RASL pictures placed after the CRA. This situation can also
occur while doing live streaming over lossy transport.
Fixes: cb5dd5a0fa518 ("media: hantro: Introduce G2/HEVC decoder") Cc: stable@vger.kernel.org Reviewed-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Nicolas Dufresne [Mon, 22 Sep 2025 18:43:38 +0000 (14:43 -0400)]
media: verisilicon: Fix CPU stalls on G2 bus error
In some seek stress tests, we are getting IRQ from the G2 decoder where
the dec_bus_int and the dec_e bits are high, meaning the decoder is
still running despite the error.
Fix this by reworking the IRQ handler to only finish the job once we
have reached completion and move the software reset to when our software
watchdog triggers.
This way, we let the hardware continue on errors when it did not self
reset and in worse case scenario the hardware timeout will
automatically stop it. The actual error will be fixed in a follow up
patch.
Fixes: 3385c514ecc5a ("media: hantro: Convert imx8m_vpu_g2_irq to helper") Cc: stable@vger.kernel.org Reviewed-by: Benjamin Gaignard <benjamin.gaignard@collabora.com> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Chen-Yu Tsai [Wed, 20 Aug 2025 07:54:05 +0000 (15:54 +0800)]
media: mediatek: vcodec: Use spinlock for context list protection lock
Previously a mutex was added to protect the encoder and decoder context
lists from unexpected changes originating from the SCP IP block, causing
the context pointer to go invalid, resulting in a NULL pointer
dereference in the IPI handler.
Turns out on the MT8173, the VPU IPI handler is called from hard IRQ
context. This causes a big warning from the scheduler. This was first
reported downstream on the ChromeOS kernels, but is also reproducible
on mainline using Fluster with the FFmpeg v4l2m2m decoders. Even though
the actual capture format is not supported, the affected code paths
are triggered.
Since this lock just protects the context list and operations on it are
very fast, it should be OK to switch to a spinlock.
Fixes: 6467cda18c9f ("media: mediatek: vcodec: adding lock to protect decoder context list") Fixes: afaaf3a0f647 ("media: mediatek: vcodec: adding lock to protect encoder context list") Cc: Yunfei Dong <yunfei.dong@mediatek.com> Cc: stable@vger.kernel.org Signed-off-by: Chen-Yu Tsai <wenst@chromium.org> Reviewed-by: Fei Shao <fshao@chromium.org> Reviewed-by: Tomasz Figa <tfiga@chromium.org> Signed-off-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>