Skip to content

Commit 0b1c899

Browse files
morimotobroonie
authored andcommitted
ASoC: pxa: pxa2xx-i2s: move .suspend/.resume to component
There is no big difference at implementation for .suspend/.resume between DAI driver and Component driver. But because some driver is using DAI version, thus ALSA SoC needs to keep supporting it, hence, framework becoming verbose. If we can switch all DAI driver .suspend/.resume to Component driver, we can remove verbose code from ALSA SoC. Driver is getting its private data via dai->dev. But dai->dev and component->dev are same dev, thus, we can convert these. For same reason, we can convert dai->active to component->active if necessary. Signed-off-by: Kuninori Morimoto <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Mark Brown <[email protected]>
1 parent 2c55f0b commit 0b1c899

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

sound/soc/pxa/pxa2xx-i2s.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ static void pxa2xx_i2s_shutdown(struct snd_pcm_substream *substream,
261261
}
262262

263263
#ifdef CONFIG_PM
264-
static int pxa2xx_i2s_suspend(struct snd_soc_dai *dai)
264+
static int pxa2xx_soc_pcm_suspend(struct snd_soc_component *component)
265265
{
266266
/* store registers */
267267
pxa_i2s.sacr0 = SACR0;
@@ -275,7 +275,7 @@ static int pxa2xx_i2s_suspend(struct snd_soc_dai *dai)
275275
return 0;
276276
}
277277

278-
static int pxa2xx_i2s_resume(struct snd_soc_dai *dai)
278+
static int pxa2xx_soc_pcm_resume(struct snd_soc_component *component)
279279
{
280280
pxa_i2s_wait();
281281

@@ -290,8 +290,8 @@ static int pxa2xx_i2s_resume(struct snd_soc_dai *dai)
290290
}
291291

292292
#else
293-
#define pxa2xx_i2s_suspend NULL
294-
#define pxa2xx_i2s_resume NULL
293+
#define pxa2xx_soc_pcm_suspend NULL
294+
#define pxa2xx_soc_pcm_resume NULL
295295
#endif
296296

297297
static int pxa2xx_i2s_probe(struct snd_soc_dai *dai)
@@ -342,8 +342,6 @@ static const struct snd_soc_dai_ops pxa_i2s_dai_ops = {
342342
static struct snd_soc_dai_driver pxa_i2s_dai = {
343343
.probe = pxa2xx_i2s_probe,
344344
.remove = pxa2xx_i2s_remove,
345-
.suspend = pxa2xx_i2s_suspend,
346-
.resume = pxa2xx_i2s_resume,
347345
.playback = {
348346
.channels_min = 2,
349347
.channels_max = 2,
@@ -370,6 +368,8 @@ static const struct snd_soc_component_driver pxa_i2s_component = {
370368
.trigger = pxa2xx_soc_pcm_trigger,
371369
.pointer = pxa2xx_soc_pcm_pointer,
372370
.mmap = pxa2xx_soc_pcm_mmap,
371+
.suspend = pxa2xx_soc_pcm_suspend,
372+
.resume = pxa2xx_soc_pcm_resume,
373373
};
374374

375375
static int pxa2xx_i2s_drv_probe(struct platform_device *pdev)

0 commit comments

Comments
 (0)