public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v3 0/2] arm64: dts: rockchip: enable I2S codec on rk3399-puma-haikou
@ 2018-02-19  8:18 Klaus Goger
  2018-02-19  8:18 ` [PATCH v3 1/2] arm64: dts: rockchip: move i2s0 node from baseboard to SoM Klaus Goger
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Klaus Goger @ 2018-02-19  8:18 UTC (permalink / raw)
  To: linux-rockchip; +Cc: linux-kernel, Heiko Stuebner, Klaus Goger

Enables the audio codec on the Haikou Baseboard when used with a RK3399-Q7.

Changes in v3:
- split i2s0 move from rk3399-puma-haikou.dts to rk3399-puma.dtsi into it's
  own patch
- use dasheѕ in node names
- added missing vin-supply properties to regulators
  had to add an additional regulator to model this correctly
- simple overwrite pins in i2s0_2ch_bus instead of deleting and redefining
  the node

Changes in v2:
- reordered entries as suggested in review
- removed a conflicting i2s definition in rk3399-puma-haikou.dts
  i2s0 was already enabled in rk3399-puma.dtsi as it should be,
  so reuse it and fix the incorrect rockchip,*-channels values
- add a patch to the series that definies a generic i2s0-2ch-bus
- overwrite the generic pin definition of i2s0-2ch-bus with a specific
  one used in the Haikou with RK3399-Q7 setup

Klaus Goger (2):
  arm64: dts: rockchip: move i2s0 node from baseboard to SoM
  arm64: dts: rockchip: enable I2S codec on rk3399-puma-haikou

 .../arm64/boot/dts/rockchip/rk3399-puma-haikou.dts | 71 +++++++++++++++++++---
 arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi      | 22 +++++++
 2 files changed, 85 insertions(+), 8 deletions(-)

-- 
2.11.0

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

* [PATCH v3 1/2] arm64: dts: rockchip: move i2s0 node from baseboard to SoM
  2018-02-19  8:18 [PATCH v3 0/2] arm64: dts: rockchip: enable I2S codec on rk3399-puma-haikou Klaus Goger
@ 2018-02-19  8:18 ` Klaus Goger
  2018-02-19  8:18 ` [PATCH v3 2/2] arm64: dts: rockchip: enable I2S codec on rk3399-puma-haikou Klaus Goger
  2018-02-19  8:47 ` [PATCH v3 0/2] " Heiko Stuebner
  2 siblings, 0 replies; 4+ messages in thread
From: Klaus Goger @ 2018-02-19  8:18 UTC (permalink / raw)
  To: linux-rockchip; +Cc: linux-kernel, Heiko Stuebner, Klaus Goger

The I2S definition is part of the SoM and therefore should be in
rk3399-puma.dtsi. Also correct the number of channels available.

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

Changes in v3: None
Changes in v2: None

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

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
index 9a7486058455..8fd0d7ba1dc9 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
@@ -117,14 +117,6 @@
 	clock-frequency = <400000>;
 };
 
-&i2s0 {
-	status = "okay";
-	rockchip,playback-channels = <8>;
-	rockchip,capture-channels = <8>;
-	#sound-dai-cells = <0>;
-	status = "okay";
-};
-
 &pcie_phy {
 	status = "okay";
 };
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
index ce15a57a5b85..fc913e2d962f 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
@@ -435,6 +435,14 @@
 	};
 };
 
+&i2s0 {
+	pinctrl-0 = <&i2s0_2ch_bus>;
+	rockchip,playback-channels = <2>;
+	rockchip,capture-channels = <2>;
+	#sound-dai-cells = <0>;
+	status = "okay";
+};
+
 &io_domains {
 	status = "okay";
 	bt656-supply = <&vcc_1v8>;
-- 
2.11.0

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

* [PATCH v3 2/2] arm64: dts: rockchip: enable I2S codec on rk3399-puma-haikou
  2018-02-19  8:18 [PATCH v3 0/2] arm64: dts: rockchip: enable I2S codec on rk3399-puma-haikou Klaus Goger
  2018-02-19  8:18 ` [PATCH v3 1/2] arm64: dts: rockchip: move i2s0 node from baseboard to SoM Klaus Goger
@ 2018-02-19  8:18 ` Klaus Goger
  2018-02-19  8:47 ` [PATCH v3 0/2] " Heiko Stuebner
  2 siblings, 0 replies; 4+ messages in thread
From: Klaus Goger @ 2018-02-19  8:18 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.

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

---

Changes in v3:
- split i2s0 move from rk3399-puma-haikou.dts to rk3399-puma.dtsi into it's
  own patch
- use dasheѕ in node names
- added missing vin-supply properties to regulators
  had to add an additional regulator to model this correctly
- simple overwrite pins in i2s0_2ch_bus instead of deleting and redefining
  the node

Changes in v2:
- reordered entries as suggested in review
- removed a conflicting i2s definition in rk3399-puma-haikou.dts
  i2s0 was already enabled in rk3399-puma.dtsi as it should be,
  so reuse it and fix the incorrect rockchip,*-channels values
- add a patch to the series that definies a generic i2s0-2ch-bus
- overwrite the generic pin definition of i2s0-2ch-bus with a specific
  one used in the Haikou with RK3399-Q7 setup

 .../arm64/boot/dts/rockchip/rk3399-puma-haikou.dts | 63 ++++++++++++++++++++++
 arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi      | 14 +++++
 2 files changed, 77 insertions(+)

diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
index 8fd0d7ba1dc9..7966f7828504 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma-haikou.dts
@@ -61,6 +61,24 @@
 		};
 	};
 
+	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";
@@ -80,6 +98,16 @@
 		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;
@@ -89,6 +117,30 @@
 		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>;
+	};
+
+	sgtl5000_clk: sgtl5000-oscillator  {
+			compatible = "fixed-clock";
+			#clock-cells = <0>;
+			clock-frequency  = <24576000>;
+	};
 };
 
 &i2c1 {
@@ -110,6 +162,17 @@
 &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 {
diff --git a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
index fc913e2d962f..4a2d06abe9c1 100644
--- a/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
+++ b/arch/arm64/boot/dts/rockchip/rk3399-puma.dtsi
@@ -443,6 +443,20 @@
 	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>;
-- 
2.11.0

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

* Re: [PATCH v3 0/2] arm64: dts: rockchip: enable I2S codec on rk3399-puma-haikou
  2018-02-19  8:18 [PATCH v3 0/2] arm64: dts: rockchip: enable I2S codec on rk3399-puma-haikou Klaus Goger
  2018-02-19  8:18 ` [PATCH v3 1/2] arm64: dts: rockchip: move i2s0 node from baseboard to SoM Klaus Goger
  2018-02-19  8:18 ` [PATCH v3 2/2] arm64: dts: rockchip: enable I2S codec on rk3399-puma-haikou Klaus Goger
@ 2018-02-19  8:47 ` Heiko Stuebner
  2 siblings, 0 replies; 4+ messages in thread
From: Heiko Stuebner @ 2018-02-19  8:47 UTC (permalink / raw)
  To: Klaus Goger; +Cc: linux-rockchip, linux-kernel

Am Montag, 19. Februar 2018, 09:18:52 CET schrieb Klaus Goger:
> Enables the audio codec on the Haikou Baseboard when used with a RK3399-Q7.
> 
> Changes in v3:
> - split i2s0 move from rk3399-puma-haikou.dts to rk3399-puma.dtsi into it's
>   own patch
> - use dasheѕ in node names
> - added missing vin-supply properties to regulators
>   had to add an additional regulator to model this correctly
> - simple overwrite pins in i2s0_2ch_bus instead of deleting and redefining
>   the node

applied both patches for 4.17, only moved the oscillator node a bit
upwards in the file.


Thanks
Heiko

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

end of thread, other threads:[~2018-02-19  8:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-19  8:18 [PATCH v3 0/2] arm64: dts: rockchip: enable I2S codec on rk3399-puma-haikou Klaus Goger
2018-02-19  8:18 ` [PATCH v3 1/2] arm64: dts: rockchip: move i2s0 node from baseboard to SoM Klaus Goger
2018-02-19  8:18 ` [PATCH v3 2/2] arm64: dts: rockchip: enable I2S codec on rk3399-puma-haikou Klaus Goger
2018-02-19  8:47 ` [PATCH v3 0/2] " Heiko Stuebner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox