All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2 1/5] ARM: tegra: provide clock aliases for AHUB configlink
@ 2012-04-10 23:19 ` Stephen Warren
  0 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-04-10 23:19 UTC (permalink / raw)
  To: Olof Johansson, Colin Cross
  Cc: Mark Brown, Liam Girdwood, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Stephen Warren

From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

The Tegra30 AHUB driver must call tegra_periph_reset_deassert() for all
devices on the AHUB's configlink bus. The AHUB driver must be able to
call clk_get_sys() to retrieve the clock parameter for this function.
Add the necessary clock aliases to allow this.

Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 arch/arm/mach-tegra/tegra30_clocks.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-tegra/tegra30_clocks.c b/arch/arm/mach-tegra/tegra30_clocks.c
index 6d08b53..e33fe4b 100644
--- a/arch/arm/mach-tegra/tegra30_clocks.c
+++ b/arch/arm/mach-tegra/tegra30_clocks.c
@@ -3015,6 +3015,15 @@ struct clk_duplicate tegra_clk_duplicates[] = {
 	CLK_DUPLICATE("sbc6", "spi_slave_tegra.5", NULL),
 	CLK_DUPLICATE("twd", "smp_twd", NULL),
 	CLK_DUPLICATE("vcp", "nvavp", "vcp"),
+	CLK_DUPLICATE("i2s0", NULL, "i2s0"),
+	CLK_DUPLICATE("i2s1", NULL, "i2s1"),
+	CLK_DUPLICATE("i2s2", NULL, "i2s2"),
+	CLK_DUPLICATE("i2s3", NULL, "i2s3"),
+	CLK_DUPLICATE("i2s4", NULL, "i2s4"),
+	CLK_DUPLICATE("dam0", NULL, "dam0"),
+	CLK_DUPLICATE("dam1", NULL, "dam1"),
+	CLK_DUPLICATE("dam2", NULL, "dam2"),
+	CLK_DUPLICATE("spdif_in", NULL, "spdif_in"),
 };
 
 struct clk *tegra_ptr_clks[] = {
-- 
1.7.0.4

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

* [PATCH V2 1/5] ARM: tegra: provide clock aliases for AHUB configlink
@ 2012-04-10 23:19 ` Stephen Warren
  0 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-04-10 23:19 UTC (permalink / raw)
  To: linux-arm-kernel

From: Stephen Warren <swarren@nvidia.com>

The Tegra30 AHUB driver must call tegra_periph_reset_deassert() for all
devices on the AHUB's configlink bus. The AHUB driver must be able to
call clk_get_sys() to retrieve the clock parameter for this function.
Add the necessary clock aliases to allow this.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 arch/arm/mach-tegra/tegra30_clocks.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-tegra/tegra30_clocks.c b/arch/arm/mach-tegra/tegra30_clocks.c
index 6d08b53..e33fe4b 100644
--- a/arch/arm/mach-tegra/tegra30_clocks.c
+++ b/arch/arm/mach-tegra/tegra30_clocks.c
@@ -3015,6 +3015,15 @@ struct clk_duplicate tegra_clk_duplicates[] = {
 	CLK_DUPLICATE("sbc6", "spi_slave_tegra.5", NULL),
 	CLK_DUPLICATE("twd", "smp_twd", NULL),
 	CLK_DUPLICATE("vcp", "nvavp", "vcp"),
+	CLK_DUPLICATE("i2s0", NULL, "i2s0"),
+	CLK_DUPLICATE("i2s1", NULL, "i2s1"),
+	CLK_DUPLICATE("i2s2", NULL, "i2s2"),
+	CLK_DUPLICATE("i2s3", NULL, "i2s3"),
+	CLK_DUPLICATE("i2s4", NULL, "i2s4"),
+	CLK_DUPLICATE("dam0", NULL, "dam0"),
+	CLK_DUPLICATE("dam1", NULL, "dam1"),
+	CLK_DUPLICATE("dam2", NULL, "dam2"),
+	CLK_DUPLICATE("spdif_in", NULL, "spdif_in"),
 };
 
 struct clk *tegra_ptr_clks[] = {
-- 
1.7.0.4

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

* [PATCH V2 2/5] ARM: tegra: set up audio clocks for tegra30 dt
  2012-04-10 23:19 ` Stephen Warren
@ 2012-04-10 23:19     ` Stephen Warren
  -1 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-04-10 23:19 UTC (permalink / raw)
  To: Olof Johansson, Colin Cross
  Cc: Mark Brown, Liam Girdwood, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Stephen Warren

From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

Set up the audio clock tree for Tegra30 in an equivalent fashion to the
existing setup for Tegra20.

Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
 arch/arm/mach-tegra/board-dt-tegra30.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/board-dt-tegra30.c
index 5f7c03e..3de21c0 100644
--- a/arch/arm/mach-tegra/board-dt-tegra30.c
+++ b/arch/arm/mach-tegra/board-dt-tegra30.c
@@ -57,6 +57,15 @@ struct of_dev_auxdata tegra30_auxdata_lookup[] __initdata = {
 static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = {
 	/* name		parent		rate		enabled */
 	{ "uarta",	"pll_p",	408000000,	true },
+	{ "pll_a",	"pll_p_out1",	564480000,	true },
+	{ "pll_a_out0",	"pll_a",	11289600,	true },
+	{ "extern1",	"pll_a_out0",	0,		true },
+	{ "clk_out_1",	"extern1",	0,		true },
+	{ "i2s0",	"pll_a_out0",	11289600,	false},
+	{ "i2s1",	"pll_a_out0",	11289600,	false},
+	{ "i2s2",	"pll_a_out0",	11289600,	false},
+	{ "i2s3",	"pll_a_out0",	11289600,	false},
+	{ "i2s4",	"pll_a_out0",	11289600,	false},
 	{ NULL,		NULL,		0,		0},
 };
 
-- 
1.7.0.4

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

* [PATCH V2 2/5] ARM: tegra: set up audio clocks for tegra30 dt
@ 2012-04-10 23:19     ` Stephen Warren
  0 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-04-10 23:19 UTC (permalink / raw)
  To: linux-arm-kernel

From: Stephen Warren <swarren@nvidia.com>

Set up the audio clock tree for Tegra30 in an equivalent fashion to the
existing setup for Tegra20.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 arch/arm/mach-tegra/board-dt-tegra30.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/board-dt-tegra30.c
index 5f7c03e..3de21c0 100644
--- a/arch/arm/mach-tegra/board-dt-tegra30.c
+++ b/arch/arm/mach-tegra/board-dt-tegra30.c
@@ -57,6 +57,15 @@ struct of_dev_auxdata tegra30_auxdata_lookup[] __initdata = {
 static __initdata struct tegra_clk_init_table tegra_dt_clk_init_table[] = {
 	/* name		parent		rate		enabled */
 	{ "uarta",	"pll_p",	408000000,	true },
+	{ "pll_a",	"pll_p_out1",	564480000,	true },
+	{ "pll_a_out0",	"pll_a",	11289600,	true },
+	{ "extern1",	"pll_a_out0",	0,		true },
+	{ "clk_out_1",	"extern1",	0,		true },
+	{ "i2s0",	"pll_a_out0",	11289600,	false},
+	{ "i2s1",	"pll_a_out0",	11289600,	false},
+	{ "i2s2",	"pll_a_out0",	11289600,	false},
+	{ "i2s3",	"pll_a_out0",	11289600,	false},
+	{ "i2s4",	"pll_a_out0",	11289600,	false},
 	{ NULL,		NULL,		0,		0},
 };
 
-- 
1.7.0.4

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

* [PATCH V2 3/5] ARM: tegra: add AUXDATA required for audio
  2012-04-10 23:19 ` Stephen Warren
@ 2012-04-10 23:19     ` Stephen Warren
  -1 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-04-10 23:19 UTC (permalink / raw)
  To: Olof Johansson, Colin Cross
  Cc: Mark Brown, Liam Girdwood, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Stephen Warren

From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

Both the Tegra30 I2S and AHUB modules used clocks, and hence currently
require AUXDATA in order to get specific device names so that clock
lookups work.

Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
v2: Remove AUXDATA for I2S devices; this is included in the AHUB driver now
that it's the bus that contains the I2S devices.
---
 arch/arm/mach-tegra/board-dt-tegra30.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/board-dt-tegra30.c
index 3de21c0..d96dae0 100644
--- a/arch/arm/mach-tegra/board-dt-tegra30.c
+++ b/arch/arm/mach-tegra/board-dt-tegra30.c
@@ -51,6 +51,7 @@ struct of_dev_auxdata tegra30_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("nvidia,tegra20-i2c", 0x7000C500, "tegra-i2c.2", NULL),
 	OF_DEV_AUXDATA("nvidia,tegra20-i2c", 0x7000C700, "tegra-i2c.3", NULL),
 	OF_DEV_AUXDATA("nvidia,tegra20-i2c", 0x7000D000, "tegra-i2c.4", NULL),
+	OF_DEV_AUXDATA("nvidia,tegra30-ahub", 0x70080000, "tegra30-ahub", NULL),
 	{}
 };
 
-- 
1.7.0.4

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

* [PATCH V2 3/5] ARM: tegra: add AUXDATA required for audio
@ 2012-04-10 23:19     ` Stephen Warren
  0 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-04-10 23:19 UTC (permalink / raw)
  To: linux-arm-kernel

From: Stephen Warren <swarren@nvidia.com>

Both the Tegra30 I2S and AHUB modules used clocks, and hence currently
require AUXDATA in order to get specific device names so that clock
lookups work.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
v2: Remove AUXDATA for I2S devices; this is included in the AHUB driver now
that it's the bus that contains the I2S devices.
---
 arch/arm/mach-tegra/board-dt-tegra30.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/arch/arm/mach-tegra/board-dt-tegra30.c b/arch/arm/mach-tegra/board-dt-tegra30.c
index 3de21c0..d96dae0 100644
--- a/arch/arm/mach-tegra/board-dt-tegra30.c
+++ b/arch/arm/mach-tegra/board-dt-tegra30.c
@@ -51,6 +51,7 @@ struct of_dev_auxdata tegra30_auxdata_lookup[] __initdata = {
 	OF_DEV_AUXDATA("nvidia,tegra20-i2c", 0x7000C500, "tegra-i2c.2", NULL),
 	OF_DEV_AUXDATA("nvidia,tegra20-i2c", 0x7000C700, "tegra-i2c.3", NULL),
 	OF_DEV_AUXDATA("nvidia,tegra20-i2c", 0x7000D000, "tegra-i2c.4", NULL),
+	OF_DEV_AUXDATA("nvidia,tegra30-ahub", 0x70080000, "tegra30-ahub", NULL),
 	{}
 };
 
-- 
1.7.0.4

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

* [PATCH V2 4/5] ARM: dt: tegra30.dtsi: Add audio-related nodes
  2012-04-10 23:19 ` Stephen Warren
@ 2012-04-10 23:19     ` Stephen Warren
  -1 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-04-10 23:19 UTC (permalink / raw)
  To: Olof Johansson, Colin Cross
  Cc: Mark Brown, Liam Girdwood, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Stephen Warren

From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

Add nodes for the Tegra30 AHUB and I2S controllers.

Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
v2:
* Move I2S nodes inside AHUB node, since it's the bus that contains them.
* Correct APBIF reg size
* Add nvidia,ahub-cif-ids to I2S nodes
---
 arch/arm/boot/dts/tegra30.dtsi |   41 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
index 62a7b39..98c29d1 100644
--- a/arch/arm/boot/dts/tegra30.dtsi
+++ b/arch/arm/boot/dts/tegra30.dtsi
@@ -183,4 +183,45 @@
 		reg = < 0x70000868 0xd0     /* Pad control registers */
 			0x70003000 0x3e0 >; /* Mux registers */
 	};
+
+	ahub@70080000 {
+		compatible = "nvidia,tegra30-ahub";
+		reg = <0x70080000 0x200 0x70080200 0x100>;
+		interrupts = < 0 103 0x04 >;
+		nvidia,dma-request-selector = <&apbdma 1>;
+
+		ranges;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		tegra_i2s0: i2s@70080300 {
+			compatible = "nvidia,tegra30-i2s";
+			reg = <0x70080300 0x100>;
+			nvidia,ahub-cif-ids = <4 4>;
+		};
+
+		tegra_i2s1: i2s@70080400 {
+			compatible = "nvidia,tegra30-i2s";
+			reg = <0x70080400 0x100>;
+			nvidia,ahub-cif-ids = <5 5>;
+		};
+
+		tegra_i2s2: i2s@70080500 {
+			compatible = "nvidia,tegra30-i2s";
+			reg = <0x70080500 0x100>;
+			nvidia,ahub-cif-ids = <6 6>;
+		};
+
+		tegra_i2s3: i2s@70080600 {
+			compatible = "nvidia,tegra30-i2s";
+			reg = <0x70080600 0x100>;
+			nvidia,ahub-cif-ids = <7 7>;
+		};
+
+		tegra_i2s4: i2s@70080700 {
+			compatible = "nvidia,tegra30-i2s";
+			reg = <0x70080700 0x100>;
+			nvidia,ahub-cif-ids = <8 8>;
+		};
+	};
 };
-- 
1.7.0.4

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

* [PATCH V2 4/5] ARM: dt: tegra30.dtsi: Add audio-related nodes
@ 2012-04-10 23:19     ` Stephen Warren
  0 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-04-10 23:19 UTC (permalink / raw)
  To: linux-arm-kernel

From: Stephen Warren <swarren@nvidia.com>

Add nodes for the Tegra30 AHUB and I2S controllers.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
v2:
* Move I2S nodes inside AHUB node, since it's the bus that contains them.
* Correct APBIF reg size
* Add nvidia,ahub-cif-ids to I2S nodes
---
 arch/arm/boot/dts/tegra30.dtsi |   41 ++++++++++++++++++++++++++++++++++++++++
 1 files changed, 41 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
index 62a7b39..98c29d1 100644
--- a/arch/arm/boot/dts/tegra30.dtsi
+++ b/arch/arm/boot/dts/tegra30.dtsi
@@ -183,4 +183,45 @@
 		reg = < 0x70000868 0xd0     /* Pad control registers */
 			0x70003000 0x3e0 >; /* Mux registers */
 	};
+
+	ahub at 70080000 {
+		compatible = "nvidia,tegra30-ahub";
+		reg = <0x70080000 0x200 0x70080200 0x100>;
+		interrupts = < 0 103 0x04 >;
+		nvidia,dma-request-selector = <&apbdma 1>;
+
+		ranges;
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		tegra_i2s0: i2s at 70080300 {
+			compatible = "nvidia,tegra30-i2s";
+			reg = <0x70080300 0x100>;
+			nvidia,ahub-cif-ids = <4 4>;
+		};
+
+		tegra_i2s1: i2s at 70080400 {
+			compatible = "nvidia,tegra30-i2s";
+			reg = <0x70080400 0x100>;
+			nvidia,ahub-cif-ids = <5 5>;
+		};
+
+		tegra_i2s2: i2s at 70080500 {
+			compatible = "nvidia,tegra30-i2s";
+			reg = <0x70080500 0x100>;
+			nvidia,ahub-cif-ids = <6 6>;
+		};
+
+		tegra_i2s3: i2s at 70080600 {
+			compatible = "nvidia,tegra30-i2s";
+			reg = <0x70080600 0x100>;
+			nvidia,ahub-cif-ids = <7 7>;
+		};
+
+		tegra_i2s4: i2s at 70080700 {
+			compatible = "nvidia,tegra30-i2s";
+			reg = <0x70080700 0x100>;
+			nvidia,ahub-cif-ids = <8 8>;
+		};
+	};
 };
-- 
1.7.0.4

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

* [PATCH V2 5/5] ARM: dt: tegra cardhu: basic audio support
  2012-04-10 23:19 ` Stephen Warren
@ 2012-04-10 23:19     ` Stephen Warren
  -1 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-04-10 23:19 UTC (permalink / raw)
  To: Olof Johansson, Colin Cross
  Cc: Mark Brown, Liam Girdwood, alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Stephen Warren

From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>

Add WM8903 codec nodes, and top-level sound complex node for basic
analog audio over headset jack and internal speakers.

Signed-off-by: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
v2:
* Adjust sound node compatible value; s/tegra30/tegra/. The requirement
  to specifically version this is removed due to the Tegra ASoC utilities
  code internally determining the chip version.
* Move I2S nodes inside AHUB node, since it's the bus that contains them.
---
 arch/arm/boot/dts/tegra-cardhu.dts |   63 ++++++++++++++++++++++++++++++++++++
 1 files changed, 63 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/tegra-cardhu.dts b/arch/arm/boot/dts/tegra-cardhu.dts
index 0a9f34a..ab8d901 100644
--- a/arch/arm/boot/dts/tegra-cardhu.dts
+++ b/arch/arm/boot/dts/tegra-cardhu.dts
@@ -51,6 +51,15 @@
 				nvidia,pull = <2>;
 				nvidia,tristate = <0>;
 			};
+			dap2_fs_pa2 {
+				nvidia,pins =	"dap2_fs_pa2",
+						"dap2_sclk_pa3",
+						"dap2_din_pa4",
+						"dap2_dout_pa5";
+				nvidia,function = "i2s1";
+				nvidia,pull = <0>;
+				nvidia,tristate = <0>;
+			};
 		};
 	};
 
@@ -92,6 +101,20 @@
 
 	i2c@7000d000 {
 		clock-frequency = <100000>;
+
+		wm8903: wm8903@1a {
+			compatible = "wlf,wm8903";
+			reg = <0x1a>;
+			interrupt-parent = <&gpio>;
+			interrupts = <179 0x04>; /* gpio PW3 */
+
+			gpio-controller;
+			#gpio-cells = <2>;
+
+			micdet-cfg = <0>;
+			micdet-delay = <100>;
+			gpio-cfg = <0xffffffff 0xffffffff 0 0xffffffff 0xffffffff>;
+		};
 	};
 
 	sdhci@78000000 {
@@ -111,4 +134,44 @@
 	sdhci@78000400 {
 		support-8bit;
 	};
+
+	ahub@70080000 {
+		i2s@70080300 {
+			status = "disable";
+		};
+
+		i2s@70080500 {
+			status = "disable";
+		};
+
+		i2s@70080600 {
+			status = "disable";
+		};
+
+		i2s@70080700 {
+			status = "disable";
+		};
+	};
+
+	sound {
+		compatible = "nvidia,tegra-audio-wm8903-cardhu",
+			     "nvidia,tegra-audio-wm8903";
+		nvidia,model = "NVIDIA Tegra Cardhu";
+
+		nvidia,audio-routing =
+			"Headphone Jack", "HPOUTR",
+			"Headphone Jack", "HPOUTL",
+			"Int Spk", "ROP",
+			"Int Spk", "RON",
+			"Int Spk", "LOP",
+			"Int Spk", "LON",
+			"Mic Jack", "MICBIAS",
+			"IN1L", "Mic Jack";
+
+		nvidia,i2s-controller = <&tegra_i2s1>;
+		nvidia,audio-codec = <&wm8903>;
+
+		nvidia,spkr-en-gpios = <&wm8903 2 0>;
+		nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */
+	};
 };
-- 
1.7.0.4

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

* [PATCH V2 5/5] ARM: dt: tegra cardhu: basic audio support
@ 2012-04-10 23:19     ` Stephen Warren
  0 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-04-10 23:19 UTC (permalink / raw)
  To: linux-arm-kernel

From: Stephen Warren <swarren@nvidia.com>

Add WM8903 codec nodes, and top-level sound complex node for basic
analog audio over headset jack and internal speakers.

Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
v2:
* Adjust sound node compatible value; s/tegra30/tegra/. The requirement
  to specifically version this is removed due to the Tegra ASoC utilities
  code internally determining the chip version.
* Move I2S nodes inside AHUB node, since it's the bus that contains them.
---
 arch/arm/boot/dts/tegra-cardhu.dts |   63 ++++++++++++++++++++++++++++++++++++
 1 files changed, 63 insertions(+), 0 deletions(-)

diff --git a/arch/arm/boot/dts/tegra-cardhu.dts b/arch/arm/boot/dts/tegra-cardhu.dts
index 0a9f34a..ab8d901 100644
--- a/arch/arm/boot/dts/tegra-cardhu.dts
+++ b/arch/arm/boot/dts/tegra-cardhu.dts
@@ -51,6 +51,15 @@
 				nvidia,pull = <2>;
 				nvidia,tristate = <0>;
 			};
+			dap2_fs_pa2 {
+				nvidia,pins =	"dap2_fs_pa2",
+						"dap2_sclk_pa3",
+						"dap2_din_pa4",
+						"dap2_dout_pa5";
+				nvidia,function = "i2s1";
+				nvidia,pull = <0>;
+				nvidia,tristate = <0>;
+			};
 		};
 	};
 
@@ -92,6 +101,20 @@
 
 	i2c at 7000d000 {
 		clock-frequency = <100000>;
+
+		wm8903: wm8903 at 1a {
+			compatible = "wlf,wm8903";
+			reg = <0x1a>;
+			interrupt-parent = <&gpio>;
+			interrupts = <179 0x04>; /* gpio PW3 */
+
+			gpio-controller;
+			#gpio-cells = <2>;
+
+			micdet-cfg = <0>;
+			micdet-delay = <100>;
+			gpio-cfg = <0xffffffff 0xffffffff 0 0xffffffff 0xffffffff>;
+		};
 	};
 
 	sdhci at 78000000 {
@@ -111,4 +134,44 @@
 	sdhci at 78000400 {
 		support-8bit;
 	};
+
+	ahub at 70080000 {
+		i2s at 70080300 {
+			status = "disable";
+		};
+
+		i2s at 70080500 {
+			status = "disable";
+		};
+
+		i2s at 70080600 {
+			status = "disable";
+		};
+
+		i2s at 70080700 {
+			status = "disable";
+		};
+	};
+
+	sound {
+		compatible = "nvidia,tegra-audio-wm8903-cardhu",
+			     "nvidia,tegra-audio-wm8903";
+		nvidia,model = "NVIDIA Tegra Cardhu";
+
+		nvidia,audio-routing =
+			"Headphone Jack", "HPOUTR",
+			"Headphone Jack", "HPOUTL",
+			"Int Spk", "ROP",
+			"Int Spk", "RON",
+			"Int Spk", "LOP",
+			"Int Spk", "LON",
+			"Mic Jack", "MICBIAS",
+			"IN1L", "Mic Jack";
+
+		nvidia,i2s-controller = <&tegra_i2s1>;
+		nvidia,audio-codec = <&wm8903>;
+
+		nvidia,spkr-en-gpios = <&wm8903 2 0>;
+		nvidia,hp-det-gpios = <&gpio 178 0>; /* gpio PW2 */
+	};
 };
-- 
1.7.0.4

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

* Re: [PATCH V2 4/5] ARM: dt: tegra30.dtsi: Add audio-related nodes
  2012-04-10 23:19     ` Stephen Warren
@ 2012-04-11  4:27       ` Olof Johansson
  -1 siblings, 0 replies; 16+ messages in thread
From: Olof Johansson @ 2012-04-11  4:27 UTC (permalink / raw)
  To: Stephen Warren
  Cc: alsa-devel, Stephen Warren, Mark Brown, Colin Cross, linux-tegra,
	Liam Girdwood, linux-arm-kernel

Hi,

Nits/questions below.

On Tue, Apr 10, 2012 at 4:19 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> Add nodes for the Tegra30 AHUB and I2S controllers.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> v2:
> * Move I2S nodes inside AHUB node, since it's the bus that contains them.
> * Correct APBIF reg size
> * Add nvidia,ahub-cif-ids to I2S nodes
> ---
>  arch/arm/boot/dts/tegra30.dtsi |   41 ++++++++++++++++++++++++++++++++++++++++
>  1 files changed, 41 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
> index 62a7b39..98c29d1 100644
> --- a/arch/arm/boot/dts/tegra30.dtsi
> +++ b/arch/arm/boot/dts/tegra30.dtsi
> @@ -183,4 +183,45 @@
>                reg = < 0x70000868 0xd0     /* Pad control registers */
>                        0x70003000 0x3e0 >; /* Mux registers */
>        };
> +
> +       ahub@70080000 {

No need for unit address here since there's only one node with this
name -- "ahub {"  is sufficient.

> +               compatible = "nvidia,tegra30-ahub";
> +               reg = <0x70080000 0x200 0x70080200 0x100>;

Why not just use 0x70080000 0x300?

> +               interrupts = < 0 103 0x04 >;
> +               nvidia,dma-request-selector = <&apbdma 1>;
> +
> +               ranges;
> +               #address-cells = <1>;
> +               #size-cells = <1>;
> +
> +               tegra_i2s0: i2s@70080300 {
> +                       compatible = "nvidia,tegra30-i2s";
> +                       reg = <0x70080300 0x100>;
> +                       nvidia,ahub-cif-ids = <4 4>;
> +               };
> +
> +               tegra_i2s1: i2s@70080400 {
> +                       compatible = "nvidia,tegra30-i2s";
> +                       reg = <0x70080400 0x100>;
> +                       nvidia,ahub-cif-ids = <5 5>;
> +               };
> +
> +               tegra_i2s2: i2s@70080500 {
> +                       compatible = "nvidia,tegra30-i2s";
> +                       reg = <0x70080500 0x100>;
> +                       nvidia,ahub-cif-ids = <6 6>;
> +               };
> +
> +               tegra_i2s3: i2s@70080600 {
> +                       compatible = "nvidia,tegra30-i2s";
> +                       reg = <0x70080600 0x100>;
> +                       nvidia,ahub-cif-ids = <7 7>;
> +               };
> +
> +               tegra_i2s4: i2s@70080700 {
> +                       compatible = "nvidia,tegra30-i2s";
> +                       reg = <0x70080700 0x100>;
> +                       nvidia,ahub-cif-ids = <8 8>;
> +               };
> +       };
>  };
> --
> 1.7.0.4
>

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

* [PATCH V2 4/5] ARM: dt: tegra30.dtsi: Add audio-related nodes
@ 2012-04-11  4:27       ` Olof Johansson
  0 siblings, 0 replies; 16+ messages in thread
From: Olof Johansson @ 2012-04-11  4:27 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Nits/questions below.

On Tue, Apr 10, 2012 at 4:19 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> Add nodes for the Tegra30 AHUB and I2S controllers.
>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
> v2:
> * Move I2S nodes inside AHUB node, since it's the bus that contains them.
> * Correct APBIF reg size
> * Add nvidia,ahub-cif-ids to I2S nodes
> ---
> ?arch/arm/boot/dts/tegra30.dtsi | ? 41 ++++++++++++++++++++++++++++++++++++++++
> ?1 files changed, 41 insertions(+), 0 deletions(-)
>
> diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
> index 62a7b39..98c29d1 100644
> --- a/arch/arm/boot/dts/tegra30.dtsi
> +++ b/arch/arm/boot/dts/tegra30.dtsi
> @@ -183,4 +183,45 @@
> ? ? ? ? ? ? ? ?reg = < 0x70000868 0xd0 ? ? /* Pad control registers */
> ? ? ? ? ? ? ? ? ? ? ? ?0x70003000 0x3e0 >; /* Mux registers */
> ? ? ? ?};
> +
> + ? ? ? ahub at 70080000 {

No need for unit address here since there's only one node with this
name -- "ahub {"  is sufficient.

> + ? ? ? ? ? ? ? compatible = "nvidia,tegra30-ahub";
> + ? ? ? ? ? ? ? reg = <0x70080000 0x200 0x70080200 0x100>;

Why not just use 0x70080000 0x300?

> + ? ? ? ? ? ? ? interrupts = < 0 103 0x04 >;
> + ? ? ? ? ? ? ? nvidia,dma-request-selector = <&apbdma 1>;
> +
> + ? ? ? ? ? ? ? ranges;
> + ? ? ? ? ? ? ? #address-cells = <1>;
> + ? ? ? ? ? ? ? #size-cells = <1>;
> +
> + ? ? ? ? ? ? ? tegra_i2s0: i2s at 70080300 {
> + ? ? ? ? ? ? ? ? ? ? ? compatible = "nvidia,tegra30-i2s";
> + ? ? ? ? ? ? ? ? ? ? ? reg = <0x70080300 0x100>;
> + ? ? ? ? ? ? ? ? ? ? ? nvidia,ahub-cif-ids = <4 4>;
> + ? ? ? ? ? ? ? };
> +
> + ? ? ? ? ? ? ? tegra_i2s1: i2s at 70080400 {
> + ? ? ? ? ? ? ? ? ? ? ? compatible = "nvidia,tegra30-i2s";
> + ? ? ? ? ? ? ? ? ? ? ? reg = <0x70080400 0x100>;
> + ? ? ? ? ? ? ? ? ? ? ? nvidia,ahub-cif-ids = <5 5>;
> + ? ? ? ? ? ? ? };
> +
> + ? ? ? ? ? ? ? tegra_i2s2: i2s at 70080500 {
> + ? ? ? ? ? ? ? ? ? ? ? compatible = "nvidia,tegra30-i2s";
> + ? ? ? ? ? ? ? ? ? ? ? reg = <0x70080500 0x100>;
> + ? ? ? ? ? ? ? ? ? ? ? nvidia,ahub-cif-ids = <6 6>;
> + ? ? ? ? ? ? ? };
> +
> + ? ? ? ? ? ? ? tegra_i2s3: i2s at 70080600 {
> + ? ? ? ? ? ? ? ? ? ? ? compatible = "nvidia,tegra30-i2s";
> + ? ? ? ? ? ? ? ? ? ? ? reg = <0x70080600 0x100>;
> + ? ? ? ? ? ? ? ? ? ? ? nvidia,ahub-cif-ids = <7 7>;
> + ? ? ? ? ? ? ? };
> +
> + ? ? ? ? ? ? ? tegra_i2s4: i2s at 70080700 {
> + ? ? ? ? ? ? ? ? ? ? ? compatible = "nvidia,tegra30-i2s";
> + ? ? ? ? ? ? ? ? ? ? ? reg = <0x70080700 0x100>;
> + ? ? ? ? ? ? ? ? ? ? ? nvidia,ahub-cif-ids = <8 8>;
> + ? ? ? ? ? ? ? };
> + ? ? ? };
> ?};
> --
> 1.7.0.4
>

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

* Re: [PATCH V2 4/5] ARM: dt: tegra30.dtsi: Add audio-related nodes
  2012-04-11  4:27       ` Olof Johansson
@ 2012-04-11  5:28           ` Stephen Warren
  -1 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-04-11  5:28 UTC (permalink / raw)
  To: Olof Johansson
  Cc: Colin Cross, Mark Brown, Liam Girdwood,
	alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw,
	linux-tegra-u79uwXL29TY76Z2rM5mHXA,
	linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
	Stephen Warren

On 04/10/2012 10:27 PM, Olof Johansson wrote:
...
> On Tue, Apr 10, 2012 at 4:19 PM, Stephen Warren <swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org> wrote:
>> From: Stephen Warren <swarren-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
>>
>> Add nodes for the Tegra30 AHUB and I2S controllers.
...
>> diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
...
>> +       ahub@70080000 {
> 
> No need for unit address here since there's only one node with this
> name -- "ahub {"  is sufficient.

Is there actually a benefit from leaving it out though?

>> +               compatible = "nvidia,tegra30-ahub";
>> +               reg = <0x70080000 0x200 0x70080200 0x100>;
> 
> Why not just use 0x70080000 0x300?

The register space is logically divided into two chunks; the first for
the DMA FIFOs and the second for the AHUB routing registers. Future
chips may change the relative positions and sizes of these two chunks,
hence I figured it was best to model them independently even though
they're contiguous in Tegra30.

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

* [PATCH V2 4/5] ARM: dt: tegra30.dtsi: Add audio-related nodes
@ 2012-04-11  5:28           ` Stephen Warren
  0 siblings, 0 replies; 16+ messages in thread
From: Stephen Warren @ 2012-04-11  5:28 UTC (permalink / raw)
  To: linux-arm-kernel

On 04/10/2012 10:27 PM, Olof Johansson wrote:
...
> On Tue, Apr 10, 2012 at 4:19 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
>> From: Stephen Warren <swarren@nvidia.com>
>>
>> Add nodes for the Tegra30 AHUB and I2S controllers.
...
>> diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
...
>> +       ahub at 70080000 {
> 
> No need for unit address here since there's only one node with this
> name -- "ahub {"  is sufficient.

Is there actually a benefit from leaving it out though?

>> +               compatible = "nvidia,tegra30-ahub";
>> +               reg = <0x70080000 0x200 0x70080200 0x100>;
> 
> Why not just use 0x70080000 0x300?

The register space is logically divided into two chunks; the first for
the DMA FIFOs and the second for the AHUB routing registers. Future
chips may change the relative positions and sizes of these two chunks,
hence I figured it was best to model them independently even though
they're contiguous in Tegra30.

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

* Re: [PATCH V2 4/5] ARM: dt: tegra30.dtsi: Add audio-related nodes
  2012-04-11  5:28           ` Stephen Warren
@ 2012-04-13 20:59             ` Olof Johansson
  -1 siblings, 0 replies; 16+ messages in thread
From: Olof Johansson @ 2012-04-13 20:59 UTC (permalink / raw)
  To: Stephen Warren
  Cc: alsa-devel, Stephen Warren, Mark Brown, Colin Cross, linux-tegra,
	Liam Girdwood, linux-arm-kernel

On Tue, Apr 10, 2012 at 10:28 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 04/10/2012 10:27 PM, Olof Johansson wrote:
> ...
>> On Tue, Apr 10, 2012 at 4:19 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>> From: Stephen Warren <swarren@nvidia.com>
>>>
>>> Add nodes for the Tegra30 AHUB and I2S controllers.
> ...
>>> diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
> ...
>>> +       ahub@70080000 {
>>
>> No need for unit address here since there's only one node with this
>> name -- "ahub {"  is sufficient.
>
> Is there actually a benefit from leaving it out though?

Just like there's no benefit from including it. :)

So, either way is OK but I think we're a little too eager to always
include them on ARM compared to what powerpc does. No big deal though.
>
>>> +               compatible = "nvidia,tegra30-ahub";
>>> +               reg = <0x70080000 0x200 0x70080200 0x100>;
>>
>> Why not just use 0x70080000 0x300?
>
> The register space is logically divided into two chunks; the first for
> the DMA FIFOs and the second for the AHUB routing registers. Future
> chips may change the relative positions and sizes of these two chunks,
> hence I figured it was best to model them independently even though
> they're contiguous in Tegra30.

Makes perfect sense, thanks for the motivation.


-Olof

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

* [PATCH V2 4/5] ARM: dt: tegra30.dtsi: Add audio-related nodes
@ 2012-04-13 20:59             ` Olof Johansson
  0 siblings, 0 replies; 16+ messages in thread
From: Olof Johansson @ 2012-04-13 20:59 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Apr 10, 2012 at 10:28 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
> On 04/10/2012 10:27 PM, Olof Johansson wrote:
> ...
>> On Tue, Apr 10, 2012 at 4:19 PM, Stephen Warren <swarren@wwwdotorg.org> wrote:
>>> From: Stephen Warren <swarren@nvidia.com>
>>>
>>> Add nodes for the Tegra30 AHUB and I2S controllers.
> ...
>>> diff --git a/arch/arm/boot/dts/tegra30.dtsi b/arch/arm/boot/dts/tegra30.dtsi
> ...
>>> + ? ? ? ahub at 70080000 {
>>
>> No need for unit address here since there's only one node with this
>> name -- "ahub {" ?is sufficient.
>
> Is there actually a benefit from leaving it out though?

Just like there's no benefit from including it. :)

So, either way is OK but I think we're a little too eager to always
include them on ARM compared to what powerpc does. No big deal though.
>
>>> + ? ? ? ? ? ? ? compatible = "nvidia,tegra30-ahub";
>>> + ? ? ? ? ? ? ? reg = <0x70080000 0x200 0x70080200 0x100>;
>>
>> Why not just use 0x70080000 0x300?
>
> The register space is logically divided into two chunks; the first for
> the DMA FIFOs and the second for the AHUB routing registers. Future
> chips may change the relative positions and sizes of these two chunks,
> hence I figured it was best to model them independently even though
> they're contiguous in Tegra30.

Makes perfect sense, thanks for the motivation.


-Olof

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

end of thread, other threads:[~2012-04-13 20:59 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-04-10 23:19 [PATCH V2 1/5] ARM: tegra: provide clock aliases for AHUB configlink Stephen Warren
2012-04-10 23:19 ` Stephen Warren
     [not found] ` <1334099980-19527-1-git-send-email-swarren-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2012-04-10 23:19   ` [PATCH V2 2/5] ARM: tegra: set up audio clocks for tegra30 dt Stephen Warren
2012-04-10 23:19     ` Stephen Warren
2012-04-10 23:19   ` [PATCH V2 3/5] ARM: tegra: add AUXDATA required for audio Stephen Warren
2012-04-10 23:19     ` Stephen Warren
2012-04-10 23:19   ` [PATCH V2 4/5] ARM: dt: tegra30.dtsi: Add audio-related nodes Stephen Warren
2012-04-10 23:19     ` Stephen Warren
2012-04-11  4:27     ` Olof Johansson
2012-04-11  4:27       ` Olof Johansson
     [not found]       ` <CAOesGMhDDenRK_GeR=jWJbcoacRMUPnjFu5w4DCyUWC=CadnbA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-04-11  5:28         ` Stephen Warren
2012-04-11  5:28           ` Stephen Warren
2012-04-13 20:59           ` Olof Johansson
2012-04-13 20:59             ` Olof Johansson
2012-04-10 23:19   ` [PATCH V2 5/5] ARM: dt: tegra cardhu: basic audio support Stephen Warren
2012-04-10 23:19     ` Stephen Warren

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.