diff options
author | Stephen Warren <swarren@nvidia.com> | 2011-03-05 00:44:29 -0500 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2011-03-07 18:34:25 -0500 |
commit | ef2b1a0f1eb299c2d00addfee3a2631395d9bdb5 (patch) | |
tree | d5c6a5a13cf4b69910909988e1d8bd5ba1fe6865 /arch | |
parent | 986afbe493b09846dffbe5c1bf9a428a839b6ca2 (diff) |
ARM: tegra: harmony: Beginnings of audio support
This change includes everything required to enable audio on Harmony, except
those parts which rely on code not currently in Tegra's for-next branch, i.e.
except those parts which rely on merges of the Tegra I2C driver or latest
ASoC subsystem.
* Define GPIO names for audio-related GPIOs
* Set up platform data and platform device for ASoC machine driver
* Register audio-related platform devices
* Initialize audio-related clocks
* Correctly configure pinmux and GPIO enables for audio-related pins
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-tegra/board-harmony-pinmux.c | 16 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-harmony.c | 26 | ||||
-rw-r--r-- | arch/arm/mach-tegra/board-harmony.h | 7 |
3 files changed, 43 insertions, 6 deletions
diff --git a/arch/arm/mach-tegra/board-harmony-pinmux.c b/arch/arm/mach-tegra/board-harmony-pinmux.c index 3ada474fbafb..4d63e2e97a8d 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[] = { | |||
27 | {TEGRA_PINGROUP_ATC, TEGRA_MUX_NAND, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, | 27 | {TEGRA_PINGROUP_ATC, TEGRA_MUX_NAND, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, |
28 | {TEGRA_PINGROUP_ATD, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, | 28 | {TEGRA_PINGROUP_ATD, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, |
29 | {TEGRA_PINGROUP_ATE, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, | 29 | {TEGRA_PINGROUP_ATE, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, |
30 | {TEGRA_PINGROUP_CDEV1, TEGRA_MUX_OSC, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, | 30 | {TEGRA_PINGROUP_CDEV1, TEGRA_MUX_PLLA_OUT, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, |
31 | {TEGRA_PINGROUP_CDEV2, TEGRA_MUX_PLLP_OUT4, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, | 31 | {TEGRA_PINGROUP_CDEV2, TEGRA_MUX_PLLP_OUT4, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, |
32 | {TEGRA_PINGROUP_CRTP, TEGRA_MUX_CRT, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, | 32 | {TEGRA_PINGROUP_CRTP, TEGRA_MUX_CRT, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, |
33 | {TEGRA_PINGROUP_CSUS, TEGRA_MUX_VI_SENSOR_CLK, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, | 33 | {TEGRA_PINGROUP_CSUS, TEGRA_MUX_VI_SENSOR_CLK, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, |
34 | {TEGRA_PINGROUP_DAP1, TEGRA_MUX_DAP1, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, | 34 | {TEGRA_PINGROUP_DAP1, TEGRA_MUX_DAP1, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, |
35 | {TEGRA_PINGROUP_DAP2, TEGRA_MUX_DAP2, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, | 35 | {TEGRA_PINGROUP_DAP2, TEGRA_MUX_DAP2, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, |
36 | {TEGRA_PINGROUP_DAP3, TEGRA_MUX_DAP3, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, | 36 | {TEGRA_PINGROUP_DAP3, TEGRA_MUX_DAP3, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, |
37 | {TEGRA_PINGROUP_DAP4, TEGRA_MUX_DAP4, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, | 37 | {TEGRA_PINGROUP_DAP4, TEGRA_MUX_DAP4, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, |
@@ -114,13 +114,13 @@ static struct tegra_pingroup_config harmony_pinmux[] = { | |||
114 | {TEGRA_PINGROUP_SLXK, TEGRA_MUX_PCIE, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, | 114 | {TEGRA_PINGROUP_SLXK, TEGRA_MUX_PCIE, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, |
115 | {TEGRA_PINGROUP_SPDI, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, | 115 | {TEGRA_PINGROUP_SPDI, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, |
116 | {TEGRA_PINGROUP_SPDO, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, | 116 | {TEGRA_PINGROUP_SPDO, TEGRA_MUX_RSVD2, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, |
117 | {TEGRA_PINGROUP_SPIA, TEGRA_MUX_GMI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, | 117 | {TEGRA_PINGROUP_SPIA, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, |
118 | {TEGRA_PINGROUP_SPIB, TEGRA_MUX_GMI, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, | 118 | {TEGRA_PINGROUP_SPIB, TEGRA_MUX_GMI, TEGRA_PUPD_NORMAL, TEGRA_TRI_NORMAL}, |
119 | {TEGRA_PINGROUP_SPIC, TEGRA_MUX_GMI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_NORMAL}, | 119 | {TEGRA_PINGROUP_SPIC, TEGRA_MUX_GMI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, |
120 | {TEGRA_PINGROUP_SPID, TEGRA_MUX_SPI1, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, | 120 | {TEGRA_PINGROUP_SPID, TEGRA_MUX_SPI1, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, |
121 | {TEGRA_PINGROUP_SPIE, TEGRA_MUX_SPI1, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, | 121 | {TEGRA_PINGROUP_SPIE, TEGRA_MUX_SPI1, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, |
122 | {TEGRA_PINGROUP_SPIF, TEGRA_MUX_SPI1, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, | 122 | {TEGRA_PINGROUP_SPIF, TEGRA_MUX_SPI1, TEGRA_PUPD_PULL_DOWN, TEGRA_TRI_TRISTATE}, |
123 | {TEGRA_PINGROUP_SPIG, TEGRA_MUX_SPI2_ALT, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, | 123 | {TEGRA_PINGROUP_SPIG, TEGRA_MUX_SPI2_ALT, TEGRA_PUPD_NORMAL, TEGRA_TRI_TRISTATE}, |
124 | {TEGRA_PINGROUP_SPIH, TEGRA_MUX_SPI2_ALT, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, | 124 | {TEGRA_PINGROUP_SPIH, TEGRA_MUX_SPI2_ALT, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, |
125 | {TEGRA_PINGROUP_UAA, TEGRA_MUX_ULPI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, | 125 | {TEGRA_PINGROUP_UAA, TEGRA_MUX_ULPI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, |
126 | {TEGRA_PINGROUP_UAB, TEGRA_MUX_ULPI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, | 126 | {TEGRA_PINGROUP_UAB, TEGRA_MUX_ULPI, TEGRA_PUPD_PULL_UP, TEGRA_TRI_TRISTATE}, |
@@ -147,6 +147,10 @@ static struct tegra_gpio_table gpio_table[] = { | |||
147 | { .gpio = TEGRA_GPIO_SD4_CD, .enable = true }, | 147 | { .gpio = TEGRA_GPIO_SD4_CD, .enable = true }, |
148 | { .gpio = TEGRA_GPIO_SD4_WP, .enable = true }, | 148 | { .gpio = TEGRA_GPIO_SD4_WP, .enable = true }, |
149 | { .gpio = TEGRA_GPIO_SD4_POWER, .enable = true }, | 149 | { .gpio = TEGRA_GPIO_SD4_POWER, .enable = true }, |
150 | { .gpio = TEGRA_GPIO_CDC_IRQ, .enable = true }, | ||
151 | { .gpio = TEGRA_GPIO_HP_DET, .enable = true }, | ||
152 | { .gpio = TEGRA_GPIO_INT_MIC_EN, .enable = true }, | ||
153 | { .gpio = TEGRA_GPIO_EXT_MIC_EN, .enable = true }, | ||
150 | }; | 154 | }; |
151 | 155 | ||
152 | void harmony_pinmux_init(void) | 156 | void harmony_pinmux_init(void) |
diff --git a/arch/arm/mach-tegra/board-harmony.c b/arch/arm/mach-tegra/board-harmony.c index 2c4a234f8acb..38c2ab864503 100644 --- a/arch/arm/mach-tegra/board-harmony.c +++ b/arch/arm/mach-tegra/board-harmony.c | |||
@@ -2,6 +2,7 @@ | |||
2 | * arch/arm/mach-tegra/board-harmony.c | 2 | * arch/arm/mach-tegra/board-harmony.c |
3 | * | 3 | * |
4 | * Copyright (C) 2010 Google, Inc. | 4 | * Copyright (C) 2010 Google, Inc. |
5 | * Copyright (C) 2011 NVIDIA, Inc. | ||
5 | * | 6 | * |
6 | * This software is licensed under the terms of the GNU General Public | 7 | * This software is licensed under the terms of the GNU General Public |
7 | * License version 2, as published by the Free Software Foundation, and | 8 | * License version 2, as published by the Free Software Foundation, and |
@@ -22,12 +23,14 @@ | |||
22 | #include <linux/dma-mapping.h> | 23 | #include <linux/dma-mapping.h> |
23 | #include <linux/pda_power.h> | 24 | #include <linux/pda_power.h> |
24 | #include <linux/io.h> | 25 | #include <linux/io.h> |
26 | #include <linux/gpio.h> | ||
25 | 27 | ||
26 | #include <asm/mach-types.h> | 28 | #include <asm/mach-types.h> |
27 | #include <asm/mach/arch.h> | 29 | #include <asm/mach/arch.h> |
28 | #include <asm/mach/time.h> | 30 | #include <asm/mach/time.h> |
29 | #include <asm/setup.h> | 31 | #include <asm/setup.h> |
30 | 32 | ||
33 | #include <mach/harmony_audio.h> | ||
31 | #include <mach/iomap.h> | 34 | #include <mach/iomap.h> |
32 | #include <mach/irqs.h> | 35 | #include <mach/irqs.h> |
33 | #include <mach/sdhci.h> | 36 | #include <mach/sdhci.h> |
@@ -60,11 +63,30 @@ static struct platform_device debug_uart = { | |||
60 | }, | 63 | }, |
61 | }; | 64 | }; |
62 | 65 | ||
66 | static struct harmony_audio_platform_data harmony_audio_pdata = { | ||
67 | .gpio_spkr_en = TEGRA_GPIO_SPKR_EN, | ||
68 | .gpio_hp_det = TEGRA_GPIO_HP_DET, | ||
69 | .gpio_int_mic_en = TEGRA_GPIO_INT_MIC_EN, | ||
70 | .gpio_ext_mic_en = TEGRA_GPIO_EXT_MIC_EN, | ||
71 | }; | ||
72 | |||
73 | static struct platform_device harmony_audio_device = { | ||
74 | .name = "tegra-snd-harmony", | ||
75 | .id = 0, | ||
76 | .dev = { | ||
77 | .platform_data = &harmony_audio_pdata, | ||
78 | }, | ||
79 | }; | ||
80 | |||
63 | static struct platform_device *harmony_devices[] __initdata = { | 81 | static struct platform_device *harmony_devices[] __initdata = { |
64 | &debug_uart, | 82 | &debug_uart, |
65 | &tegra_sdhci_device1, | 83 | &tegra_sdhci_device1, |
66 | &tegra_sdhci_device2, | 84 | &tegra_sdhci_device2, |
67 | &tegra_sdhci_device4, | 85 | &tegra_sdhci_device4, |
86 | &tegra_i2s_device1, | ||
87 | &tegra_das_device, | ||
88 | &tegra_pcm_device, | ||
89 | &harmony_audio_device, | ||
68 | }; | 90 | }; |
69 | 91 | ||
70 | static void __init tegra_harmony_fixup(struct machine_desc *desc, | 92 | static void __init tegra_harmony_fixup(struct machine_desc *desc, |
@@ -80,6 +102,10 @@ static void __init tegra_harmony_fixup(struct machine_desc *desc, | |||
80 | static __initdata struct tegra_clk_init_table harmony_clk_init_table[] = { | 102 | static __initdata struct tegra_clk_init_table harmony_clk_init_table[] = { |
81 | /* name parent rate enabled */ | 103 | /* name parent rate enabled */ |
82 | { "uartd", "pll_p", 216000000, true }, | 104 | { "uartd", "pll_p", 216000000, true }, |
105 | { "pll_a", "pll_p_out1", 56448000, true }, | ||
106 | { "pll_a_out0", "pll_a", 11289600, true }, | ||
107 | { "cdev1", NULL, 0, true }, | ||
108 | { "i2s1", "pll_a_out0", 11289600, false}, | ||
83 | { NULL, NULL, 0, 0}, | 109 | { NULL, NULL, 0, 0}, |
84 | }; | 110 | }; |
85 | 111 | ||
diff --git a/arch/arm/mach-tegra/board-harmony.h b/arch/arm/mach-tegra/board-harmony.h index 4fe33b8daa9d..9243521a1d19 100644 --- a/arch/arm/mach-tegra/board-harmony.h +++ b/arch/arm/mach-tegra/board-harmony.h | |||
@@ -17,12 +17,19 @@ | |||
17 | #ifndef _MACH_TEGRA_BOARD_HARMONY_H | 17 | #ifndef _MACH_TEGRA_BOARD_HARMONY_H |
18 | #define _MACH_TEGRA_BOARD_HARMONY_H | 18 | #define _MACH_TEGRA_BOARD_HARMONY_H |
19 | 19 | ||
20 | #define HARMONY_GPIO_WM8903(_x_) (TEGRA_NR_GPIOS + (_x_)) | ||
21 | |||
20 | #define TEGRA_GPIO_SD2_CD TEGRA_GPIO_PI5 | 22 | #define TEGRA_GPIO_SD2_CD TEGRA_GPIO_PI5 |
21 | #define TEGRA_GPIO_SD2_WP TEGRA_GPIO_PH1 | 23 | #define TEGRA_GPIO_SD2_WP TEGRA_GPIO_PH1 |
22 | #define TEGRA_GPIO_SD2_POWER TEGRA_GPIO_PT3 | 24 | #define TEGRA_GPIO_SD2_POWER TEGRA_GPIO_PT3 |
23 | #define TEGRA_GPIO_SD4_CD TEGRA_GPIO_PH2 | 25 | #define TEGRA_GPIO_SD4_CD TEGRA_GPIO_PH2 |
24 | #define TEGRA_GPIO_SD4_WP TEGRA_GPIO_PH3 | 26 | #define TEGRA_GPIO_SD4_WP TEGRA_GPIO_PH3 |
25 | #define TEGRA_GPIO_SD4_POWER TEGRA_GPIO_PI6 | 27 | #define TEGRA_GPIO_SD4_POWER TEGRA_GPIO_PI6 |
28 | #define TEGRA_GPIO_CDC_IRQ TEGRA_GPIO_PX3 | ||
29 | #define TEGRA_GPIO_SPKR_EN HARMONY_GPIO_WM8903(2) | ||
30 | #define TEGRA_GPIO_HP_DET TEGRA_GPIO_PW2 | ||
31 | #define TEGRA_GPIO_INT_MIC_EN TEGRA_GPIO_PX0 | ||
32 | #define TEGRA_GPIO_EXT_MIC_EN TEGRA_GPIO_PX1 | ||
26 | 33 | ||
27 | void harmony_pinmux_init(void); | 34 | void harmony_pinmux_init(void); |
28 | 35 | ||