Skip to content

Commit c7b50d2

Browse files
fredoh9plbossart
authored andcommitted
ASoC: intel: cml_rt1011_rt5682: move disabling jack to dai link's exit()
Move disabling jack from platform driver's remove() to dai link's exit(). This is symmetrical change as jack is enabled in init(). Signed-off-by: Fred Oh <fred.oh@linux.intel.com>
1 parent 5cf55bc commit c7b50d2

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

sound/soc/intel/boards/cml_rt1011_rt5682.c

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@ static int cml_rt5682_codec_init(struct snd_soc_pcm_runtime *rtd)
160160
return ret;
161161
};
162162

163+
static void cml_rt5682_codec_exit(struct snd_soc_pcm_runtime *rtd)
164+
{
165+
struct snd_soc_component *component = asoc_rtd_to_codec(rtd, 0)->component;
166+
167+
snd_soc_component_set_jack(component, NULL, NULL);
168+
}
169+
163170
static int cml_rt1011_spk_init(struct snd_soc_pcm_runtime *rtd)
164171
{
165172
int ret = 0;
@@ -421,6 +428,7 @@ static struct snd_soc_dai_link cml_rt1011_rt5682_dailink[] = {
421428
.name = "SSP0-Codec",
422429
.id = 0,
423430
.init = cml_rt5682_codec_init,
431+
.exit = cml_rt5682_codec_exit,
424432
.ignore_pmdown_time = 1,
425433
.ops = &cml_rt5682_ops,
426434
.dpcm_playback = 1,
@@ -568,24 +576,8 @@ static int snd_cml_rt1011_probe(struct platform_device *pdev)
568576
return devm_snd_soc_register_card(&pdev->dev, &snd_soc_card_cml);
569577
}
570578

571-
static int snd_cml_rt1011_remove(struct platform_device *pdev)
572-
{
573-
struct snd_soc_card *card = platform_get_drvdata(pdev);
574-
struct snd_soc_component *component;
575-
576-
for_each_card_components(card, component) {
577-
if (!strcmp(component->name, ssp0_codec[0].name)) {
578-
snd_soc_component_set_jack(component, NULL, NULL);
579-
break;
580-
}
581-
}
582-
583-
return 0;
584-
}
585-
586579
static struct platform_driver snd_cml_rt1011_rt5682_driver = {
587580
.probe = snd_cml_rt1011_probe,
588-
.remove = snd_cml_rt1011_remove,
589581
.driver = {
590582
.name = "cml_rt1011_rt5682",
591583
.pm = &snd_soc_pm_ops,

0 commit comments

Comments
 (0)