Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9d58a077 authored by Richard Fitzgerald's avatar Richard Fitzgerald Committed by Mark Brown
Browse files

ASoC: core: init delayed_work for codec-codec links



We must init the delayed_work for codec-codec links
otherwise shutting down the DAI chain will fault when
calling flush_delayed_work_sync() on the linked DAI.

Signed-off-by: default avatarRichard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: default avatarMark Brown <broonie@linaro.org>
parent 5f6e7d52
Loading
Loading
Loading
Loading
+12 −0
Original line number Original line Diff line number Diff line
@@ -530,6 +530,15 @@ static int soc_ac97_dev_register(struct snd_soc_codec *codec)
}
}
#endif
#endif


static void codec2codec_close_delayed_work(struct work_struct *work)
{
	/* Currently nothing to do for c2c links
	 * Since c2c links are internal nodes in the DAPM graph and
	 * don't interface with the outside world or application layer
	 * we don't have to do any special handling on close.
	 */
}

#ifdef CONFIG_PM_SLEEP
#ifdef CONFIG_PM_SLEEP
/* powers down audio subsystem for suspend */
/* powers down audio subsystem for suspend */
int snd_soc_suspend(struct device *dev)
int snd_soc_suspend(struct device *dev)
@@ -1428,6 +1437,9 @@ static int soc_probe_link_dais(struct snd_soc_card *card, int num, int order)
				return ret;
				return ret;
			}
			}
		} else {
		} else {
			INIT_DELAYED_WORK(&rtd->delayed_work,
						codec2codec_close_delayed_work);

			/* link the DAI widgets */
			/* link the DAI widgets */
			play_w = codec_dai->playback_widget;
			play_w = codec_dai->playback_widget;
			capture_w = cpu_dai->capture_widget;
			capture_w = cpu_dai->capture_widget;