All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] arm64: dts: rockchip: enable I2S codec on rk3399-puma-haikou
@ 2018-01-30 10:15 ` Klaus Goger
  0 siblings, 0 replies; 3+ messages in thread
From: Klaus Goger @ 2018-01-30 10:15 UTC (permalink / raw)
  To: linux-rockchip; +Cc: linux-kernel, Heiko Stuebner, Klaus Goger

Enable the NXP SGTL5000 audio codec on the RK3399-Q7 EVK baseboard
Haikou.

The i2s0_2ch_bus definition is only done in the SoM dtsi as it is
missing the LRCK_RX pin (that is used otherwise) and therefore not
generic enough for the SoC dtsi.

Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>

---

 .../arm64/boot/dts/rockchip/rk3399-puma-haikou.dts | 49 ++++++++++++++++++++++
 arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi      | 18 ++++++++
 2 files changed, 67 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
index 9a7486058455..060c6be7d7e3 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
@@ -61,6 +61,22 @@
 		};
 	};
 
+	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,cpu {
+			sound-dai = <&i2s0>;
+			frame-master;
+			bitclock-master;
+		};
+		simple-audio-card,codec {
+			sound-dai = <&sgtl5000>;
+			clocks = <&sgtl5000_clk>;
+		};
+	};
+
 	dc_12v: dc-12v {
 		compatible = "regulator-fixed";
 		regulator-name = "dc_12v";
@@ -89,6 +105,28 @@
 		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>;
+	};
+
+	vddd_codec: vddd-codec {
+		compatible = "regulator-fixed";
+		regulator-name = "vddd_codec";
+		regulator-boot-on;
+		regulator-min-microvolt = <1600000>;
+		regulator-max-microvolt = <1600000>;
+	};
+
+	sgtl5000_clk: sgtl5000-oscillator  {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency  = <24576000>;
+	};
 };
 
 &i2c1 {
@@ -110,6 +148,17 @@
 &i2c4 {
 	status = "okay";
 	clock-frequency = <400000>;
+
+	sgtl5000: codec@0a {
+		#sound-dai-cells = <0>;
+		compatible = "fsl,sgtl5000";
+		reg = <0x0a>;
+		VDDA-supply = <&vdda_codec>;
+		VDDIO-supply = <&vdda_codec>;
+		VDDD-supply = <&vddd_codec>;
+		clocks = <&sgtl5000_clk>;
+		status = "okay";
+	};
 };
 
 &i2c6 {
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
index 1fc5060d7027..a3fcb803ff69 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
@@ -435,6 +435,14 @@
 	};
 };
 
+&i2s0 {
+	#sound-dai-cells = <0>;
+	status = "okay";
+	pinctrl-0 = <&i2s0_2ch_bus>;
+	rockchip,playback-channels = <2>;
+	rockchip,capture-channels = <2>;
+};
+
 &io_domains {
 	status = "okay";
 	bt656-supply = <&vcc_1v8>;
@@ -461,6 +469,16 @@
 		};
 	};
 
+	i2s0 {
+		i2s0_2ch_bus: 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>;
+		};
+	};
+
 	leds {
 		led_pin_module: led-module-gpio {
 			rockchip,pins =
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH] arm64: dts: rockchip: enable I2S codec on rk3399-puma-haikou
@ 2018-01-30 10:15 ` Klaus Goger
  0 siblings, 0 replies; 3+ messages in thread
From: Klaus Goger @ 2018-01-30 10:15 UTC (permalink / raw)
  To: linux-rockchip-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r
  Cc: Klaus Goger, linux-kernel-u79uwXL29TY76Z2rM5mHXA, Heiko Stuebner

Enable the NXP SGTL5000 audio codec on the RK3399-Q7 EVK baseboard
Haikou.

The i2s0_2ch_bus definition is only done in the SoM dtsi as it is
missing the LRCK_RX pin (that is used otherwise) and therefore not
generic enough for the SoC dtsi.

Signed-off-by: Klaus Goger <klaus.goger-SN7IsUiht6C/RdPyistoZJqQE7yCjDx5@public.gmane.org>

---

 .../arm64/boot/dts/rockchip/rk3399-puma-haikou.dts | 49 ++++++++++++++++++++++
 arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi      | 18 ++++++++
 2 files changed, 67 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
index 9a7486058455..060c6be7d7e3 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
@@ -61,6 +61,22 @@
 		};
 	};
 
+	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,cpu {
+			sound-dai = <&i2s0>;
+			frame-master;
+			bitclock-master;
+		};
+		simple-audio-card,codec {
+			sound-dai = <&sgtl5000>;
+			clocks = <&sgtl5000_clk>;
+		};
+	};
+
 	dc_12v: dc-12v {
 		compatible = "regulator-fixed";
 		regulator-name = "dc_12v";
@@ -89,6 +105,28 @@
 		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>;
+	};
+
+	vddd_codec: vddd-codec {
+		compatible = "regulator-fixed";
+		regulator-name = "vddd_codec";
+		regulator-boot-on;
+		regulator-min-microvolt = <1600000>;
+		regulator-max-microvolt = <1600000>;
+	};
+
+	sgtl5000_clk: sgtl5000-oscillator  {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency  = <24576000>;
+	};
 };
 
 &i2c1 {
@@ -110,6 +148,17 @@
 &i2c4 {
 	status = "okay";
 	clock-frequency = <400000>;
+
+	sgtl5000: codec@0a {
+		#sound-dai-cells = <0>;
+		compatible = "fsl,sgtl5000";
+		reg = <0x0a>;
+		VDDA-supply = <&vdda_codec>;
+		VDDIO-supply = <&vdda_codec>;
+		VDDD-supply = <&vddd_codec>;
+		clocks = <&sgtl5000_clk>;
+		status = "okay";
+	};
 };
 
 &i2c6 {
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
index 1fc5060d7027..a3fcb803ff69 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
@@ -435,6 +435,14 @@
 	};
 };
 
+&i2s0 {
+	#sound-dai-cells = <0>;
+	status = "okay";
+	pinctrl-0 = <&i2s0_2ch_bus>;
+	rockchip,playback-channels = <2>;
+	rockchip,capture-channels = <2>;
+};
+
 &io_domains {
 	status = "okay";
 	bt656-supply = <&vcc_1v8>;
@@ -461,6 +469,16 @@
 		};
 	};
 
+	i2s0 {
+		i2s0_2ch_bus: 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>;
+		};
+	};
+
 	leds {
 		led_pin_module: led-module-gpio {
 			rockchip,pins =
-- 
2.11.0

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] arm64: dts: rockchip: enable I2S codec on rk3399-puma-haikou
  2018-01-30 10:15 ` Klaus Goger
  (?)
@ 2018-02-02 22:00 ` Heiko Stuebner
  -1 siblings, 0 replies; 3+ messages in thread
From: Heiko Stuebner @ 2018-02-02 22:00 UTC (permalink / raw)
  To: Klaus Goger; +Cc: linux-rockchip, linux-kernel

Hi Klaus,

Am Dienstag, 30. Januar 2018, 11:15:31 CET schrieb Klaus Goger:
> Enable the NXP SGTL5000 audio codec on the RK3399-Q7 EVK baseboard
> Haikou.
> 
> The i2s0_2ch_bus definition is only done in the SoM dtsi as it is
> missing the LRCK_RX pin (that is used otherwise) and therefore not
> generic enough for the SoC dtsi.
> 
> Signed-off-by: Klaus Goger <klaus.goger@theobroma-systems.com>

I did fix up the small ordering issues already but then found the i2s
pinctrl issue below, which will need a slightly bigger change and thus
a respin please.


>  .../arm64/boot/dts/rockchip/rk3399-puma-haikou.dts | 49 ++++++++++++++++++++++
>  arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi      | 18 ++++++++
>  2 files changed, 67 insertions(+)
> 
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
> index 9a7486058455..060c6be7d7e3 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
> @@ -61,6 +61,22 @@
>  		};
>  	};
>  
> +	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,cpu {
> +			sound-dai = <&i2s0>;
> +			frame-master;
> +			bitclock-master;
> +		};
> +		simple-audio-card,codec {
> +			sound-dai = <&sgtl5000>;
> +			clocks = <&sgtl5000_clk>;
> +		};
> +	};
> +

odering and a bit of spacing:

+	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>;
+		};
+	};

>  	dc_12v: dc-12v {
>  		compatible = "regulator-fixed";
>  		regulator-name = "dc_12v";

> @@ -110,6 +148,17 @@
>  &i2c4 {
>  	status = "okay";
>  	clock-frequency = <400000>;
> +
> +	sgtl5000: codec@0a {
> +		#sound-dai-cells = <0>;
> +		compatible = "fsl,sgtl5000";
> +		reg = <0x0a>;
> +		VDDA-supply = <&vdda_codec>;
> +		VDDIO-supply = <&vdda_codec>;
> +		VDDD-supply = <&vddd_codec>;
> +		clocks = <&sgtl5000_clk>;
> +		status = "okay";
> +	};

ordering again

+	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 {
> diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
> index 1fc5060d7027..a3fcb803ff69 100644
> --- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
> +++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
> @@ -435,6 +435,14 @@
>  	};
>  };
>  
> +&i2s0 {
> +	#sound-dai-cells = <0>;
> +	status = "okay";
> +	pinctrl-0 = <&i2s0_2ch_bus>;
> +	rockchip,playback-channels = <2>;
> +	rockchip,capture-channels = <2>;
> +};

ordering

+&i2s0 {
+	pinctrl-0 = <&i2s0_2ch_bus>;
+	rockchip,playback-channels = <2>;
+	rockchip,capture-channels = <2>;
+	#sound-dai-cells = <0>;
+	status = "okay";
+};


> @@ -461,6 +469,16 @@
>  		};
>  	};
>  
> +	i2s0 {
> +		i2s0_2ch_bus: i2s0_2ch_bus {

node names should use dashes, so
		i2s0_2ch_bus: i2s0-2ch-bus

But also, could you define the generic i2s0-2ch-bus (incl the phandle)
in rk3399.dtsi in a first patch and just override it here to not use that
LRCK_RX pin please?


Thanks
Heiko

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-02-02 22:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-30 10:15 [PATCH] arm64: dts: rockchip: enable I2S codec on rk3399-puma-haikou Klaus Goger
2018-01-30 10:15 ` Klaus Goger
2018-02-02 22:00 ` Heiko Stuebner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.