]> git.ipfire.org Git - thirdparty/kernel/stable.git/log
thirdparty/kernel/stable.git
6 weeks agomedia: adv7180: Move adv7180_set_power() and init_device()
Niklas Söderlund [Thu, 28 Aug 2025 16:06:44 +0000 (18:06 +0200)] 
media: adv7180: Move adv7180_set_power() and init_device()

Move the two functions adv7180_set_power() and init_device() earlier in
the file so they in future changes can be used from .querystd and
.s_stream as the driver is reworked to drop the usage of .s_power.

While at it fix two style issues in init_device() that checkpatch
complains about.

  - Two cases of indentation issues for function arguments split over
    multiple lines.

  - The repetition of the word 'interrupts' in a comment.

Apart from these style fixes the functions are moved verbatim and there
are no functional changes.

Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: rkisp1: Add support for multiple power domains
Laurent Pinchart [Mon, 16 Jun 2025 01:11:14 +0000 (04:11 +0300)] 
media: rkisp1: Add support for multiple power domains

The ISP instances in the NXP i.MX8MP need two power domains. While
single power domains are managed automatically by the device core,
support for multiple power domains requires manually attaching to the
power domains. Do so based on platform data.

Link: https://lore.kernel.org/r/20250616011115.19515-6-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: rkisp1: Acquire pclk clock on i.MX8MP
Laurent Pinchart [Mon, 16 Jun 2025 01:11:13 +0000 (04:11 +0300)] 
media: rkisp1: Acquire pclk clock on i.MX8MP

The ISP instances in the NXP i.MX8MP need the input pixel clock to be
enabled in order to access the HDR stitching registers. The clock should
ideally be mandatory, but that would break backward compatibility with
old DT. Try to acquire it as an optional clock instead.

Link: https://lore.kernel.org/r/20250616011115.19515-5-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: rkisp1: Refactor clocks initialization
Laurent Pinchart [Mon, 16 Jun 2025 01:11:12 +0000 (04:11 +0300)] 
media: rkisp1: Refactor clocks initialization

ISP instances in different SoCs differ in the number of clocks they use,
but not in the clock names. Refactor clocks initialization to avoid
duplicating the clock names per platform, and lower the total number of
clocks from 8 to 4 as no platform uses more than 4 clocks. Use a static
assert to ensure at build time that the size of the arrays match.

Link: https://lore.kernel.org/r/20250616011115.19515-4-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agodt-bindings: media: rkisp1: Add second power domain on i.MX8MP
Laurent Pinchart [Mon, 16 Jun 2025 01:11:11 +0000 (04:11 +0300)] 
dt-bindings: media: rkisp1: Add second power domain on i.MX8MP

In the NXP i.MX8MP, the pclk clock required by the ISP is gated by the
MIPI CSI-2 power domain. Add it to the power-domains property, and
require specifying power-domain-names accordingly.

Link: https://lore.kernel.org/r/20250616011115.19515-3-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agodt-bindings: media: rkisp1: Require pclk clock on i.MX8MP variant
Laurent Pinchart [Mon, 16 Jun 2025 01:11:10 +0000 (04:11 +0300)] 
dt-bindings: media: rkisp1: Require pclk clock on i.MX8MP variant

The ISP integrated in the NXP i.MX8MP requires the pclk clock to access
the HDR stitching registers. Make it mandatory in the DT binding.

Link: https://lore.kernel.org/r/20250616011115.19515-2-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: nxp: imx8-isi: m2m: Delay power up until streamon
Laurent Pinchart [Thu, 21 Aug 2025 13:51:23 +0000 (16:51 +0300)] 
media: nxp: imx8-isi: m2m: Delay power up until streamon

There's no need to power up the device when userspace opens it. Delay
the operation until streamon.

Link: https://lore.kernel.org/r/20250821135123.29462-2-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Guoniu Zhou <guoniu.zhou@nxp.com>
Tested-by: Guoniu Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: nxp: imx8-isi: m2m: Fix streaming cleanup on release
Guoniu Zhou [Thu, 21 Aug 2025 13:51:22 +0000 (16:51 +0300)] 
media: nxp: imx8-isi: m2m: Fix streaming cleanup on release

If streamon/streamoff calls are imbalanced, such as when exiting an
application with Ctrl+C when streaming, the m2m usage_count will never
reach zero and the ISI channel won't be freed. Besides from that, if the
input line width is more than 2K, it will trigger a WARN_ON():

[ 59.222120] ------------[ cut here ]------------
[ 59.226758] WARNING: drivers/media/platform/nxp/imx8-isi/imx8-isi-hw.c:631 at mxc_isi_channel_chain+0xa4/0x120, CPU#4: v4l2-ctl/654
[ 59.238569] Modules linked in: ap1302
[ 59.242231] CPU: 4 UID: 0 PID: 654 Comm: v4l2-ctl Not tainted 6.16.0-rc4-next-20250704-06511-gff0e002d480a-dirty #258 PREEMPT
[ 59.253597] Hardware name: NXP i.MX95 15X15 board (DT)
[ 59.258720] pstate: 80400009 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[ 59.265669] pc : mxc_isi_channel_chain+0xa4/0x120
[ 59.270358] lr : mxc_isi_channel_chain+0x44/0x120
[ 59.275047] sp : ffff8000848c3b40
[ 59.278348] x29: ffff8000848c3b40 x28: ffff0000859b4c98 x27: ffff800081939f00
[ 59.285472] x26: 000000000000000a x25: ffff0000859b4cb8 x24: 0000000000000001
[ 59.292597] x23: ffff0000816f4760 x22: ffff0000816f4258 x21: ffff000084ceb780
[ 59.299720] x20: ffff000084342ff8 x19: ffff000084340000 x18: 0000000000000000
[ 59.306845] x17: 0000000000000000 x16: 0000000000000000 x15: 0000ffffdb369e1c
[ 59.313969] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
[ 59.321093] x11: 0000000000000000 x10: 0000000000000000 x9 : 0000000000000000
[ 59.328217] x8 : ffff8000848c3d48 x7 : ffff800081930b30 x6 : ffff800081930b30
[ 59.335340] x5 : ffff0000859b6000 x4 : ffff80008193ae80 x3 : ffff800081022420
[ 59.342464] x2 : ffff0000852f6900 x1 : 0000000000000001 x0 : ffff000084341000
[ 59.349590] Call trace:
[ 59.352025]  mxc_isi_channel_chain+0xa4/0x120 (P)
[ 59.356722]  mxc_isi_m2m_streamon+0x160/0x20c
[ 59.361072]  v4l_streamon+0x24/0x30
[ 59.364556]  __video_do_ioctl+0x40c/0x4a0
[ 59.368560]  video_usercopy+0x2bc/0x690
[ 59.372382]  video_ioctl2+0x18/0x24
[ 59.375857]  v4l2_ioctl+0x40/0x60
[ 59.379168]  __arm64_sys_ioctl+0xac/0x104
[ 59.383172]  invoke_syscall+0x48/0x104
[ 59.386916]  el0_svc_common.constprop.0+0xc0/0xe0
[ 59.391613]  do_el0_svc+0x1c/0x28
[ 59.394915]  el0_svc+0x34/0xf4
[ 59.397966]  el0t_64_sync_handler+0xa0/0xe4
[ 59.402143]  el0t_64_sync+0x198/0x19c
[ 59.405801] ---[ end trace 0000000000000000 ]---

Address this issue by moving the streaming preparation and cleanup to
the vb2 .prepare_streaming() and .unprepare_streaming() operations. This
also simplifies the driver by allowing direct usage of the
v4l2_m2m_ioctl_streamon() and v4l2_m2m_ioctl_streamoff() helpers.

Fixes: cf21f328fcaf ("media: nxp: Add i.MX8 ISI driver")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20250821135123.29462-1-laurent.pinchart@ideasonboard.com
Signed-off-by: Guoniu Zhou <guoniu.zhou@nxp.com>
Co-developed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Guoniu Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: nxp: imx8-isi: Add suspend/resume support for ISI mem2mem
Guoniu Zhou [Fri, 15 Aug 2025 09:28:51 +0000 (17:28 +0800)] 
media: nxp: imx8-isi: Add suspend/resume support for ISI mem2mem

Add suspend/resume support for ISI when work at memory to memory mode.

Link: https://lore.kernel.org/r/20250815-isi_m2m-v2-1-32e3720880cc@nxp.com
Signed-off-by: Guoniu Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: nxp: imx8-isi: Drop unused argument to mxc_isi_channel_chain()
Laurent Pinchart [Wed, 13 Aug 2025 22:55:01 +0000 (01:55 +0300)] 
media: nxp: imx8-isi: Drop unused argument to mxc_isi_channel_chain()

The bypass argument to the mxc_isi_channel_chain() function is unused.
Drop it.

Link: https://lore.kernel.org/r/20250813225501.20762-1-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: nxp: imx8-isi: Drop mxc_isi_video.is_streaming field
Laurent Pinchart [Wed, 13 Aug 2025 21:24:51 +0000 (00:24 +0300)] 
media: nxp: imx8-isi: Drop mxc_isi_video.is_streaming field

The mxc_isi_video.is_streaming field is used to track the streaming
status of the video device. The same information is also tracked by the
videobuf2 queue. Drop the is_streaming field, and check the queue
streaming status instead.

Link: https://lore.kernel.org/r/20250813212451.22140-3-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Richard Leitner <richard.leitner@linux.dev> # i.MX8MP
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: nxp: imx8-isi: Fix streaming cleanup on release
Richard Leitner [Wed, 13 Aug 2025 21:24:50 +0000 (00:24 +0300)] 
media: nxp: imx8-isi: Fix streaming cleanup on release

The current implementation unconditionally calls
mxc_isi_video_cleanup_streaming() in mxc_isi_video_release(). This can
lead to situations where any release call (like from a simple
"v4l2-ctl -l") may release a currently streaming queue when called on
such a device.

This is reproducible on an i.MX8MP board by streaming from an ISI
capture device using gstreamer:

gst-launch-1.0 -v v4l2src device=/dev/videoX ! \
    video/x-raw,format=GRAY8,width=1280,height=800,framerate=1/120 ! \
    fakesink

While this stream is running, querying the caps of the same device
provokes the error state:

v4l2-ctl -l -d /dev/videoX

This results in the following trace:

[  155.452152] ------------[ cut here ]------------
[  155.452163] WARNING: CPU: 0 PID: 1708 at drivers/media/platform/nxp/imx8-isi/imx8-isi-pipe.c:713 mxc_isi_pipe_irq_handler+0x19c/0x1b0 [imx8_isi]
[  157.004248] Modules linked in: cfg80211 rpmsg_ctrl rpmsg_char rpmsg_tty virtio_rpmsg_bus rpmsg_ns rpmsg_core rfkill nft_ct nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nf_tables mcp251x6
[  157.053499] CPU: 0 UID: 0 PID: 1708 Comm: python3 Not tainted 6.15.4-00114-g1f61ca5cad76 #1 PREEMPT
[  157.064369] Hardware name: imx8mp_board_01 (DT)
[  157.068205] pstate: 400000c5 (nZcv daIF -PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[  157.075169] pc : mxc_isi_pipe_irq_handler+0x19c/0x1b0 [imx8_isi]
[  157.081195] lr : mxc_isi_pipe_irq_handler+0x38/0x1b0 [imx8_isi]
[  157.087126] sp : ffff800080003ee0
[  157.090438] x29: ffff800080003ee0 x28: ffff0000c3688000 x27: 0000000000000000
[  157.097580] x26: 0000000000000000 x25: ffff0000c1e7ac00 x24: ffff800081b5ad50
[  157.104723] x23: 00000000000000d1 x22: 0000000000000000 x21: ffff0000c25e4000
[  157.111866] x20: 0000000060000200 x19: ffff80007a0608d0 x18: 0000000000000000
[  157.119008] x17: ffff80006a4e3000 x16: ffff800080000000 x15: 0000000000000000
[  157.126146] x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
[  157.133287] x11: 0000000000000040 x10: ffff0000c01445f0 x9 : ffff80007a053a38
[  157.140425] x8 : ffff0000c04004b8 x7 : 0000000000000000 x6 : 0000000000000000
[  157.147567] x5 : ffff0000c0400490 x4 : ffff80006a4e3000 x3 : ffff0000c25e4000
[  157.154706] x2 : 0000000000000000 x1 : ffff8000825c0014 x0 : 0000000060000200
[  157.161850] Call trace:
[  157.164296]  mxc_isi_pipe_irq_handler+0x19c/0x1b0 [imx8_isi] (P)
[  157.170319]  __handle_irq_event_percpu+0x58/0x218
[  157.175029]  handle_irq_event+0x54/0xb8
[  157.178867]  handle_fasteoi_irq+0xac/0x248
[  157.182968]  handle_irq_desc+0x48/0x68
[  157.186723]  generic_handle_domain_irq+0x24/0x38
[  157.191346]  gic_handle_irq+0x54/0x120
[  157.195098]  call_on_irq_stack+0x24/0x30
[  157.199027]  do_interrupt_handler+0x88/0x98
[  157.203212]  el0_interrupt+0x44/0xc0
[  157.206792]  __el0_irq_handler_common+0x18/0x28
[  157.211328]  el0t_64_irq_handler+0x10/0x20
[  157.215429]  el0t_64_irq+0x198/0x1a0
[  157.219009] ---[ end trace 0000000000000000 ]---

Address this issue by moving the streaming preparation and cleanup to
the vb2 .prepare_streaming() and .unprepare_streaming() operations. This
also simplifies the driver by allowing direct usage of the
vb2_ioctl_streamon() and vb2_ioctl_streamoff() helpers, and removal of
the manual cleanup from mxc_isi_video_release().

Link: https://lore.kernel.org/r/20250813212451.22140-2-laurent.pinchart@ideasonboard.com
Signed-off-by: Richard Leitner <richard.leitner@linux.dev>
Co-developed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Richard Leitner <richard.leitner@linux.dev> # i.MX8MP
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: imx-mipi-csis: Initial support for multiple output channels
Laurent Pinchart [Fri, 22 Aug 2025 00:27:32 +0000 (03:27 +0300)] 
media: imx-mipi-csis: Initial support for multiple output channels

Some CSIS instances feature more than one output channel. Update
register macros accordingly, parse the number of channels from the
device tree, and update register dumps and event counters to log
per-channel data.

Support for routing virtual channels and data types to output channels
through the subdev internal routing API will come later.

Link: https://lore.kernel.org/r/20250822002734.23516-13-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Stefan Klug <stefan.klug@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agodt-bindings: media: nxp,imx-mipi-csi2: Add fsl,num-channels property
Laurent Pinchart [Fri, 22 Aug 2025 00:27:31 +0000 (03:27 +0300)] 
dt-bindings: media: nxp,imx-mipi-csi2: Add fsl,num-channels property

The CSI-2 receiver can be instantiated with up to four output channels.
This is an integration-specific property, specify the number of
instantiated channels through a new fsl,num-channels property. The
property is optional, and defaults to 1 as only one channel is currently
supported by drivers.

Using the compatible string to infer the number of channels has been
considered, but multiple instances of the same CSIS in the same SoC
could conceptually be synthesized with a different number of channels.
An explicit property is therefore more appropriate.

The only known SoC to have more than one channel is the i.MX8MP. As the
binding examples do not cover that SoC, don't update them.

Link: https://lore.kernel.org/r/20250822002734.23516-12-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agodt-bindings: media: nxp,imx-mipi-csi2: Mark clock-frequency as deprecated
Laurent Pinchart [Fri, 22 Aug 2025 00:27:30 +0000 (03:27 +0300)] 
dt-bindings: media: nxp,imx-mipi-csi2: Mark clock-frequency as deprecated

Usage of the clock-frequency property, which is already optional, is
discouraged in favour of using assigned-clock-rates (and
assigned-clock-parents where needed). Mark the property as deprecated,
and update the examples accordingly.

Link: https://lore.kernel.org/r/20250822002734.23516-11-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: imx-mipi-csis: Only set clock rate when specified in DT
Laurent Pinchart [Fri, 22 Aug 2025 00:27:29 +0000 (03:27 +0300)] 
media: imx-mipi-csis: Only set clock rate when specified in DT

The imx-mipi-csis driver sets the rate of the wrap clock to the value
specified in the device tree's "clock-frequency" property, and defaults
to 166 MHz otherwise. This is a historical mistake, as clock rate
selection should have been left to the assigned-clock-rates property.

Honouring the clock-frequency property can't be removed without breaking
backwards compatibility, and the corresponding code isn't very
intrusive. The 166 MHz default, on the other hand, prevents
configuration of the clock rate through assigned-clock-rates, as the
driver immediately overwrites the rate. This behaviour is confusing and
has cost debugging time.

There is little value in a 166 MHz default. All mainline device tree
sources that enable the CSIS specify a clock-frequency explicitly, and
the default wrap clock configuration on supported platforms is at least
as high as 166 MHz. Drop the default, and only set the clock rate
manually when the clock-frequency property is specified.

Link: https://lore.kernel.org/r/20250822002734.23516-10-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: imx-mipi-csis: Log per-lane start of transmission errors
Laurent Pinchart [Fri, 22 Aug 2025 00:27:28 +0000 (03:27 +0300)] 
media: imx-mipi-csis: Log per-lane start of transmission errors

The CSIS has per-line start of transmission error interrupts. Log them
all, instead of only the first data lane.

Link: https://lore.kernel.org/r/20250822002734.23516-9-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: imx-mipi-csis: Fix field alignment in register dump
Laurent Pinchart [Fri, 22 Aug 2025 00:27:27 +0000 (03:27 +0300)] 
media: imx-mipi-csis: Fix field alignment in register dump

Commit 95a1379004cb ("media: staging: media: imx: imx7-mipi-csis: Dump
MIPI_CSIS_FRAME_COUNTER_CH0 register") forgot to increase the maximum
register name length, resulting in misalignment of names printed in the
kernel log. Fix it.

Link: https://lore.kernel.org/r/20250822002734.23516-8-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: imx-mipi-csis: Use GENMASK for all register field masks
Laurent Pinchart [Fri, 22 Aug 2025 00:27:26 +0000 (03:27 +0300)] 
media: imx-mipi-csis: Use GENMASK for all register field masks

Multiple register field mask macros use GENMASK, while other define the
mask value manually. Standardize on GENMASK everywhere, as well as on
the _MASK suffix to name the macros. This improves consistency and helps
with readability.

No functional change is intended.

Link: https://lore.kernel.org/r/20250822002734.23516-7-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: imx-mipi-csis: Rename register macros to match reference manual
Laurent Pinchart [Fri, 22 Aug 2025 00:27:25 +0000 (03:27 +0300)] 
media: imx-mipi-csis: Rename register macros to match reference manual

The CSIS driver uses register macro names that do not match the
reference manual of the i.MX7[DS] and i.MX8M[MNP] SoCs in which the CSIS
is integrated. Rename them to match the documentation, making the code
easier to read alongside the reference manuals.

One of the misnamed register fields is MIPI_CSIS_INT_SRC_ERR_UNKNOWN,
which led to the corresponding event being logged as "Unknown Error".
The correct register field name is MIPI_CSIS_INT_SRC_ERR_ID, documented
as "Unknown ID error". Update the event description accordingly.

While at it, also replace a few *_OFFSET macros with parametric macros
for consistency, and add the missing MIPI_CSIS_ISP_RESOL_VRESOL and
MIPI_CSIS_ISP_RESOL_HRESOL register field macros.

No functional change intended.

Link: https://lore.kernel.org/r/20250822002734.23516-6-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: imx-mipi-csis: Shorten name of subdev state variables
Laurent Pinchart [Fri, 22 Aug 2025 00:27:24 +0000 (03:27 +0300)] 
media: imx-mipi-csis: Shorten name of subdev state variables

Rename sd_state to state to standardize the naming of the subdev state
variables and help shortening lines.

No functional change is intended.

Link: https://lore.kernel.org/r/20250822002734.23516-5-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: imx-mipi-csis: Standardize const keyword placement
Laurent Pinchart [Fri, 22 Aug 2025 00:27:23 +0000 (03:27 +0300)] 
media: imx-mipi-csis: Standardize const keyword placement

The const keyword for pointer variables is placed before the type
everywhere except in one location. Change it to improve consistency.

No functional change is intended.

Link: https://lore.kernel.org/r/20250822002734.23516-4-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: imx-mipi-csis: Simplify access to source pad
Laurent Pinchart [Fri, 22 Aug 2025 00:27:22 +0000 (03:27 +0300)] 
media: imx-mipi-csis: Simplify access to source pad

The mipi_csis_calculate_params() function needs to access the pad of the
connected source. The pad is already available in csis->source.pad, but
the function takes a convoluted path by getting the pad index and
indexing the source subdev's pads array. Simplify it.

No functional change is intended.

Link: https://lore.kernel.org/r/20250822002734.23516-3-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: v4l2-common: Constify media_pad argument to v4l2_get_link_freq()
Laurent Pinchart [Fri, 22 Aug 2025 00:27:21 +0000 (03:27 +0300)] 
media: v4l2-common: Constify media_pad argument to v4l2_get_link_freq()

The v4l2_get_link_freq() macro doesn't modify the pad argument. Make it
possible to call it with a const media_pad pointer.

Link: https://lore.kernel.org/r/20250822002734.23516-2-laurent.pinchart@ideasonboard.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Frank Li <Frank.Li@nxp.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: pci: mgb4: Fix timings comparison in VIDIOC_S_DV_TIMINGS
Martin Tůma [Tue, 26 Aug 2025 16:28:29 +0000 (18:28 +0200)] 
media: pci: mgb4: Fix timings comparison in VIDIOC_S_DV_TIMINGS

Compare the whole v4l2_bt_timings struct, not just the width/height when
setting new timings. Timings with the same resolution and different
pixelclock can now be properly set.

Signed-off-by: Martin Tůma <martin.tuma@digiteqautomotive.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: aspeed: Allow to capture from SoC display (GFX)
Jammy Huang [Tue, 26 Aug 2025 02:25:01 +0000 (10:25 +0800)] 
media: aspeed: Allow to capture from SoC display (GFX)

ASPEED BMC IC has 2 different display engines. Please find AST2600's
datasheet to get detailed information.

1. VGA on PCIe
2. SoC Display (GFX)

By default, video engine (VE) will capture video from VGA. This patch
adds an option to capture video from GFX with standard ioctl,
vidioc_s_input.

An enum, aspeed_video_input, is added for this purpose.
enum aspeed_video_input {
VIDEO_INPUT_VGA = 0,
VIDEO_INPUT_GFX,
VIDEO_INPUT_MAX
};

To test this feature, you will need to enable GFX first. Please refer to
ASPEED's SDK_User_Guide, 6.3.x Soc Display driver, for more information.
In your application, you will need to use v4l2 ioctl, VIDIOC_S_INPUT, as
below to select before start streaming.

int rc;
struct v4l2_input input;

input.index = VIDEO_INPUT_GFX;
rc = ioctl(fd, VIDIOC_S_INPUT, &input);
if (rc < 0)
{
...
}

Link: https://github.com/AspeedTech-BMC/openbmc/releases
Signed-off-by: Jammy Huang <jammy_huang@aspeedtech.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
[hverkuil: split up three overly long lines]

7 weeks agomedia: remove unneeded 'fast_io' parameter in regmap_config
Wolfram Sang [Wed, 13 Aug 2025 16:14:54 +0000 (18:14 +0200)] 
media: remove unneeded 'fast_io' parameter in regmap_config

When using MMIO with regmap, fast_io is implied. No need to set it
again.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: platform: mtk-mdp3: don't use %pK through printk
Thomas Weißschuh [Mon, 11 Aug 2025 07:46:49 +0000 (09:46 +0200)] 
media: platform: mtk-mdp3: don't use %pK through printk

In the past %pK was preferable to %p as it would not leak raw pointer
values into the kernel log.
Since commit ad67b74d2469 ("printk: hash addresses printed with %p")
the regular %p has been improved to avoid this issue.
Furthermore, restricted pointers ("%pK") were never meant to be used
through printk(). They can still unintentionally leak raw pointers or
acquire sleeping locks in atomic contexts.

Switch to the regular pointer formatting which is safer and
easier to reason about.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh@linutronix.de>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: em28xx: add special case for legacy gpiolib interface
Arnd Bergmann [Fri, 8 Aug 2025 15:17:55 +0000 (17:17 +0200)] 
media: em28xx: add special case for legacy gpiolib interface

The em28xx driver uses the old-style gpio_request_one() interface to
switch the lna on the PCTV 290E card.

This interface is becoming optional and should no longer be called by
portable drivers. As I could not figure out an obvious replacement,
select the new GPIOLIB_LEGACY symbol as a workaround.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: s5p-mfc: remove an unused/uninitialized variable
Arnd Bergmann [Thu, 7 Aug 2025 20:54:15 +0000 (22:54 +0200)] 
media: s5p-mfc: remove an unused/uninitialized variable

The s5p_mfc_cmd_args structure in the v6 driver is never used, not
initialized to anything other than zero, but as of clang-21 this
causes a warning:

drivers/media/platform/samsung/s5p-mfc/s5p_mfc_cmd_v6.c:45:7: error: variable 'h2r_args' is uninitialized when passed as a const pointer argument here [-Werror,-Wuninitialized-const-pointer]
   45 |                                         &h2r_args);
      |                                          ^~~~~~~~

Just remove this for simplicity. Since the function is also called
through a callback, this does require adding a trivial wrapper with
the correct prototype.

Fixes: f96f3cfa0bb8 ("[media] s5p-mfc: Update MFC v4l2 driver to support MFC6.x")
Cc: stable@vger.kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: fix uninitialized symbol warnings
Chelsy Ratnawat [Thu, 7 Aug 2025 06:09:36 +0000 (23:09 -0700)] 
media: fix uninitialized symbol warnings

Initialize variables to fix these smatch warnings
drivers/media/i2c/ir-kbd-i2c.c:339 ir_key_poll() error: uninitialized
symbol 'protocol'.
drivers/media/i2c/ir-kbd-i2c.c:339 ir_key_poll() error: uninitialized
symbol 'scancode'.
drivers/media/i2c/ir-kbd-i2c.c:339 ir_key_poll() error: uninitialized
symbol 'toggle'.
drivers/media/tuners/xc4000.c:1102 xc_debug_dump() error: uninitialized
symbol 'adc_envelope'.
drivers/media/tuners/xc4000.c:1108 xc_debug_dump() error: uninitialized
symbol 'lock_status'.
drivers/media/tuners/xc4000.c:1123 xc_debug_dump() error: uninitialized
symbol 'frame_lines'.
drivers/media/tuners/xc4000.c:1127 xc_debug_dump() error: uninitialized
symbol 'quality'.
drivers/media/tuners/xc5000.c:645 xc_debug_dump() error: uninitialized
symbol 'adc_envelope'.
drivers/media/tuners/xc5000.c:651 xc_debug_dump() error: uninitialized
symbol 'lock_status'.
drivers/media/tuners/xc5000.c:665 xc_debug_dump() error: uninitialized
symbol 'frame_lines'.
drivers/media/tuners/xc5000.c:668 xc_debug_dump() error: uninitialized
symbol 'quality'.
drivers/media/tuners/xc5000.c:671 xc_debug_dump() error: uninitialized
symbol 'snr'.
drivers/media/tuners/xc5000.c:674 xc_debug_dump() error: uninitialized
symbol 'totalgain'.

Signed-off-by: Chelsy Ratnawat <chelsyratnawat2001@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
[hverkuil: dropped ' = 0' from rc in ir-kbd-i2c.c, not needed]

7 weeks agomedia: uapi: Cleanup tab after define in headers
Paul Kocialkowski [Tue, 5 Aug 2025 20:47:18 +0000 (22:47 +0200)] 
media: uapi: Cleanup tab after define in headers

Some definitions use a tab after the define keyword instead of the
usual single space. Replace it for better consistency.

Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: uapi: Move colorimetry controls at the end of the file
Paul Kocialkowski [Tue, 5 Aug 2025 20:47:17 +0000 (22:47 +0200)] 
media: uapi: Move colorimetry controls at the end of the file

The colorimetry controls class is defined after the stateless codec
class at the top of the controls header. It is currently defined in
the middle of stateless codec controls.

Move the colorimetry controls after the stateless codec controls,
at the end of the file.

Signed-off-by: Paul Kocialkowski <paulk@sys-base.io>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: b2c2: Remove space before newline
Colin Ian King [Fri, 1 Aug 2025 16:49:26 +0000 (17:49 +0100)] 
media: b2c2: Remove space before newline

There is an extraneous space before a newline in a dprintk message.
Remove the space.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: atomisp: Fix incorrect snprintf format specifiers for signed integers
Colin Ian King [Fri, 1 Aug 2025 16:00:23 +0000 (17:00 +0100)] 
media: atomisp: Fix incorrect snprintf format specifiers for signed integers

There are incorrect %u format specifiers being used to for signed integers,
fix this by using %d instead.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: pci/ivtv: Replace GPLv2 boilerplate text with SPDX
Thomas Huth [Fri, 1 Aug 2025 14:29:10 +0000 (16:29 +0200)] 
media: pci/ivtv: Replace GPLv2 boilerplate text with SPDX

The FSF does not reside in 59 Temple Place anymore, so we should
not ask the people to write to that address in case they need a
copy of the GPL.

Anyway, all other files in this directory already had their boilerplate
text replaced by a proper SPDX tag in the earlier commit 1a59d1b8e05ea
("treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156"),
so let's do the same in the remaining files now, too.

Signed-off-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: Kconfig: Fix spelling mistake "Tehnology" -> "Technology"
Colin Ian King [Thu, 24 Jul 2025 11:03:18 +0000 (12:03 +0100)] 
media: Kconfig: Fix spelling mistake "Tehnology" -> "Technology"

There are spelling mistakes in the DVB_DS3000 and DVB_TS2020
config. Fix them.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agostaging: media: tegra-video: use BIT() macro instead of shift
A.T. Jefferies [Wed, 23 Jul 2025 23:17:57 +0000 (23:17 +0000)] 
staging: media: tegra-video: use BIT() macro instead of shift

Replace two instances of (1 << X) with BIT(X) in tegra20.c to follow
kernel coding style guidelines and improve clarity. The BIT() macro
also ensures proper type handling for larger shifts.

Signed-off-by: A.T. Jefferies <alextjefferies@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: cec: extron-da-hd-4k-plus: drop external-module make commands
Randy Dunlap [Wed, 23 Jul 2025 00:12:00 +0000 (17:12 -0700)] 
media: cec: extron-da-hd-4k-plus: drop external-module make commands

Delete the external-module style Makefile commands. They are not needed
for in-tree modules.

This is the only Makefile in the kernel tree (aside from tools/ and
samples/) that uses this Makefile style.

The same files are built with or without this patch.

Fixes: 056f2821b631 ("media: cec: extron-da-hd-4k-plus: add the Extron DA HD 4K Plus CEC driver")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: stable@vger.kernel.org
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: pci: mg4b: fix uninitialized iio scan data
David Lechner [Tue, 22 Jul 2025 22:05:46 +0000 (17:05 -0500)] 
media: pci: mg4b: fix uninitialized iio scan data

Fix potential leak of uninitialized stack data to userspace by ensuring
that the `scan` structure is zeroed before use.

Fixes: 0ab13674a9bd ("media: pci: mgb4: Added Digiteq Automotive MGB4 driver")
Cc: stable@vger.kernel.org
Signed-off-by: David Lechner <dlechner@baylibre.com>
Reviewed-by: Jonathan Cameron <jonathan.cameron@huawei.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: b2c2: flexcop: Fix coding style issues
Darshan Rathod [Fri, 18 Jul 2025 14:34:20 +0000 (14:34 +0000)] 
media: b2c2: flexcop: Fix coding style issues

The code in flexcop.c has several instances where spaces are missing
after commas in function call arguments. This violates the Linux
kernel coding style guidelines.

This patch cleans up these minor style issues by adding the required
spaces. This is a purely stylistic change with no functional impact
and improves overall code readability and consistency.

Signed-off-by: Darshan Rathod <darshanrathod475@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: pci: ivtv: Add missing check after DMA map
Thomas Fourier [Wed, 16 Jul 2025 13:26:30 +0000 (15:26 +0200)] 
media: pci: ivtv: Add missing check after DMA map

The DMA map functions can fail and should be tested for errors.
If the mapping fails, free blanking_ptr and set it to 0.  As 0 is a
valid DMA address, use blanking_ptr to test if the DMA address
is set.

Fixes: 1a0adaf37c30 ("V4L/DVB (5345): ivtv driver for Conexant cx23416/cx23415 MPEG encoder/decoder")
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agoMAINTAINERS: Update maintainers of TI VPE and CAL
Yemike Abhilash Chandra [Wed, 16 Jul 2025 11:19:09 +0000 (16:49 +0530)] 
MAINTAINERS: Update maintainers of TI VPE and CAL

Benoit has moved to work in other technical areas, and Yemike Abhilash will
maintain these modules instead of him.

Signed-off-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: stk1160: Restore deleted comment in stk1160_fill_urb()
Dan Carpenter [Tue, 15 Jul 2025 23:00:32 +0000 (18:00 -0500)] 
media: stk1160: Restore deleted comment in stk1160_fill_urb()

This comment explains why we return success when usb_alloc_noncoherent()
fails and I think it's helpful.  It was deleted during a recent refactor,
but let's add it back.

Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
Reviewed-by: Xu Yang <xu.yang_2@nxp.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: vim2m: remove unused CLIP macro
Yunseong Kim [Mon, 14 Jul 2025 13:33:11 +0000 (22:33 +0900)] 
media: vim2m: remove unused CLIP macro

The CLIP macro, which was used to clamp color component values to the
[0, 255] range, is no longer used anywhere in the vim2m driver. Remove it
to clean up the code and avoid confusion.

The following issues were reported by checkpatch:
ERROR: Macros with complex values should be enclosed in parentheses

Signed-off-by: Yunseong Kim <ysk@kzalloc.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: pci: zoran: Remove unused debug parameter
Dr. David Alan Gilbert [Sun, 13 Jul 2025 17:33:01 +0000 (18:33 +0100)] 
media: pci: zoran: Remove unused debug parameter

Nothing has checked the zr36067_debug variable since 2021 after
commit efdd0d42e276 ("media: staging: media: zoran: remove
detect_guest_activity")

It's set as a module parameter, remove it.

Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: cx18: Add missing check after DMA map
Thomas Fourier [Wed, 9 Jul 2025 11:35:40 +0000 (13:35 +0200)] 
media: cx18: Add missing check after DMA map

The DMA map functions can fail and should be tested for errors.
If the mapping fails, dealloc buffers, and return.

Fixes: 1c1e45d17b66 ("V4L/DVB (7786): cx18: new driver for the Conexant CX23418 MPEG encoder chip")
Cc: stable@vger.kernel.org
Signed-off-by: Thomas Fourier <fourier.thomas@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: Documentation: Improve grammar in DVB API
Hanne-Lotta Mäenpää [Tue, 8 Jul 2025 15:52:06 +0000 (18:52 +0300)] 
media: Documentation: Improve grammar in DVB API

Fix typos and punctuation and improve grammar in documentation.

Signed-off-by: Hanne-Lotta Mäenpää <hannelotta@gmail.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: stk1160: Use usb_endpoint_is_isoc_in() rather than duplicating its implementation
Markus Elfring [Tue, 24 Jun 2025 16:02:42 +0000 (18:02 +0200)] 
media: stk1160: Use usb_endpoint_is_isoc_in() rather than duplicating its implementation

Reuse existing functionality from usb_endpoint_is_isoc_in() instead of
keeping duplicate source code.

The source code was transformed by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: au0828: Use USB API functions rather than constants
Chen Ni [Wed, 18 Jun 2025 06:14:30 +0000 (14:14 +0800)] 
media: au0828: Use USB API functions rather than constants

Use the function usb_endpoint_dir_in() and usb_endpoint_type()
rather than constants.

The Coccinelle semantic patch is as follows:

@@ struct usb_endpoint_descriptor *epd; @@

- ((epd->bEndpointAddress & \(USB_ENDPOINT_DIR_MASK\|0x80\)) ==
-  \(USB_DIR_IN\|0x80\))
+ usb_endpoint_dir_in(epd)

@@ struct usb_endpoint_descriptor *epd; @@

- (epd->bmAttributes & \(USB_ENDPOINT_XFERTYPE_MASK\|3\))
+ usb_endpoint_type(epd)
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
7 weeks agomedia: st-delta: avoid excessive stack usage
Arnd Bergmann [Tue, 10 Jun 2025 09:31:56 +0000 (11:31 +0200)] 
media: st-delta: avoid excessive stack usage

Building with a reduced stack warning limit shows that delta_mjpeg_decode()
copies a giant structure to the stack each time but only uses three of
its members:

drivers/media/platform/st/sti/delta/delta-mjpeg-dec.c: In function 'delta_mjpeg_decode':
drivers/media/platform/st/sti/delta/delta-mjpeg-dec.c:427:1: error: the frame size of 1296 bytes is larger than 1280 bytes [-Werror=frame-larger-than=]

Open-code the passing of the structure members that are actually used here.

Fixes: 433ff5b4a29b ("[media] st-delta: add mjpeg support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: mc: Improve unconnected pads debugging message in link exploration
Laurent Pinchart [Wed, 20 Aug 2025 14:00:21 +0000 (17:00 +0300)] 
media: mc: Improve unconnected pads debugging message in link exploration

When exploring links, a message is printed to indicate unconnected pads
being added. The message prints the entity name only. Print the origin
pad number as well to help with debugging pipeline start issues. While
at it, get the entity name from origin->entity instead of local->entity.
Both point to the same entity, but the former conveys the meaning
better.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: mc: Fix MUST_CONNECT handling for pads with no links
Laurent Pinchart [Wed, 20 Aug 2025 14:00:20 +0000 (17:00 +0300)] 
media: mc: Fix MUST_CONNECT handling for pads with no links

Commit b3decc5ce7d7 ("media: mc: Expand MUST_CONNECT flag to always
require an enabled link") expanded the meaning of the MUST_CONNECT flag
to require an enabled link in all cases. To do so, the link exploration
code was expanded to cover unconnected pads, in order to reject those
that have the MUST_CONNECT flag set. The implementation was however
incorrect, ignoring unconnected pads instead of ignoring connected pads.
Fix it.

Reported-by: Martin Kepplinger-Novaković <martink@posteo.de>
Closes: https://lore.kernel.org/linux-media/20250205172957.182362-1-martink@posteo.de
Reported-by: Maud Spierings <maudspierings@gocontroll.com>
Closes: https://lore.kernel.org/linux-media/20250818-imx8_isi-v1-1-e9cfe994c435@gocontroll.com
Fixes: b3decc5ce7d7 ("media: mc: Expand MUST_CONNECT flag to always require an enabled link")
Cc: stable@vger.kernel.org # 6.1
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Tested-by: Maud Spierings <maudspierings@gocontroll.com>
Tested-by: Martin Kepplinger-Novaković <martink@posteo.de>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: stm32-csi: Fix dereference before NULL check
Chandra Mohan Sundar [Mon, 18 Aug 2025 09:31:57 +0000 (15:01 +0530)] 
media: stm32-csi: Fix dereference before NULL check

In 'stm32_csi_start', 'csidev->s_subdev' is dereferenced directly while
assigning a value to the 'src_pad'. However the same value is being
checked against NULL at a later point of time indicating that there
are chances that the value can be NULL.

Move the dereference after the NULL check.

Fixes: e7bad98c205d1 ("media: v4l: Convert the users of v4l2_get_link_freq to call it on a pad")
Cc: stable@vger.kernel.org
Signed-off-by: Chandra Mohan Sundar <chandramohan.explore@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: i2c: imx: Add note to prevent buggy code re-use
Krzysztof Kozlowski [Mon, 18 Aug 2025 15:00:26 +0000 (17:00 +0200)] 
media: i2c: imx: Add note to prevent buggy code re-use

Multiple Sony IMX sensor drivers have mixed up logical and line level
for XCLR signal.  They call it a reset signal (it indeed behaves like
that), but drivers assert the reset to operate which is clearly
incorrect and relies on incorrect DTS.

People in discussions copy existing poor code and claim they can repeat
same mistake, so add a note to prevent that.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: i2c: vd55g1: Fix duster register address
Benjamin Mugnier [Mon, 18 Aug 2025 13:50:58 +0000 (15:50 +0200)] 
media: i2c: vd55g1: Fix duster register address

The duster register needs to be disabled on test patterns. While the
code is correctly doing so, the register address contained a typo, thus
not disabling the duster correctly. Fix the typo.

Fixes: e56616d7b23c ("media: i2c: Add driver for ST VD55G1 camera sensor")
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>
8 weeks agomedia: staging/ipu7: cleanup the MMU correctly in IPU7 driver release
Bingbu Cao [Fri, 15 Aug 2025 09:20:37 +0000 (17:20 +0800)] 
media: staging/ipu7: cleanup the MMU correctly in IPU7 driver release

IPU7 ISYS and PSYS auxiliary devices are released after
ipu7_bus_del_devices(), so driver can not reference the MMU devices
from ISYS and PSYS auxiliary devices, so move the MMUs cleanup before
releasing the auxiliary devices.

Fixes: b7fe4c0019b1 ("media: staging/ipu7: add Intel IPU7 PCI device driver")
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
[Sakari Ailus: Drop extra newline.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: staging/ipu7: Don't set name for IPU7 PCI device
Bingbu Cao [Fri, 15 Aug 2025 09:20:36 +0000 (17:20 +0800)] 
media: staging/ipu7: Don't set name for IPU7 PCI device

Driver better not dev_set_name() to change the PCI device
name, so remove it.

Fixes: b7fe4c0019b1 ("media: staging/ipu7: add Intel IPU7 PCI device driver")
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: staging/ipu7: convert to use pci_alloc_irq_vectors() API
Bingbu Cao [Fri, 15 Aug 2025 09:20:35 +0000 (17:20 +0800)] 
media: staging/ipu7: convert to use pci_alloc_irq_vectors() API

pci_enable_msi() is a deprecated API, thus switch to use modern
pci_alloc_irq_vectors().

Fixes: b7fe4c0019b1 ("media: staging/ipu7: add Intel IPU7 PCI device driver")
Signed-off-by: Bingbu Cao <bingbu.cao@intel.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: ti: j721e-csi2rx: Support multiple pixels per clock
Jai Luthra [Mon, 11 Aug 2025 08:20:18 +0000 (13:50 +0530)] 
media: ti: j721e-csi2rx: Support multiple pixels per clock

Add support for negotiating the highest possible pixel mode (from
single, dual, quad) with the Cadence CSI2RX bridge. This is required to
drain the Cadence stream FIFOs without overflowing when the source is
operating at a high link-frequency [1].

Also, update the Kconfig as this introduces a hard build-time dependency
on the Cadence CSI2RX driver, even for a COMPILE_TEST.

[1] Section 12.6.1.4.8.14 CSI_RX_IF Programming Restrictions of AM62 TRM

Link: https://www.ti.com/lit/pdf/spruj16
Tested-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com> (on SK-AM68)
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: cadence: cdns-csi2rx: Support multiple pixels per clock cycle
Jai Luthra [Mon, 11 Aug 2025 08:20:17 +0000 (13:50 +0530)] 
media: cadence: cdns-csi2rx: Support multiple pixels per clock cycle

The output pixel interface is a parallel bus (32 bits), which
supports sending multiple pixels (1, 2 or 4) per clock cycle for
smaller pixel widths like RAW8-RAW16.

Dual-pixel and Quad-pixel modes can be a requirement if the export rate
of the Cadence IP in Single-pixel mode maxes out before the maximum
supported DPHY-RX frequency, which is the case with TI's integration of
this IP [1].

So, we export a function that lets the downstream hardware block request
a higher pixel-per-clock on a particular output pad.

We check if we can support the requested pixels per clock given the
known maximum for the currently configured format. If not, we set it
to the highest feasible value and return this value to the caller.

[1] Section 12.6.1.4.8.14 CSI_RX_IF Programming Restrictions of AM62 TRM

Link: https://www.ti.com/lit/pdf/spruj16
Tested-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com> (on SK-AM68)
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: cadence: csi2rx: Implement get_fwnode_pad op
Jai Luthra [Mon, 11 Aug 2025 08:20:16 +0000 (13:50 +0530)] 
media: cadence: csi2rx: Implement get_fwnode_pad op

Use v4l2_subdev_get_fwnode_pad_1_to_1() as the get_fwnode_pad operation.
Cadence CSI2RX maps port numbers and pad indices 1:1.

Reviewed-by: Changhuang Liang <changhuang.liang@starfivetech.com>
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Tested-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com> (on SK-AM68)
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: ti: j721e-csi2rx: Fix source subdev link creation
Jai Luthra [Mon, 11 Aug 2025 08:20:15 +0000 (13:50 +0530)] 
media: ti: j721e-csi2rx: Fix source subdev link creation

We don't use OF ports and remote-endpoints to connect the CSI2RX bridge
and this device in the device tree, thus it is wrong to use
v4l2_create_fwnode_links_to_pad() to create the media graph link between
the two.

It works out on accident, as neither the source nor the sink implement
the .get_fwnode_pad() callback, and the framework helper falls back on
using the first source and sink pads to create the link between them.

Instead, manually create the media link from the first source pad of the
bridge to the first sink pad of the J721E CSI2RX.

Fixes: b4a3d877dc92 ("media: ti: Add CSI2RX support for J721E")
Cc: stable@vger.kernel.org
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Tested-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com> (on SK-AM68)
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: ti: j721e-csi2rx: Use fwnode_get_named_child_node
Jai Luthra [Mon, 11 Aug 2025 08:20:14 +0000 (13:50 +0530)] 
media: ti: j721e-csi2rx: Use fwnode_get_named_child_node

Simplify notifier registration logic. Instead of first getting the
device node, get the fwnode of the child directly.

Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Tested-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com> (on SK-AM68)
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: ti: j721e-csi2rx: Use devm_of_platform_populate
Jai Luthra [Mon, 11 Aug 2025 08:20:13 +0000 (13:50 +0530)] 
media: ti: j721e-csi2rx: Use devm_of_platform_populate

Ensure that we clean up the platform bus when we remove this driver.

This fixes a crash seen when reloading the module for the child device
with the parent not yet reloaded.

Fixes: b4a3d877dc92 ("media: ti: Add CSI2RX support for J721E")
Cc: stable@vger.kernel.org
Reviewed-by: Devarsh Thakkar <devarsht@ti.com>
Tested-by: Yemike Abhilash Chandra <y-abhilashchandra@ti.com> (on SK-AM68)
Signed-off-by: Jai Luthra <jai.luthra@ideasonboard.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: v4l2-common: Update v4l2_get_link_freq() documentation
Sakari Ailus [Thu, 21 Aug 2025 11:56:49 +0000 (14:56 +0300)] 
media: v4l2-common: Update v4l2_get_link_freq() documentation

Document that v4l2_get_link_freq() obtains the link frequency primarily
by calling the get_mbus_config sub-device pad operation.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: v4l2-common: Drop the workaround from v4l2_get_link_freq()
Sakari Ailus [Mon, 18 Aug 2025 13:49:39 +0000 (16:49 +0300)] 
media: v4l2-common: Drop the workaround from v4l2_get_link_freq()

Remove the workaround that allowed calling v4l2_get_link_freq() on the
control handler.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: amlogic: c3-mipi-csi2: Call v4l2_get_link_freq() on source pad
Sakari Ailus [Mon, 18 Aug 2025 13:44:07 +0000 (16:44 +0300)] 
media: amlogic: c3-mipi-csi2: Call v4l2_get_link_freq() on source pad

Call v4l2_get_link_freq() on the source pad so we can remove the
workaround that allows calling it on a control handler.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Keke Li <keke.li@amlogic.com>
Tested-by: Keke Li <keke.li@amlogic.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: uapi: Documentation: Improve column width hints for examples
Sakari Ailus [Wed, 22 Jan 2025 09:24:13 +0000 (11:24 +0200)] 
media: uapi: Documentation: Improve column width hints for examples

Use less arbitrary widths for the columns in metadata layout examples.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: imx296: Remove redundant semicolons
Liao Yuanhong [Wed, 13 Aug 2025 09:47:46 +0000 (17:47 +0800)] 
media: imx296: Remove redundant semicolons

Remove unnecessary semicolons.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
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>
8 weeks agomedia: v4l2-subdev: Fix alloc failure check in v4l2_subdev_call_state_try()
Tomi Valkeinen [Fri, 8 Aug 2025 08:59:15 +0000 (11:59 +0300)] 
media: v4l2-subdev: Fix alloc failure check in v4l2_subdev_call_state_try()

v4l2_subdev_call_state_try() macro allocates a subdev state with
__v4l2_subdev_state_alloc(), but does not check the returned value. If
__v4l2_subdev_state_alloc fails, it returns an ERR_PTR, and that would
cause v4l2_subdev_call_state_try() to crash.

Add proper error handling to v4l2_subdev_call_state_try().

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Fixes: 982c0487185b ("media: subdev: Add v4l2_subdev_call_state_try() macro")
Reported-by: Dan Carpenter <dan.carpenter@linaro.org>
Closes: https://lore.kernel.org/all/aJTNtpDUbTz7eyJc%40stanley.mountain/
Cc: stable@vger.kernel.org
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: i2c: imx214: Separate legacy link frequency check from PLL calculation
André Apitzsch [Mon, 30 Jun 2025 19:05:25 +0000 (21:05 +0200)] 
media: i2c: imx214: Separate legacy link frequency check from PLL calculation

Make it easier to drop the legacy support from the driver later.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
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>
8 weeks agomedia: i2c: imx214: Move imx214_pll_update to imx214_ctrls_init
André Apitzsch [Mon, 30 Jun 2025 19:05:24 +0000 (21:05 +0200)] 
media: i2c: imx214: Move imx214_pll_update to imx214_ctrls_init

It is more logical to call the PLL update in imx214_ctrls_init(). So
let's move it there.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
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>
8 weeks agomedia: i2c: imx214: Use __free(fwnode_handle)
André Apitzsch [Mon, 30 Jun 2025 19:05:23 +0000 (21:05 +0200)] 
media: i2c: imx214: Use __free(fwnode_handle)

Use the __free(fwnode_handle) hook to free the endpoint when the
function exits to simplify the error path.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
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>
8 weeks agomedia: i2c: imx214: Drop dev argument from imx214_parse_fwnode()
André Apitzsch [Mon, 30 Jun 2025 19:05:22 +0000 (21:05 +0200)] 
media: i2c: imx214: Drop dev argument from imx214_parse_fwnode()

The device can be accessed from struct imx214.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
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>
8 weeks agomedia: i2c: imx214: Remove unneeded parentheses
André Apitzsch [Mon, 30 Jun 2025 19:05:21 +0000 (21:05 +0200)] 
media: i2c: imx214: Remove unneeded parentheses

The parentheses are not needed to calculate bit_rate_mbps.

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
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>
8 weeks agomedia: i2c: vgxy61: Report stream using frame descriptors
Julien Massot [Fri, 4 Jul 2025 09:28:24 +0000 (11:28 +0200)] 
media: i2c: vgxy61: Report stream using frame descriptors

Add support for .get_frame_desc() to report CSI-2 virtual channel
and data type information. This allows CSI-2 receivers to properly
interpret the stream without inferring the data type from the pixel
format.

Signed-off-by: Julien Massot <julien.massot@collabora.com>
Reviewed-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>
8 weeks agomedia: mt9m114: Set pad-slew-rate
Mathis Foerst [Mon, 14 Jul 2025 07:59:27 +0000 (09:59 +0200)] 
media: mt9m114: Set pad-slew-rate

The MT9M114 supports the different slew rates (0 to 7) on the output pads.
At the moment, this is hardcoded to 7 (the fastest rate).
The user might want to change this values due to EMC requirements.

Read the 'slew-rate' from the DT and configure the pad slew rates of
the output pads accordingly in mt9m114_initialize().
Remove the hardcoded slew rate setting from the mt9m114_init table.

Signed-off-by: Mathis Foerst <mathis.foerst@mt.com>
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>
8 weeks agomedia: mt9m114: Allow set_selection while streaming
Mathis Foerst [Mon, 14 Jul 2025 07:59:26 +0000 (09:59 +0200)] 
media: mt9m114: Allow set_selection while streaming

The current implementation does not apply changes to the crop-
configuration of the sensor immediately if the sensor is in
streaming state. The user has to stop and restart the stream for
the changes to be applied.

This can be undesirable e.g. in a calibration usecase where the user
wants to see the impact of his changes in a live video stream.
Under the condition that the width & height of the cropped image area
does not change, the changed cropping configuration can be applied to
the pixel-array immediately without disturbing the IFP.

Call mt9m114_configure_pa() in mt9m114_pa_set_selection() if the sensor is
in streaming state and the size of the cropping rectangle didn't change,
issue a CONFIG_CHANGE to apply the changes immediately.

Signed-off-by: Mathis Foerst <mathis.foerst@mt.com>
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>
8 weeks agomedia: i2c: ov5648: make read-only arrays regs and values static const
Colin Ian King [Tue, 29 Jul 2025 07:00:21 +0000 (08:00 +0100)] 
media: i2c: ov5648: make read-only arrays regs and values static const

Don't populate the read-only arrays regs and values on the stack at run
time, instead make them static const.

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: rzg2l-cru: Drop function pointer to configure CSI
Biju Das [Fri, 1 Aug 2025 05:34:22 +0000 (06:34 +0100)] 
media: rzg2l-cru: Drop function pointer to configure CSI

Drop function pointer to configure CSI to avoid code duplication
by checking the presence of vc select register in rzg2l_cru_info.
After this change, limit the scope of the rzg2l_cru_csi2_setup()
to static.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Tested-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Reviewed-by: Tommaso Merciai <tommaso.merciai.xr@bp.renesas.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: i2c: imx334: add support for additional test patterns
Shravan Chippa [Tue, 24 Jun 2025 06:54:38 +0000 (12:24 +0530)] 
media: i2c: imx334: add support for additional test patterns

Added support for three additional test patterns in the
IMX334 driver: Black and Grey Bars, Black Color, and White Color.

Signed-off-by: Shravan Chippa <shravan.chippa@microchip.com>
[Sakari Ailus: Fix hexadecimal value.]
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: rj54n1cb0c: Fix memleak in rj54n1_probe()
Zhang Shurong [Tue, 24 Jun 2025 08:27:24 +0000 (16:27 +0800)] 
media: rj54n1cb0c: Fix memleak in rj54n1_probe()

rj54n1_probe() won't clean all the allocated resources in fail
path, which may causes the memleaks. Add v4l2_ctrl_handler_free() to
prevent memleak.

Fixes: f187352dcd45 ("media: i2c: Copy rj54n1cb0c soc_camera sensor driver")
Signed-off-by: Zhang Shurong <zhang_shurong@foxmail.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>
8 weeks agomedia: ov02c10: Don't include linux/version.h
Sakari Ailus [Sat, 28 Jun 2025 13:44:21 +0000 (16:44 +0300)] 
media: ov02c10: Don't include linux/version.h

linux/version.h isn't needed by the driver, don't include it.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: Move gc0310 sensor drivers to drivers/media/i2c/
Hans de Goede [Sat, 17 May 2025 11:41:06 +0000 (13:41 +0200)] 
media: Move gc0310 sensor drivers to drivers/media/i2c/

The atomisp gc0310 sensor driver has now been fully converted to
a standard v4l2 sensor driver. Move it to drivers/media/i2c/
to reflect this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: vim2m: Remove compilation conditional to CONFIG_MEDIA_CONTROLLER
Sakari Ailus [Tue, 18 Jun 2024 10:42:25 +0000 (13:42 +0300)] 
media: vim2m: Remove compilation conditional to CONFIG_MEDIA_CONTROLLER

MEDIA_CONTROLLER is selected for vim2m already since commit 016baa59bf9f
("media: Kconfig: Don't expose the Request API option"). Also remove the
related #ifdefs.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: MAINTAINERS: Change rcar-jpu maintainer
Sakari Ailus [Fri, 8 Aug 2025 08:23:20 +0000 (11:23 +0300)] 
media: MAINTAINERS: Change rcar-jpu maintainer

Assign the driver to Nikita as discussed on LMML.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: Documentation: Move streams documentation one level up
Sakari Ailus [Fri, 6 Sep 2024 06:24:31 +0000 (09:24 +0300)] 
media: Documentation: Move streams documentation one level up

While streams can be found within pads, they do deserve their own
documentation section on the same level than pads. Move them one level up.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: ipu6: isys: Set embedded data type correctly for metadata formats
Sakari Ailus [Wed, 21 May 2025 08:06:16 +0000 (11:06 +0300)] 
media: ipu6: isys: Set embedded data type correctly for metadata formats

The IPU6 ISYS driver supported metadata formats but was missing correct
embedded data type in the receiver configuration. Add it now.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: MAINTAINERS: Remove Stanislaw from IVCS and IPU6 reviewers
Sakari Ailus [Thu, 7 Aug 2025 09:13:13 +0000 (12:13 +0300)] 
media: MAINTAINERS: Remove Stanislaw from IVCS and IPU6 reviewers

Stanislaw's e-mail no longer works so remove him from IVSC and IPU6 driver
reviewers.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: staging/ipu7: Use v4l2_ctrl_subdev_subscribe_event()
Laurent Pinchart [Mon, 4 Aug 2025 21:41:27 +0000 (00:41 +0300)] 
media: staging/ipu7: Use v4l2_ctrl_subdev_subscribe_event()

The ipu7-isys driver uses v4l2_ctrl_subscribe_event() to handle control
event subscription on a subdev. While this works, it is the wrong API.
Use the subdev-specific v4l2_ctrl_subdev_subscribe_event() helper
instead.

Signed-off-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>
8 weeks agomedia: ipu6: isys: Use v4l2_ctrl_subdev_subscribe_event()
Laurent Pinchart [Mon, 4 Aug 2025 21:41:26 +0000 (00:41 +0300)] 
media: ipu6: isys: Use v4l2_ctrl_subdev_subscribe_event()

The ipu6-isys driver uses v4l2_ctrl_subscribe_event() to handle control
event subscription on a subdev. While this works, it is the wrong API.
Use the subdev-specific v4l2_ctrl_subdev_subscribe_event() helper
instead.

Signed-off-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>
8 weeks agomedia: Documentation: Reword split of sensor driver to two classes
Sakari Ailus [Thu, 10 Oct 2024 09:07:17 +0000 (12:07 +0300)] 
media: Documentation: Reword split of sensor driver to two classes

The sensor drivers do not configure the output size of the sensors but the
entire internal pipeline. Reflect this in the documentation.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: Documentation: Add a hyphen to list-based
Sakari Ailus [Fri, 8 Nov 2024 12:36:03 +0000 (14:36 +0200)] 
media: Documentation: Add a hyphen to list-based

Add a hyphen to list-based for uniform spelling in camera-sensor.rst.

Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Jacopo Mondi <jacopo.mondi@ideasonboard.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
8 weeks agomedia: staging: imx: Drop custom .unsubscribe_event() handler
Laurent Pinchart [Fri, 1 Aug 2025 21:19:33 +0000 (00:19 +0300)] 
media: staging: imx: Drop custom .unsubscribe_event() handler

The csi_unsubscribe_event() function simply calls
v4l2_event_unsubscribe(), forwarding its arguments. Replace it with the
v4l2_event_subdev_unsubscribe() helper that performs exactly the same
operation.

Signed-off-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>
8 weeks agomedia: staging: atomisp: Drop custom .unsubscribe_event() handler
Laurent Pinchart [Fri, 1 Aug 2025 21:19:32 +0000 (00:19 +0300)] 
media: staging: atomisp: Drop custom .unsubscribe_event() handler

The isp_subdev_unsubscribe_event() function simply calls
v4l2_event_unsubscribe(), forwarding its arguments. Replace it with the
v4l2_event_subdev_unsubscribe() helper that performs exactly the same
operation.

Signed-off-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>
8 weeks agomedia: omap3isp: Drop custom .unsubscribe_event() handler
Laurent Pinchart [Fri, 1 Aug 2025 21:19:31 +0000 (00:19 +0300)] 
media: omap3isp: Drop custom .unsubscribe_event() handler

The ccdc_unsubscribe_event() and omap3isp_stat_unsubscribe_event()
functions simply call v4l2_event_unsubscribe(), forwarding their
arguments. Replace them with the v4l2_event_subdev_unsubscribe() helper
that performs exactly the same operation.

Signed-off-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>
8 weeks agomedia: v4l2-subdev: Make struct v4l2_subdev_stream_config private
Laurent Pinchart [Mon, 28 Jul 2025 23:50:10 +0000 (02:50 +0300)] 
media: v4l2-subdev: Make struct v4l2_subdev_stream_config private

The v4l2_subdev_stream_config structure holds configuration data for a
stream. It was meant to be used internally only, but already found its
way into the ds90ub913 driver. Now that the driver has been fixed, make
the structure private to v4l2-subdev.c to avoid using it by accident.

Signed-off-by: Laurent Pinchart <laurent.pinchart@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>
8 weeks agomedia: staging/ipu7: Disallow source multiplexing
Laurent Pinchart [Mon, 28 Jul 2025 23:50:09 +0000 (02:50 +0300)] 
media: staging/ipu7: Disallow source multiplexing

The IPU7 ISYS driver can't capture multiple streams on the same video
device. Disallow source multiplexing in the routes of the internal
subdev to reflect that limitation. As a result we can hardcode the
source stream to 0, simplifying the driver.

Signed-off-by: Laurent Pinchart <laurent.pinchart@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>
8 weeks agomedia: i2c: ds90ub913: Stop accessing streams configs directly
Laurent Pinchart [Mon, 28 Jul 2025 23:50:08 +0000 (02:50 +0300)] 
media: i2c: ds90ub913: Stop accessing streams configs directly

The v4l2_subdev_stream_config structure will be made private. Stop
accessing it directly, iterate over routes instead to initialize
formats.

Signed-off-by: Laurent Pinchart <laurent.pinchart@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>