]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
media: v4l2-common: Add a helper for obtaining the clock producer
authorMehdi Djait <mehdi.djait@linux.intel.com>
Mon, 7 Jul 2025 14:32:53 +0000 (16:32 +0200)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Wed, 13 Aug 2025 13:10:18 +0000 (15:10 +0200)
commit7ecb662b717a34305beacf71e9fadd1559b4b9ee
treee6a87ac7019c86facc987badecc27f857e8ab1c8
parent078f1a7eb48eef9b3cb78bcd2254356f3a332358
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>
drivers/media/v4l2-core/v4l2-common.c
include/media/v4l2-common.h