[PATCH 0/5] ARM: Tegra: Harmony: Enable audio driver

STALE5638d

28 messages, 4 authors, 2011-02-23 · open the first message on its own page

[PATCH 0/5] ARM: Tegra: Harmony: Enable audio driver

From: Stephen Warren <hidden>
Date: 2011-02-23 18:58:47

This patchset enables the audio driver for Tegra Harmony.

Important notes:
* This series is based on Olof's recently posted boards-for-next branch.
  Some patches won't apply without that being in first.
* The final patch in the series depends on header adds/edits that are not
  in Tegra's for-next branch

See notes in the individual patches for further details.

Stephen Warren (5):
  ARM: Tegra: Add devices.c entries for audio
  ARM: Tegra: Rename I2S clocks to match driver name
  ARM: Tegra: Rename clk_dev1/2 to cdev1/2
  ARM: Tegra: Create defines for GPIO names
  ARM: Tegra: Enable Harmony audio support

 arch/arm/mach-tegra/board-harmony-pinmux.c  |   28 ++++++-----
 arch/arm/mach-tegra/board-harmony.c         |   70 ++++++++++++++++++++++++--
 arch/arm/mach-tegra/board-harmony.h         |   14 +++++
 arch/arm/mach-tegra/board-seaboard-pinmux.c |   10 ++--
 arch/arm/mach-tegra/board-seaboard.c        |    6 +-
 arch/arm/mach-tegra/board-seaboard.h        |    3 +
 arch/arm/mach-tegra/devices.c               |   70 +++++++++++++++++++++++++++
 arch/arm/mach-tegra/devices.h               |    4 ++
 arch/arm/mach-tegra/include/mach/iomap.h    |    3 +
 arch/arm/mach-tegra/tegra2_clocks.c         |   16 +++---
 10 files changed, 190 insertions(+), 34 deletions(-)

[PATCH 1/5] ARM: Tegra: Add devices.c entries for audio

From: Stephen Warren <hidden>
Date: 2011-02-23 18:58:48

For I2S, DAS, PCM devices

Signed-off-by: Stephen Warren <redacted>
---
NOTE: This patch will not apply until Olof's recently posted
boards-for-next branch is merged.

 arch/arm/mach-tegra/devices.c            |   70 ++++++++++++++++++++++++++++++
 arch/arm/mach-tegra/devices.h            |    4 ++
 arch/arm/mach-tegra/include/mach/iomap.h |    3 +
 3 files changed, 77 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-tegra/devices.c b/arch/arm/mach-tegra/devices.c
index 682e6d3..1528f9d 100644
--- a/arch/arm/mach-tegra/devices.c
+++ b/arch/arm/mach-tegra/devices.c
@@ -503,3 +503,73 @@ struct platform_device tegra_uarte_device = {
 		.coherent_dma_mask	= DMA_BIT_MASK(32),
 	},
 };
+
+static struct resource i2s_resource1[] = {
+	[0] = {
+		.start	= INT_I2S1,
+		.end	= INT_I2S1,
+		.flags	= IORESOURCE_IRQ
+	},
+	[1] = {
+		.start	= TEGRA_DMA_REQ_SEL_I2S_1,
+		.end	= TEGRA_DMA_REQ_SEL_I2S_1,
+		.flags	= IORESOURCE_DMA
+	},
+	[2] = {
+		.start	= TEGRA_I2S1_BASE,
+		.end	= TEGRA_I2S1_BASE + TEGRA_I2S1_SIZE - 1,
+		.flags	= IORESOURCE_MEM
+	}
+};
+
+static struct resource i2s_resource2[] = {
+	[0] = {
+		.start	= INT_I2S2,
+		.end	= INT_I2S2,
+		.flags	= IORESOURCE_IRQ
+	},
+	[1] = {
+		.start	= TEGRA_DMA_REQ_SEL_I2S2_1,
+		.end	= TEGRA_DMA_REQ_SEL_I2S2_1,
+		.flags	= IORESOURCE_DMA
+	},
+	[2] = {
+		.start	= TEGRA_I2S2_BASE,
+		.end	= TEGRA_I2S2_BASE + TEGRA_I2S2_SIZE - 1,
+		.flags	= IORESOURCE_MEM
+	}
+};
+
+struct platform_device tegra_i2s_device1 = {
+	.name		= "tegra-i2s",
+	.id		= 0,
+	.resource	= i2s_resource1,
+	.num_resources	= ARRAY_SIZE(i2s_resource1),
+};
+
+struct platform_device tegra_i2s_device2 = {
+	.name		= "tegra-i2s",
+	.id		= 1,
+	.resource	= i2s_resource2,
+	.num_resources	= ARRAY_SIZE(i2s_resource2),
+};
+
+static struct resource tegra_das_resources[] = {
+	[0] = {
+		.start = TEGRA_APB_MISC_DAS_BASE,
+		.end = TEGRA_APB_MISC_DAS_BASE + TEGRA_APB_MISC_DAS_SIZE - 1,
+		.flags = IORESOURCE_MEM,
+	},
+};
+
+struct platform_device tegra_das_device = {
+	.name		= "tegra-das",
+	.id		= -1,
+	.num_resources	= ARRAY_SIZE(tegra_das_resources),
+	.resource	= tegra_das_resources,
+};
+
+struct platform_device tegra_pcm_device = {
+	.name = "tegra-pcm-audio",
+	.id = -1,
+};
diff --git a/arch/arm/mach-tegra/devices.h b/arch/arm/mach-tegra/devices.h
index 888810c..4a7dc0a 100644
--- a/arch/arm/mach-tegra/devices.h
+++ b/arch/arm/mach-tegra/devices.h
@@ -42,5 +42,9 @@ extern struct platform_device tegra_uartc_device;
 extern struct platform_device tegra_uartd_device;
 extern struct platform_device tegra_uarte_device;
 extern struct platform_device tegra_pmu_device;
+extern struct platform_device tegra_i2s_device1;
+extern struct platform_device tegra_i2s_device2;
+extern struct platform_device tegra_das_device;
+extern struct platform_device tegra_pcm_device;
 
 #endif
diff --git a/arch/arm/mach-tegra/include/mach/iomap.h b/arch/arm/mach-tegra/include/mach/iomap.h
index 691cdab..19dec3a 100644
--- a/arch/arm/mach-tegra/include/mach/iomap.h
+++ b/arch/arm/mach-tegra/include/mach/iomap.h
@@ -122,6 +122,9 @@
 #define TEGRA_APB_MISC_BASE		0x70000000
 #define TEGRA_APB_MISC_SIZE		SZ_4K
 
+#define TEGRA_APB_MISC_DAS_BASE		0x70000c00
+#define TEGRA_APB_MISC_DAS_SIZE		SZ_128
+
 #define TEGRA_AC97_BASE			0x70002000
 #define TEGRA_AC97_SIZE			SZ_512
 
-- 
1.7.1

[PATCH 1/5] ARM: Tegra: Add devices.c entries for audio

From: Colin Cross <hidden>
Date: 2011-02-23 21:04:16

On Wed, Feb 23, 2011 at 10:58 AM, Stephen Warren [off-list ref] wrote:
quoted hunk
For I2S, DAS, PCM devices

Signed-off-by: Stephen Warren <redacted>
---
NOTE: This patch will not apply until Olof's recently posted
boards-for-next branch is merged.

?arch/arm/mach-tegra/devices.c ? ? ? ? ? ?| ? 70 ++++++++++++++++++++++++++++++
?arch/arm/mach-tegra/devices.h ? ? ? ? ? ?| ? ?4 ++
?arch/arm/mach-tegra/include/mach/iomap.h | ? ?3 +
?3 files changed, 77 insertions(+), 0 deletions(-)
diff --git a/arch/arm/mach-tegra/devices.c b/arch/arm/mach-tegra/devices.c
index 682e6d3..1528f9d 100644
--- a/arch/arm/mach-tegra/devices.c
+++ b/arch/arm/mach-tegra/devices.c
@@ -503,3 +503,73 @@ struct platform_device tegra_uarte_device = {
? ? ? ? ? ? ? ?.coherent_dma_mask ? ? ?= DMA_BIT_MASK(32),
? ? ? ?},
?};
+
+static struct resource i2s_resource1[] = {
+ ? ? ? [0] = {
+ ? ? ? ? ? ? ? .start ?= INT_I2S1,
+ ? ? ? ? ? ? ? .end ? ?= INT_I2S1,
+ ? ? ? ? ? ? ? .flags ?= IORESOURCE_IRQ
+ ? ? ? },
+ ? ? ? [1] = {
+ ? ? ? ? ? ? ? .start ?= TEGRA_DMA_REQ_SEL_I2S_1,
+ ? ? ? ? ? ? ? .end ? ?= TEGRA_DMA_REQ_SEL_I2S_1,
+ ? ? ? ? ? ? ? .flags ?= IORESOURCE_DMA
+ ? ? ? },
+ ? ? ? [2] = {
+ ? ? ? ? ? ? ? .start ?= TEGRA_I2S1_BASE,
+ ? ? ? ? ? ? ? .end ? ?= TEGRA_I2S1_BASE + TEGRA_I2S1_SIZE - 1,
+ ? ? ? ? ? ? ? .flags ?= IORESOURCE_MEM
+ ? ? ? }
+};
+
+static struct resource i2s_resource2[] = {
+ ? ? ? [0] = {
+ ? ? ? ? ? ? ? .start ?= INT_I2S2,
+ ? ? ? ? ? ? ? .end ? ?= INT_I2S2,
+ ? ? ? ? ? ? ? .flags ?= IORESOURCE_IRQ
+ ? ? ? },
+ ? ? ? [1] = {
+ ? ? ? ? ? ? ? .start ?= TEGRA_DMA_REQ_SEL_I2S2_1,
+ ? ? ? ? ? ? ? .end ? ?= TEGRA_DMA_REQ_SEL_I2S2_1,
+ ? ? ? ? ? ? ? .flags ?= IORESOURCE_DMA
+ ? ? ? },
+ ? ? ? [2] = {
+ ? ? ? ? ? ? ? .start ?= TEGRA_I2S2_BASE,
+ ? ? ? ? ? ? ? .end ? ?= TEGRA_I2S2_BASE + TEGRA_I2S2_SIZE - 1,
+ ? ? ? ? ? ? ? .flags ?= IORESOURCE_MEM
+ ? ? ? }
+};
+
+struct platform_device tegra_i2s_device1 = {
+ ? ? ? .name ? ? ? ? ? = "tegra-i2s",
+ ? ? ? .id ? ? ? ? ? ? = 0,
+ ? ? ? .resource ? ? ? = i2s_resource1,
+ ? ? ? .num_resources ?= ARRAY_SIZE(i2s_resource1),
+};
+
+struct platform_device tegra_i2s_device2 = {
+ ? ? ? .name ? ? ? ? ? = "tegra-i2s",
+ ? ? ? .id ? ? ? ? ? ? = 1,
+ ? ? ? .resource ? ? ? = i2s_resource2,
+ ? ? ? .num_resources ?= ARRAY_SIZE(i2s_resource2),
+};
+
+static struct resource tegra_das_resources[] = {
+ ? ? ? [0] = {
+ ? ? ? ? ? ? ? .start = TEGRA_APB_MISC_DAS_BASE,
+ ? ? ? ? ? ? ? .end = TEGRA_APB_MISC_DAS_BASE + TEGRA_APB_MISC_DAS_SIZE - 1,
+ ? ? ? ? ? ? ? .flags = IORESOURCE_MEM,
+ ? ? ? },
+};
+
+struct platform_device tegra_das_device = {
+ ? ? ? .name ? ? ? ? ? = "tegra-das",
+ ? ? ? .id ? ? ? ? ? ? = -1,
+ ? ? ? .num_resources ?= ARRAY_SIZE(tegra_das_resources),
+ ? ? ? .resource ? ? ? = tegra_das_resources,
+};
+
+struct platform_device tegra_pcm_device = {
+ ? ? ? .name = "tegra-pcm-audio",
+ ? ? ? .id = -1,
+};
diff --git a/arch/arm/mach-tegra/devices.h b/arch/arm/mach-tegra/devices.h
index 888810c..4a7dc0a 100644
--- a/arch/arm/mach-tegra/devices.h
+++ b/arch/arm/mach-tegra/devices.h
@@ -42,5 +42,9 @@ extern struct platform_device tegra_uartc_device;
?extern struct platform_device tegra_uartd_device;
?extern struct platform_device tegra_uarte_device;
?extern struct platform_device tegra_pmu_device;
+extern struct platform_device tegra_i2s_device1;
+extern struct platform_device tegra_i2s_device2;
+extern struct platform_device tegra_das_device;
+extern struct platform_device tegra_pcm_device;

?#endif
diff --git a/arch/arm/mach-tegra/include/mach/iomap.h b/arch/arm/mach-tegra/include/mach/iomap.h
index 691cdab..19dec3a 100644
--- a/arch/arm/mach-tegra/include/mach/iomap.h
+++ b/arch/arm/mach-tegra/include/mach/iomap.h
@@ -122,6 +122,9 @@
?#define TEGRA_APB_MISC_BASE ? ? ? ? ? ?0x70000000
?#define TEGRA_APB_MISC_SIZE ? ? ? ? ? ?SZ_4K

+#define TEGRA_APB_MISC_DAS_BASE ? ? ? ? ? ? ? ?0x70000c00
+#define TEGRA_APB_MISC_DAS_SIZE ? ? ? ? ? ? ? ?SZ_128
+
?#define TEGRA_AC97_BASE ? ? ? ? ? ? ? ? ? ? ? ?0x70002000
?#define TEGRA_AC97_SIZE ? ? ? ? ? ? ? ? ? ? ? ?SZ_512
Acked-by: Colin Cross <redacted>

[PATCH 2/5] ARM: Tegra: Rename I2S clocks to match driver name

From: Stephen Warren <hidden>
Date: 2011-02-23 18:58:49

The driver is tegra-i2s not just i2s. Rename the clocks to match, so that
clk_get_sys can look up by driver name.

Signed-off-by: Stephen Warren <redacted>
---
NOTE: This patch should apply right now.

 arch/arm/mach-tegra/tegra2_clocks.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-tegra/tegra2_clocks.c b/arch/arm/mach-tegra/tegra2_clocks.c
index 3015a2c..ee3f9d7 100644
--- a/arch/arm/mach-tegra/tegra2_clocks.c
+++ b/arch/arm/mach-tegra/tegra2_clocks.c
@@ -2128,8 +2128,8 @@ struct clk tegra_list_clks[] = {
 	PERIPH_CLK("apbdma",	"tegra-dma",		NULL,	34,	0,	108000000, mux_pclk,			0),
 	PERIPH_CLK("rtc",	"rtc-tegra",		NULL,	4,	0,	32768,     mux_clk_32k,			PERIPH_NO_RESET),
 	PERIPH_CLK("timer",	"timer",		NULL,	5,	0,	26000000,  mux_clk_m,			0),
-	PERIPH_CLK("i2s1",	"i2s.0",		NULL,	11,	0x100,	26000000,  mux_pllaout0_audio2x_pllp_clkm,	MUX | DIV_U71),
-	PERIPH_CLK("i2s2",	"i2s.1",		NULL,	18,	0x104,	26000000,  mux_pllaout0_audio2x_pllp_clkm,	MUX | DIV_U71),
+	PERIPH_CLK("i2s1",	"tegra-i2s.0",		NULL,	11,	0x100,	26000000,  mux_pllaout0_audio2x_pllp_clkm,	MUX | DIV_U71),
+	PERIPH_CLK("i2s2",	"tegra-i2s.1",		NULL,	18,	0x104,	26000000,  mux_pllaout0_audio2x_pllp_clkm,	MUX | DIV_U71),
 	PERIPH_CLK("spdif_out",	"spdif_out",		NULL,	10,	0x108,	100000000, mux_pllaout0_audio2x_pllp_clkm,	MUX | DIV_U71),
 	PERIPH_CLK("spdif_in",	"spdif_in",		NULL,	10,	0x10c,	100000000, mux_pllp_pllc_pllm,		MUX | DIV_U71),
 	PERIPH_CLK("pwm",	"pwm",			NULL,	17,	0x110,	432000000, mux_pllp_pllc_audio_clkm_clk32,	MUX | DIV_U71),
-- 
1.7.1

[PATCH 2/5] ARM: Tegra: Rename I2S clocks to match driver name

From: Colin Cross <hidden>
Date: 2011-02-23 21:06:27

On Wed, Feb 23, 2011 at 10:58 AM, Stephen Warren [off-list ref] wrote:
quoted hunk
The driver is tegra-i2s not just i2s. Rename the clocks to match, so that
clk_get_sys can look up by driver name.

Signed-off-by: Stephen Warren <redacted>
---
NOTE: This patch should apply right now.

?arch/arm/mach-tegra/tegra2_clocks.c | ? ?4 ++--
?1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-tegra/tegra2_clocks.c b/arch/arm/mach-tegra/tegra2_clocks.c
index 3015a2c..ee3f9d7 100644
--- a/arch/arm/mach-tegra/tegra2_clocks.c
+++ b/arch/arm/mach-tegra/tegra2_clocks.c
@@ -2128,8 +2128,8 @@ struct clk tegra_list_clks[] = {
? ? ? ?PERIPH_CLK("apbdma", ? ?"tegra-dma", ? ? ? ? ? ?NULL, ? 34, ? ? 0, ? ? ?108000000, mux_pclk, ? ? ? ? ? ? ? ? ? ?0),
? ? ? ?PERIPH_CLK("rtc", ? ? ? "rtc-tegra", ? ? ? ? ? ?NULL, ? 4, ? ? ?0, ? ? ?32768, ? ? mux_clk_32k, ? ? ? ? ? ? ? ? PERIPH_NO_RESET),
? ? ? ?PERIPH_CLK("timer", ? ? "timer", ? ? ? ? ? ? ? ?NULL, ? 5, ? ? ?0, ? ? ?26000000, ?mux_clk_m, ? ? ? ? ? ? ? ? ? 0),
- ? ? ? PERIPH_CLK("i2s1", ? ? ?"i2s.0", ? ? ? ? ? ? ? ?NULL, ? 11, ? ? 0x100, ?26000000, ?mux_pllaout0_audio2x_pllp_clkm, ? ? ?MUX | DIV_U71),
- ? ? ? PERIPH_CLK("i2s2", ? ? ?"i2s.1", ? ? ? ? ? ? ? ?NULL, ? 18, ? ? 0x104, ?26000000, ?mux_pllaout0_audio2x_pllp_clkm, ? ? ?MUX | DIV_U71),
+ ? ? ? PERIPH_CLK("i2s1", ? ? ?"tegra-i2s.0", ? ? ? ? ?NULL, ? 11, ? ? 0x100, ?26000000, ?mux_pllaout0_audio2x_pllp_clkm, ? ? ?MUX | DIV_U71),
+ ? ? ? PERIPH_CLK("i2s2", ? ? ?"tegra-i2s.1", ? ? ? ? ?NULL, ? 18, ? ? 0x104, ?26000000, ?mux_pllaout0_audio2x_pllp_clkm, ? ? ?MUX | DIV_U71),
? ? ? ?PERIPH_CLK("spdif_out", "spdif_out", ? ? ? ? ? ?NULL, ? 10, ? ? 0x108, ?100000000, mux_pllaout0_audio2x_pllp_clkm, ? ? ?MUX | DIV_U71),
? ? ? ?PERIPH_CLK("spdif_in", ?"spdif_in", ? ? ? ? ? ? NULL, ? 10, ? ? 0x10c, ?100000000, mux_pllp_pllc_pllm, ? ? ? ? ?MUX | DIV_U71),
? ? ? ?PERIPH_CLK("pwm", ? ? ? "pwm", ? ? ? ? ? ? ? ? ?NULL, ? 17, ? ? 0x110, ?432000000, mux_pllp_pllc_audio_clkm_clk32, ? ? ?MUX | DIV_U71),
--
1.7.1
Ack, I'll put it in for-next

[PATCH 3/5] ARM: Tegra: Rename clk_dev1/2 to cdev1/2

From: Stephen Warren <hidden>
Date: 2011-02-23 18:58:50

The ASoC machine driver was written assuming my previous patch to add
complete support for these clocks, which named them cdev1/2. Rename
the clocks to match that, to avoid churn in the ASoC driver.

This rename also makes the clocks more consistent with other Tegra
clocks irrespective of any of that.

Signed-off-by: Stephen Warren <redacted>
---
NOTE: This patch should apply right now.

 arch/arm/mach-tegra/tegra2_clocks.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-tegra/tegra2_clocks.c b/arch/arm/mach-tegra/tegra2_clocks.c
index ee3f9d7..6d7c4ee 100644
--- a/arch/arm/mach-tegra/tegra2_clocks.c
+++ b/arch/arm/mach-tegra/tegra2_clocks.c
@@ -1823,8 +1823,8 @@ static struct clk tegra_clk_d = {
 };
 
 /* dap_mclk1, belongs to the cdev1 pingroup. */
-static struct clk tegra_dev1_clk = {
-	.name      = "clk_dev1",
+static struct clk tegra_clk_cdev1 = {
+	.name      = "cdev1",
 	.ops       = &tegra_cdev_clk_ops,
 	.rate      = 26000000,
 	.max_rate  = 26000000,
@@ -1834,8 +1834,8 @@ static struct clk tegra_dev1_clk = {
 };
 
 /* dap_mclk2, belongs to the cdev2 pingroup. */
-static struct clk tegra_dev2_clk = {
-	.name      = "clk_dev2",
+static struct clk tegra_clk_cdev2 = {
+	.name      = "cdev2",
 	.ops       = &tegra_cdev_clk_ops,
 	.rate      = 26000000,
 	.max_rate  = 26000000,
@@ -2276,8 +2276,8 @@ struct clk *tegra_ptr_clks[] = {
 	&tegra_clk_hclk,
 	&tegra_clk_pclk,
 	&tegra_clk_d,
-	&tegra_dev1_clk,
-	&tegra_dev2_clk,
+	&tegra_clk_cdev1,
+	&tegra_clk_cdev2,
 	&tegra_clk_virtual_cpu,
 	&tegra_clk_blink,
 	&tegra_clk_cop,
-- 
1.7.1

[PATCH 3/5] ARM: Tegra: Rename clk_dev1/2 to cdev1/2

From: Colin Cross <hidden>
Date: 2011-02-23 21:06:40

On Wed, Feb 23, 2011 at 10:58 AM, Stephen Warren [off-list ref] wrote:
quoted hunk
The ASoC machine driver was written assuming my previous patch to add
complete support for these clocks, which named them cdev1/2. Rename
the clocks to match that, to avoid churn in the ASoC driver.

This rename also makes the clocks more consistent with other Tegra
clocks irrespective of any of that.

Signed-off-by: Stephen Warren <redacted>
---
NOTE: This patch should apply right now.

?arch/arm/mach-tegra/tegra2_clocks.c | ? 12 ++++++------
?1 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-tegra/tegra2_clocks.c b/arch/arm/mach-tegra/tegra2_clocks.c
index ee3f9d7..6d7c4ee 100644
--- a/arch/arm/mach-tegra/tegra2_clocks.c
+++ b/arch/arm/mach-tegra/tegra2_clocks.c
@@ -1823,8 +1823,8 @@ static struct clk tegra_clk_d = {
?};

?/* dap_mclk1, belongs to the cdev1 pingroup. */
-static struct clk tegra_dev1_clk = {
- ? ? ? .name ? ? ?= "clk_dev1",
+static struct clk tegra_clk_cdev1 = {
+ ? ? ? .name ? ? ?= "cdev1",
? ? ? ?.ops ? ? ? = &tegra_cdev_clk_ops,
? ? ? ?.rate ? ? ?= 26000000,
? ? ? ?.max_rate ?= 26000000,
@@ -1834,8 +1834,8 @@ static struct clk tegra_dev1_clk = {
?};

?/* dap_mclk2, belongs to the cdev2 pingroup. */
-static struct clk tegra_dev2_clk = {
- ? ? ? .name ? ? ?= "clk_dev2",
+static struct clk tegra_clk_cdev2 = {
+ ? ? ? .name ? ? ?= "cdev2",
? ? ? ?.ops ? ? ? = &tegra_cdev_clk_ops,
? ? ? ?.rate ? ? ?= 26000000,
? ? ? ?.max_rate ?= 26000000,
@@ -2276,8 +2276,8 @@ struct clk *tegra_ptr_clks[] = {
? ? ? ?&tegra_clk_hclk,
? ? ? ?&tegra_clk_pclk,
? ? ? ?&tegra_clk_d,
- ? ? ? &tegra_dev1_clk,
- ? ? ? &tegra_dev2_clk,
+ ? ? ? &tegra_clk_cdev1,
+ ? ? ? &tegra_clk_cdev2,
? ? ? ?&tegra_clk_virtual_cpu,
? ? ? ?&tegra_clk_blink,
? ? ? ?&tegra_clk_cop,
--
1.7.1
Ack, I'll put it in for-next

[PATCH 4/5] ARM: Tegra: Create defines for GPIO names

From: Stephen Warren <hidden>
Date: 2011-02-23 18:58:51

This ensures they're kept in sync between platform_data definitions and
the GPIO table initialization.

Signed-off-by: Stephen Warren <redacted>
---
NOTE: This patch will not apply until Olof's recently posted
boards-for-next branch is merged.

 arch/arm/mach-tegra/board-harmony-pinmux.c  |   12 ++++++------
 arch/arm/mach-tegra/board-harmony.c         |   12 ++++++------
 arch/arm/mach-tegra/board-harmony.h         |    7 +++++++
 arch/arm/mach-tegra/board-seaboard-pinmux.c |   10 +++++-----
 arch/arm/mach-tegra/board-seaboard.c        |    6 +++---
 arch/arm/mach-tegra/board-seaboard.h        |    3 +++
 6 files changed, 30 insertions(+), 20 deletions(-)
diff --git a/arch/arm/mach-tegra/board-harmony-pinmux.c b/arch/arm/mach-tegra/board-harmony-pinmux.c
index 98368d9..3ada474 100644
--- a/arch/arm/mach-tegra/board-harmony-pinmux.c
+++ b/arch/arm/mach-tegra/board-harmony-pinmux.c
@@ -141,12 +141,12 @@ static struct tegra_pingroup_config harmony_pinmux[] = {
 };
 
 static struct tegra_gpio_table gpio_table[] = {
-	{ .gpio = TEGRA_GPIO_PI5,	.enable = true	}, /* mmc2 cd	*/
-	{ .gpio = TEGRA_GPIO_PH1,	.enable = true	}, /* mmc2 wp	*/
-	{ .gpio = TEGRA_GPIO_PT3,	.enable = true	}, /* mmc2 pwr	*/
-	{ .gpio = TEGRA_GPIO_PH2,	.enable = true	}, /* mmc4 cd	*/
-	{ .gpio = TEGRA_GPIO_PH3,	.enable = true	}, /* mmc4 wp	*/
-	{ .gpio = TEGRA_GPIO_PI6,	.enable = true	}, /* mmc4 pwr	*/
+	{ .gpio = TEGRA_GPIO_SD2_CD,		.enable = true	},
+	{ .gpio = TEGRA_GPIO_SD2_WP,		.enable = true	},
+	{ .gpio = TEGRA_GPIO_SD2_POWER,		.enable = true	},
+	{ .gpio = TEGRA_GPIO_SD4_CD,		.enable = true	},
+	{ .gpio = TEGRA_GPIO_SD4_WP,		.enable = true	},
+	{ .gpio = TEGRA_GPIO_SD4_POWER,		.enable = true	},
 };
 
 void harmony_pinmux_init(void)
diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-tegra/board-harmony.c
index 49224e9..2c4a234 100644
--- a/arch/arm/mach-tegra/board-harmony.c
+++ b/arch/arm/mach-tegra/board-harmony.c
@@ -91,15 +91,15 @@ static struct tegra_sdhci_platform_data sdhci_pdata1 = {
 };
 
 static struct tegra_sdhci_platform_data sdhci_pdata2 = {
-	.cd_gpio	= TEGRA_GPIO_PI5,
-	.wp_gpio	= TEGRA_GPIO_PH1,
-	.power_gpio	= TEGRA_GPIO_PT3,
+	.cd_gpio	= TEGRA_GPIO_SD2_CD,
+	.wp_gpio	= TEGRA_GPIO_SD2_WP,
+	.power_gpio	= TEGRA_GPIO_SD2_POWER,
 };
 
 static struct tegra_sdhci_platform_data sdhci_pdata4 = {
-	.cd_gpio	= TEGRA_GPIO_PH2,
-	.wp_gpio	= TEGRA_GPIO_PH3,
-	.power_gpio	= TEGRA_GPIO_PI6,
+	.cd_gpio	= TEGRA_GPIO_SD4_CD,
+	.wp_gpio	= TEGRA_GPIO_SD4_WP,
+	.power_gpio	= TEGRA_GPIO_SD4_POWER,
 	.is_8bit	= 1,
 };
 
diff --git a/arch/arm/mach-tegra/board-harmony.h b/arch/arm/mach-tegra/board-harmony.h
index 09ca775..4fe33b8 100644
--- a/arch/arm/mach-tegra/board-harmony.h
+++ b/arch/arm/mach-tegra/board-harmony.h
@@ -17,6 +17,13 @@
 #ifndef _MACH_TEGRA_BOARD_HARMONY_H
 #define _MACH_TEGRA_BOARD_HARMONY_H
 
+#define TEGRA_GPIO_SD2_CD		TEGRA_GPIO_PI5
+#define TEGRA_GPIO_SD2_WP		TEGRA_GPIO_PH1
+#define TEGRA_GPIO_SD2_POWER		TEGRA_GPIO_PT3
+#define TEGRA_GPIO_SD4_CD		TEGRA_GPIO_PH2
+#define TEGRA_GPIO_SD4_WP		TEGRA_GPIO_PH3
+#define TEGRA_GPIO_SD4_POWER		TEGRA_GPIO_PI6
+
 void harmony_pinmux_init(void);
 
 #endif
diff --git a/arch/arm/mach-tegra/board-seaboard-pinmux.c b/arch/arm/mach-tegra/board-seaboard-pinmux.c
index 2d6ad83..7b6f38c 100644
--- a/arch/arm/mach-tegra/board-seaboard-pinmux.c
+++ b/arch/arm/mach-tegra/board-seaboard-pinmux.c
@@ -161,11 +161,11 @@ static __initdata struct tegra_pingroup_config seaboard_pinmux[] = {
 
 
 static struct tegra_gpio_table gpio_table[] = {
-	{ .gpio = TEGRA_GPIO_PI5,	.enable = true	}, /* mmc2 cd	 */
-	{ .gpio = TEGRA_GPIO_PH1,	.enable = true	}, /* mmc2 wp	 */
-	{ .gpio = TEGRA_GPIO_PI6,	.enable = true	}, /* mmc2 pwr	 */
-	{ .gpio = TEGRA_GPIO_LIDSWITCH,	.enable = true	}, /* lid switch */
-	{ .gpio = TEGRA_GPIO_POWERKEY,	.enable = true	}, /* power key	 */
+	{ .gpio = TEGRA_GPIO_SD2_CD,		.enable = true	},
+	{ .gpio = TEGRA_GPIO_SD2_WP,		.enable = true	},
+	{ .gpio = TEGRA_GPIO_SD2_POWER,		.enable = true	},
+	{ .gpio = TEGRA_GPIO_LIDSWITCH,		.enable = true	},
+	{ .gpio = TEGRA_GPIO_POWERKEY,		.enable = true	},
 };
 
 void __init seaboard_pinmux_init(void)
diff --git a/arch/arm/mach-tegra/board-seaboard.c b/arch/arm/mach-tegra/board-seaboard.c
index 6ca9e61..eb28dbd 100644
--- a/arch/arm/mach-tegra/board-seaboard.c
+++ b/arch/arm/mach-tegra/board-seaboard.c
@@ -103,9 +103,9 @@ static struct tegra_sdhci_platform_data sdhci_pdata1 = {
 };
 
 static struct tegra_sdhci_platform_data sdhci_pdata3 = {
-	.cd_gpio	= TEGRA_GPIO_PI5,
-	.wp_gpio	= TEGRA_GPIO_PH1,
-	.power_gpio	= TEGRA_GPIO_PI6,
+	.cd_gpio	= TEGRA_GPIO_SD2_CD,
+	.wp_gpio	= TEGRA_GPIO_SD2_WP,
+	.power_gpio	= TEGRA_GPIO_SD2_POWER,
 };
 
 static struct tegra_sdhci_platform_data sdhci_pdata4 = {
diff --git a/arch/arm/mach-tegra/board-seaboard.h b/arch/arm/mach-tegra/board-seaboard.h
index a098e35..d8415e1 100644
--- a/arch/arm/mach-tegra/board-seaboard.h
+++ b/arch/arm/mach-tegra/board-seaboard.h
@@ -17,6 +17,9 @@
 #ifndef _MACH_TEGRA_BOARD_SEABOARD_H
 #define _MACH_TEGRA_BOARD_SEABOARD_H
 
+#define TEGRA_GPIO_SD2_CD		TEGRA_GPIO_PI5
+#define TEGRA_GPIO_SD2_WP		TEGRA_GPIO_PH1
+#define TEGRA_GPIO_SD2_POWER		TEGRA_GPIO_PI6
 #define TEGRA_GPIO_LIDSWITCH		TEGRA_GPIO_PC7
 #define TEGRA_GPIO_USB1			TEGRA_GPIO_PD0
 #define TEGRA_GPIO_POWERKEY		TEGRA_GPIO_PV2
-- 
1.7.1

[PATCH 4/5] ARM: Tegra: Create defines for GPIO names

From: Colin Cross <hidden>
Date: 2011-02-23 19:08:50

On Wed, Feb 23, 2011 at 10:58 AM, Stephen Warren [off-list ref] wrote:
This ensures they're kept in sync between platform_data definitions and
the GPIO table initialization.
Can you name these for what they are used for (if they have a single use)?
i.e. TEGRA_GPIO_EMMC_CD instead of TEGRA_GPIO_SD2_CD

[PATCH 4/5] ARM: Tegra: Create defines for GPIO names

From: Stephen Warren <hidden>
Date: 2011-02-23 20:35:42

Colin Cross wrote at Wednesday, February 23, 2011 12:09 PM:
On Wed, Feb 23, 2011 at 10:58 AM, Stephen Warren [off-list ref] wrote:
quoted
This ensures they're kept in sync between platform_data definitions and
the GPIO table initialization.
Can you name these for what they are used for (if they have a single use)?
i.e. TEGRA_GPIO_EMMC_CD instead of TEGRA_GPIO_SD2_CD
Are you looking for correlation with the schematics, or something else;
my interpretation is that the names in the patch already appear to describe
what the signals are used for.

In particular, in your example, you wrote "EMMC" rather than "SD2". I'm not
sure where the name "EMMC" comes from, nor why there's no number in the name
"EMMC".

For reference, the schematics for these two boards use the following signal
names:

Harmony:
SDIO2_CD, SDIO2_WP, EN_VDDIO_SD
HSMMC_CD, HSMMC_WP, EN_VDDIO_SDMMC

Seaboard:
SDIO32_CD, SDIO3_WP, EN_VDDIO_SD

Would those be OK?

Thanks.

-- 
nvpublic

[PATCH 4/5] ARM: Tegra: Create defines for GPIO names

From: Colin Cross <hidden>
Date: 2011-02-23 20:39:12

On Wed, Feb 23, 2011 at 12:35 PM, Stephen Warren [off-list ref] wrote:
Colin Cross wrote at Wednesday, February 23, 2011 12:09 PM:
quoted
On Wed, Feb 23, 2011 at 10:58 AM, Stephen Warren [off-list ref] wrote:
quoted
This ensures they're kept in sync between platform_data definitions and
the GPIO table initialization.
Can you name these for what they are used for (if they have a single use)?
i.e. TEGRA_GPIO_EMMC_CD instead of TEGRA_GPIO_SD2_CD
Are you looking for correlation with the schematics, or something else;
my interpretation is that the names in the patch already appear to describe
what the signals are used for.

In particular, in your example, you wrote "EMMC" rather than "SD2". I'm not
sure where the name "EMMC" comes from, nor why there's no number in the name
"EMMC".

For reference, the schematics for these two boards use the following signal
names:

Harmony:
SDIO2_CD, SDIO2_WP, EN_VDDIO_SD
HSMMC_CD, HSMMC_WP, EN_VDDIO_SDMMC

Seaboard:
SDIO32_CD, SDIO3_WP, EN_VDDIO_SD

Would those be OK?
I meant use the name of the device they are connected to (if there is
one).  By EMMC I meant the embedded MMC storage device.  The gpio is
not notable because it is used by the SDIO driver for port 2, it is
notable because it is connected to the EMMC chip or the wifi chip or a
card slot.

[PATCH 4/5] ARM: Tegra: Create defines for GPIO names

From: Stephen Warren <hidden>
Date: 2011-02-23 20:49:46

Colin Cross wrote at Wednesday, February 23, 2011 1:39 PM:
On Wed, Feb 23, 2011 at 12:35 PM, Stephen Warren [off-list ref] wrote:
quoted
Colin Cross wrote at Wednesday, February 23, 2011 12:09 PM:
quoted
On Wed, Feb 23, 2011 at 10:58 AM, Stephen Warren [off-list ref] wrote:
quoted
This ensures they're kept in sync between platform_data definitions and
the GPIO table initialization.
Can you name these for what they are used for (if they have a single use)?
i.e. TEGRA_GPIO_EMMC_CD instead of TEGRA_GPIO_SD2_CD
Are you looking for correlation with the schematics, or something else;
...

I meant use the name of the device they are connected to (if there is
one).  By EMMC I meant the embedded MMC storage device.  The gpio is
not notable because it is used by the SDIO driver for port 2, it is
notable because it is connected to the EMMC chip or the wifi chip or a
card slot.
The GPIOs currently in the code are for SD slots/connectors; we don't have
any GPIO definitions for any internal MMC memory, or WiFi chips.

I guess the numbering could be changed; 2 vs. 4 don't very obviously map to
the slots on the board for the user, yet the only thing better I can think
of would be the connector numbers on the silkscreen?

-- 
nvpublic

[PATCH 4/5] ARM: Tegra: Create defines for GPIO names

From: Colin Cross <hidden>
Date: 2011-02-23 20:58:18

On Wed, Feb 23, 2011 at 12:49 PM, Stephen Warren [off-list ref] wrote:
Colin Cross wrote at Wednesday, February 23, 2011 1:39 PM:
quoted
On Wed, Feb 23, 2011 at 12:35 PM, Stephen Warren [off-list ref] wrote:
quoted
Colin Cross wrote at Wednesday, February 23, 2011 12:09 PM:
quoted
On Wed, Feb 23, 2011 at 10:58 AM, Stephen Warren [off-list ref] wrote:
quoted
This ensures they're kept in sync between platform_data definitions and
the GPIO table initialization.
Can you name these for what they are used for (if they have a single use)?
i.e. TEGRA_GPIO_EMMC_CD instead of TEGRA_GPIO_SD2_CD
Are you looking for correlation with the schematics, or something else;
...

I meant use the name of the device they are connected to (if there is
one). ?By EMMC I meant the embedded MMC storage device. ?The gpio is
not notable because it is used by the SDIO driver for port 2, it is
notable because it is connected to the EMMC chip or the wifi chip or a
card slot.
The GPIOs currently in the code are for SD slots/connectors; we don't have
any GPIO definitions for any internal MMC memory, or WiFi chips.

I guess the numbering could be changed; 2 vs. 4 don't very obviously map to
the slots on the board for the user, yet the only thing better I can think
of would be the connector numbers on the silkscreen?
If they are just general-purpose slots, the existing naming is fine.
Acked-by: Colin Cross <redacted>

[PATCH 5/5] ARM: Tegra: Enable Harmony audio support

From: Stephen Warren <hidden>
Date: 2011-02-23 18:58:52

* Set up platform data required by I2C, and ASoC machine & codec drivers.
* Enable required GPIO pins as GPIOs.
* Initialize audio-related clocks.
* Correctly configure pinmux for audio-related GPIOs.

Signed-off-by: Stephen Warren <redacted>
---
NOTE: This patch will not apply until Olof's recently posted
boards-for-next branch is merged.

NOTE: This patch will not apply until the following two commits are
present in Tegra for-next:

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git
7cfe56172ac14d2031f1896ecb629033f71caafa
ASoC: wm8903: Expose GPIOs through gpiolib
Mark said he'd be OK with this being cherry-picked into the Tegra tree.

git://git.fluff.org/bjdooks/linux.git
db811ca0f48578f9940f49f284ac81e336b264ad
i2c: tegra: Add i2c support
Ben hasn't been asked whether a cherry-pick is OK. We could ask, or simply
wait for the merge window to be open, Linus' tree to pick this change up,
Tegra for-next to be rebased on Linus' tree, and then apply the patch below.

Note: I manually tested cherry-picking both those changes into Tegra for-next,
merging Olof's branch, and applying this patch series. The build succeeded,
and Harmony booted to a shell prompt.

 arch/arm/mach-tegra/board-harmony-pinmux.c |   16 +++++---
 arch/arm/mach-tegra/board-harmony.c        |   58 ++++++++++++++++++++++++++++
 arch/arm/mach-tegra/board-harmony.h        |    7 +++
 3 files changed, 75 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-tegra/board-harmony-pinmux.c b/arch/arm/mach-tegra/board-harmony-pinmux.c
index 3ada474..4d63e2e 100644
--- a/arch/arm/mach-tegra/board-harmony-pinmux.c
+++ b/arch/arm/mach-tegra/board-harmony-pinmux.c
@@ -27,11 +27,11 @@ static struct tegra_pingroup_config harmony_pinmux[] = {
 	{TEGRA_PINGROUP_ATC,   TEGRA_MUX_NAND,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
 	{TEGRA_PINGROUP_ATD,   TEGRA_MUX_GMI,           TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
 	{TEGRA_PINGROUP_ATE,   TEGRA_MUX_GMI,           TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
-	{TEGRA_PINGROUP_CDEV1, TEGRA_MUX_OSC,           TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
+	{TEGRA_PINGROUP_CDEV1, TEGRA_MUX_PLLA_OUT,      TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
 	{TEGRA_PINGROUP_CDEV2, TEGRA_MUX_PLLP_OUT4,     TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
 	{TEGRA_PINGROUP_CRTP,  TEGRA_MUX_CRT,           TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
 	{TEGRA_PINGROUP_CSUS,  TEGRA_MUX_VI_SENSOR_CLK, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
-	{TEGRA_PINGROUP_DAP1,  TEGRA_MUX_DAP1,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
+	{TEGRA_PINGROUP_DAP1,  TEGRA_MUX_DAP1,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
 	{TEGRA_PINGROUP_DAP2,  TEGRA_MUX_DAP2,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
 	{TEGRA_PINGROUP_DAP3,  TEGRA_MUX_DAP3,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
 	{TEGRA_PINGROUP_DAP4,  TEGRA_MUX_DAP4,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
@@ -114,13 +114,13 @@ static struct tegra_pingroup_config harmony_pinmux[] = {
 	{TEGRA_PINGROUP_SLXK,  TEGRA_MUX_PCIE,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
 	{TEGRA_PINGROUP_SPDI,  TEGRA_MUX_RSVD2,         TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
 	{TEGRA_PINGROUP_SPDO,  TEGRA_MUX_RSVD2,         TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
-	{TEGRA_PINGROUP_SPIA,  TEGRA_MUX_GMI,           TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
-	{TEGRA_PINGROUP_SPIB,  TEGRA_MUX_GMI,           TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
-	{TEGRA_PINGROUP_SPIC,  TEGRA_MUX_GMI,           TEGRA_PUPD_PULL_UP,   TEGRA_TRI_NORMAL},
+	{TEGRA_PINGROUP_SPIA,  TEGRA_MUX_GMI,           TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
+	{TEGRA_PINGROUP_SPIB,  TEGRA_MUX_GMI,           TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
+	{TEGRA_PINGROUP_SPIC,  TEGRA_MUX_GMI,           TEGRA_PUPD_PULL_UP,   TEGRA_TRI_TRISTATE},
 	{TEGRA_PINGROUP_SPID,  TEGRA_MUX_SPI1,          TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
 	{TEGRA_PINGROUP_SPIE,  TEGRA_MUX_SPI1,          TEGRA_PUPD_PULL_UP,   TEGRA_TRI_TRISTATE},
 	{TEGRA_PINGROUP_SPIF,  TEGRA_MUX_SPI1,          TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
-	{TEGRA_PINGROUP_SPIG,  TEGRA_MUX_SPI2_ALT,      TEGRA_PUPD_PULL_UP,   TEGRA_TRI_TRISTATE},
+	{TEGRA_PINGROUP_SPIG,  TEGRA_MUX_SPI2_ALT,      TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
 	{TEGRA_PINGROUP_SPIH,  TEGRA_MUX_SPI2_ALT,      TEGRA_PUPD_PULL_UP,   TEGRA_TRI_TRISTATE},
 	{TEGRA_PINGROUP_UAA,   TEGRA_MUX_ULPI,          TEGRA_PUPD_PULL_UP,   TEGRA_TRI_TRISTATE},
 	{TEGRA_PINGROUP_UAB,   TEGRA_MUX_ULPI,          TEGRA_PUPD_PULL_UP,   TEGRA_TRI_TRISTATE},
@@ -147,6 +147,10 @@ static struct tegra_gpio_table gpio_table[] = {
 	{ .gpio = TEGRA_GPIO_SD4_CD,		.enable = true	},
 	{ .gpio = TEGRA_GPIO_SD4_WP,		.enable = true	},
 	{ .gpio = TEGRA_GPIO_SD4_POWER,		.enable = true	},
+	{ .gpio = TEGRA_GPIO_CDC_IRQ,		.enable = true	},
+	{ .gpio = TEGRA_GPIO_HP_DET,		.enable = true	},
+	{ .gpio = TEGRA_GPIO_INT_MIC_EN,	.enable = true	},
+	{ .gpio = TEGRA_GPIO_EXT_MIC_EN,	.enable = true	},
 };
 
 void harmony_pinmux_init(void)
diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-tegra/board-harmony.c
index 2c4a234..afa4b5e 100644
--- a/arch/arm/mach-tegra/board-harmony.c
+++ b/arch/arm/mach-tegra/board-harmony.c
@@ -2,6 +2,7 @@
  * arch/arm/mach-tegra/board-harmony.c
  *
  * Copyright (C) 2010 Google, Inc.
+ * Copyright (C) 2011 NVIDIA, Inc.
  *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and
@@ -21,13 +22,19 @@
 #include <linux/clk.h>
 #include <linux/dma-mapping.h>
 #include <linux/pda_power.h>
+#include <linux/i2c.h>
+#include <linux/i2c-tegra.h>
 #include <linux/io.h>
 
+#include <sound/wm8903.h>
+
 #include <asm/mach-types.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/time.h>
 #include <asm/setup.h>
 
+#include <mach/gpio.h>
+#include <mach/harmony_audio.h>
 #include <mach/iomap.h>
 #include <mach/irqs.h>
 #include <mach/sdhci.h>
@@ -60,11 +67,31 @@ static struct platform_device debug_uart = {
 	},
 };
 
+static struct harmony_audio_platform_data harmony_audio_pdata = {
+	.gpio_spkr_en		= TEGRA_GPIO_SPKR_EN,
+	.gpio_hp_det		= TEGRA_GPIO_HP_DET,
+	.gpio_int_mic_en	= TEGRA_GPIO_INT_MIC_EN,
+	.gpio_ext_mic_en	= TEGRA_GPIO_EXT_MIC_EN,
+};
+
+static struct platform_device harmony_audio_device = {
+	.name	= "tegra-snd-harmony",
+	.id	= 0,
+	.dev	= {
+		.platform_data  = &harmony_audio_pdata,
+	},
+};
+
 static struct platform_device *harmony_devices[] __initdata = {
 	&debug_uart,
 	&tegra_sdhci_device1,
 	&tegra_sdhci_device2,
 	&tegra_sdhci_device4,
+	&tegra_i2c_device1,
+	&tegra_i2s_device1,
+	&tegra_das_device,
+	&tegra_pcm_device,
+	&harmony_audio_device,
 };
 
 static void __init tegra_harmony_fixup(struct machine_desc *desc,
@@ -80,6 +107,10 @@ static void __init tegra_harmony_fixup(struct machine_desc *desc,
 static __initdata struct tegra_clk_init_table harmony_clk_init_table[] = {
 	/* name		parent		rate		enabled */
 	{ "uartd",	"pll_p",	216000000,	true },
+	{ "pll_a",	"pll_p_out1",	56448000,	true },
+	{ "pll_a_out0",	"pll_a",	11289600,	true },
+	{ "cdev1",	NULL,		0,		true },
+	{ "i2s1",	"pll_a_out0",	11289600,	false},
 	{ NULL,		NULL,		0,		0},
 };
 
@@ -103,6 +134,30 @@ static struct tegra_sdhci_platform_data sdhci_pdata4 = {
 	.is_8bit	= 1,
 };
 
+static struct tegra_i2c_platform_data i2c_pdata1 = {
+	.bus_clk_rate = 400000,
+};
+
+static struct wm8903_platform_data harmony_wm8903_pdata = {
+	.irq_active_low = 0,
+	.micdet_cfg = 0,
+	.micdet_delay = 100,
+	.gpio_base = GPIO_WM8903(0),
+	.gpio_cfg = {
+		WM8903_GPIO_NO_CONFIG,
+		WM8903_GPIO_NO_CONFIG,
+		0,
+		WM8903_GPIO_NO_CONFIG,
+		WM8903_GPIO_NO_CONFIG,
+	},
+};
+
+static struct i2c_board_info __initdata wm8903_board_info = {
+	I2C_BOARD_INFO("wm8903", 0x1a),
+	.platform_data = &harmony_wm8903_pdata,
+	.irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_CDC_IRQ),
+};
+
 static void __init tegra_harmony_init(void)
 {
 	tegra_clk_init_from_table(harmony_clk_init_table);
@@ -112,8 +167,11 @@ static void __init tegra_harmony_init(void)
 	tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
 	tegra_sdhci_device2.dev.platform_data = &sdhci_pdata2;
 	tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
+	tegra_i2c_device1.dev.platform_data = &i2c_pdata1;
 
 	platform_add_devices(harmony_devices, ARRAY_SIZE(harmony_devices));
+
+	i2c_register_board_info(0, &wm8903_board_info, 1);
 }
 
 MACHINE_START(HARMONY, "harmony")
diff --git a/arch/arm/mach-tegra/board-harmony.h b/arch/arm/mach-tegra/board-harmony.h
index 4fe33b8..fbf2304 100644
--- a/arch/arm/mach-tegra/board-harmony.h
+++ b/arch/arm/mach-tegra/board-harmony.h
@@ -17,12 +17,19 @@
 #ifndef _MACH_TEGRA_BOARD_HARMONY_H
 #define _MACH_TEGRA_BOARD_HARMONY_H
 
+#define GPIO_WM8903(_x_)		(TEGRA_NR_GPIOS + (_x_))
+
 #define TEGRA_GPIO_SD2_CD		TEGRA_GPIO_PI5
 #define TEGRA_GPIO_SD2_WP		TEGRA_GPIO_PH1
 #define TEGRA_GPIO_SD2_POWER		TEGRA_GPIO_PT3
 #define TEGRA_GPIO_SD4_CD		TEGRA_GPIO_PH2
 #define TEGRA_GPIO_SD4_WP		TEGRA_GPIO_PH3
 #define TEGRA_GPIO_SD4_POWER		TEGRA_GPIO_PI6
+#define TEGRA_GPIO_CDC_IRQ		TEGRA_GPIO_PX3
+#define TEGRA_GPIO_SPKR_EN		GPIO_WM8903(2)
+#define TEGRA_GPIO_HP_DET		TEGRA_GPIO_PW2
+#define TEGRA_GPIO_INT_MIC_EN		TEGRA_GPIO_PX0
+#define TEGRA_GPIO_EXT_MIC_EN		TEGRA_GPIO_PX1
 
 void harmony_pinmux_init(void);
 
-- 
1.7.1

[PATCH 5/5] ARM: Tegra: Enable Harmony audio support

From: Colin Cross <hidden>
Date: 2011-02-23 21:08:01

On Wed, Feb 23, 2011 at 10:58 AM, Stephen Warren [off-list ref] wrote:
quoted hunk
* Set up platform data required by I2C, and ASoC machine & codec drivers.
* Enable required GPIO pins as GPIOs.
* Initialize audio-related clocks.
* Correctly configure pinmux for audio-related GPIOs.

Signed-off-by: Stephen Warren <redacted>
---
NOTE: This patch will not apply until Olof's recently posted
boards-for-next branch is merged.

NOTE: This patch will not apply until the following two commits are
present in Tegra for-next:

git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound-2.6.git
7cfe56172ac14d2031f1896ecb629033f71caafa
ASoC: wm8903: Expose GPIOs through gpiolib
Mark said he'd be OK with this being cherry-picked into the Tegra tree.

git://git.fluff.org/bjdooks/linux.git
db811ca0f48578f9940f49f284ac81e336b264ad
i2c: tegra: Add i2c support
Ben hasn't been asked whether a cherry-pick is OK. We could ask, or simply
wait for the merge window to be open, Linus' tree to pick this change up,
Tegra for-next to be rebased on Linus' tree, and then apply the patch below.

Note: I manually tested cherry-picking both those changes into Tegra for-next,
merging Olof's branch, and applying this patch series. The build succeeded,
and Harmony booted to a shell prompt.

?arch/arm/mach-tegra/board-harmony-pinmux.c | ? 16 +++++---
?arch/arm/mach-tegra/board-harmony.c ? ? ? ?| ? 58 ++++++++++++++++++++++++++++
?arch/arm/mach-tegra/board-harmony.h ? ? ? ?| ? ?7 +++
?3 files changed, 75 insertions(+), 6 deletions(-)
diff --git a/arch/arm/mach-tegra/board-harmony-pinmux.c b/arch/arm/mach-tegra/board-harmony-pinmux.c
index 3ada474..4d63e2e 100644
--- a/arch/arm/mach-tegra/board-harmony-pinmux.c
+++ b/arch/arm/mach-tegra/board-harmony-pinmux.c
@@ -27,11 +27,11 @@ static struct tegra_pingroup_config harmony_pinmux[] = {
? ? ? ?{TEGRA_PINGROUP_ATC, ? TEGRA_MUX_NAND, ? ? ? ? ?TEGRA_PUPD_NORMAL, ? ?TEGRA_TRI_NORMAL},
? ? ? ?{TEGRA_PINGROUP_ATD, ? TEGRA_MUX_GMI, ? ? ? ? ? TEGRA_PUPD_NORMAL, ? ?TEGRA_TRI_NORMAL},
? ? ? ?{TEGRA_PINGROUP_ATE, ? TEGRA_MUX_GMI, ? ? ? ? ? TEGRA_PUPD_NORMAL, ? ?TEGRA_TRI_NORMAL},
- ? ? ? {TEGRA_PINGROUP_CDEV1, TEGRA_MUX_OSC, ? ? ? ? ? TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
+ ? ? ? {TEGRA_PINGROUP_CDEV1, TEGRA_MUX_PLLA_OUT, ? ? ?TEGRA_PUPD_NORMAL, ? ?TEGRA_TRI_NORMAL},
? ? ? ?{TEGRA_PINGROUP_CDEV2, TEGRA_MUX_PLLP_OUT4, ? ? TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
? ? ? ?{TEGRA_PINGROUP_CRTP, ?TEGRA_MUX_CRT, ? ? ? ? ? TEGRA_PUPD_NORMAL, ? ?TEGRA_TRI_TRISTATE},
? ? ? ?{TEGRA_PINGROUP_CSUS, ?TEGRA_MUX_VI_SENSOR_CLK, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
- ? ? ? {TEGRA_PINGROUP_DAP1, ?TEGRA_MUX_DAP1, ? ? ? ? ?TEGRA_PUPD_NORMAL, ? ?TEGRA_TRI_TRISTATE},
+ ? ? ? {TEGRA_PINGROUP_DAP1, ?TEGRA_MUX_DAP1, ? ? ? ? ?TEGRA_PUPD_NORMAL, ? ?TEGRA_TRI_NORMAL},
? ? ? ?{TEGRA_PINGROUP_DAP2, ?TEGRA_MUX_DAP2, ? ? ? ? ?TEGRA_PUPD_NORMAL, ? ?TEGRA_TRI_TRISTATE},
? ? ? ?{TEGRA_PINGROUP_DAP3, ?TEGRA_MUX_DAP3, ? ? ? ? ?TEGRA_PUPD_NORMAL, ? ?TEGRA_TRI_TRISTATE},
? ? ? ?{TEGRA_PINGROUP_DAP4, ?TEGRA_MUX_DAP4, ? ? ? ? ?TEGRA_PUPD_NORMAL, ? ?TEGRA_TRI_TRISTATE},
@@ -114,13 +114,13 @@ static struct tegra_pingroup_config harmony_pinmux[] = {
? ? ? ?{TEGRA_PINGROUP_SLXK, ?TEGRA_MUX_PCIE, ? ? ? ? ?TEGRA_PUPD_NORMAL, ? ?TEGRA_TRI_TRISTATE},
? ? ? ?{TEGRA_PINGROUP_SPDI, ?TEGRA_MUX_RSVD2, ? ? ? ? TEGRA_PUPD_NORMAL, ? ?TEGRA_TRI_TRISTATE},
? ? ? ?{TEGRA_PINGROUP_SPDO, ?TEGRA_MUX_RSVD2, ? ? ? ? TEGRA_PUPD_NORMAL, ? ?TEGRA_TRI_TRISTATE},
- ? ? ? {TEGRA_PINGROUP_SPIA, ?TEGRA_MUX_GMI, ? ? ? ? ? TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
- ? ? ? {TEGRA_PINGROUP_SPIB, ?TEGRA_MUX_GMI, ? ? ? ? ? TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
- ? ? ? {TEGRA_PINGROUP_SPIC, ?TEGRA_MUX_GMI, ? ? ? ? ? TEGRA_PUPD_PULL_UP, ? TEGRA_TRI_NORMAL},
+ ? ? ? {TEGRA_PINGROUP_SPIA, ?TEGRA_MUX_GMI, ? ? ? ? ? TEGRA_PUPD_NORMAL, ? ?TEGRA_TRI_NORMAL},
+ ? ? ? {TEGRA_PINGROUP_SPIB, ?TEGRA_MUX_GMI, ? ? ? ? ? TEGRA_PUPD_NORMAL, ? ?TEGRA_TRI_NORMAL},
+ ? ? ? {TEGRA_PINGROUP_SPIC, ?TEGRA_MUX_GMI, ? ? ? ? ? TEGRA_PUPD_PULL_UP, ? TEGRA_TRI_TRISTATE},
? ? ? ?{TEGRA_PINGROUP_SPID, ?TEGRA_MUX_SPI1, ? ? ? ? ?TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
? ? ? ?{TEGRA_PINGROUP_SPIE, ?TEGRA_MUX_SPI1, ? ? ? ? ?TEGRA_PUPD_PULL_UP, ? TEGRA_TRI_TRISTATE},
? ? ? ?{TEGRA_PINGROUP_SPIF, ?TEGRA_MUX_SPI1, ? ? ? ? ?TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
- ? ? ? {TEGRA_PINGROUP_SPIG, ?TEGRA_MUX_SPI2_ALT, ? ? ?TEGRA_PUPD_PULL_UP, ? TEGRA_TRI_TRISTATE},
+ ? ? ? {TEGRA_PINGROUP_SPIG, ?TEGRA_MUX_SPI2_ALT, ? ? ?TEGRA_PUPD_NORMAL, ? ?TEGRA_TRI_TRISTATE},
? ? ? ?{TEGRA_PINGROUP_SPIH, ?TEGRA_MUX_SPI2_ALT, ? ? ?TEGRA_PUPD_PULL_UP, ? TEGRA_TRI_TRISTATE},
? ? ? ?{TEGRA_PINGROUP_UAA, ? TEGRA_MUX_ULPI, ? ? ? ? ?TEGRA_PUPD_PULL_UP, ? TEGRA_TRI_TRISTATE},
? ? ? ?{TEGRA_PINGROUP_UAB, ? TEGRA_MUX_ULPI, ? ? ? ? ?TEGRA_PUPD_PULL_UP, ? TEGRA_TRI_TRISTATE},
@@ -147,6 +147,10 @@ static struct tegra_gpio_table gpio_table[] = {
? ? ? ?{ .gpio = TEGRA_GPIO_SD4_CD, ? ? ? ? ? ?.enable = true ?},
? ? ? ?{ .gpio = TEGRA_GPIO_SD4_WP, ? ? ? ? ? ?.enable = true ?},
? ? ? ?{ .gpio = TEGRA_GPIO_SD4_POWER, ? ? ? ? .enable = true ?},
+ ? ? ? { .gpio = TEGRA_GPIO_CDC_IRQ, ? ? ? ? ? .enable = true ?},
+ ? ? ? { .gpio = TEGRA_GPIO_HP_DET, ? ? ? ? ? ?.enable = true ?},
+ ? ? ? { .gpio = TEGRA_GPIO_INT_MIC_EN, ? ? ? ?.enable = true ?},
+ ? ? ? { .gpio = TEGRA_GPIO_EXT_MIC_EN, ? ? ? ?.enable = true ?},
?};

?void harmony_pinmux_init(void)
diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-tegra/board-harmony.c
index 2c4a234..afa4b5e 100644
--- a/arch/arm/mach-tegra/board-harmony.c
+++ b/arch/arm/mach-tegra/board-harmony.c
@@ -2,6 +2,7 @@
?* arch/arm/mach-tegra/board-harmony.c
?*
?* Copyright (C) 2010 Google, Inc.
+ * Copyright (C) 2011 NVIDIA, Inc.
?*
?* This software is licensed under the terms of the GNU General Public
?* License version 2, as published by the Free Software Foundation, and
@@ -21,13 +22,19 @@
?#include <linux/clk.h>
?#include <linux/dma-mapping.h>
?#include <linux/pda_power.h>
+#include <linux/i2c.h>
+#include <linux/i2c-tegra.h>
?#include <linux/io.h>

+#include <sound/wm8903.h>
+
?#include <asm/mach-types.h>
?#include <asm/mach/arch.h>
?#include <asm/mach/time.h>
?#include <asm/setup.h>

+#include <mach/gpio.h>
+#include <mach/harmony_audio.h>
?#include <mach/iomap.h>
?#include <mach/irqs.h>
?#include <mach/sdhci.h>
@@ -60,11 +67,31 @@ static struct platform_device debug_uart = {
? ? ? ?},
?};

+static struct harmony_audio_platform_data harmony_audio_pdata = {
+ ? ? ? .gpio_spkr_en ? ? ? ? ? = TEGRA_GPIO_SPKR_EN,
+ ? ? ? .gpio_hp_det ? ? ? ? ? ?= TEGRA_GPIO_HP_DET,
+ ? ? ? .gpio_int_mic_en ? ? ? ?= TEGRA_GPIO_INT_MIC_EN,
+ ? ? ? .gpio_ext_mic_en ? ? ? ?= TEGRA_GPIO_EXT_MIC_EN,
+};
+
+static struct platform_device harmony_audio_device = {
+ ? ? ? .name ? = "tegra-snd-harmony",
+ ? ? ? .id ? ? = 0,
+ ? ? ? .dev ? ?= {
+ ? ? ? ? ? ? ? .platform_data ?= &harmony_audio_pdata,
+ ? ? ? },
+};
+
?static struct platform_device *harmony_devices[] __initdata = {
? ? ? ?&debug_uart,
? ? ? ?&tegra_sdhci_device1,
? ? ? ?&tegra_sdhci_device2,
? ? ? ?&tegra_sdhci_device4,
+ ? ? ? &tegra_i2c_device1,
+ ? ? ? &tegra_i2s_device1,
+ ? ? ? &tegra_das_device,
+ ? ? ? &tegra_pcm_device,
+ ? ? ? &harmony_audio_device,
?};

?static void __init tegra_harmony_fixup(struct machine_desc *desc,
@@ -80,6 +107,10 @@ static void __init tegra_harmony_fixup(struct machine_desc *desc,
?static __initdata struct tegra_clk_init_table harmony_clk_init_table[] = {
? ? ? ?/* name ? ? ? ? parent ? ? ? ? ?rate ? ? ? ? ? ?enabled */
? ? ? ?{ "uartd", ? ? ?"pll_p", ? ? ? ?216000000, ? ? ?true },
+ ? ? ? { "pll_a", ? ? ?"pll_p_out1", ? 56448000, ? ? ? true },
+ ? ? ? { "pll_a_out0", "pll_a", ? ? ? ?11289600, ? ? ? true },
+ ? ? ? { "cdev1", ? ? ?NULL, ? ? ? ? ? 0, ? ? ? ? ? ? ?true },
+ ? ? ? { "i2s1", ? ? ? "pll_a_out0", ? 11289600, ? ? ? false},
? ? ? ?{ NULL, ? ? ? ? NULL, ? ? ? ? ? 0, ? ? ? ? ? ? ?0},
?};
@@ -103,6 +134,30 @@ static struct tegra_sdhci_platform_data sdhci_pdata4 = {
? ? ? ?.is_8bit ? ? ? ?= 1,
?};

+static struct tegra_i2c_platform_data i2c_pdata1 = {
+ ? ? ? .bus_clk_rate = 400000,
+};
+
+static struct wm8903_platform_data harmony_wm8903_pdata = {
+ ? ? ? .irq_active_low = 0,
+ ? ? ? .micdet_cfg = 0,
+ ? ? ? .micdet_delay = 100,
+ ? ? ? .gpio_base = GPIO_WM8903(0),
+ ? ? ? .gpio_cfg = {
+ ? ? ? ? ? ? ? WM8903_GPIO_NO_CONFIG,
+ ? ? ? ? ? ? ? WM8903_GPIO_NO_CONFIG,
+ ? ? ? ? ? ? ? 0,
+ ? ? ? ? ? ? ? WM8903_GPIO_NO_CONFIG,
+ ? ? ? ? ? ? ? WM8903_GPIO_NO_CONFIG,
+ ? ? ? },
+};
+
+static struct i2c_board_info __initdata wm8903_board_info = {
+ ? ? ? I2C_BOARD_INFO("wm8903", 0x1a),
+ ? ? ? .platform_data = &harmony_wm8903_pdata,
+ ? ? ? .irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_CDC_IRQ),
+};
+
?static void __init tegra_harmony_init(void)
?{
? ? ? ?tegra_clk_init_from_table(harmony_clk_init_table);
@@ -112,8 +167,11 @@ static void __init tegra_harmony_init(void)
? ? ? ?tegra_sdhci_device1.dev.platform_data = &sdhci_pdata1;
? ? ? ?tegra_sdhci_device2.dev.platform_data = &sdhci_pdata2;
? ? ? ?tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
+ ? ? ? tegra_i2c_device1.dev.platform_data = &i2c_pdata1;

? ? ? ?platform_add_devices(harmony_devices, ARRAY_SIZE(harmony_devices));
+
+ ? ? ? i2c_register_board_info(0, &wm8903_board_info, 1);
?}

?MACHINE_START(HARMONY, "harmony")
diff --git a/arch/arm/mach-tegra/board-harmony.h b/arch/arm/mach-tegra/board-harmony.h
index 4fe33b8..fbf2304 100644
--- a/arch/arm/mach-tegra/board-harmony.h
+++ b/arch/arm/mach-tegra/board-harmony.h
@@ -17,12 +17,19 @@
?#ifndef _MACH_TEGRA_BOARD_HARMONY_H
?#define _MACH_TEGRA_BOARD_HARMONY_H

+#define GPIO_WM8903(_x_) ? ? ? ? ? ? ? (TEGRA_NR_GPIOS + (_x_))
Can you name this HARMONY_GPIO_WM8903?
+
?#define TEGRA_GPIO_SD2_CD ? ? ? ? ? ? ?TEGRA_GPIO_PI5
?#define TEGRA_GPIO_SD2_WP ? ? ? ? ? ? ?TEGRA_GPIO_PH1
?#define TEGRA_GPIO_SD2_POWER ? ? ? ? ? TEGRA_GPIO_PT3
?#define TEGRA_GPIO_SD4_CD ? ? ? ? ? ? ?TEGRA_GPIO_PH2
?#define TEGRA_GPIO_SD4_WP ? ? ? ? ? ? ?TEGRA_GPIO_PH3
?#define TEGRA_GPIO_SD4_POWER ? ? ? ? ? TEGRA_GPIO_PI6
+#define TEGRA_GPIO_CDC_IRQ ? ? ? ? ? ? TEGRA_GPIO_PX3
+#define TEGRA_GPIO_SPKR_EN ? ? ? ? ? ? GPIO_WM8903(2)
+#define TEGRA_GPIO_HP_DET ? ? ? ? ? ? ?TEGRA_GPIO_PW2
+#define TEGRA_GPIO_INT_MIC_EN ? ? ? ? ?TEGRA_GPIO_PX0
+#define TEGRA_GPIO_EXT_MIC_EN ? ? ? ? ?TEGRA_GPIO_PX1

?void harmony_pinmux_init(void);

--
1.7.1

[PATCH 5/5] ARM: Tegra: Enable Harmony audio support

From: Stephen Warren <hidden>
Date: 2011-02-23 21:16:50

Colin Cross wrote at Wednesday, February 23, 2011 2:08 PM:
On Wed, Feb 23, 2011 at 10:58 AM, Stephen Warren [off-list ref] wrote:
quoted
* Set up platform data required by I2C, and ASoC machine & codec drivers.
* Enable required GPIO pins as GPIOs.
* Initialize audio-related clocks.
* Correctly configure pinmux for audio-related GPIOs.

Signed-off-by: Stephen Warren <redacted>
diff --git a/arch/arm/mach-tegra/board-harmony.h b/arch/arm/mach-tegra/board-harmony.h
...
+#define GPIO_WM8903(_x_) ? ? ? ? ? ? ? (TEGRA_NR_GPIOS + (_x_))
Can you name this HARMONY_GPIO_WM8903?
Sure. But then, wouldn't it make sense to also rename all the TEGRA_GPIO_*
below too?
quoted
+
?#define TEGRA_GPIO_SD2_CD ? ? ? ? ? ? ?TEGRA_GPIO_PI5
?#define TEGRA_GPIO_SD2_WP ? ? ? ? ? ? ?TEGRA_GPIO_PH1
?#define TEGRA_GPIO_SD2_POWER ? ? ? ? ? TEGRA_GPIO_PT3
?#define TEGRA_GPIO_SD4_CD ? ? ? ? ? ? ?TEGRA_GPIO_PH2
?#define TEGRA_GPIO_SD4_WP ? ? ? ? ? ? ?TEGRA_GPIO_PH3
?#define TEGRA_GPIO_SD4_POWER ? ? ? ? ? TEGRA_GPIO_PI6
+#define TEGRA_GPIO_CDC_IRQ ? ? ? ? ? ? TEGRA_GPIO_PX3
+#define TEGRA_GPIO_SPKR_EN ? ? ? ? ? ? GPIO_WM8903(2)
+#define TEGRA_GPIO_HP_DET ? ? ? ? ? ? ?TEGRA_GPIO_PW2
+#define TEGRA_GPIO_INT_MIC_EN ? ? ? ? ?TEGRA_GPIO_PX0
+#define TEGRA_GPIO_EXT_MIC_EN ? ? ? ? ?TEGRA_GPIO_PX1
-- 
nvpublic

[PATCH 5/5] ARM: Tegra: Enable Harmony audio support

From: Colin Cross <hidden>
Date: 2011-02-23 21:19:06

On Wed, Feb 23, 2011 at 1:16 PM, Stephen Warren [off-list ref] wrote:
Colin Cross wrote at Wednesday, February 23, 2011 2:08 PM:
quoted
On Wed, Feb 23, 2011 at 10:58 AM, Stephen Warren [off-list ref] wrote:
quoted
* Set up platform data required by I2C, and ASoC machine & codec drivers.
* Enable required GPIO pins as GPIOs.
* Initialize audio-related clocks.
* Correctly configure pinmux for audio-related GPIOs.

Signed-off-by: Stephen Warren <redacted>
diff --git a/arch/arm/mach-tegra/board-harmony.h b/arch/arm/mach-tegra/board-harmony.h
...
+#define GPIO_WM8903(_x_) ? ? ? ? ? ? ? (TEGRA_NR_GPIOS + (_x_))
Can you name this HARMONY_GPIO_WM8903?
Sure. But then, wouldn't it make sense to also rename all the TEGRA_GPIO_*
below too?
True, but no point in adding churn.  Those can be cleaned up later.  I
just want it to be clear that the numbering of gpios above
TEGRA_NR_GPIOS is specific to the board, so the next board author
doesn't get it wrong.
quoted
quoted
+
?#define TEGRA_GPIO_SD2_CD ? ? ? ? ? ? ?TEGRA_GPIO_PI5
?#define TEGRA_GPIO_SD2_WP ? ? ? ? ? ? ?TEGRA_GPIO_PH1
?#define TEGRA_GPIO_SD2_POWER ? ? ? ? ? TEGRA_GPIO_PT3
?#define TEGRA_GPIO_SD4_CD ? ? ? ? ? ? ?TEGRA_GPIO_PH2
?#define TEGRA_GPIO_SD4_WP ? ? ? ? ? ? ?TEGRA_GPIO_PH3
?#define TEGRA_GPIO_SD4_POWER ? ? ? ? ? TEGRA_GPIO_PI6
+#define TEGRA_GPIO_CDC_IRQ ? ? ? ? ? ? TEGRA_GPIO_PX3
+#define TEGRA_GPIO_SPKR_EN ? ? ? ? ? ? GPIO_WM8903(2)
+#define TEGRA_GPIO_HP_DET ? ? ? ? ? ? ?TEGRA_GPIO_PW2
+#define TEGRA_GPIO_INT_MIC_EN ? ? ? ? ?TEGRA_GPIO_PX0
+#define TEGRA_GPIO_EXT_MIC_EN ? ? ? ? ?TEGRA_GPIO_PX1
--
nvpublic

[PATCH 5/5] ARM: Tegra: Enable Harmony audio support

From: Olof Johansson <hidden>
Date: 2011-02-23 21:08:26

Stephen,

Since this depends on i2c, and registers one of the adapters to do it,
we should just get the adapters registered separately (all of them)
before this. I was holding off that part of board code since the i2c
driver went up that maintainer path instead, but if Colin pulls it
into tegra for-next, then I'll go ahead with those peices as well.

I'll pick up the board-side patches from this series (1, 4, 5), and
Colin will take the core patches (2, 3).


On Wed, Feb 23, 2011 at 10:58 AM, Stephen Warren [off-list ref] wrote:
+static struct wm8903_platform_data harmony_wm8903_pdata = {
+ ? ? ? .irq_active_low = 0,
+ ? ? ? .micdet_cfg = 0,
+ ? ? ? .micdet_delay = 100,
+ ? ? ? .gpio_base = GPIO_WM8903(0),
+ ? ? ? .gpio_cfg = {
+ ? ? ? ? ? ? ? WM8903_GPIO_NO_CONFIG,
+ ? ? ? ? ? ? ? WM8903_GPIO_NO_CONFIG,
+ ? ? ? ? ? ? ? 0,
+ ? ? ? ? ? ? ? WM8903_GPIO_NO_CONFIG,
+ ? ? ? ? ? ? ? WM8903_GPIO_NO_CONFIG,
+ ? ? ? },
+};
[...]
quoted hunk
diff --git a/arch/arm/mach-tegra/board-harmony.h b/arch/arm/mach-tegra/board-harmony.h
index 4fe33b8..fbf2304 100644
--- a/arch/arm/mach-tegra/board-harmony.h
+++ b/arch/arm/mach-tegra/board-harmony.h
@@ -17,12 +17,19 @@
?#ifndef _MACH_TEGRA_BOARD_HARMONY_H
?#define _MACH_TEGRA_BOARD_HARMONY_H

+#define GPIO_WM8903(_x_) ? ? ? ? ? ? ? (TEGRA_NR_GPIOS + (_x_))

The above assumes that wm8903 is the GPIO controller that gets
allocated the numbers right after native tegra gpio. That might not be
the case on all boards, since the TPS PMIC has some as well, I
believe.

Does it need a hardcoded GPIO base, or can it use the dynamic one
(i.e. use -1 here)? I don't even see any reference to gpio_base in the
driver...


-Olof

[PATCH 5/5] ARM: Tegra: Enable Harmony audio support

From: Colin Cross <hidden>
Date: 2011-02-23 21:15:51

On Wed, Feb 23, 2011 at 1:08 PM, Olof Johansson [off-list ref] wrote:
Stephen,

Since this depends on i2c, and registers one of the adapters to do it,
we should just get the adapters registered separately (all of them)
before this. I was holding off that part of board code since the i2c
driver went up that maintainer path instead, but if Colin pulls it
into tegra for-next, then I'll go ahead with those peices as well.

I'll pick up the board-side patches from this series (1, 4, 5), and
Colin will take the core patches (2, 3).


On Wed, Feb 23, 2011 at 10:58 AM, Stephen Warren [off-list ref] wrote:
quoted
+static struct wm8903_platform_data harmony_wm8903_pdata = {
+ ? ? ? .irq_active_low = 0,
+ ? ? ? .micdet_cfg = 0,
+ ? ? ? .micdet_delay = 100,
+ ? ? ? .gpio_base = GPIO_WM8903(0),
+ ? ? ? .gpio_cfg = {
+ ? ? ? ? ? ? ? WM8903_GPIO_NO_CONFIG,
+ ? ? ? ? ? ? ? WM8903_GPIO_NO_CONFIG,
+ ? ? ? ? ? ? ? 0,
+ ? ? ? ? ? ? ? WM8903_GPIO_NO_CONFIG,
+ ? ? ? ? ? ? ? WM8903_GPIO_NO_CONFIG,
+ ? ? ? },
+};
[...]
quoted
diff --git a/arch/arm/mach-tegra/board-harmony.h b/arch/arm/mach-tegra/board-harmony.h
index 4fe33b8..fbf2304 100644
--- a/arch/arm/mach-tegra/board-harmony.h
+++ b/arch/arm/mach-tegra/board-harmony.h
@@ -17,12 +17,19 @@
?#ifndef _MACH_TEGRA_BOARD_HARMONY_H
?#define _MACH_TEGRA_BOARD_HARMONY_H

+#define GPIO_WM8903(_x_) ? ? ? ? ? ? ? (TEGRA_NR_GPIOS + (_x_))

The above assumes that wm8903 is the GPIO controller that gets
allocated the numbers right after native tegra gpio. That might not be
the case on all boards, since the TPS PMIC has some as well, I
believe.
The GPIO numbers above TEGRA_NR_GPIOS are allocated by the board, and
this is in board-harmony.h, so I think its OK.
Does it need a hardcoded GPIO base, or can it use the dynamic one
(i.e. use -1 here)? I don't even see any reference to gpio_base in the
driver...
I assume that is in the ASoC tree.  The platform data in tegra
for-next does not include a gpio_base entry.

[PATCH 5/5] ARM: Tegra: Enable Harmony audio support

From: Olof Johansson <hidden>
Date: 2011-02-23 21:21:31

Hi,
The GPIO numbers above TEGRA_NR_GPIOS are allocated by the board, and
this is in board-harmony.h, so I think its OK.
On second thought, it's probably even preferred, since otherwise the
dynamic allocation can mess up the static ones.
quoted
Does it need a hardcoded GPIO base, or can it use the dynamic one
(i.e. use -1 here)? I don't even see any reference to gpio_base in the
driver...
I assume that is in the ASoC tree. ?The platform data in tegra
for-next does not include a gpio_base entry.
Yeah, I only looked at the current driver in .37, my bad.


-Olof

[PATCH 5/5] ARM: Tegra: Enable Harmony audio support

From: Stephen Warren <hidden>
Date: 2011-02-23 21:22:43

Colin Cross wrote at Wednesday, February 23, 2011 2:16 PM:
On Wed, Feb 23, 2011 at 1:08 PM, Olof Johansson [off-list ref] wrote:
quoted
...
On Wed, Feb 23, 2011 at 10:58 AM, Stephen Warren [off-list ref] wrote:
[...]
quoted
diff --git a/arch/arm/mach-tegra/board-harmony.h b/arch/arm/mach-tegra/board-harmony.h
index 4fe33b8..fbf2304 100644
--- a/arch/arm/mach-tegra/board-harmony.h
+++ b/arch/arm/mach-tegra/board-harmony.h
@@ -17,12 +17,19 @@
?#ifndef _MACH_TEGRA_BOARD_HARMONY_H
?#define _MACH_TEGRA_BOARD_HARMONY_H

+#define GPIO_WM8903(_x_) ? ? ? ? ? ? ? (TEGRA_NR_GPIOS + (_x_))

The above assumes that wm8903 is the GPIO controller that gets
allocated the numbers right after native tegra gpio. That might not be
the case on all boards, since the TPS PMIC has some as well, I
believe.
The GPIO numbers above TEGRA_NR_GPIOS are allocated by the board, and
this is in board-harmony.h, so I think its OK.
The Seaboard equivalent of this that I wrote for ChromeOS is:

#define TPS_GPIO_BASE			TEGRA_NR_GPIOS

#define TPS_GPIO_WWAN_PWR		(TPS_GPIO_BASE + 2)

#define GPIO_WM8903(_x_)		(TPS_GPIO_BASE + 4 + (_x_))

Which takes into account other devices.
quoted
Does it need a hardcoded GPIO base, or can it use the dynamic one
(i.e. use -1 here)? I don't even see any reference to gpio_base in the
driver...
I assume that is in the ASoC tree.  The platform data in tegra
for-next does not include a gpio_base entry.
Yes, gpio_base is added to that tree.

-1 would probably work. But then, I have no idea how to find out what base
was assigned to the WM8903, in order to initialize the ASoC machine driver's
platform_data...

-- 
nvpublic

[PATCH 5/5] ARM: Tegra: Enable Harmony audio support

From: Olof Johansson <hidden>
Date: 2011-02-23 21:25:53

On Wed, Feb 23, 2011 at 1:22 PM, Stephen Warren [off-list ref] wrote:
Colin Cross wrote at Wednesday, February 23, 2011 2:16 PM:
quoted
On Wed, Feb 23, 2011 at 1:08 PM, Olof Johansson [off-list ref] wrote:
quoted
...
On Wed, Feb 23, 2011 at 10:58 AM, Stephen Warren [off-list ref] wrote:
[...]
quoted
diff --git a/arch/arm/mach-tegra/board-harmony.h b/arch/arm/mach-tegra/board-harmony.h
index 4fe33b8..fbf2304 100644
--- a/arch/arm/mach-tegra/board-harmony.h
+++ b/arch/arm/mach-tegra/board-harmony.h
@@ -17,12 +17,19 @@
?#ifndef _MACH_TEGRA_BOARD_HARMONY_H
?#define _MACH_TEGRA_BOARD_HARMONY_H

+#define GPIO_WM8903(_x_) ? ? ? ? ? ? ? (TEGRA_NR_GPIOS + (_x_))

The above assumes that wm8903 is the GPIO controller that gets
allocated the numbers right after native tegra gpio. That might not be
the case on all boards, since the TPS PMIC has some as well, I
believe.
The GPIO numbers above TEGRA_NR_GPIOS are allocated by the board, and
this is in board-harmony.h, so I think its OK.
The Seaboard equivalent of this that I wrote for ChromeOS is:

#define TPS_GPIO_BASE ? ? ? ? ? ? ? ? ? TEGRA_NR_GPIOS

#define TPS_GPIO_WWAN_PWR ? ? ? ? ? ? ? (TPS_GPIO_BASE + 2)

#define GPIO_WM8903(_x_) ? ? ? ? ? ? ? ?(TPS_GPIO_BASE + 4 + (_x_))

Which takes into account other devices.
quoted
quoted
Does it need a hardcoded GPIO base, or can it use the dynamic one
(i.e. use -1 here)? I don't even see any reference to gpio_base in the
driver...
I assume that is in the ASoC tree. ?The platform data in tegra
for-next does not include a gpio_base entry.
Yes, gpio_base is added to that tree.

-1 would probably work. But then, I have no idea how to find out what base
was assigned to the WM8903, in order to initialize the ASoC machine driver's
platform_data...
Yeah, like I said in a separate reply, keeping it the way it is will
work out for the best.


-Olof

[PATCH 5/5] ARM: Tegra: Enable Harmony audio support

From: Colin Cross <hidden>
Date: 2011-02-23 21:21:04

On Wed, Feb 23, 2011 at 1:08 PM, Olof Johansson [off-list ref] wrote:
Stephen,

Since this depends on i2c, and registers one of the adapters to do it,
we should just get the adapters registered separately (all of them)
before this. I was holding off that part of board code since the i2c
driver went up that maintainer path instead, but if Colin pulls it
into tegra for-next, then I'll go ahead with those peices as well.
I'll merge the i2c-tegra branch into for-next (assuming Ben doesn't
object to it), and you can put all the i2c devices in your pull
request.  That way we can get everything except this patch into the
first pull request to Linus, and just put this patch into a second
pull request once the ASoC branch is merged.

[PATCH 5/5] ARM: Tegra: Enable Harmony audio support

From: Olof Johansson <hidden>
Date: 2011-02-23 21:24:41

On Wed, Feb 23, 2011 at 1:21 PM, Colin Cross [off-list ref] wrote:
On Wed, Feb 23, 2011 at 1:08 PM, Olof Johansson [off-list ref] wrote:
quoted
Stephen,

Since this depends on i2c, and registers one of the adapters to do it,
we should just get the adapters registered separately (all of them)
before this. I was holding off that part of board code since the i2c
driver went up that maintainer path instead, but if Colin pulls it
into tegra for-next, then I'll go ahead with those peices as well.
I'll merge the i2c-tegra branch into for-next (assuming Ben doesn't
object to it), and you can put all the i2c devices in your pull
request. ?That way we can get everything except this patch into the
first pull request to Linus, and just put this patch into a second
pull request once the ASoC branch is merged.
Sure, that works. I'll stage the i2c changes tonight.


-Olof

[PATCH 5/5] ARM: Tegra: Enable Harmony audio support

From: Stephen Warren <hidden>
Date: 2011-02-23 21:35:10

Olof Johansson wrote at Wednesday, February 23, 2011 2:25 PM:
On Wed, Feb 23, 2011 at 1:21 PM, Colin Cross [off-list ref] wrote:
quoted
On Wed, Feb 23, 2011 at 1:08 PM, Olof Johansson [off-list ref] wrote:
quoted
Stephen,

Since this depends on i2c, and registers one of the adapters to do it,
we should just get the adapters registered separately (all of them)
before this. I was holding off that part of board code since the i2c
driver went up that maintainer path instead, but if Colin pulls it
into tegra for-next, then I'll go ahead with those peices as well.
I'll merge the i2c-tegra branch into for-next (assuming Ben doesn't
object to it), and you can put all the i2c devices in your pull
request. ?That way we can get everything except this patch into the
first pull request to Linus, and just put this patch into a second
pull request once the ASoC branch is merged.
Sure, that works. I'll stage the i2c changes tonight.
OK, so just so I'm clear:

Patches 1..4 are all going in as-is.

I should re-post patch 5 once the merge window is open, having rebased
it on Olof's i2c registration changes, and
s/GPIO_WM8903/HARMONY_GPIO_WM8903/. Or, should I repost as soon as Olof
has updated his branch with the I2C changes, and you'll just hold off
applying it until the merge window?

Thanks.

-- 
nvpublic

[PATCH 5/5] ARM: Tegra: Enable Harmony audio support

From: Olof Johansson <hidden>
Date: 2011-02-23 21:51:43

On Wed, Feb 23, 2011 at 1:35 PM, Stephen Warren [off-list ref] wrote:
Olof Johansson wrote at Wednesday, February 23, 2011 2:25 PM:
quoted
On Wed, Feb 23, 2011 at 1:21 PM, Colin Cross [off-list ref] wrote:
quoted
On Wed, Feb 23, 2011 at 1:08 PM, Olof Johansson [off-list ref] wrote:
quoted
Stephen,

Since this depends on i2c, and registers one of the adapters to do it,
we should just get the adapters registered separately (all of them)
before this. I was holding off that part of board code since the i2c
driver went up that maintainer path instead, but if Colin pulls it
into tegra for-next, then I'll go ahead with those peices as well.
I'll merge the i2c-tegra branch into for-next (assuming Ben doesn't
object to it), and you can put all the i2c devices in your pull
request. ?That way we can get everything except this patch into the
first pull request to Linus, and just put this patch into a second
pull request once the ASoC branch is merged.
Sure, that works. I'll stage the i2c changes tonight.
OK, so just so I'm clear:

Patches 1..4 are all going in as-is.

I should re-post patch 5 once the merge window is open, having rebased
it on Olof's i2c registration changes, and
s/GPIO_WM8903/HARMONY_GPIO_WM8903/. Or, should I repost as soon as Olof
has updated his branch with the I2C changes, and you'll just hold off
applying it until the merge window?
How big would the delta be between a patch that would apply (and work)
with current .38-rc wm8903 platform data? If it's just the GPIO base,
we can merge everything but that and just do the small change late in
the merge window.

And yeah, please repost after the i2c stuff is in my branch, I'll
stage it accordingly.


-Olof

[PATCH 5/5] ARM: Tegra: Enable Harmony audio support

From: Stephen Warren <hidden>
Date: 2011-02-23 21:54:23

Olof Johansson wrote at Wednesday, February 23, 2011 2:52 PM:
On Wed, Feb 23, 2011 at 1:35 PM, Stephen Warren [off-list ref] wrote:
quoted
...
OK, so just so I'm clear:

Patches 1..4 are all going in as-is.

I should re-post patch 5 once the merge window is open, having rebased
it on Olof's i2c registration changes, and
s/GPIO_WM8903/HARMONY_GPIO_WM8903/. Or, should I repost as soon as Olof
has updated his branch with the I2C changes, and you'll just hold off
applying it until the merge window?
How big would the delta be between a patch that would apply (and work)
with current .38-rc wm8903 platform data? If it's just the GPIO base,
we can merge everything but that and just do the small change late in
the merge window.
Once the I2C tree is merged, the only thing needed to make my patch
apply immediately is to remove the gpio_base assignment. I can split
that into a separate patch and post a series if that helps.
And yeah, please repost after the i2c stuff is in my branch, I'll
stage it accordingly.
Great, thanks.

-- 
nvpublic

[PATCH 5/5] ARM: Tegra: Enable Harmony audio support

From: Russell King - ARM Linux <hidden>
Date: 2011-02-23 22:48:20

On Wed, Feb 23, 2011 at 11:58:52AM -0700, Stephen Warren wrote:
+#include <mach/gpio.h>
linux/gpio.h please.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help