ARM: Tegra: Seaboard board updates for audio
Subsystems (3)
PATCH 1/2 ARM: Tegra: Seaboard board updates for audio
* 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
--- arch/arm/mach-tegra/board-seaboard-pinmux.c | 21 ++++++++++- arch/arm/mach-tegra/board-seaboard.c | 51 +++++++++++++++++++++++++++ arch/arm/mach-tegra/board-seaboard.h | 12 ++++-- 3 files changed, 78 insertions(+), 6 deletions(-)
arch/arm/mach-tegra/board-seaboard-pinmux.c +19 -2
@@ -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},
@@ -171,6 +171,23 @@ static struct tegra_gpio_table gpio_table[] = {void __init seaboard_pinmux_init (void ) { +/* +* PINGROUP_SPIC contains two pins: +* + PX2, DISABLE_CHRGR (output) +* + PX3, WM8903 codec IRQ (input) +* +* The pinmux module can only configure TRISTATE vs. NORMAL on a +* per-group rather than per-pin basis. The group must be NORMAL +* since at least one pin is an output. However, we must ensure that +* the WM8903 IRQ is never driven, since the WM8903 itself is driving +* it, and we don't want multiple drivers. To ensure this, configure +* PX3 as a GPIO here, and set is as an input, before the pinmux table +* is written, which is when the pins will be un-tristated. +*/ +tegra_gpio_enable (TEGRA_GPIO_CDC_IRQ ); +gpio_request (TEGRA_GPIO_CDC_IRQ ,"wm8903" ); +gpio_direction_input (TEGRA_GPIO_CDC_IRQ ); +tegra_pinmux_config_table (seaboard_pinmux,ARRAY_SIZE (seaboard_pinmux)); tegra_drive_pinmux_config_table(seaboard_drive_pinmux,
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
@@ -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_PA5void seaboard_pinmux_init (void );
Signature · 1 line
1.7.0.4
PATCH 2/2 ARM: Tegra: Seaboard: Add USB devices
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.
--- 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
@@ -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_USB1, .enable = true }, };void __init seaboard_pinmux_init (void )
arch/arm/mach-tegra/board-seaboard.c +27 -0
@@ -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
PATCH 2/2 ARM: Tegra: Seaboard: Add USB devices
Quoted 8 lines · 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.
Signed-off-by Stephen Warren <[email protected]>
PATCH 1/2 ARM: Tegra: Seaboard board updates for audio
In reply to Stephen WarrenQuoted 9 lines · 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 handleHP_MUTEGPIO
* Register platform devices for audio
* Update pinmux to cater for new GPIOs used for audioSigned-off-by Stephen Warren <[email protected]>
Colin, sounds like you're collecting board patches this merge window, so:
-Olof
PATCH 1/2 ARM: Tegra: Seaboard board updates for audio
Olof Johansson wrote at Wednesday, July 13, 2011 5:17 PM:
Quoted 9 lines · Stephen Warren
Quoted 8 lines
* 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 handleHP_MUTEGPIO
* Register platform devices for audio
* Update pinmux to cater for new GPIOs used for audio
Quoted 5 lines
Quoted 1 line
Signed-off-by Stephen Warren <[email protected]>Colin, sounds like you're collecting board patches this merge window, so:
Acked-by Olof Johansson <[email protected]>
Colin,
Do you want me to ask Arnd to pick these patches up directly, or do you want to apply them to the Tegra for-next tree, and have Arnd pull them?
Thanks.
Signature · 1 line
nvpublic
PATCH 1/2 ARM: Tegra: Seaboard board updates for audio
Quoted 12 lines · Stephen Warren
Olof Johansson wrote at Wednesday, July 13, 2011 5:17 PM:
Quoted 11 lines · Stephen Warren
Quoted 9 lines
* 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 handleHP_MUTEGPIO
* Register platform devices for audio
* Update pinmux to cater for new GPIOs used for audioSigned-off-by Stephen Warren <[email protected]>
Quoted 8 lines
Quoted 3 lines
Colin, sounds like you're collecting board patches this merge window, so:
Acked-by Olof Johansson <[email protected]>Colin,
Do you want me to ask Arnd to pick these patches up directly, or do you want to apply them to the Tegra for-next tree, and have Arnd pull them?
Normally I would want them to go through me so I have a chance to deal with conflicts before it hits the arm-soc tree, but since Arnd has already taken some patches for this release cycle, they might as well go directly to him.
PATCH 1/2 ARM: Tegra: Seaboard board updates for audio
Colin Cross wrote at Thursday, July 21, 2011 12:48 PM:
Quoted 1 line · Stephen Warren
...
Quoted 9 lines
Quoted 4 lines
Colin,
Do you want me to ask Arnd to pick these patches up directly, or do you want to apply them to the Tegra for-next tree, and have Arnd pull them?
Normally I would want them to go through me so I have a chance to deal with conflicts before it hits the arm-soc tree, but since Arnd has already taken some patches for this release cycle, they might as well go directly to him.
Arnd,
Per Colin's note above, can you please pick up the patches below into arm-soc.git. Let me know if you need me to repost them so you have a good copy. These are probably appropriate for your tegra/devel branch, although they're actually based on a merge of linux-next and Tegra's for-next from a week ago.
Both Acked-by Olof already:
[PATCH 1/2] ARM: Tegra: Seaboard board updates for audio
http://www.spinics.net/lists/arm-kernel/msg133180.html
[PATCH 2/2] ARM: Tegra: Seaboard: Add USB devices
http://www.spinics.net/lists/arm-kernel/msg133181.html
Not yet Acked-by anyone (Colin, Olof, could you please oblige; thanks):
[PATCH 2/2] ARM: Tegra: Harmony: Add USB device
http://www.spinics.net/lists/arm-kernel/msg133175.html
(don't pick up patch 1 of this series; there's discussion on how to handle that better)
Thanks very much!
Signature · 1 line
nvpublic
PATCH 1/2 ARM: Tegra: Seaboard board updates for audio
Quoted 29 lines · Stephen Warren
Colin Cross wrote at Thursday, July 21, 2011 12:48 PM:
Quoted 1 line · Stephen Warren
...
Quoted 9 lines
Quoted 4 lines
Colin,
Do you want me to ask Arnd to pick these patches up directly, or do you want to apply them to the Tegra for-next tree, and have Arnd pull them?
Normally I would want them to go through me so I have a chance to deal with conflicts before it hits the arm-soc tree, but since Arnd has already taken some patches for this release cycle, they might as well go directly to him.
Arnd,
Per Colin's note above, can you please pick up the patches below into arm-soc.git. Let me know if you need me to repost them so you have a good copy. These are probably appropriate for your tegra/devel branch, although they're actually based on a merge of linux-next and Tegra's for-next from a week ago.
Both Acked-by Olof already:
[PATCH 1/2] ARM: Tegra: Seaboard board updates for audio
http://www.spinics.net/lists/arm-kernel/msg133180.html[PATCH 2/2] ARM: Tegra: Seaboard: Add USB devices
http://www.spinics.net/lists/arm-kernel/msg133181.html
Quoted 6 lines
Not yet Acked-by anyone (Colin, Olof, could you please oblige; thanks):
[PATCH 2/2] ARM: Tegra: Harmony: Add USB device
http://www.spinics.net/lists/arm-kernel/msg133175.html
(don't pick up patch 1 of this series; there's discussion on how to handle that better)
I didn't see a need to ack a patch that had my earlier S-o-B on, but feel free to add one, Arnd.
-Olof