arm64: dts: rockchip: enable I2S codec on rk3399-puma-haikou
authorKlaus Goger <klaus.goger@theobroma-systems.com>
Mon, 19 Feb 2018 08:18:54 +0000 (09:18 +0100)
committerHeiko Stuebner <heiko@sntech.de>
Mon, 19 Feb 2018 08:46:23 +0000 (09:46 +0100)
Enable the NXP SGTL5000 audio codec on the RK3399-Q7 EVK baseboard
Haikou.

Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi

index 8fd0d7ba1dc9d1ca7fbc30e8533ed81b42c5de72..7d3e8bfd51dd4f2fa9a73845ae5cbb0d51cc03b7 100644 (file)
                };
        };
 
+       i2s0-sound {
+               compatible = "simple-audio-card";
+               simple-audio-card,format = "i2s";
+               simple-audio-card,name = "Haikou,I2S-codec";
+               simple-audio-card,mclk-fs = <512>;
+
+               simple-audio-card,codec {
+                       clocks = <&sgtl5000_clk>;
+                       sound-dai = <&sgtl5000>;
+               };
+
+               simple-audio-card,cpu {
+                       bitclock-master;
+                       frame-master;
+                       sound-dai = <&i2s0>;
+               };
+       };
+
+       sgtl5000_clk: sgtl5000-oscillator  {
+                       compatible = "fixed-clock";
+                       #clock-cells = <0>;
+                       clock-frequency  = <24576000>;
+       };
+
        dc_12v: dc-12v {
                compatible = "regulator-fixed";
                regulator-name = "dc_12v";
                vin-supply = <&dc_12v>;
        };
 
+       vcc5v0_baseboard: vcc5v0-baseboard {
+               compatible = "regulator-fixed";
+               regulator-name = "vcc5v0_baseboard";
+               regulator-always-on;
+               regulator-boot-on;
+               regulator-min-microvolt = <5000000>;
+               regulator-max-microvolt = <5000000>;
+               vin-supply = <&dc_12v>;
+       };
+
        vcc5v0_otg: vcc5v0-otg-regulator {
                compatible = "regulator-fixed";
                enable-active-high;
                regulator-name = "vcc5v0_otg";
                regulator-always-on;
        };
+
+       vdda_codec: vdda-codec {
+               compatible = "regulator-fixed";
+               regulator-name = "vdda_codec";
+               regulator-boot-on;
+               regulator-min-microvolt = <3300000>;
+               regulator-max-microvolt = <3300000>;
+               vin-supply = <&vcc5v0_baseboard>;
+       };
+
+       vddd_codec: vddd-codec {
+               compatible = "regulator-fixed";
+               regulator-name = "vddd_codec";
+               regulator-boot-on;
+               regulator-min-microvolt = <1600000>;
+               regulator-max-microvolt = <1600000>;
+               vin-supply = <&vcc5v0_baseboard>;
+       };
 };
 
 &i2c1 {
 &i2c4 {
        status = "okay";
        clock-frequency = <400000>;
+
+       sgtl5000: codec@0a {
+               compatible = "fsl,sgtl5000";
+               reg = <0x0a>;
+               clocks = <&sgtl5000_clk>;
+               #sound-dai-cells = <0>;
+               VDDA-supply = <&vdda_codec>;
+               VDDIO-supply = <&vdda_codec>;
+               VDDD-supply = <&vddd_codec>;
+               status = "okay";
+       };
 };
 
 &i2c6 {
index fc913e2d962f682bd5d4ac254e8e1ad3ccfa33cf..4a2d06abe9c1dc892e819d116f6ce3fa3241e9a9 100644 (file)
        status = "okay";
 };
 
+/*
+ * As Q7 does not specify neither a global nor a RX clock for I2S these
+ * signals are not used. Furthermore I2S0_LRCK_RX is used as GPIO.
+ * Therefore we have to redefine the i2s0_2ch_bus definition to prevent
+ * conflicts.
+ */
+&i2s0_2ch_bus {
+       rockchip,pins =
+               <RK_GPIO3 RK_PD0 RK_FUNC_1 &pcfg_pull_none>,
+               <RK_GPIO3 RK_PD2 RK_FUNC_1 &pcfg_pull_none>,
+               <RK_GPIO3 RK_PD3 RK_FUNC_1 &pcfg_pull_none>,
+               <RK_GPIO3 RK_PD7 RK_FUNC_1 &pcfg_pull_none>;
+};
+
 &io_domains {
        status = "okay";
        bt656-supply = <&vcc_1v8>;