Skip to content

Commit 450312b

Browse files
morimotobroonie
authored andcommitted
ASoC: soc-core: remove DAI suspend/resume
Historically, CPU and Codec were implemented different, but now it is merged as Component. ALSA SoC is supporting suspend/resume at DAI and Component level. The method is like below. 1) Suspend/Resume all CPU DAI if bus-control was 0 2) Suspend/Resume all Component 3) Suspend/Resume all CPU DAI if bus-control was 1 Historically 2) was Codec special operation. Because CPU and Codec were merged into Component, CPU suspend/resume has 3 chance to suspend(= 1/2/3), but Codec suspend/resume has 1 chance (= 2). Here, DAI side suspend/resume is caring bus-control, but no driver which is supporting suspend/resume is setting bus-control. This means 3) was never used. Here, used parameter for suspend/resume component->dev and dai->dev are same pointer. For that reason, we can merge DAI and Component suspend/resume. One note is that we should use 2), because it is caring BIAS level. This patch removes 1) and 3). Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 0b1c899 commit 450312b

File tree

3 files changed

+0
-55
lines changed

3 files changed

+0
-55
lines changed

include/sound/soc-dai.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,6 @@ struct snd_soc_dai_driver {
286286
/* DAI driver callbacks */
287287
int (*probe)(struct snd_soc_dai *dai);
288288
int (*remove)(struct snd_soc_dai *dai);
289-
int (*suspend)(struct snd_soc_dai *dai);
290-
int (*resume)(struct snd_soc_dai *dai);
291289
/* compress dai */
292290
int (*compress_new)(struct snd_soc_pcm_runtime *rtd, int num);
293291
/* Optional Callback used at pcm creation*/

sound/soc/soc-core.c

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -558,16 +558,6 @@ int snd_soc_suspend(struct device *dev)
558558
if (card->suspend_pre)
559559
card->suspend_pre(card);
560560

561-
for_each_card_rtds(card, rtd) {
562-
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
563-
564-
if (rtd->dai_link->ignore_suspend)
565-
continue;
566-
567-
if (!cpu_dai->driver->bus_control)
568-
snd_soc_dai_suspend(cpu_dai);
569-
}
570-
571561
/* close any waiting streams */
572562
snd_soc_flush_all_delayed_work(card);
573563

@@ -639,16 +629,6 @@ int snd_soc_suspend(struct device *dev)
639629
}
640630
}
641631

642-
for_each_card_rtds(card, rtd) {
643-
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
644-
645-
if (rtd->dai_link->ignore_suspend)
646-
continue;
647-
648-
if (cpu_dai->driver->bus_control)
649-
snd_soc_dai_suspend(cpu_dai);
650-
}
651-
652632
if (card->suspend_post)
653633
card->suspend_post(card);
654634

@@ -682,17 +662,6 @@ static void soc_resume_deferred(struct work_struct *work)
682662
if (card->resume_pre)
683663
card->resume_pre(card);
684664

685-
/* resume control bus DAIs */
686-
for_each_card_rtds(card, rtd) {
687-
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
688-
689-
if (rtd->dai_link->ignore_suspend)
690-
continue;
691-
692-
if (cpu_dai->driver->bus_control)
693-
snd_soc_dai_resume(cpu_dai);
694-
}
695-
696665
for_each_card_components(card, component) {
697666
if (snd_soc_component_is_suspended(component))
698667
snd_soc_component_resume(component);
@@ -726,16 +695,6 @@ static void soc_resume_deferred(struct work_struct *work)
726695
}
727696
}
728697

729-
for_each_card_rtds(card, rtd) {
730-
struct snd_soc_dai *cpu_dai = rtd->cpu_dai;
731-
732-
if (rtd->dai_link->ignore_suspend)
733-
continue;
734-
735-
if (!cpu_dai->driver->bus_control)
736-
snd_soc_dai_resume(cpu_dai);
737-
}
738-
739698
if (card->resume_post)
740699
card->resume_post(card);
741700

sound/soc/soc-dai.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -354,18 +354,6 @@ snd_pcm_sframes_t snd_soc_dai_delay(struct snd_soc_dai *dai,
354354
return delay;
355355
}
356356

357-
void snd_soc_dai_suspend(struct snd_soc_dai *dai)
358-
{
359-
if (dai->driver->suspend)
360-
dai->driver->suspend(dai);
361-
}
362-
363-
void snd_soc_dai_resume(struct snd_soc_dai *dai)
364-
{
365-
if (dai->driver->resume)
366-
dai->driver->resume(dai);
367-
}
368-
369357
int snd_soc_dai_probe(struct snd_soc_dai *dai)
370358
{
371359
if (dai->driver->probe)

0 commit comments

Comments
 (0)