Skip to contentSkip to conversation

Add i2s nodes on Exynos5420 and enable sound support on sdmk5420

PATCH Superseded Padmavathi Venna 4 participants 18 messages Aug 7, 2013

Subsystems (5)

v3 of 5 Superseded Latest is v5 →

lore
Share & tools
lore
#0 lore raw

v3 cover Add i2s nodes on Exynos5420 and enable sound support on sdmk5420

Changes since V2:
- Seperated out driver side changes and dts changes in two patch sets
- Added proper names for wm8994 regulators as commented by Mark
- Moved common i2s nodes into the exynos5.dtsi
- Added clock info in wm8994 node as requested by Mark.
- Registered the 16.9MHz oscillator clock as fixed clock in the machine file. Right now no user of this clock but as Mark requested to add mclk info in wm8994 node, I added this part.

This patch set is dependent on the following i2c, dma and audio subsystem clk controller patches.
http://comments.gmane.org/gmane.linux.kernel.samsung-soc/20077
http://comments.gmane.org/gmane.linux.kernel.samsung-soc/20661
http://comments.gmane.org/gmane.linux.kernel.samsung-soc/20668

This patch set is made based on Kukjin Kim for-next branch.

Andrew Bresticker (1):
ARM: dts: exynos5420: add i2s controllers

Padmavathi Venna (6):
ARM: dts: Change i2s compatible string on exynos5250
ARM: dts: Add i2c bus 1 and it's audio codec child node on smdk5420
ARM: dts: exynos5250: move common i2s properties to exynos5 dtsi
ARM: dts: Add osc clock node on smdk5420.
ASoC: Samsung: wm8994: Register the osc clock.
ARM: dts: Enable sound support on smdk5420

 arch/arm/boot/dts/exynos5.dtsi            |   21 ++++++++
 arch/arm/boot/dts/exynos5250.dtsi         |   17 +------
 arch/arm/boot/dts/exynos5420-smdk5420.dts |   78 +++++++++++++++++++++++++++++
 arch/arm/boot/dts/exynos5420.dtsi         |   32 ++++++++++++
 sound/soc/samsung/smdk_wm8994.c           |   12 +++++
 5 files changed, 144 insertions(+), 16 deletions(-)
Signature · 1 line
1.7.4.4
#1 lore raw

PATCH v3 1/7 ARM: dts: Change i2s compatible string on exynos5250

This patch removes quirks from i2s node and change the i2s compatible names.

---
 arch/arm/boot/dts/exynos5250.dtsi |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)
arch/arm/boot/dts/exynos5250.dtsi +3 -6
index 48c0a88..5b36121 100644
@@ -393,7 +393,7 @@
 	};
 
 	i2s0: i2s@03830000 {
-		compatible = "samsung,i2s-v5";
+		compatible = "samsung,s5pv210-i2s";
 		reg = <0x03830000 0x100>;
 		dmas = <&pdma0 10
 			&pdma0 9
@@ -403,16 +403,13 @@
 			<&clock_audss EXYNOS_I2S_BUS>,
 			<&clock_audss EXYNOS_SCLK_I2S>;
 		clock-names = "iis", "i2s_opclk0", "i2s_opclk1";
-		samsung,supports-6ch;
-		samsung,supports-rstclr;
-		samsung,supports-secdai;
 		samsung,idma-addr = <0x03000000>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&i2s0_bus>;
 	};
 
 	i2s1: i2s@12D60000 {
-		compatible = "samsung,i2s-v5";
+		compatible = "samsung,s3c6410-i2s";
 		reg = <0x12D60000 0x100>;
 		dmas = <&pdma1 12
 			&pdma1 11>;
@@ -424,7 +421,7 @@
 	};
 
 	i2s2: i2s@12D70000 {
-		compatible = "samsung,i2s-v5";
+		compatible = "samsung,s3c6410-i2s";
 		reg = <0x12D70000 0x100>;
 		dmas = <&pdma0 12
 			&pdma0 11>;
Signature · 1 line
1.7.4.4
maintainer
#2 lore raw

PATCH v3 1/7 ARM: dts: Change i2s compatible string on exynos5250

Quoted 2 lines · Padmavathi Venna

This patch removes quirks from i2s node and change the i2s compatible names.

This needs to go along with the driver change otherwise we break
bisection.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130807/7ded5473/attachment-0001.sig>

#3 lore raw

PATCH v3 1/7 ARM: dts: Change i2s compatible string on exynos5250

Hi Mark,

Quoted 6 lines · Mark Brown
Quoted 2 lines · Padmavathi Venna

This patch removes quirks from i2s node and change the i2s compatible names.

This needs to go along with the driver change otherwise we break bisection.

some of the patches at dts side are dependent on this patch. So I separated it into another set. Should I re-post this patch along with other driver side patches?

Thanks
Padma

#4 lore raw

PATCH v3 1/7 ARM: dts: Change i2s compatible string on exynos5250

Quoted 7 lines · On Wednesday 07 of August 2013 16:02:16 Padma Venkat wrote:

Hi Mark,

Quoted 4 lines · Mark Brown
Quoted 2 lines · Padmavathi Venna

This patch removes quirks from i2s node and change the i2s compatible names.

Quoted 6 lines
Quoted 2 lines

This needs to go along with the driver change otherwise we break bisection.

some of the patches at dts side are dependent on this patch. So I separated it into another set. Should I re-post this patch along with other driver side patches?

I fully agree with Mark. There are 2 ways of solving this:

a) Do things in steps that don't break anything, i.e.:
1) add new bindings to the driver,
2) update DTS files,
3) remove old bindings from the driver.

b) Do all the things above atomically, in one patch.

Personally, I'm a fan of method a), but if it requires much effort then method b) can be used as a fallback.

Best regards,
Tomasz

#5 lore raw

PATCH v3 2/7 ARM: dts: exynos5420: add i2s controllers

In reply to Padmavathi Venna

From: Andrew Bresticker <[email protected]>

This adds device-tree bindings for the i2s controllers on Exynos 5420.

Reviewed-on: https://gerrit.chromium.org/gerrit/57713

---
 arch/arm/boot/dts/exynos5420.dtsi |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)
arch/arm/boot/dts/exynos5420.dtsi +32 -0
index c2a2bd6..286354e 100644
@@ -242,4 +242,36 @@
 		pinctrl-names = "default";
 		pinctrl-0 = <&i2c3_bus>;
 	};
+
+	i2s_0: i2s@03830000 {
+		compatible = "samsung,exynos5420-i2s";
+		dmas = <&adma 0
+			&adma 2
+			&adma 1>;
+		dma-names = "tx", "rx", "tx-sec";
+		clocks = <&clock_audss EXYNOS_I2S_BUS>,
+			<&clock_audss EXYNOS_I2S_BUS>,
+			<&clock_audss EXYNOS_SCLK_I2S>;
+		clock-names = "iis", "i2s_opclk0", "i2s_opclk1";
+		pinctrl-names = "default";
+		pinctrl-0 = <&i2s0_bus>;
+		status = "disabled";
+	};
+
+	i2s_1: i2s@12D60000 {
+		clocks = <&clock 275>, <&clock 138>;
+		clock-names = "iis", "i2s_opclk0";
+		pinctrl-names = "default";
+		pinctrl-0 = <&i2s1_bus>;
+		status = "disabled";
+	};
+
+	i2s_2: i2s@12D70000 {
+		clocks = <&clock 276>, <&clock 139>;
+		clock-names = "iis", "i2s_opclk0";
+		pinctrl-names = "default";
+		pinctrl-0 = <&i2s2_bus>;
+		status = "disabled";
+	};
+
 };
Signature · 1 line
1.7.4.4
#6 lore raw

PATCH v3 3/7 ARM: dts: Add i2c bus 1 and it's audio codec child node on smdk5420

In reply to Padmavathi Venna

This patch adds i2c bus 1 and wm8994 codec node on i2c bus1 and the required regulator supplies and properties on smdk5420 board.

---
 arch/arm/boot/dts/exynos5420-smdk5420.dts |   58 +++++++++++++++++++++++++++++
 1 files changed, 58 insertions(+), 0 deletions(-)
arch/arm/boot/dts/exynos5420-smdk5420.dts +58 -0
index d05de7a..e86c1ae 100644
@@ -68,4 +68,62 @@
 			bus-width = <4>;
 		};
 	};
+
+	avdd2: fixed-regulator@0 {
+		compatible = "regulator-fixed";
+		regulator-name = "avdd2-supply";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-always-on;
+	};
+
+	cpvdd: fixed-regulator@1 {
+		compatible = "regulator-fixed";
+		regulator-name = "cpvdd-supply";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-always-on;
+	};
+
+	dbvdd: fixed-regulator@2 {
+		compatible = "regulator-fixed";
+		regulator-name = "dbvdd-supply";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-always-on;
+	};
+
+	spkvdd: fixed-regulator@3 {
+		compatible = "regulator-fixed";
+		regulator-name = "spkvdd-supply";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};
+
+	i2c@12C70000 {
+		status = "okay";
+		samsung,i2c-sda-delay = <100>;
+		samsung,i2c-max-bus-freq = <20000>;
+
+		eeprom@51 {
+			compatible = "samsung,s524ad0xd1";
+			reg = <0x51>;
+		};
+
+		wm8994: wm8994@1a {
+			compatible = "wlf,wm8994";
+			reg = <0x1a>;
+
+			gpio-controller;
+			#gpio-cells = <2>;
+
+			AVDD2-supply = <&avdd2>;
+			CPVDD-supply = <&cpvdd>;
+			DBVDD-supply = <&dbvdd>;
+			SPKVDD1-supply = <&spkvdd>;
+			SPKVDD2-supply = <&spkvdd>;
+		};
+	};
+
 };
Signature · 1 line
1.7.4.4
#7 lore raw

PATCH v3 3/7 ARM: dts: Add i2c bus 1 and it's audio codec child node on smdk5420

Quoted 15 lines · On Wednesday 07 of August 2013 14:40:12 Padmavathi Venna wrote:

This patch adds i2c bus 1 and wm8994 codec node on i2c bus1 and the required regulator supplies and properties on smdk5420 board.

---
 arch/arm/boot/dts/exynos5420-smdk5420.dts |   58

+++++++++++++++++++++++++++++ 1 files changed, 58 insertions(+), 0 deletions(-)

(quoted diff) +0 -0

b/arch/arm/boot/dts/exynos5420-smdk5420.dts index d05de7a..e86c1ae 100644

arch/arm/boot/dts/exynos5420-smdk5420.dts line 72

Quoted 5 lines
arch/arm/boot/dts/exynos5420-smdk5420.dts +2 -0
@@ -68,4 +68,62 @@
 			bus-width = <4>;
 		};
 	};
+
+	avdd2: fixed-regulator at 0 {

@ suffix should be present only if reg property is present as well. Otherwise a suffix separated with "-" should be used, like fixed- regulator-0.

Quoted 20 lines
arch/arm/boot/dts/exynos5420-smdk5420.dts +20 -0
+		compatible = "regulator-fixed";
+		regulator-name = "avdd2-supply";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-always-on;
+	};
+
+	cpvdd: fixed-regulator at 1 {
+		compatible = "regulator-fixed";
+		regulator-name = "cpvdd-supply";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-always-on;
+	};
+
+	dbvdd: fixed-regulator at 2 {
+		compatible = "regulator-fixed";
+		regulator-name = "dbvdd-supply";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;

arch/arm/boot/dts/exynos5420-smdk5420.dts line 102

Quoted 10 lines
arch/arm/boot/dts/exynos5420-smdk5420.dts +10 -0
+		regulator-always-on;
+	};
+
+	spkvdd: fixed-regulator at 3 {
+		compatible = "regulator-fixed";
+		regulator-name = "spkvdd-supply";
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+		regulator-always-on;
+	};

All these regulators should be made subnodes of a fixed-regulators node aggregating all fixed regulators on the board, like on following example:

	fixed-regulators {
		avdd2: fixed-regulator-0 {
			compatible = "regulator-fixed";
			regulator-name = "avdd2-supply";
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-always-on;
		};

		cpvdd: fixed-regulator-1 {
			compatible = "regulator-fixed";
			regulator-name = "cpvdd-supply";
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			regulator-always-on;
		};

		/* ... */
	};

Best regards,
Tomasz

#8 lore raw

PATCH v3 4/7 ARM: dts: exynos5250: move common i2s properties to exynos5 dtsi

In reply to Padmavathi Venna

I2S nodes shares some properties across exynos5 SoCs (exynos5250 and exyno5420). Common code is moved to exynos5.dtsi which is included in exyno5250 and exynos5420 SoC files.

---
 arch/arm/boot/dts/exynos5.dtsi    |   21 +++++++++++++++++++++
 arch/arm/boot/dts/exynos5250.dtsi |   12 ------------
 2 files changed, 21 insertions(+), 12 deletions(-)
arch/arm/boot/dts/exynos5.dtsi +21 -0
index ec384c9..c37b57d 100644
@@ -191,4 +191,25 @@
 		#size-cells = <0>;
 		status = "disabled";
 	};
+
+	i2s0: i2s@03830000 {
+		reg = <0x03830000 0x100>;
+		samsung,idma-addr = <0x03000000>;
+	};
+
+	i2s1: i2s@12D60000 {
+		compatible = "samsung,s3c6410-i2s";
+		reg = <0x12D60000 0x100>;
+		dmas = <&pdma1 12
+			&pdma1 11>;
+		dma-names = "tx", "rx";
+	};
+
+	i2s2: i2s@12D70000 {
+		compatible = "samsung,s3c6410-i2s";
+		reg = <0x12D70000 0x100>;
+		dmas = <&pdma0 12
+			&pdma0 11>;
+		dma-names = "tx", "rx";
+	};
 };
arch/arm/boot/dts/exynos5250.dtsi +0 -12
index 5b36121..3873ff7 100644
@@ -394,7 +394,6 @@
 
 	i2s0: i2s@03830000 {
 		compatible = "samsung,s5pv210-i2s";
-		reg = <0x03830000 0x100>;
 		dmas = <&pdma0 10
 			&pdma0 9
 			&pdma0 8>;
@@ -403,17 +402,11 @@
 			<&clock_audss EXYNOS_I2S_BUS>,
 			<&clock_audss EXYNOS_SCLK_I2S>;
 		clock-names = "iis", "i2s_opclk0", "i2s_opclk1";
-		samsung,idma-addr = <0x03000000>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&i2s0_bus>;
 	};
 
 	i2s1: i2s@12D60000 {
-		compatible = "samsung,s3c6410-i2s";
-		reg = <0x12D60000 0x100>;
-		dmas = <&pdma1 12
-			&pdma1 11>;
-		dma-names = "tx", "rx";
 		clocks = <&clock 307>, <&clock 157>;
 		clock-names = "iis", "i2s_opclk0";
 		pinctrl-names = "default";
@@ -421,11 +414,6 @@
 	};
 
 	i2s2: i2s@12D70000 {
-		compatible = "samsung,s3c6410-i2s";
-		reg = <0x12D70000 0x100>;
-		dmas = <&pdma0 12
-			&pdma0 11>;
-		dma-names = "tx", "rx";
 		clocks = <&clock 308>, <&clock 158>;
 		clock-names = "iis", "i2s_opclk0";
 		pinctrl-names = "default";
Signature · 1 line
1.7.4.4
#9 lore raw

PATCH v3 4/7 ARM: dts: exynos5250: move common i2s properties to exynos5 dtsi

Quoted 3 lines · On Wednesday 07 of August 2013 14:40:13 Padmavathi Venna wrote:

I2S nodes shares some properties across exynos5 SoCs (exynos5250 and exyno5420). Common code is moved to exynos5.dtsi which is included in exyno5250 and exynos5420 SoC files.

Shouldn't this patch be ordered before patch 1/7, which already uses the i2s1 and i2s2 nodes inherited from exynos5.dtsi, even though they get moved to it later in this series.

Best regards,
Tomasz

Quoted 78 lines
---
 arch/arm/boot/dts/exynos5.dtsi    |   21 +++++++++++++++++++++
 arch/arm/boot/dts/exynos5250.dtsi |   12 ------------
 2 files changed, 21 insertions(+), 12 deletions(-)
(quoted diff) +0 -0

b/arch/arm/boot/dts/exynos5.dtsi index ec384c9..c37b57d 100644

arch/arm/boot/dts/exynos5.dtsi +21 -0
@@ -191,4 +191,25 @@
 		#size-cells = <0>;
 		status = "disabled";
 	};
+
+	i2s0: i2s at 03830000 {
+		reg = <0x03830000 0x100>;
+		samsung,idma-addr = <0x03000000>;
+	};
+
+	i2s1: i2s at 12D60000 {
+		compatible = "samsung,s3c6410-i2s";
+		reg = <0x12D60000 0x100>;
+		dmas = <&pdma1 12
+			&pdma1 11>;
+		dma-names = "tx", "rx";
+	};
+
+	i2s2: i2s at 12D70000 {
+		compatible = "samsung,s3c6410-i2s";
+		reg = <0x12D70000 0x100>;
+		dmas = <&pdma0 12
+			&pdma0 11>;
+		dma-names = "tx", "rx";
+	};
 };
(quoted diff) +0 -0

b/arch/arm/boot/dts/exynos5250.dtsi index 5b36121..3873ff7 100644

arch/arm/boot/dts/exynos5250.dtsi +0 -12
@@ -394,7 +394,6 @@
 
 	i2s0: i2s at 03830000 {
 		compatible = "samsung,s5pv210-i2s";
-		reg = <0x03830000 0x100>;
 		dmas = <&pdma0 10
 			&pdma0 9
 			&pdma0 8>;
@@ -403,17 +402,11 @@
 			<&clock_audss EXYNOS_I2S_BUS>,
 			<&clock_audss EXYNOS_SCLK_I2S>;
 		clock-names = "iis", "i2s_opclk0", "i2s_opclk1";
-		samsung,idma-addr = <0x03000000>;
 		pinctrl-names = "default";
 		pinctrl-0 = <&i2s0_bus>;
 	};
 
 	i2s1: i2s at 12D60000 {
-		compatible = "samsung,s3c6410-i2s";
-		reg = <0x12D60000 0x100>;
-		dmas = <&pdma1 12
-			&pdma1 11>;
-		dma-names = "tx", "rx";
 		clocks = <&clock 307>, <&clock 157>;
 		clock-names = "iis", "i2s_opclk0";
 		pinctrl-names = "default";
@@ -421,11 +414,6 @@
 	};
 
 	i2s2: i2s at 12D70000 {
-		compatible = "samsung,s3c6410-i2s";
-		reg = <0x12D70000 0x100>;
-		dmas = <&pdma0 12
-			&pdma0 11>;
-		dma-names = "tx", "rx";
 		clocks = <&clock 308>, <&clock 158>;
 		clock-names = "iis", "i2s_opclk0";
 		pinctrl-names = "default";
#10 lore raw

PATCH v3 5/7 ARM: dts: Add osc clock node on smdk5420.

In reply to Padmavathi Venna

This patch adds 16MHz oscillator clock node required for audio on smdk5420 and adds the phandle of the same in wm8994 clock info.

---
 arch/arm/boot/dts/exynos5420-smdk5420.dts |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
arch/arm/boot/dts/exynos5420-smdk5420.dts +10 -0
index e86c1ae..3c56a91 100644
@@ -31,6 +31,13 @@
 		};
 	};
 
+	osc3_clk16mhz: clk16mhz {
+		compatible = "osc3_clk16mhz";
+		#clock-cells = <0>;
+		clock-frequency = <16934400>;
+		clock-output-names = "osc3_clk16mhz";
+	};
+
 	dwmmc0@12200000 {
 		status = "okay";
 		num-slots = <1>;
@@ -123,6 +130,9 @@
 			DBVDD-supply = <&dbvdd>;
 			SPKVDD1-supply = <&spkvdd>;
 			SPKVDD2-supply = <&spkvdd>;
+
+			clocks = <&osc3_clk16mhz>;
+			clock-names = "mclk1";
 		};
 	};
 
Signature · 1 line
1.7.4.4
#11 lore raw

PATCH v3 5/7 ARM: dts: Add osc clock node on smdk5420.

Quoted 14 lines · On Wednesday 07 of August 2013 14:40:14 Padmavathi Venna wrote:

This patch adds 16MHz oscillator clock node required for audio on smdk5420 and adds the phandle of the same in wm8994 clock info.

---
 arch/arm/boot/dts/exynos5420-smdk5420.dts |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/arch/arm/boot/dts/exynos5420-smdk5420.dts index e86c1ae..3c56a91 100644

arch/arm/boot/dts/exynos5420-smdk5420.dts line 35

Quoted 5 lines
arch/arm/boot/dts/exynos5420-smdk5420.dts +2 -0
@@ -31,6 +31,13 @@
 		};
 	};
 
+	osc3_clk16mhz: clk16mhz {
+		compatible = "osc3_clk16mhz";

Hmm?

What about the generic fixed rate clock binding[1]?

Also please name nodes being added with generic names, not platform- specific ones. For example, fixed-rate-clock-0 or oscillator-0, just like it is done with fixed regulators.

Best regards,
Tomasz

[1] - Documentation/devicetree/bindings/clock/fixed-clock.txt

Quoted 17 lines
arch/arm/boot/dts/exynos5420-smdk5420.dts +8 -0
+		#clock-cells = <0>;
+		clock-frequency = <16934400>;
+		clock-output-names = "osc3_clk16mhz";
+	};
+
 	dwmmc0 at 12200000 {
 		status = "okay";
 		num-slots = <1>;
@@ -123,6 +130,9 @@
 			DBVDD-supply = <&dbvdd>;
 			SPKVDD1-supply = <&spkvdd>;
 			SPKVDD2-supply = <&spkvdd>;
+
+			clocks = <&osc3_clk16mhz>;
+			clock-names = "mclk1";
 		};
 	};
#12 lore raw

PATCH v3 6/7 ASoC: Samsung: wm8994: Register the osc clock.

In reply to Padmavathi Venna

This patch registers the 16MHz oscillator clock as fixed clk.

---
 sound/soc/samsung/smdk_wm8994.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
sound/soc/samsung/smdk_wm8994.c +12 -0
index 581ea4a..a6edded 100644
@@ -9,6 +9,7 @@
 
 #include "../codecs/wm8994.h"
 #include <sound/pcm_params.h>
+#include <linux/clk-provider.h>
 #include <linux/module.h>
 #include <linux/of.h>
 
@@ -37,6 +38,15 @@
 /* SMDK has a 16.934MHZ crystal attached to WM8994 */
 #define SMDK_WM8994_FREQ 16934000
 
+/* 16.9MHz fixed oscillator clock */
+static void init_osc_clock(void)
+{
+	struct device_node *np;
+
+	np = of_find_compatible_node(NULL, NULL, "osc3_clk16mhz");
+	of_fixed_clk_setup(np);
+}
+
 static int smdk_hw_params(struct snd_pcm_substream *substream,
 	struct snd_pcm_hw_params *params)
 {
@@ -173,6 +183,8 @@ static int smdk_audio_probe(struct platform_device *pdev)
 		smdk_dai[0].platform_of_node = smdk_dai[0].cpu_of_node;
 	}
 
+	init_osc_clock();
+
 	ret = snd_soc_register_card(card);
 
 	if (ret)
Signature · 1 line
1.7.4.4
maintainer
#13 lore raw

PATCH v3 6/7 ASoC: Samsung: wm8994: Register the osc clock.

Quoted 15 lines · Padmavathi Venna

This patch registers the 16MHz oscillator clock as fixed clk.

sound/soc/samsung/smdk_wm8994.c +9 -0
+/* 16.9MHz fixed oscillator clock */
+static void init_osc_clock(void)
+{
+	struct device_node *np;
+
+	np = of_find_compatible_node(NULL, NULL, "osc3_clk16mhz");
+	of_fixed_clk_setup(np);
+}
+
 static int smdk_hw_params(struct snd_pcm_substream *substream,
 	struct snd_pcm_hw_params *params)
 {

sound/soc/samsung/smdk_wm8994.c static int smdk_audio_probe(struct platform_device *pdev) · line 187

Quoted 5 lines
sound/soc/samsung/smdk_wm8994.c +2 -0
@@ -173,6 +183,8 @@ static int smdk_audio_probe(struct platform_device *pdev)
 		smdk_dai[0].platform_of_node = smdk_dai[0].cpu_of_node;
 	}
 
+	init_osc_clock();
+

This doesn't seem great - it means that this machine driver needs to
know about a specifically named fixed clock which makes it hard to reuse
on other similar boards. For example I'm intending to reuse this on
Arndale. Mike?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130807/7eb0e38f/attachment.sig>

#14 lore raw

PATCH v3 6/7 ASoC: Samsung: wm8994: Register the osc clock.

Hi Mark,

Quoted 19 lines · Mark Brown
Quoted 18 lines · Padmavathi Venna

This patch registers the 16MHz oscillator clock as fixed clk.

sound/soc/samsung/smdk_wm8994.c +9 -0
+/* 16.9MHz fixed oscillator clock */
+static void init_osc_clock(void)
+{
+     struct device_node *np;
+
+     np = of_find_compatible_node(NULL, NULL, "osc3_clk16mhz");
+     of_fixed_clk_setup(np);
+}
+
 static int smdk_hw_params(struct snd_pcm_substream *substream,
      struct snd_pcm_hw_params *params)
 {
@@ -173,6 +183,8 @@ static int smdk_audio_probe(struct platform_device *pdev)
              smdk_dai[0].platform_of_node = smdk_dai[0].cpu_of_node;
      }
 
Quoted 4 lines

sound/soc/samsung/smdk_wm8994.c static int smdk_audio_probe(struct platform_device *pdev) · line 187

Quoted 2 lines
sound/soc/samsung/smdk_wm8994.c +2 -0
+     init_osc_clock();
+

This doesn't seem great - it means that this machine driver needs to

Yes. True. But I am not sure of the correct place to keep this code. Any suggestions?

Thanks
Padma

Quoted 3 lines

know about a specifically named fixed clock which makes it hard to reuse on other similar boards. For example I'm intending to reuse this on Arndale. Mike?

#15 lore raw

PATCH v3 6/7 ASoC: Samsung: wm8994: Register the osc clock.

In reply to Padmavathi Venna
Quoted 36 lines · On Wednesday 07 of August 2013 14:40:15 Padmavathi Venna wrote:

This patch registers the 16MHz oscillator clock as fixed clk.

---
 sound/soc/samsung/smdk_wm8994.c |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)
(quoted diff) +0 -0

b/sound/soc/samsung/smdk_wm8994.c index 581ea4a..a6edded 100644

sound/soc/samsung/smdk_wm8994.c +10 -0
@@ -9,6 +9,7 @@
 
 #include "../codecs/wm8994.h"
 #include <sound/pcm_params.h>
+#include <linux/clk-provider.h>
 #include <linux/module.h>
 #include <linux/of.h>
 
@@ -37,6 +38,15 @@
 /* SMDK has a 16.934MHZ crystal attached to WM8994 */
 #define SMDK_WM8994_FREQ 16934000
 
+/* 16.9MHz fixed oscillator clock */
+static void init_osc_clock(void)
+{
+	struct device_node *np;
+
+	np = of_find_compatible_node(NULL, NULL, "osc3_clk16mhz");
+	of_fixed_clk_setup(np);
+}
+
 static int smdk_hw_params(struct snd_pcm_substream *substream,
 	struct snd_pcm_hw_params *params)
 {

sound/soc/samsung/smdk_wm8994.c static int smdk_audio_probe(struct platform_device · line 190

Quoted 8 lines
sound/soc/samsung/smdk_wm8994.c +2 -0
@@ -173,6 +183,8 @@ static int smdk_audio_probe(struct platform_device
 *pdev) smdk_dai[0].platform_of_node = smdk_dai[0].cpu_of_node;
 	}
 
+	init_osc_clock();
+
 	ret = snd_soc_register_card(card);
 
 	if (ret)

I don't think this patch is needed at all. You can use generic fixed rate clock bindings[1] to define a fixed rate clock using device tree.

Best regards,
Tomasz

[1] - Documentation/devicetree/bindings/clock/fixed-clock.txt

maintainer
#16 lore raw

PATCH v3 6/7 ASoC: Samsung: wm8994: Register the osc clock.

Quoted 2 lines · Tomasz Figa

I don't think this patch is needed at all. You can use generic fixed rate clock bindings[1] to define a fixed rate clock using device tree.

OK, good - that's what I'd have expected but I wasn't sure if that
hadn't been defined for some reason.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20130807/aa6bdd88/attachment.sig>

#17 lore raw

PATCH v3 7/7 ARM: dts: Enable sound support on smdk5420

In reply to Padmavathi Venna

This patch enables i2s0 and sound support on smdk5420.

---
 arch/arm/boot/dts/exynos5420-smdk5420.dts |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
arch/arm/boot/dts/exynos5420-smdk5420.dts +10 -0
index 3c56a91..a9eab45 100644
@@ -136,4 +136,14 @@
 		};
 	};
 
+	i2s0: i2s@03830000 {
+		status = "okay";
+	};
+
+	sound {
+		compatible = "samsung,smdk-wm8994";
+
+		samsung,i2s-controller = <&i2s0>;
+		samsung,audio-codec = <&wm8994>;
+	};
 };
Signature · 1 line
1.7.4.4