summaryrefslogtreecommitdiff
path: root/rust/helpers/platform.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2025-08-13 00:46:10 +0300
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>2025-09-09 15:59:20 +0200
commitc0baf70955e7f865036463fdfc562ffa092f4250 (patch)
tree2af1a479770e9fbab9a25424836db2fb3f1a11c1 /rust/helpers/platform.c
parent5bf86863ddfee547bce59f385e3dd85fecc63440 (diff)
media: i2c: s5k6a3: Use V4L2 legacy sensor clock helper
Several camera sensor drivers access the "clock-frequency" property directly to retrieve the external clock rate, or modify the clock rate of the external clock programmatically. Both behaviours are valid on a subset of ACPI platforms, but are considered deprecated on OF platforms, and do not support ACPI platforms that implement MIPI DisCo for Imaging. Implementing them manually in drivers is deprecated, as that can encourage copying deprecated behaviour for OF platforms in new drivers, and lead to differences in behaviour between drivers. Instead, drivers that need to preserve the deprecated OF behaviour should use the devm_v4l2_sensor_clk_get_legacy() helper. This driver supports OF platforms only. The "clocks" property has always been specified as mandatory in the DT bindings and the "clock-frequency" property has initially been optional. Both properties were initially set in the upstream DT sources. The driver retrieves the clock, retrieves the clock rate from the "clock-frequency" property if available or uses a fixed default otherwise, and sets the clock rate. This is deprecated behaviour for OF. Switch to using the devm_v4l2_sensor_clk_get_legacy() helper. This preserves setting the clock rate on OF platforms. Should support for OF platforms that set the clock rate through clock-frequency be considered unneeded in the future, the driver will only need to switch to devm_v4l2_sensor_clk_get() without any other change. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com> Reviewed-by: Mehdi Djait <mehdi.djait@linux.intel.com> Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
Diffstat (limited to 'rust/helpers/platform.c')
0 files changed, 0 insertions, 0 deletions