Skip to contentSkip to conversation

ARM: Tegra: Harmony: Enable audio driver

PATCH New Stephen Warren 4 participants 28 messages Feb 23, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover ARM: Tegra: Harmony: Enable audio driver

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(-)
#1 lore raw

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

For I2S, DAS, PCM devices

---
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(-)
arch/arm/mach-tegra/devices.c +70 -0
index 682e6d3..1528f9d 100644
@@ -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,
+};
arch/arm/mach-tegra/devices.h +4 -0
index 888810c..4a7dc0a 100644
@@ -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
arch/arm/mach-tegra/include/mach/iomap.h +3 -0
index 691cdab..19dec3a 100644
@@ -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
 
Signature · 1 line
1.7.1
#2 lore raw

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

Quoted 115 lines · Stephen Warren

For I2S, DAS, PCM devices

---
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(-)

arch/arm/mach-tegra/devices.c +70 -0
index 682e6d3..1528f9d 100644
@@ -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,
+};
arch/arm/mach-tegra/devices.h +4 -0
index 888810c..4a7dc0a 100644
@@ -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

arch/arm/mach-tegra/include/mach/iomap.h +0 -0
index 691cdab..19dec3a 100644
@@ -122,6 +122,9 @@

?#define TEGRA_APB_MISC_BASE ? ? ? ? ? ?0x70000000 ?#define TEGRA_APB_MISC_SIZE ? ? ? ? ? ?SZ_4K

arch/arm/mach-tegra/include/mach/iomap.h +3 -0
+#define TEGRA_APB_MISC_DAS_BASE ? ? ? ? ? ? ? ?0x70000c00
+#define TEGRA_APB_MISC_DAS_SIZE ? ? ? ? ? ? ? ?SZ_128
+
Quoted 2 lines

?#define TEGRA_AC97_BASE ? ? ? ? ? ? ? ? ? ? ? ?0x70002000 ?#define TEGRA_AC97_SIZE ? ? ? ? ? ? ? ? ? ? ? ?SZ_512

#3 lore raw

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

In reply to Stephen Warren

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

---
NOTE: This patch should apply right now.

 arch/arm/mach-tegra/tegra2_clocks.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-tegra/tegra2_clocks.c +2 -2
index 3015a2c..ee3f9d7 100644
@@ -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),
Signature · 1 line
1.7.1
#4 lore raw

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

Quoted 26 lines · Stephen Warren

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

---
NOTE: This patch should apply right now.

?arch/arm/mach-tegra/tegra2_clocks.c | ? ?4 ++--
?1 files changed, 2 insertions(+), 2 deletions(-)

arch/arm/mach-tegra/tegra2_clocks.c +2 -3
index 3015a2c..ee3f9d7 100644
@@ -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),
--
Quoted 3 lines

1.7.1

Ack, I'll put it in for-next

#5 lore raw

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

In reply to Stephen Warren

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.

---
NOTE: This patch should apply right now.

 arch/arm/mach-tegra/tegra2_clocks.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)
arch/arm/mach-tegra/tegra2_clocks.c +6 -6
index ee3f9d7..6d7c4ee 100644
@@ -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,
Signature · 1 line
1.7.1
#6 lore raw

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

Quoted 52 lines · Stephen Warren

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.

---
NOTE: This patch should apply right now.

?arch/arm/mach-tegra/tegra2_clocks.c | ? 12 ++++++------ ?1 files changed, 6 insertions(+), 6 deletions(-)

arch/arm/mach-tegra/tegra2_clocks.c +0 -0
index ee3f9d7..6d7c4ee 100644
@@ -1823,8 +1823,8 @@ static struct clk tegra_clk_d = {
 ?};
 

?/* dap_mclk1, belongs to the cdev1 pingroup. */

arch/arm/mach-tegra/tegra2_clocks.c +2 -2
-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,

arch/arm/mach-tegra/tegra2_clocks.c +0 -0
@@ -1834,8 +1834,8 @@ static struct clk tegra_dev1_clk = {
 ?};
 

?/* dap_mclk2, belongs to the cdev2 pingroup. */

arch/arm/mach-tegra/tegra2_clocks.c +2 -2
-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,

arch/arm/mach-tegra/tegra2_clocks.c +2 -3
@@ -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,
--
Quoted 3 lines

1.7.1

Ack, I'll put it in for-next

#7 lore raw

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

In reply to Stephen Warren

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

---
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(-)
arch/arm/mach-tegra/board-harmony-pinmux.c +6 -6
index 98368d9..3ada474 100644
@@ -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)
arch/arm/mach-tegra/board-harmony.c +6 -6
index 49224e9..2c4a234 100644
@@ -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,
 };
 
arch/arm/mach-tegra/board-harmony.h +7 -0
index 09ca775..4fe33b8 100644
@@ -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
arch/arm/mach-tegra/board-seaboard-pinmux.c +5 -5
index 2d6ad83..7b6f38c 100644
@@ -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)
arch/arm/mach-tegra/board-seaboard.c +3 -3
index 6ca9e61..eb28dbd 100644
@@ -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 = {
arch/arm/mach-tegra/board-seaboard.h +3 -0
index a098e35..d8415e1 100644
@@ -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
Signature · 1 line
1.7.1
#8 lore raw

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

Quoted 3 lines · Stephen Warren

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

#9 lore raw

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

Colin Cross wrote at Wednesday, February 23, 2011 12:09 PM:

Quoted 6 lines · Stephen Warren
Quoted 2 lines

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.

Signature · 1 line
nvpublic
#10 lore raw

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

Quoted 19 lines · Stephen Warren

Colin Cross wrote at Wednesday, February 23, 2011 12:09 PM:

Quoted 6 lines · Stephen Warren
Quoted 2 lines

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:

Quoted 8 lines

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.

#11 lore raw

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

Colin Cross wrote at Wednesday, February 23, 2011 1:39 PM:

Quoted 10 lines · Stephen Warren
Quoted 8 lines

Colin Cross wrote at Wednesday, February 23, 2011 12:09 PM:

Quoted 6 lines · Stephen Warren
Quoted 2 lines

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

Quoted 8 lines
Quoted 1 line

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?

Signature · 1 line
nvpublic
#12 lore raw

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

Quoted 20 lines · Stephen Warren

Colin Cross wrote at Wednesday, February 23, 2011 1:39 PM:

Quoted 10 lines · Stephen Warren
Quoted 8 lines

Colin Cross wrote at Wednesday, February 23, 2011 12:09 PM:

Quoted 6 lines · Stephen Warren
Quoted 2 lines

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

Quoted 8 lines
Quoted 1 line

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.

Quoted 6 lines

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.

#13 lore raw

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

In reply to Stephen Warren

* 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.

---
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(-)
arch/arm/mach-tegra/board-harmony-pinmux.c +10 -6
index 3ada474..4d63e2e 100644
@@ -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)
arch/arm/mach-tegra/board-harmony.c +58 -0

108 lines not on this page · raw message

arch/arm/mach-tegra/board-harmony.h +7 -0
index 4fe33b8..fbf2304 100644
@@ -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);
 
Signature · 1 line
1.7.1
#14 lore raw

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

Quoted 207 lines · Stephen Warren

* 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.

---
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(-)

arch/arm/mach-tegra/board-harmony-pinmux.c +10 -6
index 3ada474..4d63e2e 100644
@@ -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)
arch/arm/mach-tegra/board-harmony.c +0 -0
index 2c4a234..afa4b5e 100644
@@ -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

arch/arm/mach-tegra/board-harmony.c +0 -0
@@ -21,13 +22,19 @@

?#include <linux/clk.h>
?#include <linux/dma-mapping.h>
?#include <linux/pda_power.h>

arch/arm/mach-tegra/board-harmony.c +2 -0
+#include <linux/i2c.h>
+#include <linux/i2c-tegra.h>

?#include <linux/io.h>

arch/arm/mach-tegra/board-harmony.c +2 -0
+#include <sound/wm8903.h>
+

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

arch/arm/mach-tegra/board-harmony.c +2 -0
+#include <mach/gpio.h>
+#include <mach/harmony_audio.h>

?#include <mach/iomap.h>
?#include <mach/irqs.h>
?#include <mach/sdhci.h>

arch/arm/mach-tegra/board-harmony.c +20 -0
@@ -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}, ?};

arch/arm/mach-tegra/board-harmony.c +27 -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")
arch/arm/mach-tegra/board-harmony.h +0 -0
index 4fe33b8..fbf2304 100644
@@ -17,12 +17,19 @@

?#ifndef _MACH_TEGRA_BOARD_HARMONY_H
?#define _MACH_TEGRA_BOARD_HARMONY_H

Quoted 1 line

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

Can you name this HARMONY_GPIO_WM8903?

Quoted 19 lines

+
?#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

arch/arm/mach-tegra/board-harmony.h +5 -0
+#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

#15 lore raw

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

Colin Cross wrote at Wednesday, February 23, 2011 2:08 PM:

Quoted 7 lines · Stephen Warren
Quoted 5 lines

* 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.

Quoted 5 lines

arch/arm/mach-tegra/board-harmony.h

Quoted 4 lines
arch/arm/mach-tegra/board-harmony.h +1 -0
...
+#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 12 lines
Quoted 12 lines

+
?#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

arch/arm/mach-tegra/board-harmony.h +5 -0
+#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
Signature · 1 line
nvpublic
#16 lore raw

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

Quoted 8 lines · Stephen Warren

Colin Cross wrote at Wednesday, February 23, 2011 2:08 PM:

Quoted 7 lines · Stephen Warren
Quoted 5 lines

* 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.

Quoted 8 lines
Quoted 5 lines

arch/arm/mach-tegra/board-harmony.h

Quoted 4 lines
arch/arm/mach-tegra/board-harmony.h +1 -0
...
+#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 17 lines
Quoted 4 lines
Quoted 4 lines

+
?#define TEGRA_GPIO_SD2_CD ? ? ? ? ? ? ?TEGRA_GPIO_PI5 ?#define TEGRA_GPIO_SD2_WP ? ? ? ? ? ? ?TEGRA_GPIO_PH1 ?#define TEGRA_GPIO_SD2_POWER ? ? ? ? ? TEGRA_GPIO_PT3

Quoted 8 lines

arch/arm/mach-tegra/board-harmony.h

Quoted 8 lines

?#define TEGRA_GPIO_SD4_CD ? ? ? ? ? ? ?TEGRA_GPIO_PH2 ?#define TEGRA_GPIO_SD4_WP ? ? ? ? ? ? ?TEGRA_GPIO_PH3 ?#define TEGRA_GPIO_SD4_POWER ? ? ? ? ? TEGRA_GPIO_PI6

arch/arm/mach-tegra/board-harmony.h +5 -0
+#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

#17 lore raw

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

In reply to Stephen Warren

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).

Quoted 13 lines · Stephen Warren
(quoted diff) +13 -0
+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 9 lines
arch/arm/mach-tegra/board-harmony.h +0 -0
index 4fe33b8..fbf2304 100644
@@ -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

#18 lore raw

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

Quoted 36 lines · Olof Johansson

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).

Quoted 13 lines · Stephen Warren
(quoted diff) +13 -0
+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 8 lines
arch/arm/mach-tegra/board-harmony.h +0 -0
index 4fe33b8..fbf2304 100644
@@ -17,12 +17,19 @@

?#ifndef _MACH_TEGRA_BOARD_HARMONY_H
?#define _MACH_TEGRA_BOARD_HARMONY_H

Quoted 7 lines
Quoted 1 line

+#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.

Quoted 3 lines

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.

#19 lore raw

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

Hi,

Quoted 2 lines

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 5 lines
Quoted 3 lines

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

#20 lore raw

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

In reply to Colin Cross

Colin Cross wrote at Wednesday, February 23, 2011 2:16 PM:

Quoted 20 lines · Olof Johansson
Quoted 11 lines

...
On Wed, Feb 23, 2011 at 10:58 AM, Stephen Warren <[email protected]> wrote:
[...]

Quoted 8 lines
arch/arm/mach-tegra/board-harmony.h +0 -0
index 4fe33b8..fbf2304 100644
@@ -17,12 +17,19 @@

?#ifndef _MACH_TEGRA_BOARD_HARMONY_H
?#define _MACH_TEGRA_BOARD_HARMONY_H

Quoted 7 lines
Quoted 1 line

+#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.

Quoted 2 lines

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 5 lines
Quoted 3 lines

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...

Signature · 1 line
nvpublic
#21 lore raw

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

Quoted 37 lines · Stephen Warren

Colin Cross wrote at Wednesday, February 23, 2011 2:16 PM:

Quoted 20 lines · Olof Johansson
Quoted 11 lines

...
On Wed, Feb 23, 2011 at 10:58 AM, Stephen Warren <[email protected]> wrote:
[...]

Quoted 8 lines
arch/arm/mach-tegra/board-harmony.h +0 -0
index 4fe33b8..fbf2304 100644
@@ -17,12 +17,19 @@

?#ifndef _MACH_TEGRA_BOARD_HARMONY_H
?#define _MACH_TEGRA_BOARD_HARMONY_H

Quoted 7 lines
Quoted 1 line

+#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.

Quoted 2 lines

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 3 lines
Quoted 3 lines

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...

Quoted 8 lines
Quoted 2 lines

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

#22 lore raw

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

In reply to Olof Johansson
Quoted 7 lines · Olof Johansson

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.

#23 lore raw

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

Quoted 9 lines · Colin Cross
Quoted 7 lines · Olof Johansson

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.

Quoted 5 lines

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

#24 lore raw

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

Olof Johansson wrote at Wednesday, February 23, 2011 2:25 PM:

Quoted 10 lines · Colin Cross
Quoted 9 lines · Olof Johansson
Quoted 7 lines

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.

Quoted 7 lines
Quoted 5 lines

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.

Signature · 1 line
nvpublic
#25 lore raw

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

Quoted 21 lines · Stephen Warren

Olof Johansson wrote at Wednesday, February 23, 2011 2:25 PM:

Quoted 10 lines · Colin Cross
Quoted 9 lines · Olof Johansson
Quoted 7 lines

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.

Quoted 7 lines
Quoted 5 lines

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:

Quoted 7 lines

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

#26 lore raw

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

Olof Johansson wrote at Wednesday, February 23, 2011 2:52 PM:

Quoted 13 lines · Stephen Warren
Quoted 10 lines

...
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?

Quoted 4 lines

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.

Quoted 2 lines

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

Great, thanks.

Signature · 1 line
nvpublic