summaryrefslogtreecommitdiff
path: root/sound/soc/intel
diff options
context:
space:
mode:
authorFred Oh <fred.oh@linux.intel.com>2020-06-22 18:42:41 +0300
committerMark Brown <broonie@kernel.org>2020-06-23 14:25:41 +0300
commit4fcc922cb31179f9bc1e99cd707f2b36138fbcf8 (patch)
tree9c6f0d9c5fff27d2d513dca1e780108623331543 /sound/soc/intel
parentb0c96fc1ab2947e331f817cecc5ca733eaf5619b (diff)
downloadlinux-4fcc922cb31179f9bc1e99cd707f2b36138fbcf8.tar.xz
ASoC: intel: cml_rt1011_rt5682: disable jack in dailink .exit()
When removing the machine driver, the rt5682 jack handler will oops if jack detection is not disabled. The jack can be disabled in the dai link's exit(). This is symmetrical change as jack is enabled in init(). Signed-off-by: Fred Oh <fred.oh@linux.intel.com> Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Guennadi Liakhovetski <guennadi.liakhovetski@linux.intel.com> Link: https://lore.kernel.org/r/20200622154241.29053-6-pierre-louis.bossart@linux.intel.com Signed-off-by: Mark Brown <broonie@kernel.org>
Diffstat (limited to 'sound/soc/intel')
-rw-r--r--sound/soc/intel/boards/cml_rt1011_rt5682.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/sound/soc/intel/boards/cml_rt1011_rt5682.c b/sound/soc/intel/boards/cml_rt1011_rt5682.c
index 68eff29daf8f..189c908c4aa8 100644
--- a/sound/soc/intel/boards/cml_rt1011_rt5682.c
+++ b/sound/soc/intel/boards/cml_rt1011_rt5682.c
@@ -161,6 +161,13 @@ static int cml_rt5682_codec_init(struct snd_soc_pcm_runtime *rtd)
return ret;
};
+static void cml_rt5682_codec_exit(struct snd_soc_pcm_runtime *rtd)
+{
+ struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
+
+ snd_soc_component_set_jack(component, NULL, NULL);
+}
+
static int cml_rt1011_spk_init(struct snd_soc_pcm_runtime *rtd)
{
int ret = 0;
@@ -415,6 +422,7 @@ static struct snd_soc_dai_link cml_rt1011_rt5682_dailink[] = {
.name = "SSP0-Codec",
.id = 0,
.init = cml_rt5682_codec_init,
+ .exit = cml_rt5682_codec_exit,
.ignore_pmdown_time = 1,
.ops = &cml_rt5682_ops,
.dpcm_playback = 1,