Skip to contentSkip to conversation

Documentation: media: Document clock handling in camera sensor drivers

PATCH New Sakari Ailus 1 participant 1 message Dec 21, 2020

Subsystems (4)
lore
Share & tools
lore

Sakari Ailus

author maintainer
#0 lore raw

PATCH 1/1 Documentation: media: Document clock handling in camera sensor drivers

Document pratices of handling clocks in camera sensor drivers on both DT and ACPI.

---
 .../driver-api/media/camera-sensor.rst        | 20 ++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)
Documentation/driver-api/media/camera-sensor.rst +19 -1
index ffb0cad8137a..4e8e92fdd8b4 100644
@@ -15,7 +15,7 @@ Camera sensors have an internal clock tree including a PLL and a number of
 divisors. The clock tree is generally configured by the driver based on a few
 input parameters that are specific to the hardware:: the external clock frequency
 and the link frequency. The two parameters generally are obtained from system
-firmware. No other frequencies should be used in any circumstances.
+firmware. **No other frequencies should be used in any circumstances.**
 
 The reason why the clock frequencies are so important is that the clock signals
 come out of the SoC, and in many cases a specific frequency is designed to be
@@ -23,6 +23,24 @@ used in the system. Using another frequency may cause harmful effects
 elsewhere. Therefore only the pre-determined frequencies are configurable by the
 user.
 
+ACPI
+~~~~
+
+Read the "clock-frequency" _DSD property to denote the frequency. The driver can
+rely this frequency being used.
+
+Devicetree
+~~~~~~~~~~
+
+The currently preferred way to achieve this is using "assigned-clock-rates"
+property. See Documentation/devicetree/bindings/clock/clock-bindings.txt for
+more information.
+
+This approach has the drawback that there's no guarantee that the frequency
+hasn't been modified directly or indirectly by another driver, or supported by
+the board's clock tree to begin with. Changes to the Common Clock Framework API
+are required to ensure reliability.
+
 Frame size
 ----------
 
Signature · 1 line
2.29.2