Skip to contentSkip to conversation

ARM: Tegra: Harmony & Seaboard USB and audio

PATCH In review Stephen Warren 2 participants 7 messages Aug 8, 2011 – Aug 14, 2011

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

v2 cover ARM: Tegra: Harmony & Seaboard USB and audio

This is a slight rev of some patches I posted a little while ago, now in a single series. The second patch has a minor revision that simplifies board-seaboard-pinmux.c.

The (previous version of the) patches were previously Ack'd by Tegra maintainers, and Colin asked Arnd to pick them up in arm-soc.git, although I'm not sure if that request still holds given the merge window is over?

Stephen Warren (3):
ARM: Tegra: Harmony: Add USB device
ARM: Tegra: Seaboard board updates for audio
ARM: Tegra: Seaboard: Add USB devices

 arch/arm/mach-tegra/board-harmony.c         |    2 +
 arch/arm/mach-tegra/board-seaboard-pinmux.c |    6 ++-
 arch/arm/mach-tegra/board-seaboard.c        |   78 +++++++++++++++++++++++++++
 arch/arm/mach-tegra/board-seaboard.h        |   12 +++--
 4 files changed, 92 insertions(+), 6 deletions(-)
#1 lore raw

PATCH v2 1/3 ARM: Tegra: Harmony: Add USB device

The Tegra USB port is attached an an SMSC9514; a combination USB hub and Ethernet controller.

This change is extracted from a change in the ChromeOS 2.6.38 kernel.

---
v2: No change

 arch/arm/mach-tegra/board-harmony.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
arch/arm/mach-tegra/board-harmony.c +2 -0
index 846cd7d..f528a5a 100644
@@ -117,6 +117,7 @@ static struct platform_device *harmony_devices[] __initdata = {
 	&tegra_sdhci_device1,
 	&tegra_sdhci_device2,
 	&tegra_sdhci_device4,
+	&tegra_ehci3_device,
 	&tegra_i2s_device1,
 	&tegra_das_device,
 	&tegra_pcm_device,
@@ -140,6 +141,7 @@ static __initdata struct tegra_clk_init_table harmony_clk_init_table[] = {
 	{ "pll_a_out0",	"pll_a",	11289600,	true },
 	{ "cdev1",	NULL,		0,		true },
 	{ "i2s1",	"pll_a_out0",	11289600,	false},
+	{ "usb3",	"clk_m",	12000000,	true },
 	{ NULL,		NULL,		0,		0},
 };
 
Signature · 1 line
1.7.0.4
#2 lore raw

PATCH v2 2/3 ARM: Tegra: Seaboard board updates for audio

In reply to Stephen Warren

* Initialize clock tree for audio
* Add GPIO base definitions
* Add audio GPIO definitions
* Define platform data for WM8903 and ASoC machine driver
* Add special case for Kaen to handle HP_MUTE GPIO
* Register platform devices for audio
* Update pinmux to cater for new GPIOs used for audio

---
v2: Simplify WM8903 interrupt GPIO registration, to match Harmony.
... It turns out the HW issue I was WARing in v1 (multiple signal
drivers) is a non-issue, since both drivers drive the same value, hence we can handle this GPIO and pingroup just like any other.

 arch/arm/mach-tegra/board-seaboard-pinmux.c |    5 ++-
 arch/arm/mach-tegra/board-seaboard.c        |   51 +++++++++++++++++++++++++++
 arch/arm/mach-tegra/board-seaboard.h        |   12 ++++--
 3 files changed, 62 insertions(+), 6 deletions(-)
arch/arm/mach-tegra/board-seaboard-pinmux.c +3 -2
index 0bda495..7879750 100644
@@ -49,7 +49,7 @@ static __initdata struct tegra_pingroup_config seaboard_pinmux[] = {
 	{TEGRA_PINGROUP_CRTP,  TEGRA_MUX_CRT,           TEGRA_PUPD_PULL_UP,   TEGRA_TRI_TRISTATE},
 	{TEGRA_PINGROUP_CSUS,  TEGRA_MUX_VI_SENSOR_CLK, 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_DAP2,  TEGRA_MUX_DAP2,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
 	{TEGRA_PINGROUP_DAP3,  TEGRA_MUX_DAP3,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
 	{TEGRA_PINGROUP_DAP4,  TEGRA_MUX_DAP4,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
 	{TEGRA_PINGROUP_DDC,   TEGRA_MUX_RSVD2,         TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
@@ -133,7 +133,7 @@ static __initdata struct tegra_pingroup_config seaboard_pinmux[] = {
 	{TEGRA_PINGROUP_SPDO,  TEGRA_MUX_RSVD2,         TEGRA_PUPD_NORMAL,    TEGRA_TRI_NORMAL},
 	{TEGRA_PINGROUP_SPIA,  TEGRA_MUX_GMI,           TEGRA_PUPD_PULL_UP,   TEGRA_TRI_TRISTATE},
 	{TEGRA_PINGROUP_SPIB,  TEGRA_MUX_GMI,           TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
-	{TEGRA_PINGROUP_SPIC,  TEGRA_MUX_GMI,           TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
+	{TEGRA_PINGROUP_SPIC,  TEGRA_MUX_GMI,           TEGRA_PUPD_PULL_UP,   TEGRA_TRI_NORMAL},
 	{TEGRA_PINGROUP_SPID,  TEGRA_MUX_SPI1,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
 	{TEGRA_PINGROUP_SPIE,  TEGRA_MUX_SPI1,          TEGRA_PUPD_NORMAL,    TEGRA_TRI_TRISTATE},
 	{TEGRA_PINGROUP_SPIF,  TEGRA_MUX_SPI1,          TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE},
@@ -167,6 +167,7 @@ static struct tegra_gpio_table gpio_table[] = {
 	{ .gpio = TEGRA_GPIO_LIDSWITCH,		.enable = true },
 	{ .gpio = TEGRA_GPIO_POWERKEY,		.enable = true },
 	{ .gpio = TEGRA_GPIO_ISL29018_IRQ,	.enable = true },
+	{ .gpio = TEGRA_GPIO_CDC_IRQ,		.enable = true },
 };
 
 void __init seaboard_pinmux_init(void)
arch/arm/mach-tegra/board-seaboard.c +51 -0

96 lines not on this page · raw message

arch/arm/mach-tegra/board-seaboard.h +8 -4
index d8415e1..d06c334 100644
@@ -17,6 +17,9 @@
 #ifndef _MACH_TEGRA_BOARD_SEABOARD_H
 #define _MACH_TEGRA_BOARD_SEABOARD_H
 
+#define SEABOARD_GPIO_TPS6586X(_x_)	(TEGRA_NR_GPIOS + (_x_))
+#define SEABOARD_GPIO_WM8903(_x_)	(SEABOARD_GPIO_TPS6586X(4) + (_x_))
+
 #define TEGRA_GPIO_SD2_CD		TEGRA_GPIO_PI5
 #define TEGRA_GPIO_SD2_WP		TEGRA_GPIO_PH1
 #define TEGRA_GPIO_SD2_POWER		TEGRA_GPIO_PI6
@@ -31,10 +34,11 @@
 #define TEGRA_GPIO_MAGNETOMETER		TEGRA_GPIO_PN5
 #define TEGRA_GPIO_ISL29018_IRQ		TEGRA_GPIO_PZ2
 #define TEGRA_GPIO_AC_ONLINE		TEGRA_GPIO_PV3
-
-#define TPS_GPIO_BASE			TEGRA_NR_GPIOS
-
-#define TPS_GPIO_WWAN_PWR		(TPS_GPIO_BASE + 2)
+#define TEGRA_GPIO_WWAN_PWR		SEABOARD_GPIO_TPS6586X(2)
+#define TEGRA_GPIO_CDC_IRQ		TEGRA_GPIO_PX3
+#define TEGRA_GPIO_SPKR_EN		SEABOARD_GPIO_WM8903(2)
+#define TEGRA_GPIO_HP_DET		TEGRA_GPIO_PX1
+#define TEGRA_GPIO_KAEN_HP_MUTE		TEGRA_GPIO_PA5
 
 void seaboard_pinmux_init(void);
 
Signature · 1 line
1.7.0.4
#3 lore raw

PATCH v2 3/3 ARM: Tegra: Seaboard: Add USB devices

In reply to Stephen Warren

Seaboard has a couple of external USB ports. Add the platform devices and GPIO infra-structure to enable these.

I tested both ports with a mouse on Seaboard non-clamshell.

This change is extracted from code in the ChromeOS 2.6.38 kernel.

---
v2: No change

 arch/arm/mach-tegra/board-seaboard-pinmux.c |    1 +
 arch/arm/mach-tegra/board-seaboard.c        |   27 +++++++++++++++++++++++++++
 2 files changed, 28 insertions(+), 0 deletions(-)
arch/arm/mach-tegra/board-seaboard-pinmux.c +1 -0
index 7879750..74f78b7 100644
@@ -168,6 +168,7 @@ static struct tegra_gpio_table gpio_table[] = {
 	{ .gpio = TEGRA_GPIO_POWERKEY,		.enable = true },
 	{ .gpio = TEGRA_GPIO_ISL29018_IRQ,	.enable = true },
 	{ .gpio = TEGRA_GPIO_CDC_IRQ,		.enable = true },
+	{ .gpio = TEGRA_GPIO_USB1,		.enable = true },
 };
 
 void __init seaboard_pinmux_init(void)
arch/arm/mach-tegra/board-seaboard.c +27 -0
index 07cd8e4..237a94a 100644
@@ -69,6 +69,8 @@ static __initdata struct tegra_clk_init_table seaboard_clk_init_table[] = {
 	{ "pll_a_out0",	"pll_a",	11289600,	true },
 	{ "cdev1",	NULL,		0,		true },
 	{ "i2s1",	"pll_a_out0",	11289600,	false},
+	{ "usbd",	"clk_m",	12000000,	true},
+	{ "usb3",	"clk_m",	12000000,	true},
 	{ NULL,		NULL,		0,		0},
 };
 
@@ -182,6 +184,29 @@ static struct i2c_board_info __initdata wm8903_device = {
 	.irq = TEGRA_GPIO_TO_IRQ(TEGRA_GPIO_CDC_IRQ),
 };
 
+static int seaboard_ehci_init(void)
+{
+	int gpio_status;
+
+	gpio_status = gpio_request(TEGRA_GPIO_USB1, "VBUS_USB1");
+	if (gpio_status < 0) {
+		pr_err("VBUS_USB1 request GPIO FAILED\n");
+		WARN_ON(1);
+	}
+
+	gpio_status = gpio_direction_output(TEGRA_GPIO_USB1, 1);
+	if (gpio_status < 0) {
+		pr_err("VBUS_USB1 request GPIO DIRECTION FAILED\n");
+		WARN_ON(1);
+	}
+	gpio_set_value(TEGRA_GPIO_USB1, 1);
+
+	platform_device_register(&tegra_ehci1_device);
+	platform_device_register(&tegra_ehci3_device);
+
+	return 0;
+}
+
 static void __init seaboard_i2c_init(void)
 {
 	gpio_request(TEGRA_GPIO_ISL29018_IRQ, "isl29018");
@@ -209,6 +234,8 @@ static void __init seaboard_common_init(void)
 	tegra_sdhci_device4.dev.platform_data = &sdhci_pdata4;
 
 	platform_add_devices(seaboard_devices, ARRAY_SIZE(seaboard_devices));
+
+	seaboard_ehci_init();
 }
 
 static void __init tegra_seaboard_init(void)
Signature · 1 line
1.7.0.4
#4 lore raw
In reply to Stephen Warren
Quoted 8 lines · Stephen Warren

This is a slight rev of some patches I posted a little while ago, now in a single series. The second patch has a minor revision that simplifies board-seaboard-pinmux.c.

The (previous version of the) patches were previously Ack'd by Tegra maintainers, and Colin asked Arnd to pick them up in arm-soc.git, although I'm not sure if that request still holds given the merge window is over?

Thanks, I've picked them up in boards-for-3.2, which will be merged in through Arnd for 3.2.

-Olof

#5 lore raw

Olof Johansson wrote at Tuesday, August 09, 2011 1:34 PM:

Quoted 5 lines · Stephen Warren
Quoted 4 lines

This is a slight rev of some patches I posted a little while ago, now in a single series. The second patch has a minor revision that simplifies board-seaboard-pinmux.c.

Quoted 7 lines
Quoted 4 lines

The (previous version of the) patches were previously Ack'd by Tegra maintainers, and Colin asked Arnd to pick them up in arm-soc.git, although I'm not sure if that request still holds given the merge window is over?

Thanks, I've picked them up in boards-for-3.2, which will be merged in through Arnd for 3.2.

I see boards-for-3.2 isn't in linux-next itself, so these changes aren't getting rebased out of my local tree on top of linux-next.

Does it make sense to add your tree into linux-next? Or, is the expected process that such trees will be quickly pulled/merged into Arnd's tree, which I assume is in linux-next?

Thanks.

Signature · 1 line
nvpublic
#6 lore raw
Quoted 14 lines · Stephen Warren

Olof Johansson wrote at Tuesday, August 09, 2011 1:34 PM:

Quoted 5 lines · Stephen Warren
Quoted 4 lines

This is a slight rev of some patches I posted a little while ago, now in a single series. The second patch has a minor revision that simplifies board-seaboard-pinmux.c.

Quoted 7 lines
Quoted 4 lines

The (previous version of the) patches were previously Ack'd by Tegra maintainers, and Colin asked Arnd to pick them up in arm-soc.git, although I'm not sure if that request still holds given the merge window is over?

Thanks, I've picked them up in boards-for-3.2, which will be merged in through Arnd for 3.2.

Quoted 6 lines

I see boards-for-3.2 isn't in linux-next itself, so these changes aren't getting rebased out of my local tree on top of linux-next.

Does it make sense to add your tree into linux-next? Or, is the expected process that such trees will be quickly pulled/merged into Arnd's tree, which I assume is in linux-next?

Ah yeah, good point. I'll send a pull request to Arnd.

-Olof