[alsa-devel] Applied "ASoC: samsung: spdif: move .suspend/.resume to component" to the asoc tree
Mark Brown
broonie at kernel.org
Tue Jan 21 18:28:39 CET 2020
The patch
ASoC: samsung: spdif: move .suspend/.resume to component
has been applied to the asoc tree at
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-5.6
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
>From 79a5cf90f8719c3f69a0dc53efebb38da654512f Mon Sep 17 00:00:00 2001
From: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
Date: Mon, 20 Jan 2020 10:04:13 +0900
Subject: [PATCH] ASoC: samsung: spdif: 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.
This patch moves DAI driver .suspend/.resume to Component driver
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx at renesas.com>
Link: https://lore.kernel.org/r/874kwrym42.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Mark Brown <broonie at kernel.org>
---
sound/soc/samsung/spdif.c | 18 ++++++++++++------
1 file changed, 12 insertions(+), 6 deletions(-)
diff --git a/sound/soc/samsung/spdif.c b/sound/soc/samsung/spdif.c
index 805c57986e0b..1a9f08a50394 100644
--- a/sound/soc/samsung/spdif.c
+++ b/sound/soc/samsung/spdif.c
@@ -91,6 +91,12 @@ struct samsung_spdif_info {
static struct snd_dmaengine_dai_dma_data spdif_stereo_out;
static struct samsung_spdif_info spdif_info;
+static inline struct samsung_spdif_info
+*component_to_info(struct snd_soc_component *component)
+{
+ return snd_soc_component_get_drvdata(component);
+}
+
static inline struct samsung_spdif_info *to_info(struct snd_soc_dai *cpu_dai)
{
return snd_soc_dai_get_drvdata(cpu_dai);
@@ -290,9 +296,9 @@ static void spdif_shutdown(struct snd_pcm_substream *substream,
}
#ifdef CONFIG_PM
-static int spdif_suspend(struct snd_soc_dai *cpu_dai)
+static int spdif_suspend(struct snd_soc_component *component)
{
- struct samsung_spdif_info *spdif = to_info(cpu_dai);
+ struct samsung_spdif_info *spdif = component_to_info(component);
u32 con = spdif->saved_con;
dev_dbg(spdif->dev, "Entered %s\n", __func__);
@@ -307,9 +313,9 @@ static int spdif_suspend(struct snd_soc_dai *cpu_dai)
return 0;
}
-static int spdif_resume(struct snd_soc_dai *cpu_dai)
+static int spdif_resume(struct snd_soc_component *component)
{
- struct samsung_spdif_info *spdif = to_info(cpu_dai);
+ struct samsung_spdif_info *spdif = component_to_info(component);
dev_dbg(spdif->dev, "Entered %s\n", __func__);
@@ -343,12 +349,12 @@ static struct snd_soc_dai_driver samsung_spdif_dai = {
SNDRV_PCM_RATE_96000),
.formats = SNDRV_PCM_FMTBIT_S16_LE, },
.ops = &spdif_dai_ops,
- .suspend = spdif_suspend,
- .resume = spdif_resume,
};
static const struct snd_soc_component_driver samsung_spdif_component = {
.name = "samsung-spdif",
+ .suspend = spdif_suspend,
+ .resume = spdif_resume,
};
static int spdif_probe(struct platform_device *pdev)
--
2.20.1
More information about the Alsa-devel
mailing list