diff options
author | Todd Poynor <toddpoynor@google.com> | 2012-01-18 15:05:06 -0800 |
---|---|---|
committer | Todd Poynor <toddpoynor@google.com> | 2012-01-18 15:05:06 -0800 |
commit | 7b85fb28edcd86cde9a265c763ada1b2be366f55 (patch) | |
tree | c1e3a86e7b67e91b404e4d893146d4652d29fcab /sound/soc | |
parent | 8f88cb4cab5eeab21c14360e54ea5a29e4e8efed (diff) | |
parent | 817c7dd8532bb5129550f912bd82a14bd088b362 (diff) | |
download | kernel_samsung_tuna-7b85fb28edcd86cde9a265c763ada1b2be366f55.zip kernel_samsung_tuna-7b85fb28edcd86cde9a265c763ada1b2be366f55.tar.gz kernel_samsung_tuna-7b85fb28edcd86cde9a265c763ada1b2be366f55.tar.bz2 |
Merge branch 'linux-omap-3.0' into android-omap-3.0
Conflicts:
arch/arm/mach-omap2/Kconfig
Change-Id: I43e69654c80590b971018903ae00fc7fa2ea5cc7
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/soc-dsp.c | 80 |
1 files changed, 38 insertions, 42 deletions
diff --git a/sound/soc/soc-dsp.c b/sound/soc/soc-dsp.c index 40e459a..c04b24a 100644 --- a/sound/soc/soc-dsp.c +++ b/sound/soc/soc-dsp.c @@ -1103,31 +1103,31 @@ disconnect: if (be->dsp[stream].state != SND_SOC_DSP_STATE_START) dsp_params->state = SND_SOC_DSP_LINK_STATE_FREE; } - be_disconnect(fe, stream); + return ret; } -static int dsp_run_update(struct snd_soc_pcm_runtime *fe, int stream, - int start, int stop) +static int dsp_run_new_update(struct snd_soc_pcm_runtime *fe, int stream) { - int ret = 0; + int ret; fe->dsp[stream].runtime_update = SND_SOC_DSP_UPDATE_BE; + ret = dsp_run_update_startup(fe, stream); + if (ret < 0) + dev_err(&fe->dev, "failed to startup some BEs\n"); + fe->dsp[stream].runtime_update = SND_SOC_DSP_UPDATE_NO; - /* startup any new BEs */ - if (start) { - ret = dsp_run_update_startup(fe, stream); - if (ret < 0) - dev_err(&fe->dev, "failed to startup BEs\n"); - } + return ret; +} - /* close down old BEs */ - if (stop) { - ret = dsp_run_update_shutdown(fe, stream); - if (ret < 0) - dev_err(&fe->dev, "failed to shutdown BEs\n"); - } +static int dsp_run_old_update(struct snd_soc_pcm_runtime *fe, int stream) +{ + int ret; + fe->dsp[stream].runtime_update = SND_SOC_DSP_UPDATE_BE; + ret = dsp_run_update_shutdown(fe, stream); + if (ret < 0) + dev_err(&fe->dev, "failed to shutdown some BEs\n"); fe->dsp[stream].runtime_update = SND_SOC_DSP_UPDATE_NO; return ret; @@ -1167,44 +1167,40 @@ int soc_dsp_runtime_update(struct snd_soc_dapm_widget *widget) if (!fe->cpu_dai->driver->playback.channels_min) goto capture; - /* update any playback paths */ + /* update new playback paths */ start = dsp_add_new_paths(fe, SNDRV_PCM_STREAM_PLAYBACK, 1); - stop = dsp_prune_old_paths(fe, SNDRV_PCM_STREAM_PLAYBACK, 1); - if (!(start || stop)) - goto capture; - - /* run PCM ops on new/old playback paths */ - ret = dsp_run_update(fe, SNDRV_PCM_STREAM_PLAYBACK, start, stop); - if (ret < 0) { - dev_err(&fe->dev, "failed to update playback FE stream %s\n", - fe->dai_link->stream_name); + if (start) { + dsp_run_new_update(fe, SNDRV_PCM_STREAM_PLAYBACK); + fe_clear_pending(fe, SNDRV_PCM_STREAM_PLAYBACK); } - /* free old playback links */ - be_disconnect(fe, SNDRV_PCM_STREAM_PLAYBACK); - fe_clear_pending(fe, SNDRV_PCM_STREAM_PLAYBACK); + /* update old playback paths */ + stop = dsp_prune_old_paths(fe, SNDRV_PCM_STREAM_PLAYBACK, 1); + if (stop) { + dsp_run_old_update(fe, SNDRV_PCM_STREAM_PLAYBACK); + fe_clear_pending(fe, SNDRV_PCM_STREAM_PLAYBACK); + be_disconnect(fe, SNDRV_PCM_STREAM_PLAYBACK); + } capture: /* skip if FE doesn't have capture capability */ if (!fe->cpu_dai->driver->capture.channels_min) continue; - /* update any capture paths */ + /* update new capture paths */ start = dsp_add_new_paths(fe, SNDRV_PCM_STREAM_CAPTURE, 1); - stop = dsp_prune_old_paths(fe, SNDRV_PCM_STREAM_CAPTURE, 1); - if (!(start || stop)) - continue; - - /* run PCM ops on new/old capture paths */ - ret = dsp_run_update(fe, SNDRV_PCM_STREAM_CAPTURE, start, stop); - if (ret < 0) { - dev_err(&fe->dev, "failed to update capture FE stream %s\n", - fe->dai_link->stream_name); + if (start) { + dsp_run_new_update(fe, SNDRV_PCM_STREAM_CAPTURE); + fe_clear_pending(fe, SNDRV_PCM_STREAM_CAPTURE); } - /* free old capture links */ - be_disconnect(fe, SNDRV_PCM_STREAM_CAPTURE); - fe_clear_pending(fe, SNDRV_PCM_STREAM_CAPTURE); + /* update old capture paths */ + stop = dsp_prune_old_paths(fe, SNDRV_PCM_STREAM_CAPTURE, 1); + if (stop) { + dsp_run_old_update(fe, SNDRV_PCM_STREAM_CAPTURE); + fe_clear_pending(fe, SNDRV_PCM_STREAM_CAPTURE); + be_disconnect(fe, SNDRV_PCM_STREAM_CAPTURE); + } } mutex_unlock(&widget->dapm->card->dsp_mutex); |