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>
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>
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>
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>
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>
Sakari Ailus [Wed, 29 Nov 2023 14:15:45 +0000 (16:15 +0200)]
media: vimc: Don't explicitly set bus_info
The platform device name is already set by V4L2 and MC frameworks for
media device bus_info and V4L2 querycap bus_info fields. Don't do it in
the driver.
Acked-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
media: imon: grab lock earlier in imon_ir_change_protocol()
Move mutex_trylock() in imon_ir_change_protocol() to the beginning,
for memcpy() which modifies ictx->usb_tx_buf should be protected by
ictx->lock.
Also, verify at the beginning of send_packet() that ictx->lock is held
in case send_packet() is by error called from imon_ir_change_protocol()
when mutex_trylock() failed due to concurrent requests.
Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
syzbot is reporting that imon has three problems which result in
hung tasks due to forever holding device lock [1].
First problem is that when usb_rx_callback_intf0() once got -EPROTO error
after ictx->dev_present_intf0 became true, usb_rx_callback_intf0()
resubmits urb after printk(), and resubmitted urb causes
usb_rx_callback_intf0() to again get -EPROTO error. This results in
printk() flooding (RCU stalls).
Alan Stern commented [2] that
In theory it's okay to resubmit _if_ the driver has a robust
error-recovery scheme (such as giving up after some fixed limit on the
number of errors or after some fixed time has elapsed, perhaps with a
time delay to prevent a flood of errors). Most drivers don't bother to
do this; they simply give up right away. This makes them more
vulnerable to short-term noise interference during USB transfers, but in
reality such interference is quite rare. There's nothing really wrong
with giving up right away.
but imon has a poor error-recovery scheme which just retries forever;
this behavior should be fixed.
Since I'm not sure whether it is safe for imon users to give up upon any
error code, this patch takes care of only union of error codes chosen from
modules in drivers/media/rc/ directory which handle -EPROTO error (i.e.
ir_toy, mceusb and igorplugusb).
Second problem is that when usb_rx_callback_intf0() once got -EPROTO error
before ictx->dev_present_intf0 becomes true, usb_rx_callback_intf0() always
resubmits urb due to commit 8791d63af0cf ("[media] imon: don't wedge
hardware after early callbacks"). Move the ictx->dev_present_intf0 test
introduced by commit 6f6b90c9231a ("[media] imon: don't parse scancodes
until intf configured") to immediately before imon_incoming_packet(), or
the first problem explained above happens without printk() flooding (i.e.
hung task).
Third problem is that when usb_rx_callback_intf0() is not called for some
reason (e.g. flaky hardware; the reproducer for this problem sometimes
prevents usb_rx_callback_intf0() from being called),
wait_for_completion_interruptible() in send_packet() never returns (i.e.
hung task). As a workaround for such situation, change send_packet() to
wait for completion with timeout of 10 seconds.
Ma Ke [Fri, 18 Jul 2025 09:50:54 +0000 (17:50 +0800)]
media: lirc: Fix error handling in lirc_register()
When cdev_device_add() failed, calling put_device() to explicitly
release dev->lirc_dev. Otherwise, it could cause the fault of the
reference count.
Found by code review.
Cc: stable@vger.kernel.org Fixes: a6ddd4fecbb0 ("media: lirc: remove last remnants of lirc kapi") Signed-off-by: Ma Ke <make24@iscas.ac.cn> Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Remove the extra leading period and provide more elaborate explanation for
why devm_v4l2_sensor_clk_get() is only allowed to be used on camera sensor
devices.
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:39 +0000 (15:34 +0200)]
media: i2c: ov2680: Use the v4l2 helper for obtaining the clock
Use the new v4l2 helper devm_v4l2_sensor_clk_get() that works on both
DT- and ACPI-based platforms to retrieve a reference to the clock
producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:38 +0000 (15:34 +0200)]
media: i2c: vgxy61: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:37 +0000 (15:34 +0200)]
media: i2c: vd56g3: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:36 +0000 (15:34 +0200)]
media: i2c: vd55g1: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:35 +0000 (15:34 +0200)]
media: i2c: s5k6a3: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:34 +0000 (15:34 +0200)]
media: i2c: s5k5baf: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:33 +0000 (15:34 +0200)]
media: i2c: s5c73m3: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:32 +0000 (15:34 +0200)]
media: i2c: ov9650: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:31 +0000 (15:34 +0200)]
media: i2c: ov9640: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:30 +0000 (15:34 +0200)]
media: i2c: ov9282: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:29 +0000 (15:34 +0200)]
media: i2c: ov8865: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:28 +0000 (15:34 +0200)]
media: i2c: ov8858: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:27 +0000 (15:34 +0200)]
media: i2c: ov8856: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:26 +0000 (15:34 +0200)]
media: i2c: ov7740: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:25 +0000 (15:34 +0200)]
media: i2c: ov6650: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:24 +0000 (15:34 +0200)]
media: i2c: ov64a40: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:23 +0000 (15:34 +0200)]
media: i2c: ov5695: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:22 +0000 (15:34 +0200)]
media: i2c: ov5648: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:21 +0000 (15:34 +0200)]
media: i2c: ov5647: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:20 +0000 (15:34 +0200)]
media: i2c: ov5645: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:19 +0000 (15:34 +0200)]
media: i2c: ov5640: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:18 +0000 (15:34 +0200)]
media: i2c: ov2685: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:17 +0000 (15:34 +0200)]
media: i2c: ov2659: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:16 +0000 (15:34 +0200)]
media: i2c: ov02a10: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:15 +0000 (15:34 +0200)]
media: i2c: mt9v111: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:14 +0000 (15:34 +0200)]
media: i2c: mt9v032: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:13 +0000 (15:34 +0200)]
media: i2c: mt9t112: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:12 +0000 (15:34 +0200)]
media: i2c: mt9p031: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:11 +0000 (15:34 +0200)]
media: i2c: mt9m114: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:10 +0000 (15:34 +0200)]
media: i2c: mt9m111: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:09 +0000 (15:34 +0200)]
media: i2c: mt9m001: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:08 +0000 (15:34 +0200)]
media: i2c: imx415: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Reviewed-by: Michael Riesch <michael.riesch@collabora.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:07 +0000 (15:34 +0200)]
media: i2c: imx412: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:06 +0000 (15:34 +0200)]
media: i2c: imx335: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:05 +0000 (15:34 +0200)]
media: i2c: imx334: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:04 +0000 (15:34 +0200)]
media: i2c: imx296: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:03 +0000 (15:34 +0200)]
media: i2c: imx290: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:02 +0000 (15:34 +0200)]
media: i2c: imx283: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:01 +0000 (15:34 +0200)]
media: i2c: imx219: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:34:00 +0000 (15:34 +0200)]
media: i2c: imx214: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:33:59 +0000 (15:33 +0200)]
media: i2c: hi846: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:33:58 +0000 (15:33 +0200)]
media: i2c: gc2145: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:33:57 +0000 (15:33 +0200)]
media: i2c: gc08a3: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:33:56 +0000 (15:33 +0200)]
media: i2c: gc05a2: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:33:55 +0000 (15:33 +0200)]
media: i2c: et8ek8: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper
devm_v4l2_sensor_clk_get() that works on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:33:54 +0000 (15:33 +0200)]
media: i2c: ar0521: Use the v4l2 helper for obtaining the clock
devm_clk_get() fails on ACPI-based platforms, where firmware does not
provide a direct reference to the clock producer.
Replace devm_clk_get() with the new v4l2 helper devm_v4l2_sensor_clk_get()
that works on both DT- and ACPI-based platforms to retrieve a reference to
the clock producer from firmware.
Acked-by: Krzysztof Hałasa <khalasa@piap.pl> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Mehdi Djait [Thu, 26 Jun 2025 13:33:53 +0000 (15:33 +0200)]
Documentation: media: camera-sensor: Mention v4l2_devm_sensor_clk_get() for obtaining the clock
Add the new v4l2 helper devm_v4l2_sensor_clk_get() to Documentation. the
helper works on both DT- and ACPI-based platforms to retrieve a
reference to the clock producer from firmware.
Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Co-developed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> 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>
Mehdi Djait [Mon, 7 Jul 2025 14:32:53 +0000 (16:32 +0200)]
media: v4l2-common: Add a helper for obtaining the clock producer
Introduce a helper for v4l2 sensor drivers on both DT- and ACPI-based
platforms to retrieve a reference to the clock producer from firmware.
This helper behaves the same as devm_clk_get() except where there is
no clock producer like in ACPI-based platforms.
For ACPI-based platforms the function will read the "clock-frequency"
ACPI _DSD property and register a fixed frequency clock with the frequency
indicated in the property.
This function also handles the special ACPI-based system case where:
. The clock-frequency _DSD property is present.
. A reference to the clock producer is present, where the clock is provided
by a camera sensor PMIC driver (e.g. int3472/tps68470.c)
In this case try to set the clock-frequency value to the provided clock.
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Lad Prabhakar <prabhakar.mahadev-lad.rj@bp.renesas.com> Signed-off-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Laurent Pinchart [Sun, 10 Aug 2025 01:30:58 +0000 (04:30 +0300)]
media: staging: Rename second ioctl handlers argument to 'void *priv'
The second argument to the ioctl handlers is not a file handle any more.
The standard practice is to name it 'void *priv' in drivers. Many
drivers still name it 'void *fh', and a few use more exotic names.
Replace those more exotic names with 'void *priv' in all media staging
drivers.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Laurent Pinchart [Sun, 10 Aug 2025 01:30:57 +0000 (04:30 +0300)]
media: v4l2: Rename second ioctl handlers argument to 'void *priv'
The second argument to the ioctl handlers is not a file handle any more.
The standard practice is to name it 'void *priv' in drivers. Many
drivers still name it 'void *fh', and a few use more exotic names.
Replace those more exotic names with 'void *priv' in all media drivers.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Acked-by: Jai Luthra <jai.luthra@linux.dev> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Laurent Pinchart [Sun, 10 Aug 2025 01:30:56 +0000 (04:30 +0300)]
media: v4l2-core: Rename second ioctl handlers argument to 'void *priv'
The second argument to the ioctl handlers is not a file handle any more.
Rename it from 'void *fh' to 'void *priv' in the V4L2 core, to avoid
misconceptions.
While at it, align function arguments in include/media/v4l2-mem2mem.h.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Laurent Pinchart [Sun, 10 Aug 2025 01:30:55 +0000 (04:30 +0300)]
media: v4l2-pci-skeleton: Rename second ioctl handlers argument to 'void *priv'
The second argument to the ioctl handlers is not a file handle any more.
Rename it to 'void *priv', to avoid misconceptions. This is particularly
important in the v4l2-pci-skeleton driver, as it is meant to be a base
for new drivers.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Laurent Pinchart [Sun, 10 Aug 2025 01:30:54 +0000 (04:30 +0300)]
media: uvcvideo: Rename second ioctl handlers argument to 'void *priv'
The second argument to the ioctl handlers is not a file handle any more.
Rename it from 'void *fh' to 'void *priv', to avoid misconceptions. This
is particularly important in the uvcvideo driver, as it is widely used
and can be taken as an example for new drivers.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Laurent Pinchart [Sun, 10 Aug 2025 01:30:53 +0000 (04:30 +0300)]
media: test-drivers: Rename second ioctl handlers argument to 'void *priv'
The second argument to the ioctl handlers is not a file handle any more.
Rename it from 'void *fh' to 'void *priv', to avoid misconceptions. This
is particularly important in test drivers as they are meant to be used
as reference implementations.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Laurent Pinchart [Sun, 10 Aug 2025 01:30:52 +0000 (04:30 +0300)]
media: v4l2-ioctl: Push NULL fh argument down to ioctl wrappers
As ioctl handlers do not expect a priv argument anymore, start pushing
the NULL pointer down from __video_do_ioctl() to the ioctl wrappers.
This paves the way to dropping the void *priv argument to ioctl handlers
themselves.
Changes to ioctl wrappers have been generated with the following
coccinelle semantic patch:
Manual changes have been added to handle the calls to
v4l_[gs]_selection(), drop the fh argument in the v4l2_ioctl_info
structure definition and in the DEFINE_V4L_STUB_FUNC() macro, and stop
passing NULL to the wrappers in __video_do_ioctl()
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Laurent Pinchart [Sun, 10 Aug 2025 01:30:51 +0000 (04:30 +0300)]
media: v4l2-ioctl: Stop passing fh pointer to ioctl handlers
Now that all drivers access the v4l2_fh from the file structure, there
is no need to pass it as an explicit argument to ioctl handlers. Set the
argument to NULL in the __video_do_ioctl() function, and rename the 'fh'
argument in the ioctl handler declarations to 'priv' indicate it does
not contain a file handle.
The argument could be removed altogether with a mechanical change
(probably using coccinelle), but there are plans to pass a new argument
to the ioctl handlers in the near future. The tree-wide change to remove
the argument, only to add another one soon after, would be too much
churn.
While at it, fix argument alignment in vidioc_try_fmt_vid_out_overlay().
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Laurent Pinchart [Sun, 10 Aug 2025 01:30:44 +0000 (04:30 +0300)]
media: hantro: Access v4l2_fh from file->private_data
To prepare for the introduction of video_device_state as second argument
of the v4l2_ioctl_ops handler, access the v4l2_fh from
file->private_data instead of using void *priv.
The file->private_data is initialized to point to the v4l2_fh
by the usage of v4l2_fh_init() in the v4l2_file_operations.open()
handler.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Reviewed-by: Paul Kocialkowski <paulk@sys-base.io> Acked-by: Nicolas Dufresne <nicolas.dufresne@collabora.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Laurent Pinchart [Sun, 10 Aug 2025 01:30:39 +0000 (04:30 +0300)]
media: s5p-mfc: Store s5p_mfc_ctx in vb2_queue.drv_priv
The driver stores a pointer to a v4l2_fh in the vb2_queue.drv_priv,
which it then has to cast to a s5p_mfc_ctx pointer in all vb2 queue
operations. Store the pointer to the s5p_mfc_ctx instead to avoid the
cast. While at it, use the vb2_get_drv_priv() helper to access the
field.
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>