alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: <broonie@kernel.org>
Cc: cezary.rojewski@intel.com, heiko@sntech.de,
	kuninori.morimoto.gx@renesas.com, alsa-devel@alsa-project.org,
	nicolas.ferre@microchip.com, srinivas.kandagatla@linaro.org,
	peter.ujfalusi@gmail.com,
	linux-stm32@st-md-mailman.stormreply.com, jbrunet@baylibre.com,
	pierre-louis.bossart@linux.intel.com, krzk@kernel.org,
	linux-rockchip@lists.infradead.org, linux-imx@nxp.com,
	linux-mips@vger.kernel.org, linux-sunxi@lists.linux.dev,
	linux-xtensa@linux-xtensa.org, nsaenz@kernel.org,
	linux-mediatek@lists.infradead.org, linux-tegra@vger.kernel.org,
	linux-amlogic@lists.infradead.org, linux-omap@vger.kernel.org,
	patches@opensource.cirrus.com, lgirdwood@gmail.com,
	daniel@zonque.org, kernel@pengutronix.de, shawnguo@kernel.org,
	jarkko.nikula@bitmer.com
Subject: [PATCH 03/56] ASoC: atmel: Update to use set_fmt_new callback
Date: Thu, 19 May 2022 16:42:25 +0100	[thread overview]
Message-ID: <20220519154318.2153729-4-ckeepax@opensource.cirrus.com> (raw)
In-Reply-To: <20220519154318.2153729-1-ckeepax@opensource.cirrus.com>

As part of updating the core to directly tell drivers if they are clock
provider or consumer update these CPU side drivers to use the new direct
callback.

Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com>
---
 sound/soc/atmel/atmel-i2s.c     |  6 +++---
 sound/soc/atmel/atmel_ssc_dai.c | 20 ++++++++++----------
 sound/soc/atmel/mchp-i2s-mcc.c  | 10 +++++-----
 sound/soc/atmel/mchp-pdmc.c     |  6 +++---
 4 files changed, 21 insertions(+), 21 deletions(-)

diff --git a/sound/soc/atmel/atmel-i2s.c b/sound/soc/atmel/atmel-i2s.c
index 1934767690b51..c5ce695da5866 100644
--- a/sound/soc/atmel/atmel-i2s.c
+++ b/sound/soc/atmel/atmel-i2s.c
@@ -343,7 +343,7 @@ static int atmel_i2s_hw_params(struct snd_pcm_substream *substream,
 	}
 
 	switch (dev->fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
-	case SND_SOC_DAIFMT_CBC_CFC:
+	case SND_SOC_DAIFMT_BP_FP:
 		/* codec is slave, so cpu is master */
 		mr |= ATMEL_I2SC_MR_MODE_MASTER;
 		ret = atmel_i2s_get_gck_param(dev, params_rate(params));
@@ -351,7 +351,7 @@ static int atmel_i2s_hw_params(struct snd_pcm_substream *substream,
 			return ret;
 		break;
 
-	case SND_SOC_DAIFMT_CBP_CFP:
+	case SND_SOC_DAIFMT_BC_FC:
 		/* codec is master, so cpu is slave */
 		mr |= ATMEL_I2SC_MR_MODE_SLAVE;
 		dev->gck_param = NULL;
@@ -533,7 +533,7 @@ static const struct snd_soc_dai_ops atmel_i2s_dai_ops = {
 	.prepare	= atmel_i2s_prepare,
 	.trigger	= atmel_i2s_trigger,
 	.hw_params	= atmel_i2s_hw_params,
-	.set_fmt	= atmel_i2s_set_dai_fmt,
+	.set_fmt_new	= atmel_i2s_set_dai_fmt,
 };
 
 static int atmel_i2s_dai_probe(struct snd_soc_dai *dai)
diff --git a/sound/soc/atmel/atmel_ssc_dai.c b/sound/soc/atmel/atmel_ssc_dai.c
index c1dea8d624164..da094762dc994 100644
--- a/sound/soc/atmel/atmel_ssc_dai.c
+++ b/sound/soc/atmel/atmel_ssc_dai.c
@@ -210,7 +210,7 @@ static int atmel_ssc_hw_rule_rate(struct snd_pcm_hw_params *params,
 		return frame_size;
 
 	switch (ssc_p->daifmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
-	case SND_SOC_DAIFMT_CBP_CFC:
+	case SND_SOC_DAIFMT_BC_FP:
 		if ((ssc_p->dir_mask & SSC_DIR_MASK_CAPTURE)
 		    && ssc->clk_from_rk_pin)
 			/* Receiver Frame Synchro (i.e. capture)
@@ -220,7 +220,7 @@ static int atmel_ssc_hw_rule_rate(struct snd_pcm_hw_params *params,
 			mck_div = 3;
 		break;
 
-	case SND_SOC_DAIFMT_CBP_CFP:
+	case SND_SOC_DAIFMT_BC_FC:
 		if ((ssc_p->dir_mask & SSC_DIR_MASK_PLAYBACK)
 		    && !ssc->clk_from_rk_pin)
 			/* Transmit Frame Synchro (i.e. playback)
@@ -233,7 +233,7 @@ static int atmel_ssc_hw_rule_rate(struct snd_pcm_hw_params *params,
 	}
 
 	switch (ssc_p->daifmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
-	case SND_SOC_DAIFMT_CBC_CFC:
+	case SND_SOC_DAIFMT_BP_FP:
 		r.num = ssc_p->mck_rate / mck_div / frame_size;
 
 		ret = snd_interval_ratnum(i, 1, &r, &num, &den);
@@ -243,8 +243,8 @@ static int atmel_ssc_hw_rule_rate(struct snd_pcm_hw_params *params,
 		}
 		break;
 
-	case SND_SOC_DAIFMT_CBP_CFC:
-	case SND_SOC_DAIFMT_CBP_CFP:
+	case SND_SOC_DAIFMT_BC_FP:
+	case SND_SOC_DAIFMT_BC_FC:
 		t.min = 8000;
 		t.max = ssc_p->mck_rate / mck_div / frame_size;
 		t.openmin = t.openmax = 0;
@@ -433,8 +433,8 @@ static int atmel_ssc_set_dai_clkdiv(struct snd_soc_dai *cpu_dai,
 static int atmel_ssc_cfs(struct atmel_ssc_info *ssc_p)
 {
 	switch (ssc_p->daifmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
-	case SND_SOC_DAIFMT_CBP_CFC:
-	case SND_SOC_DAIFMT_CBC_CFC:
+	case SND_SOC_DAIFMT_BC_FP:
+	case SND_SOC_DAIFMT_BP_FP:
 		return 1;
 	}
 	return 0;
@@ -444,8 +444,8 @@ static int atmel_ssc_cfs(struct atmel_ssc_info *ssc_p)
 static int atmel_ssc_cbs(struct atmel_ssc_info *ssc_p)
 {
 	switch (ssc_p->daifmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
-	case SND_SOC_DAIFMT_CBC_CFP:
-	case SND_SOC_DAIFMT_CBC_CFC:
+	case SND_SOC_DAIFMT_BP_FC:
+	case SND_SOC_DAIFMT_BP_FP:
 		return 1;
 	}
 	return 0;
@@ -835,7 +835,7 @@ static const struct snd_soc_dai_ops atmel_ssc_dai_ops = {
 	.prepare	= atmel_ssc_prepare,
 	.trigger	= atmel_ssc_trigger,
 	.hw_params	= atmel_ssc_hw_params,
-	.set_fmt	= atmel_ssc_set_dai_fmt,
+	.set_fmt_new	= atmel_ssc_set_dai_fmt,
 	.set_clkdiv	= atmel_ssc_set_dai_clkdiv,
 };
 
diff --git a/sound/soc/atmel/mchp-i2s-mcc.c b/sound/soc/atmel/mchp-i2s-mcc.c
index 6d1227a1d67b5..48d434e0c3318 100644
--- a/sound/soc/atmel/mchp-i2s-mcc.c
+++ b/sound/soc/atmel/mchp-i2s-mcc.c
@@ -350,7 +350,7 @@ static int mchp_i2s_mcc_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 		return -EINVAL;
 
 	/* We can't generate only FSYNC */
-	if ((fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) == SND_SOC_DAIFMT_CBP_CFC)
+	if ((fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) == SND_SOC_DAIFMT_BC_FP)
 		return -EINVAL;
 
 	/* We can only reconfigure the IP when it's stopped */
@@ -547,19 +547,19 @@ static int mchp_i2s_mcc_hw_params(struct snd_pcm_substream *substream,
 	}
 
 	switch (dev->fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
-	case SND_SOC_DAIFMT_CBC_CFC:
+	case SND_SOC_DAIFMT_BP_FP:
 		/* cpu is BCLK and LRC master */
 		mra |= MCHP_I2SMCC_MRA_MODE_MASTER;
 		if (dev->sysclk)
 			mra |= MCHP_I2SMCC_MRA_IMCKMODE_GEN;
 		set_divs = 1;
 		break;
-	case SND_SOC_DAIFMT_CBC_CFP:
+	case SND_SOC_DAIFMT_BP_FC:
 		/* cpu is BCLK master */
 		mrb |= MCHP_I2SMCC_MRB_CLKSEL_INT;
 		set_divs = 1;
 		fallthrough;
-	case SND_SOC_DAIFMT_CBP_CFP:
+	case SND_SOC_DAIFMT_BC_FC:
 		/* cpu is slave */
 		mra |= MCHP_I2SMCC_MRA_MODE_SLAVE;
 		if (dev->sysclk)
@@ -877,7 +877,7 @@ static const struct snd_soc_dai_ops mchp_i2s_mcc_dai_ops = {
 	.trigger	= mchp_i2s_mcc_trigger,
 	.hw_params	= mchp_i2s_mcc_hw_params,
 	.hw_free	= mchp_i2s_mcc_hw_free,
-	.set_fmt	= mchp_i2s_mcc_set_dai_fmt,
+	.set_fmt_new	= mchp_i2s_mcc_set_dai_fmt,
 	.set_tdm_slot	= mchp_i2s_mcc_set_dai_tdm_slot,
 };
 
diff --git a/sound/soc/atmel/mchp-pdmc.c b/sound/soc/atmel/mchp-pdmc.c
index a3856c73e2214..b3f04fa2f6089 100644
--- a/sound/soc/atmel/mchp-pdmc.c
+++ b/sound/soc/atmel/mchp-pdmc.c
@@ -492,8 +492,8 @@ static int mchp_pdmc_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
 	unsigned int fmt_format = fmt & SND_SOC_DAIFMT_FORMAT_MASK;
 
 	/* IP needs to be bitclock master */
-	if (fmt_master != SND_SOC_DAIFMT_CBS_CFS &&
-	    fmt_master != SND_SOC_DAIFMT_CBS_CFM)
+	if (fmt_master != SND_SOC_DAIFMT_BP_FP &&
+	    fmt_master != SND_SOC_DAIFMT_BP_FC)
 		return -EINVAL;
 
 	/* IP supports only PDM interface */
@@ -708,7 +708,7 @@ static int mchp_pdmc_trigger(struct snd_pcm_substream *substream,
 }
 
 static const struct snd_soc_dai_ops mchp_pdmc_dai_ops = {
-	.set_fmt	= mchp_pdmc_set_fmt,
+	.set_fmt_new	= mchp_pdmc_set_fmt,
 	.startup	= mchp_pdmc_startup,
 	.shutdown	= mchp_pdmc_shutdown,
 	.hw_params	= mchp_pdmc_hw_params,
-- 
2.30.2


  parent reply	other threads:[~2022-05-19 15:46 UTC|newest]

Thread overview: 73+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-19 15:42 [PATCH 00/56] Specify clock provider directly to CPU DAIs Charles Keepax
2022-05-19 15:42 ` [PATCH 01/56] ASoC: core: Add set_fmt_new callback that directly specifies provider Charles Keepax
2022-05-19 15:42 ` [PATCH 02/56] ASoC: amd: vangogh: Update to use set_fmt_new callback Charles Keepax
2022-05-19 15:42 ` Charles Keepax [this message]
2022-05-19 15:42 ` [PATCH 04/56] ASoC: au1x: " Charles Keepax
2022-05-19 15:42 ` [PATCH 05/56] ASoC: bcm: " Charles Keepax
2022-05-19 15:42 ` [PATCH 06/56] ASoC: ep93xx: " Charles Keepax
2022-05-19 15:42 ` [PATCH 07/56] ASoC: dwc: " Charles Keepax
2022-05-19 15:42 ` [PATCH 08/56] ASoC: fsl: " Charles Keepax
2022-05-19 15:42 ` [PATCH 09/56] ASoC: hisilicon: " Charles Keepax
2022-05-19 15:42 ` [PATCH 10/56] ASoC: img: " Charles Keepax
2022-05-19 15:42 ` [PATCH 11/56] ASoC: Intel: " Charles Keepax
2022-05-19 15:42 ` [PATCH 12/56] ASoC: js4740-i2s: " Charles Keepax
2022-05-19 15:42 ` [PATCH 13/56] ASoC: mediatek: " Charles Keepax
2022-05-19 15:42 ` [PATCH 14/56] ASoC: meson: " Charles Keepax
2022-05-19 15:42 ` [PATCH 15/56] ASoC: mxs-saif: " Charles Keepax
2022-05-19 15:42 ` [PATCH 16/56] ASoC: pxa: " Charles Keepax
2022-05-19 15:42 ` [PATCH 17/56] ASoC: qcom: " Charles Keepax
2022-05-19 15:42 ` [PATCH 18/56] ASoC: rockchip: " Charles Keepax
2022-05-20 13:39   ` Nicolas Frattaroli
2022-05-19 15:42 ` [PATCH 19/56] ASoC: samsung: " Charles Keepax
2022-05-19 15:42 ` [PATCH 20/56] ASoC: sh: " Charles Keepax
2022-05-20  0:51   ` Kuninori Morimoto
2022-05-19 15:42 ` [PATCH 21/56] ASoC: stm: " Charles Keepax
2022-05-19 15:42 ` [PATCH 22/56] ASoC: sunxi: " Charles Keepax
2022-05-19 23:40   ` Samuel Holland
2022-05-20  9:56     ` Charles Keepax
2022-05-19 15:42 ` [PATCH 23/56] ASoC: tegra: " Charles Keepax
2022-05-19 15:42 ` [PATCH 24/56] ASoC: test-component: " Charles Keepax
2022-05-20  0:52   ` Kuninori Morimoto
2022-05-19 15:42 ` [PATCH 25/56] ASoC: ti: " Charles Keepax
2022-05-28  9:18   ` Péter Ujfalusi
2022-05-19 15:42 ` [PATCH 26/56] ASoC: ux500: " Charles Keepax
2022-05-19 15:42 ` [PATCH 27/56] ASoC: xtensa: " Charles Keepax
2022-05-19 15:42 ` [PATCH 28/56] ASoC: core: Always send the CPU DAI a direct clock specifier Charles Keepax
2022-05-19 15:42 ` [PATCH 29/56] ASoC: amd: vangogh: Rename set_fmt_new back to set_fmt Charles Keepax
2022-05-19 15:42 ` [PATCH 30/56] ASoC: atmel: " Charles Keepax
2022-05-19 15:42 ` [PATCH 31/56] ASoC: au1x: " Charles Keepax
2022-05-19 15:42 ` [PATCH 32/56] ASoC: bcm: " Charles Keepax
2022-05-19 15:42 ` [PATCH 33/56] ASoC: ep93xx: " Charles Keepax
2022-05-19 15:42 ` [PATCH 34/56] ASoC: dwc: " Charles Keepax
2022-05-19 15:42 ` [PATCH 35/56] ASoC: fsl: " Charles Keepax
2022-05-19 15:42 ` [PATCH 36/56] ASoC: hisilicon: " Charles Keepax
2022-05-19 15:42 ` [PATCH 37/56] ASoC: img: " Charles Keepax
2022-05-19 15:43 ` [PATCH 38/56] ASoC: Intel: " Charles Keepax
2022-05-19 15:43 ` [PATCH 39/56] ASoC: jz4740-i2s: " Charles Keepax
2022-05-19 15:43 ` [PATCH 40/56] ASoC: mediatek: " Charles Keepax
2022-05-19 15:43 ` [PATCH 41/56] ASoC: meson: " Charles Keepax
2022-05-19 15:43 ` [PATCH 42/56] ASoC: mxs-saif: " Charles Keepax
2022-05-19 15:43 ` [PATCH 43/56] ASoC: pxa: " Charles Keepax
2022-05-19 15:43 ` [PATCH 44/56] ASoC: qcom: " Charles Keepax
2022-05-19 15:43 ` [PATCH 45/56] ASoC: rockchip: " Charles Keepax
2022-05-19 15:43 ` [PATCH 46/56] ASoC: samsung: " Charles Keepax
2022-05-20  6:45   ` Krzysztof Kozlowski
2022-05-19 15:43 ` [PATCH 47/56] ASoC: sh: " Charles Keepax
2022-05-19 15:43 ` [PATCH 48/56] ASoC: stm: " Charles Keepax
2022-05-19 15:43 ` [PATCH 49/56] ASoC: sunxi: " Charles Keepax
2022-05-19 15:43 ` [PATCH 50/56] ASoC: tegra: " Charles Keepax
2022-05-19 15:43 ` [PATCH 51/56] ASoC: test-component: " Charles Keepax
2022-05-19 15:43 ` [PATCH 52/56] ASoC: ti: " Charles Keepax
2022-05-28  9:19   ` Péter Ujfalusi
2022-05-19 15:43 ` [PATCH 53/56] ASoC: ux500: " Charles Keepax
2022-05-19 15:43 ` [PATCH 54/56] ASoC: xtensa: " Charles Keepax
2022-05-19 15:43 ` [PATCH 55/56] ASoC: soc-dai: Remove set_fmt_new callback Charles Keepax
2022-05-19 15:43 ` [PATCH 56/56] ASoC: simple-card-utils: Move snd_soc_component_is_codec to be local Charles Keepax
2022-05-20  1:02   ` Kuninori Morimoto
2022-05-20 10:24     ` Charles Keepax
2022-05-22 23:26       ` Kuninori Morimoto
2022-05-19 18:43 ` [PATCH 00/56] Specify clock provider directly to CPU DAIs Pierre-Louis Bossart
2022-06-09 13:32 ` Mark Brown
2022-06-10  2:03   ` Samuel Holland
2022-06-10 12:03     ` Mark Brown
2022-06-13  9:54       ` Charles Keepax

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=20220519154318.2153729-4-ckeepax@opensource.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=cezary.rojewski@intel.com \
    --cc=daniel@zonque.org \
    --cc=heiko@sntech.de \
    --cc=jarkko.nikula@bitmer.com \
    --cc=jbrunet@baylibre.com \
    --cc=kernel@pengutronix.de \
    --cc=krzk@kernel.org \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=lgirdwood@gmail.com \
    --cc=linux-amlogic@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=linux-sunxi@lists.linux.dev \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux-xtensa@linux-xtensa.org \
    --cc=nicolas.ferre@microchip.com \
    --cc=nsaenz@kernel.org \
    --cc=patches@opensource.cirrus.com \
    --cc=peter.ujfalusi@gmail.com \
    --cc=pierre-louis.bossart@linux.intel.com \
    --cc=shawnguo@kernel.org \
    --cc=srinivas.kandagatla@linaro.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).