1

ASoC: atmel: Update to use set_fmt_new callback

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>
Link: https://lore.kernel.org/r/20220519154318.2153729-4-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Charles Keepax 2022-05-19 16:42:25 +01:00 committed by Mark Brown
parent ab890e0f83
commit 0fd054a577
No known key found for this signature in database
GPG Key ID: 24D68B725D5487D0
4 changed files with 21 additions and 21 deletions

View File

@ -343,7 +343,7 @@ static int atmel_i2s_hw_params(struct snd_pcm_substream *substream,
} }
switch (dev->fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) { 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 */ /* codec is slave, so cpu is master */
mr |= ATMEL_I2SC_MR_MODE_MASTER; mr |= ATMEL_I2SC_MR_MODE_MASTER;
ret = atmel_i2s_get_gck_param(dev, params_rate(params)); 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; return ret;
break; break;
case SND_SOC_DAIFMT_CBP_CFP: case SND_SOC_DAIFMT_BC_FC:
/* codec is master, so cpu is slave */ /* codec is master, so cpu is slave */
mr |= ATMEL_I2SC_MR_MODE_SLAVE; mr |= ATMEL_I2SC_MR_MODE_SLAVE;
dev->gck_param = NULL; dev->gck_param = NULL;
@ -533,7 +533,7 @@ static const struct snd_soc_dai_ops atmel_i2s_dai_ops = {
.prepare = atmel_i2s_prepare, .prepare = atmel_i2s_prepare,
.trigger = atmel_i2s_trigger, .trigger = atmel_i2s_trigger,
.hw_params = atmel_i2s_hw_params, .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) static int atmel_i2s_dai_probe(struct snd_soc_dai *dai)

View File

@ -210,7 +210,7 @@ static int atmel_ssc_hw_rule_rate(struct snd_pcm_hw_params *params,
return frame_size; return frame_size;
switch (ssc_p->daifmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) { 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) if ((ssc_p->dir_mask & SSC_DIR_MASK_CAPTURE)
&& ssc->clk_from_rk_pin) && ssc->clk_from_rk_pin)
/* Receiver Frame Synchro (i.e. capture) /* 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; mck_div = 3;
break; break;
case SND_SOC_DAIFMT_CBP_CFP: case SND_SOC_DAIFMT_BC_FC:
if ((ssc_p->dir_mask & SSC_DIR_MASK_PLAYBACK) if ((ssc_p->dir_mask & SSC_DIR_MASK_PLAYBACK)
&& !ssc->clk_from_rk_pin) && !ssc->clk_from_rk_pin)
/* Transmit Frame Synchro (i.e. playback) /* 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) { 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; r.num = ssc_p->mck_rate / mck_div / frame_size;
ret = snd_interval_ratnum(i, 1, &r, &num, &den); 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; break;
case SND_SOC_DAIFMT_CBP_CFC: case SND_SOC_DAIFMT_BC_FP:
case SND_SOC_DAIFMT_CBP_CFP: case SND_SOC_DAIFMT_BC_FC:
t.min = 8000; t.min = 8000;
t.max = ssc_p->mck_rate / mck_div / frame_size; t.max = ssc_p->mck_rate / mck_div / frame_size;
t.openmin = t.openmax = 0; 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) static int atmel_ssc_cfs(struct atmel_ssc_info *ssc_p)
{ {
switch (ssc_p->daifmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) { switch (ssc_p->daifmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBP_CFC: case SND_SOC_DAIFMT_BC_FP:
case SND_SOC_DAIFMT_CBC_CFC: case SND_SOC_DAIFMT_BP_FP:
return 1; return 1;
} }
return 0; 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) static int atmel_ssc_cbs(struct atmel_ssc_info *ssc_p)
{ {
switch (ssc_p->daifmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) { switch (ssc_p->daifmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBC_CFP: case SND_SOC_DAIFMT_BP_FC:
case SND_SOC_DAIFMT_CBC_CFC: case SND_SOC_DAIFMT_BP_FP:
return 1; return 1;
} }
return 0; return 0;
@ -835,7 +835,7 @@ static const struct snd_soc_dai_ops atmel_ssc_dai_ops = {
.prepare = atmel_ssc_prepare, .prepare = atmel_ssc_prepare,
.trigger = atmel_ssc_trigger, .trigger = atmel_ssc_trigger,
.hw_params = atmel_ssc_hw_params, .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, .set_clkdiv = atmel_ssc_set_dai_clkdiv,
}; };

View File

@ -350,7 +350,7 @@ static int mchp_i2s_mcc_set_dai_fmt(struct snd_soc_dai *dai, unsigned int fmt)
return -EINVAL; return -EINVAL;
/* We can't generate only FSYNC */ /* 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; return -EINVAL;
/* We can only reconfigure the IP when it's stopped */ /* 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) { 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 */ /* cpu is BCLK and LRC master */
mra |= MCHP_I2SMCC_MRA_MODE_MASTER; mra |= MCHP_I2SMCC_MRA_MODE_MASTER;
if (dev->sysclk) if (dev->sysclk)
mra |= MCHP_I2SMCC_MRA_IMCKMODE_GEN; mra |= MCHP_I2SMCC_MRA_IMCKMODE_GEN;
set_divs = 1; set_divs = 1;
break; break;
case SND_SOC_DAIFMT_CBC_CFP: case SND_SOC_DAIFMT_BP_FC:
/* cpu is BCLK master */ /* cpu is BCLK master */
mrb |= MCHP_I2SMCC_MRB_CLKSEL_INT; mrb |= MCHP_I2SMCC_MRB_CLKSEL_INT;
set_divs = 1; set_divs = 1;
fallthrough; fallthrough;
case SND_SOC_DAIFMT_CBP_CFP: case SND_SOC_DAIFMT_BC_FC:
/* cpu is slave */ /* cpu is slave */
mra |= MCHP_I2SMCC_MRA_MODE_SLAVE; mra |= MCHP_I2SMCC_MRA_MODE_SLAVE;
if (dev->sysclk) if (dev->sysclk)
@ -877,7 +877,7 @@ static const struct snd_soc_dai_ops mchp_i2s_mcc_dai_ops = {
.trigger = mchp_i2s_mcc_trigger, .trigger = mchp_i2s_mcc_trigger,
.hw_params = mchp_i2s_mcc_hw_params, .hw_params = mchp_i2s_mcc_hw_params,
.hw_free = mchp_i2s_mcc_hw_free, .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, .set_tdm_slot = mchp_i2s_mcc_set_dai_tdm_slot,
}; };

View File

@ -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; unsigned int fmt_format = fmt & SND_SOC_DAIFMT_FORMAT_MASK;
/* IP needs to be bitclock master */ /* IP needs to be bitclock master */
if (fmt_master != SND_SOC_DAIFMT_CBS_CFS && if (fmt_master != SND_SOC_DAIFMT_BP_FP &&
fmt_master != SND_SOC_DAIFMT_CBS_CFM) fmt_master != SND_SOC_DAIFMT_BP_FC)
return -EINVAL; return -EINVAL;
/* IP supports only PDM interface */ /* 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 = { 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, .startup = mchp_pdmc_startup,
.shutdown = mchp_pdmc_shutdown, .shutdown = mchp_pdmc_shutdown,
.hw_params = mchp_pdmc_hw_params, .hw_params = mchp_pdmc_hw_params,