Thread (17 messages) 17 messages, 4 authors, 2025-03-07

Re: [PATCH 3/7] ASoC: dt-bindings: add schema for rockchip SAI controllers

From: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
Date: 2025-03-06 13:14:08
Also in: linux-clk, linux-devicetree, linux-rockchip, linux-sound, lkml

On Thursday, 6 March 2025 08:42:54 Central European Standard Time Krzysztof 
Kozlowski wrote:
On 05/03/2025 22:24, Nicolas Frattaroli wrote:
quoted
Rockchip introduced a new audio controller called the "Serial Audio
Interface", or "SAI" for short, on some of their newer SoCs. In
particular, this controller is used several times on the RK3576 SoC.

Add a schema for it, with only an RK3576 compatible for now. Other SoCs
may follow as mainline support for them lands.

Signed-off-by: Nicolas Frattaroli <nicolas.frattaroli@collabora.com>
---

 .../devicetree/bindings/sound/rockchip,sai.yaml    | 151
 +++++++++++++++++++++
Filename based on compatible.
Sure, but more compatibles will follow. Are you certain you want a file named 
rockchip,rk3576-sai.yaml to then contain rockchip,rk3528-sai? If so then I do 
not understand the reason behind this policy.
quoted
 MAINTAINERS                                        |   6 +
 2 files changed, 157 insertions(+)
...
quoted
+
+  dma-names:
+    minItems: 1
+    maxItems: 2
+    oneOf:
+      - const: tx
+      - const: rx
+      - items:
+          - const: tx
+          - const: rx
Why all combinations are possible?
Because they are. sai5 in rk3576 is rx only. sai7 is tx only. Others are both 
tx and rx. Do you want me to enforce that those with both are always tx 
followed by rx?
quoted
+
+  clocks:
+    items:
+      - description: master audio clock
+      - description: AHB clock driving the interface
+
+  clock-names:
+    items:
+      - const: mclk
+      - const: hclk
+
+  resets:
+    minItems: 1
+    maxItems: 2
+    description: resets for the mclk domain and ahb domain
List the items instead with description and minItems: 1.
Will do
quoted
+
+  reset-names:
+    minItems: 1
+    items:
+      - const: m
+      - const: h
+
+  port:
+    $ref: audio-graph-port.yaml#
+    unevaluatedProperties: false
+
+  power-domains:
+    maxItems: 1
+
+  "#sound-dai-cells":
+    const: 0
+
+  rockchip,sai-rx-route:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    description:
+      Defines the mapping of the controller's SDI ports to actual input
lanes, +      as well as the number of input lanes.
+      rockchip,sai-rx-route = <3> would mean sdi3 is receiving from
data0, and +      that there is only one receiving lane.
+      This property's absence is to be understood as only one receiving
lane +      being used if the controller has capture capabilities.
+    maxItems: 4
+    items:
+      enum: [0, 1, 2, 3]
+
+  rockchip,sai-tx-route:
+    $ref: /schemas/types.yaml#/definitions/uint32-array
+    description:
+      Defines the mapping of the controller's SDO ports to actual output
lanes, +      as well as the number of output lanes.
+      rockchip,sai-tx-route = <3> would mean sdo3 is sending to data0,
and
I understand this is only example because = <3> would not be allowed
(test it).
I'll have to look into that, I was fairly certain I tested it, but maybe I 
forgot to run a CHECK_DTBS with it in.
quoted
+      that there is only one transmitting lane.
+      This property's absence is to be understood as only one
transmitting lane +      being used if the controller has playback
capabilities.
+    maxItems: 4
+    items:
+      enum: [0, 1, 2, 3]
+
+  rockchip,always-on:
+    type: boolean
+    description:
+      The hardware requires this controller to remain turned on.
How hardware requires this? You rather miss proper PM domain handling or
some other resources.
This isn't about power domains. It's about the FS/SCLK generator inside the 
IP. I'll remove it in the next revision since downstream only uses it for a 
different IP on the RK3588, and I'd rather not get bogged down by discussions 
as to whether SAI should be modelled as a clock provider.
quoted
+
+
Just one blank line.
Will do
quoted
+required:
+  - compatible
+  - reg
+  - dmas
+  - dma-names
+  - clocks
+  - clock-names
+  - "#sound-dai-cells"
+
+unevaluatedProperties: false
Best regards,
Krzysztof
Cheers,
Nicolas Frattaroli



Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help