struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
struct imx_pcm_runtime_data *iprtd = substream->runtime->private_data;
+ if (!cpu_dai->active)
+ hw_state.hw = 0;
+}
+
+static int imx_3stack_surround_hw_free(struct snd_pcm_substream *substream)
+{
+ struct imx_pcm_runtime_data *iprtd = substream->runtime->private_data;
+
if (iprtd->asrc_enable) {
if (iprtd->asrc_index != -1) {
asrc_release_pair(iprtd->asrc_index);
iprtd->asrc_index = -1;
}
- if (!cpu_dai->active)
- hw_state.hw = 0;
+ return 0;
}
-
static int imx_3stack_surround_hw_params(struct snd_pcm_substream *substream,
struct snd_pcm_hw_params *params)
{
unsigned int lrclk_ratio = 0;
int err = 0;
- if (hw_state.hw)
- return 0;
- hw_state.hw = 1;
-
if (iprtd->asrc_enable) {
err = config_asrc(substream, params);
if (err < 0)
return err;
rate = iprtd->p2p->p2p_rate;
}
+
+ if (hw_state.hw)
+ return 0;
+ hw_state.hw = 1;
+
if (cpu_is_mx53() || machine_is_mx6q_sabreauto()) {
switch (rate) {
case 32000:
.startup = imx_3stack_startup,
.shutdown = imx_3stack_shutdown,
.hw_params = imx_3stack_surround_hw_params,
+ .hw_free = imx_3stack_surround_hw_free,
};
static const struct snd_soc_dapm_widget imx_3stack_dapm_widgets[] = {