All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
To: Mark Brown <broonie@kernel.org>
Cc: Linux-ALSA <alsa-devel@alsa-project.org>
Subject: [alsa-devel] [PATCH v2 04/17] ASoC: jz4740: jz4740-i2s: move .suspend/.resume to component
Date: 20 Jan 2020 10:03:56 +0900	[thread overview]
Message-ID: <878sm3ym4j.wl-kuninori.morimoto.gx@renesas.com> (raw)
In-Reply-To: <87eevvym6s.wl-kuninori.morimoto.gx@renesas.com>

From: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

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@renesas.com>
---
 sound/soc/jz4740/jz4740-i2s.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/sound/soc/jz4740/jz4740-i2s.c b/sound/soc/jz4740/jz4740-i2s.c
index 38d48d1..9d54058 100644
--- a/sound/soc/jz4740/jz4740-i2s.c
+++ b/sound/soc/jz4740/jz4740-i2s.c
@@ -324,12 +324,12 @@ static int jz4740_i2s_set_sysclk(struct snd_soc_dai *dai, int clk_id,
 	return ret;
 }
 
-static int jz4740_i2s_suspend(struct snd_soc_dai *dai)
+static int jz4740_i2s_suspend(struct snd_soc_component *component)
 {
-	struct jz4740_i2s *i2s = snd_soc_dai_get_drvdata(dai);
+	struct jz4740_i2s *i2s = snd_soc_component_get_drvdata(component);
 	uint32_t conf;
 
-	if (dai->active) {
+	if (component->active) {
 		conf = jz4740_i2s_read(i2s, JZ_REG_AIC_CONF);
 		conf &= ~JZ_AIC_CONF_ENABLE;
 		jz4740_i2s_write(i2s, JZ_REG_AIC_CONF, conf);
@@ -342,9 +342,9 @@ static int jz4740_i2s_suspend(struct snd_soc_dai *dai)
 	return 0;
 }
 
-static int jz4740_i2s_resume(struct snd_soc_dai *dai)
+static int jz4740_i2s_resume(struct snd_soc_component *component)
 {
-	struct jz4740_i2s *i2s = snd_soc_dai_get_drvdata(dai);
+	struct jz4740_i2s *i2s = snd_soc_component_get_drvdata(component);
 	uint32_t conf;
 	int ret;
 
@@ -352,7 +352,7 @@ static int jz4740_i2s_resume(struct snd_soc_dai *dai)
 	if (ret)
 		return ret;
 
-	if (dai->active) {
+	if (component->active) {
 		ret = clk_prepare_enable(i2s->clk_i2s);
 		if (ret) {
 			clk_disable_unprepare(i2s->clk_aic);
@@ -455,8 +455,6 @@ static struct snd_soc_dai_driver jz4740_i2s_dai = {
 	},
 	.symmetric_rates = 1,
 	.ops = &jz4740_i2s_dai_ops,
-	.suspend = jz4740_i2s_suspend,
-	.resume = jz4740_i2s_resume,
 };
 
 static struct snd_soc_dai_driver jz4780_i2s_dai = {
@@ -475,12 +473,12 @@ static struct snd_soc_dai_driver jz4780_i2s_dai = {
 		.formats = JZ4740_I2S_FMTS,
 	},
 	.ops = &jz4740_i2s_dai_ops,
-	.suspend = jz4740_i2s_suspend,
-	.resume = jz4740_i2s_resume,
 };
 
 static const struct snd_soc_component_driver jz4740_i2s_component = {
 	.name		= "jz4740-i2s",
+	.suspend	= jz4740_i2s_suspend,
+	.resume		= jz4740_i2s_resume,
 };
 
 #ifdef CONFIG_OF
-- 
2.7.4

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/alsa-devel

  parent reply	other threads:[~2020-01-20  1:07 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-20  1:02 [alsa-devel] [PATCH v2 00/17] ASoC: remove DAI suspend/resume Kuninori Morimoto
2020-01-20  1:03 ` [alsa-devel] [PATCH v2 01/17] ASoC: atmel: atmel_ssc_dai: move .suspend/.resume to component Kuninori Morimoto
2020-01-21 17:28   ` [alsa-devel] Applied "ASoC: atmel: atmel_ssc_dai: move .suspend/.resume to component" to the asoc tree Mark Brown
2020-01-20  1:03 ` [alsa-devel] [PATCH v2 02/17] ASoC: bcm: cygnus-ssp: move .suspend/.resume to component Kuninori Morimoto
2020-01-21 17:28   ` [alsa-devel] Applied "ASoC: bcm: cygnus-ssp: move .suspend/.resume to component" to the asoc tree Mark Brown
2020-01-20  1:03 ` [alsa-devel] [PATCH v2 03/17] ASoC: cirrus: ep93xx-i2s: move .suspend/.resume to component Kuninori Morimoto
2020-01-21 17:28   ` [alsa-devel] Applied "ASoC: cirrus: ep93xx-i2s: move .suspend/.resume to component" to the asoc tree Mark Brown
2020-01-20  1:03 ` Kuninori Morimoto [this message]
2020-01-21 17:28   ` [alsa-devel] Applied "ASoC: jz4740: jz4740-i2s: " Mark Brown
2020-01-20  1:04 ` [alsa-devel] [PATCH v2 05/17] ASoC: mediatek: move .suspend/.resume to component Kuninori Morimoto
2020-01-21 17:28   ` [alsa-devel] Applied "ASoC: mediatek: move .suspend/.resume to component" to the asoc tree Mark Brown
2020-01-20  1:04 ` [alsa-devel] [PATCH v2 06/17] ASoC: samsung: s3c24xx-i2s: move .suspend/.resume to component Kuninori Morimoto
2020-01-21 17:28   ` [alsa-devel] Applied "ASoC: samsung: s3c24xx-i2s: move .suspend/.resume to component" to the asoc tree Mark Brown
2020-01-20  1:04 ` [alsa-devel] [PATCH v2 07/17] ASoC: samsung: spdif: move .suspend/.resume to component Kuninori Morimoto
2020-01-21 17:28   ` [alsa-devel] Applied "ASoC: samsung: spdif: move .suspend/.resume to component" to the asoc tree Mark Brown
2020-01-20  1:04 ` [alsa-devel] [PATCH v2 08/17] ASoC: sti: sti_uniperif: move .suspend/.resume to component Kuninori Morimoto
2020-01-21 17:28   ` [alsa-devel] Applied "ASoC: sti: sti_uniperif: move .suspend/.resume to component" to the asoc tree Mark Brown
2020-01-20  1:04 ` [alsa-devel] [PATCH v2 09/17] ASoC: ti: omap-mcpdm: move .suspend/.resume to component Kuninori Morimoto
2020-01-20  8:26   ` Peter Ujfalusi
2020-01-21 17:28   ` [alsa-devel] Applied "ASoC: ti: omap-mcpdm: move .suspend/.resume to component" to the asoc tree Mark Brown
2020-01-20  1:04 ` [alsa-devel] [PATCH v2 10/17] ASoC: uniphier: move .suspend/.resume to component Kuninori Morimoto
2020-01-21 17:28   ` [alsa-devel] Applied "ASoC: uniphier: move .suspend/.resume to component" to the asoc tree Mark Brown
2020-01-20  1:04 ` [alsa-devel] [PATCH v2 11/17] ASoC: dwc: dwc-i2s: move .suspend/.resume to component Kuninori Morimoto
2020-01-21 17:28   ` [alsa-devel] Applied "ASoC: dwc: dwc-i2s: move .suspend/.resume to component" to the asoc tree Mark Brown
2020-01-20  1:04 ` [alsa-devel] [PATCH v2 12/17] ASoC: samsung: i2s: move .suspend/.resume to component Kuninori Morimoto
2020-01-21 17:28   ` [alsa-devel] Applied "ASoC: samsung: i2s: move .suspend/.resume to component" to the asoc tree Mark Brown
2020-01-20  1:04 ` [alsa-devel] [PATCH v2 13/17] ASoC: ux500: ux500_msp_dai: remove unused DAI .suspend/.resume Kuninori Morimoto
2020-01-21 17:28   ` [alsa-devel] Applied "ASoC: ux500: ux500_msp_dai: remove unused DAI .suspend/.resume" to the asoc tree Mark Brown
2020-01-20  1:04 ` [alsa-devel] [PATCH v2 14/17] ASoC: pxa: pxa-ssp: move .suspend/.resume to component Kuninori Morimoto
2020-01-21 17:28   ` [alsa-devel] Applied "ASoC: pxa: pxa-ssp: move .suspend/.resume to component" to the asoc tree Mark Brown
2020-01-20  1:04 ` [alsa-devel] [PATCH v2 15/17] ASoC: pxa: pxa2xx-i2s: move .suspend/.resume to component Kuninori Morimoto
2020-01-21 17:28   ` [alsa-devel] Applied "ASoC: pxa: pxa2xx-i2s: move .suspend/.resume to component" to the asoc tree Mark Brown
2020-01-20  1:05 ` [alsa-devel] [PATCH v2 16/17] ASoC: soc-core: remove DAI suspend/resume Kuninori Morimoto
2020-01-21 17:28   ` [alsa-devel] Applied "ASoC: soc-core: remove DAI suspend/resume" to the asoc tree Mark Brown
2020-01-20  1:05 ` [alsa-devel] [PATCH v2 17/17] ASoC: soc-core: remove bus_control Kuninori Morimoto
2020-01-21 17:28   ` [alsa-devel] Applied "ASoC: soc-core: remove bus_control" to the asoc tree Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878sm3ym4j.wl-kuninori.morimoto.gx@renesas.com \
    --to=kuninori.morimoto.gx@renesas.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.