diff options
author | Stephen Warren <swarren@nvidia.com> | 2011-11-22 20:21:13 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2011-11-23 05:24:10 -0500 |
commit | 65713ce8442b42c6f688bd8b0950a49d8f4dcf5f (patch) | |
tree | 20d251c473ab523635cf8aa03f8f2ca00b12792e /sound | |
parent | f2296d7bf19a210a462a57bb90b1c9263d18a4ee (diff) |
ASoC: Tegra: Move DAS configuration into machine drivers
This removes potentially machine-specific routing knowledge from the
I2S driverinto the machine drivers, which is better equipped to know
what the appropriate routing configuration is.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/tegra/tegra_i2s.c | 18 | ||||
-rw-r--r-- | sound/soc/tegra/tegra_wm8903.c | 13 | ||||
-rw-r--r-- | sound/soc/tegra/trimslice.c | 15 |
3 files changed, 28 insertions, 18 deletions
diff --git a/sound/soc/tegra/tegra_i2s.c b/sound/soc/tegra/tegra_i2s.c index 6728fab8c411..33e62fcdfce3 100644 --- a/sound/soc/tegra/tegra_i2s.c +++ b/sound/soc/tegra/tegra_i2s.c | |||
@@ -42,7 +42,6 @@ | |||
42 | #include <sound/pcm_params.h> | 42 | #include <sound/pcm_params.h> |
43 | #include <sound/soc.h> | 43 | #include <sound/soc.h> |
44 | 44 | ||
45 | #include "tegra_das.h" | ||
46 | #include "tegra_i2s.h" | 45 | #include "tegra_i2s.h" |
47 | 46 | ||
48 | #define DRV_NAME "tegra-i2s" | 47 | #define DRV_NAME "tegra-i2s" |
@@ -363,23 +362,6 @@ static __devinit int tegra_i2s_platform_probe(struct platform_device *pdev) | |||
363 | return -EINVAL; | 362 | return -EINVAL; |
364 | } | 363 | } |
365 | 364 | ||
366 | /* | ||
367 | * FIXME: Until a codec driver exists for the tegra DAS, hard-code a | ||
368 | * 1:1 mapping between audio controllers and audio ports. | ||
369 | */ | ||
370 | ret = tegra_das_connect_dap_to_dac(TEGRA_DAS_DAP_ID_1 + pdev->id, | ||
371 | TEGRA_DAS_DAP_SEL_DAC1 + pdev->id); | ||
372 | if (ret) { | ||
373 | dev_err(&pdev->dev, "Can't set up DAP connection\n"); | ||
374 | return ret; | ||
375 | } | ||
376 | ret = tegra_das_connect_dac_to_dap(TEGRA_DAS_DAC_ID_1 + pdev->id, | ||
377 | TEGRA_DAS_DAC_SEL_DAP1 + pdev->id); | ||
378 | if (ret) { | ||
379 | dev_err(&pdev->dev, "Can't set up DAC connection\n"); | ||
380 | return ret; | ||
381 | } | ||
382 | |||
383 | i2s = kzalloc(sizeof(struct tegra_i2s), GFP_KERNEL); | 365 | i2s = kzalloc(sizeof(struct tegra_i2s), GFP_KERNEL); |
384 | if (!i2s) { | 366 | if (!i2s) { |
385 | dev_err(&pdev->dev, "Can't allocate tegra_i2s\n"); | 367 | dev_err(&pdev->dev, "Can't allocate tegra_i2s\n"); |
diff --git a/sound/soc/tegra/tegra_wm8903.c b/sound/soc/tegra/tegra_wm8903.c index a81cf39257bf..9b0ee1510935 100644 --- a/sound/soc/tegra/tegra_wm8903.c +++ b/sound/soc/tegra/tegra_wm8903.c | |||
@@ -249,6 +249,19 @@ static int tegra_wm8903_init(struct snd_soc_pcm_runtime *rtd) | |||
249 | struct tegra_wm8903_platform_data *pdata = machine->pdata; | 249 | struct tegra_wm8903_platform_data *pdata = machine->pdata; |
250 | int ret; | 250 | int ret; |
251 | 251 | ||
252 | ret = tegra_das_connect_dap_to_dac(TEGRA_DAS_DAP_ID_1, | ||
253 | TEGRA_DAS_DAP_SEL_DAC1); | ||
254 | if (ret) { | ||
255 | dev_err(card->dev, "Can't set up DAS DAP connection\n"); | ||
256 | return ret; | ||
257 | } | ||
258 | ret = tegra_das_connect_dac_to_dap(TEGRA_DAS_DAC_ID_1, | ||
259 | TEGRA_DAS_DAC_SEL_DAP1); | ||
260 | if (ret) { | ||
261 | dev_err(card->dev, "Can't set up DAS DAC connection\n"); | ||
262 | return ret; | ||
263 | } | ||
264 | |||
252 | if (gpio_is_valid(pdata->gpio_spkr_en)) { | 265 | if (gpio_is_valid(pdata->gpio_spkr_en)) { |
253 | ret = gpio_request(pdata->gpio_spkr_en, "spkr_en"); | 266 | ret = gpio_request(pdata->gpio_spkr_en, "spkr_en"); |
254 | if (ret) { | 267 | if (ret) { |
diff --git a/sound/soc/tegra/trimslice.c b/sound/soc/tegra/trimslice.c index b3a7efa6d960..2699a6fa45f9 100644 --- a/sound/soc/tegra/trimslice.c +++ b/sound/soc/tegra/trimslice.c | |||
@@ -118,7 +118,22 @@ static const struct snd_soc_dapm_route trimslice_audio_map[] = { | |||
118 | static int trimslice_asoc_init(struct snd_soc_pcm_runtime *rtd) | 118 | static int trimslice_asoc_init(struct snd_soc_pcm_runtime *rtd) |
119 | { | 119 | { |
120 | struct snd_soc_codec *codec = rtd->codec; | 120 | struct snd_soc_codec *codec = rtd->codec; |
121 | struct snd_soc_card *card = codec->card; | ||
121 | struct snd_soc_dapm_context *dapm = &codec->dapm; | 122 | struct snd_soc_dapm_context *dapm = &codec->dapm; |
123 | int ret; | ||
124 | |||
125 | ret = tegra_das_connect_dap_to_dac(TEGRA_DAS_DAP_ID_1, | ||
126 | TEGRA_DAS_DAP_SEL_DAC1); | ||
127 | if (ret) { | ||
128 | dev_err(card->dev, "Can't set up DAS DAP connection\n"); | ||
129 | return ret; | ||
130 | } | ||
131 | ret = tegra_das_connect_dac_to_dap(TEGRA_DAS_DAC_ID_1, | ||
132 | TEGRA_DAS_DAC_SEL_DAP1); | ||
133 | if (ret) { | ||
134 | dev_err(card->dev, "Can't set up DAS DAC connection\n"); | ||
135 | return ret; | ||
136 | } | ||
122 | 137 | ||
123 | snd_soc_dapm_nc_pin(dapm, "LHPOUT"); | 138 | snd_soc_dapm_nc_pin(dapm, "LHPOUT"); |
124 | snd_soc_dapm_nc_pin(dapm, "RHPOUT"); | 139 | snd_soc_dapm_nc_pin(dapm, "RHPOUT"); |