Thread (10 messages) flat view 10 messages, 3 authors, 2021-03-02
STALE2020d

[RFC PATCH 3/5] ASoC: audio-graph-card: Add bindings for sysclk and pll

From: Sameer Pujar <hidden>
Date: 2021-02-25 18:09:36
Also in: alsa-devel, lkml
Subsystem: open firmware and flattened device tree bindings, sound - generic sound card (simple-audio-card, audio-graph-card), sound - soc layer / dynamic audio power management (asoc), the rest · Maintainers: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Mark Brown, Kuninori Morimoto, Liam Girdwood, Linus Torvalds

ASoC core provides callbacks snd_soc_dai_set_sysclk() and
snd_soc_dai_set_pll() for system clock (sysclk) and pll configurations
respectively. Add bindings for flexible sysclk or pll configurations
which can be driven from CPU/Codec DAI or endpoint subnode from DT.
This in turn helps to avoid hard codings in driver and makes it more
generic.

Also add system-clock related bindings, "system-clock-direction-out"
and "system-clock-frequency", which are already supported.

Cc: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: Rob Herring <robh@kernel.org>
Signed-off-by: Sameer Pujar <redacted>
---
 .../bindings/sound/audio-graph-port.yaml           | 71 ++++++++++++++++++++++
 1 file changed, 71 insertions(+)
diff --git a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml
index 766e910..4f50291 100644
--- a/Documentation/devicetree/bindings/sound/audio-graph-port.yaml
+++ b/Documentation/devicetree/bindings/sound/audio-graph-port.yaml
@@ -71,6 +71,77 @@ properties:
             description: CPU to Codec rate channels.
             $ref: /schemas/types.yaml#/definitions/uint32
 
+          system-clock-frequency:
+            description: |
+              Specify system clock (sysclk) frequency for CPU or Codec
+              component. Or if a clock is specified in the CPU or Codec
+              device node and a scaling factor is given with "mclk-fs",
+              sysclk will be calculated as a multiple of stream sample
+              rate and "mclk-fs". The rate is updated when stream starts.
+            $ref: /schemas/types.yaml#/definitions/uint32
+
+          system-clock-direction-out:
+            description: |
+              Specifies clock direction as "out" on initialization. It
+              is useful for some CPUs with fixed clocks.
+            $ref: /schemas/types.yaml#/definitions/flag
+
+          system-clock-id:
+            description: |
+              CPU or Codec component may have multiple clocks. A specific
+              clock may have to be configured. In such cases the clock
+              ID needs to be specified.
+            $ref: /schemas/types.yaml#/definitions/uint32
+
+          system-clock-source:
+            description: |
+              CPU or Codec component may have multiple sources for its
+              system clock (sysclk). In such cases the sysclk source
+              needs to be specified.
+            $ref: /schemas/types.yaml#/definitions/uint32
+
+          pll-id:
+            description: |
+              Specify PLL that needs to be configured. This is useful
+              when the CPU or Codec component has multiple PLLs.
+            $ref: /schemas/types.yaml#/definitions/uint32
+
+          pll-source:
+            description: |
+              When PLL has multiple reference clock sources, the exact
+              source needs to be specified for the required configuration.
+            $ref: /schemas/types.yaml#/definitions/uint32
+
+          pll-input-reference:
+            description: |
+              Specify how to calculate input frequency for the PLL.
+              Depending on the identifier, input frequency can be
+              calculated at runtime. For example if I2S bit clock is used
+              as reference, rate depends on actual PCM parameters (rate,
+              channels and bits) during an audio session. If a fixed rate
+              is used, then "pll-input-frequency" can be used instead.
+            $ref: /schemas/types.yaml#/definitions/uint32
+            const: 2
+
+          pll-input-frequency:
+            description: Specify fixed input frequency
+            $ref: /schemas/types.yaml#/definitions/uint32
+
+          pll-output-reference:
+            description: |
+              Specify how to calculate output frequency for the PLL.
+              Depending on the identifier, output frequency can be
+              calculated at runtime. If output clock is used for MCLK purpose,
+              then it may depend on "mclk-fs" scale factor. In such cases it
+              needs to be calculated at runtime. If a fixed output frequency
+              is needed, then "pll-output-frequency" can be used instead.
+            $ref: /schemas/types.yaml#/definitions/uint32
+            const: 1
+
+          pll-output-frequency:
+            description: Specify fixed output frequency
+            $ref: /schemas/types.yaml#/definitions/uint32
+
   ports:
     description: multi OF-Graph subnode
     type: object
-- 
2.7.4
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help