--- v3
+++ v1
@@ -2,17 +2,18 @@
Signed-off-by: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
---
- .../bindings/sound/rockchip,i2s-tdm.yaml | 218 ++++++++++++++++++
- MAINTAINERS | 1 +
- 2 files changed, 219 insertions(+)
+ .../bindings/sound/rockchip,i2s-tdm.yaml | 221 ++++++++++++++++++
+ include/dt-bindings/sound/rockchip,i2s-tdm.h | 9 +
+ 2 files changed, 230 insertions(+)
create mode 100644 Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.yaml
+ create mode 100644 include/dt-bindings/sound/rockchip,i2s-tdm.h
diff --git a/Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.yaml b/Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.yaml
new file mode 100644
-index 000000000000..ab8731779805
+index 000000000000..c3022620b47f
--- /dev/null
+++ b/Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.yaml
-@@ -0,0 +1,218 @@
+@@ -0,0 +1,221 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
@@ -49,40 +50,23 @@
+ maxItems: 2
+
+ dma-names:
-+ minItems: 1
-+ maxItems: 2
-+ items:
-+ enum:
-+ - rx
-+ - tx
++ oneOf:
++ - const: rx
++ - items:
++ - const: tx
++ - const: rx
+
+ clocks:
-+ minItems: 3
+ items:
+ - description: clock for TX
+ - description: clock for RX
-+ - description: AHB clock driving the interface
-+ - description:
-+ Parent clock for mclk_tx (only required when using mclk-calibrate)
-+ - description:
-+ Parent clock for mclk_rx (only required when using mclk-calibrate)
-+ - description:
-+ Clock for sample rates that are an integer multiple of 8000
-+ (only required when using mclk-calibrate)
-+ - description:
-+ Clock for sample rates that are an integer multiple of 11025
-+ (only required when using mclk-calibrate)
++ - description: clock for I2S bus
+
+ clock-names:
-+ minItems: 3
+ items:
+ - const: mclk_tx
+ - const: mclk_rx
+ - const: hclk
-+ - const: mclk_tx_src
-+ - const: mclk_rx_src
-+ - const: mclk_root0
-+ - const: mclk_root1
+
+ rockchip,frame-width:
+ $ref: /schemas/types.yaml#/definitions/uint32
@@ -107,7 +91,8 @@
+ $ref: /schemas/types.yaml#/definitions/phandle
+ description:
+ The phandle of the cru.
-+ Required if neither trcm-sync-tx-only nor trcm-sync-rx-only are specified.
++ Required if both playback and capture are used, i.e. if rockchip,clk-trcm
++ is 0.
+
+ rockchip,grf:
+ $ref: /schemas/types.yaml#/definitions/phandle
@@ -116,24 +101,44 @@
+
+ rockchip,mclk-calibrate:
+ description:
-+ Switch between two root clocks depending on the audio sample rate.
-+ For integer multiples of 8000 (e.g. 48000 Hz), mclk_root0 is used.
-+ For integer multiples of 11025 (e.g. 44100 Hz), mclk_root1 is used.
-+ type: boolean
-+
-+ rockchip,trcm-sync-tx-only:
-+ type: boolean
-+ description: Use TX BCLK/LRCK for both TX and RX.
-+
-+ rockchip,trcm-sync-rx-only:
-+ type: boolean
-+ description: Use RX BCLK/LRCK for both TX and RX.
++ Enable mclk source calibration.
++ type: boolean
++
++ rockchip,trcm-sync:
++ $ref: /schemas/types.yaml#/definitions/uint32
++ description:
++ Which lrck/bclk clocks each direction will sync to. You should use the
++ constants in <dt-bindings/sound/rockchip,i2s-tdm.h>
++ oneOf:
++ - const: 0
++ description:
++ RK_TRCM_TXRX. Use both the TX and the RX clock for TX and RX.
++ - const: 1
++ description:
++ RK_TRCM_TX. Use only the TX clock for TX and RX.
++ - const: 2
++ description:
++ RK_TRCM_RX. Use only the RX clock for TX and RX.
+
+ "#sound-dai-cells":
+ const: 0
+
++ rockchip,no-dmaengine:
++ description:
++ If present, driver will not register a pcm dmaengine, only the dai.
++ If the dai is part of multi-dais, the property should be present.
++ type: boolean
++
++ rockchip,playback-only:
++ description: Specify that the controller only has playback capability.
++ type: boolean
++
++ rockchip,capture-only:
++ description: Specify that the controller only has capture capability.
++ type: boolean
++
+ rockchip,i2s-rx-route:
-+ $ref: /schemas/types.yaml#/definitions/uint32-array
++ $ref: /schemas/types.yaml#/definitions/uint32
+ description:
+ Defines the mapping of I2S RX sdis to I2S data bus lines.
+ By default, they are mapped one-to-one.
@@ -144,7 +149,7 @@
+ - description: which sdi to connect to data line 3
+
+ rockchip,i2s-tx-route:
-+ $ref: /schemas/types.yaml#/definitions/uint32-array
++ $ref: /schemas/types.yaml#/definitions/uint32
+ description:
+ Defines the mapping of I2S TX sdos to I2S data bus lines.
+ By default, they are mapped one-to-one.
@@ -156,12 +161,6 @@
+
+ rockchip,tdm-fsync-half-frame:
+ description: Whether to use half frame fsync.
-+ type: boolean
-+
-+ rockchip,io-multiplex:
-+ description:
-+ Specify that the GPIO lines on the I2S bus are multiplexed such that
-+ the direction (input/output) needs to be dynamically adjusted.
+ type: boolean
+
+
@@ -177,15 +176,18 @@
+ - reset-names
+ - rockchip,grf
+ - "#sound-dai-cells"
++ - rockchip,trcm-sync
+
+allOf:
+ - if:
+ properties:
-+ rockchip,trcm-sync-tx-only: false
-+ rockchip,trcm-sync-rx-only: false
++ rockchip,clk-trcm:
++ contains:
++ enum: [0]
+ then:
+ required:
+ - rockchip,cru
++
+
+additionalProperties: false
+
@@ -195,6 +197,8 @@
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/interrupt-controller/irq.h>
+ #include <dt-bindings/pinctrl/rockchip.h>
++ #include <dt-bindings/sound/rockchip,i2s-tdm.h>
++
+
+ foo {
+ #address-cells = <2>;
@@ -206,11 +210,11 @@
+ clocks = <&cru MCLK_I2S1_8CH_TX>, <&cru MCLK_I2S1_8CH_RX>,
+ <&cru HCLK_I2S1_8CH>;
+ clock-names = "mclk_tx", "mclk_rx", "hclk";
-+ dmas = <&dmac1 3>, <&dmac1 2>;
-+ dma-names = "rx", "tx";
++ dmas = <&dmac1 2>, <&dmac1 3>;
++ dma-names = "tx", "rx";
+ resets = <&cru SRST_M_I2S1_8CH_TX>, <&cru SRST_M_I2S1_8CH_RX>;
+ reset-names = "tx-m", "rx-m";
-+ rockchip,trcm-sync-tx-only;
++ rockchip,trcm-sync = <RK_TRCM_TX>;
+ rockchip,cru = <&cru>;
+ rockchip,grf = <&grf>;
+ #sound-dai-cells = <0>;
@@ -228,21 +232,24 @@
+ &i2s1m0_sdo1
+ &i2s1m0_sdo2
+ &i2s1m0_sdo3>;
-+ status = "okay";
++ status = "disabled";
+ };
+ };
-diff --git a/MAINTAINERS b/MAINTAINERS
-index 5d459d42672c..d2be16a85009 100644
---- a/MAINTAINERS
-+++ b/MAINTAINERS
-@@ -16053,6 +16053,7 @@ ROCKCHIP I2S TDM DRIVER
- M: Nicolas Frattaroli <frattaroli.nicolas@gmail.com>
- L: linux-rockchip@lists.infradead.org
- S: Maintained
-+F: Documentation/devicetree/bindings/sound/rockchip,i2s-tdm.yaml
- F: sound/soc/rockchip/rockchip_i2s_tdm.*
-
- ROCKCHIP ISP V1 DRIVER
+diff --git a/include/dt-bindings/sound/rockchip,i2s-tdm.h b/include/dt-bindings/sound/rockchip,i2s-tdm.h
+new file mode 100644
+index 000000000000..32494d64cf33
+--- /dev/null
++++ b/include/dt-bindings/sound/rockchip,i2s-tdm.h
+@@ -0,0 +1,9 @@
++/* SPDX-License-Identifier: GPL-2.0 */
++#ifndef _DT_BINDINGS_ROCKCHIP_I2S_TDM_H
++#define _DT_BINDINGS_ROCKCHIP_I2S_TDM_H
++
++#define RK_TRCM_TXRX 0
++#define RK_TRCM_TX 1
++#define RK_TRCM_RX 2
++
++#endif /* _DT_BINDINGS_ROCKCHIP_I2S_TDM_H */
--
-2.33.0
+2.32.0