Commit 7cc3965f authored by Charles Keepax's avatar Charles Keepax Committed by Mark Brown

ASoC: sunxi: 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: default avatarCharles Keepax <ckeepax@opensource.cirrus.com>
Link: https://lore.kernel.org/r/20220519154318.2153729-23-ckeepax@opensource.cirrus.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 0092dac9
...@@ -702,13 +702,13 @@ static int sun4i_i2s_set_soc_fmt(const struct sun4i_i2s *i2s, ...@@ -702,13 +702,13 @@ static int sun4i_i2s_set_soc_fmt(const struct sun4i_i2s *i2s,
SUN4I_I2S_FMT0_FMT_MASK, val); SUN4I_I2S_FMT0_FMT_MASK, val);
/* DAI clock master masks */ /* DAI clock master masks */
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_BP_FP:
/* BCLK and LRCLK master */ /* BCLK and LRCLK master */
val = SUN4I_I2S_CTRL_MODE_MASTER; val = SUN4I_I2S_CTRL_MODE_MASTER;
break; break;
case SND_SOC_DAIFMT_CBM_CFM: case SND_SOC_DAIFMT_BC_FC:
/* BCLK and LRCLK slave */ /* BCLK and LRCLK slave */
val = SUN4I_I2S_CTRL_MODE_SLAVE; val = SUN4I_I2S_CTRL_MODE_SLAVE;
break; break;
...@@ -802,13 +802,13 @@ static int sun8i_i2s_set_soc_fmt(const struct sun4i_i2s *i2s, ...@@ -802,13 +802,13 @@ static int sun8i_i2s_set_soc_fmt(const struct sun4i_i2s *i2s,
SUN8I_I2S_TX_CHAN_OFFSET(offset)); SUN8I_I2S_TX_CHAN_OFFSET(offset));
/* DAI clock master masks */ /* DAI clock master masks */
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_BP_FP:
/* BCLK and LRCLK master */ /* BCLK and LRCLK master */
val = SUN8I_I2S_CTRL_BCLK_OUT | SUN8I_I2S_CTRL_LRCK_OUT; val = SUN8I_I2S_CTRL_BCLK_OUT | SUN8I_I2S_CTRL_LRCK_OUT;
break; break;
case SND_SOC_DAIFMT_CBM_CFM: case SND_SOC_DAIFMT_BC_FC:
/* BCLK and LRCLK slave */ /* BCLK and LRCLK slave */
val = 0; val = 0;
break; break;
...@@ -909,13 +909,13 @@ static int sun50i_h6_i2s_set_soc_fmt(const struct sun4i_i2s *i2s, ...@@ -909,13 +909,13 @@ static int sun50i_h6_i2s_set_soc_fmt(const struct sun4i_i2s *i2s,
SUN50I_H6_I2S_TX_CHAN_SEL_OFFSET(offset)); SUN50I_H6_I2S_TX_CHAN_SEL_OFFSET(offset));
/* DAI clock master masks */ /* DAI clock master masks */
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBS_CFS: case SND_SOC_DAIFMT_BP_FP:
/* BCLK and LRCLK master */ /* BCLK and LRCLK master */
val = SUN8I_I2S_CTRL_BCLK_OUT | SUN8I_I2S_CTRL_LRCK_OUT; val = SUN8I_I2S_CTRL_BCLK_OUT | SUN8I_I2S_CTRL_LRCK_OUT;
break; break;
case SND_SOC_DAIFMT_CBM_CFM: case SND_SOC_DAIFMT_BC_FC:
/* BCLK and LRCLK slave */ /* BCLK and LRCLK slave */
val = 0; val = 0;
break; break;
...@@ -1081,7 +1081,7 @@ static int sun4i_i2s_set_tdm_slot(struct snd_soc_dai *dai, ...@@ -1081,7 +1081,7 @@ static int sun4i_i2s_set_tdm_slot(struct snd_soc_dai *dai,
static const struct snd_soc_dai_ops sun4i_i2s_dai_ops = { static const struct snd_soc_dai_ops sun4i_i2s_dai_ops = {
.hw_params = sun4i_i2s_hw_params, .hw_params = sun4i_i2s_hw_params,
.set_fmt = sun4i_i2s_set_fmt, .set_fmt_new = sun4i_i2s_set_fmt,
.set_sysclk = sun4i_i2s_set_sysclk, .set_sysclk = sun4i_i2s_set_sysclk,
.set_tdm_slot = sun4i_i2s_set_tdm_slot, .set_tdm_slot = sun4i_i2s_set_tdm_slot,
.trigger = sun4i_i2s_trigger, .trigger = sun4i_i2s_trigger,
......
...@@ -286,11 +286,11 @@ static int sun8i_codec_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) ...@@ -286,11 +286,11 @@ static int sun8i_codec_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
u32 dsp_format, format, invert, value; u32 dsp_format, format, invert, value;
/* clock masters */ /* clock masters */
switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) {
case SND_SOC_DAIFMT_CBS_CFS: /* Codec slave, DAI master */ case SND_SOC_DAIFMT_BP_FP: /* Codec slave, DAI master */
value = 0x1; value = 0x1;
break; break;
case SND_SOC_DAIFMT_CBM_CFM: /* Codec Master, DAI slave */ case SND_SOC_DAIFMT_BC_FC: /* Codec Master, DAI slave */
value = 0x0; value = 0x0;
break; break;
default: default:
...@@ -630,7 +630,7 @@ static int sun8i_codec_hw_free(struct snd_pcm_substream *substream, ...@@ -630,7 +630,7 @@ static int sun8i_codec_hw_free(struct snd_pcm_substream *substream,
} }
static const struct snd_soc_dai_ops sun8i_codec_dai_ops = { static const struct snd_soc_dai_ops sun8i_codec_dai_ops = {
.set_fmt = sun8i_codec_set_fmt, .set_fmt_new = sun8i_codec_set_fmt,
.set_tdm_slot = sun8i_codec_set_tdm_slot, .set_tdm_slot = sun8i_codec_set_tdm_slot,
.startup = sun8i_codec_startup, .startup = sun8i_codec_startup,
.hw_params = sun8i_codec_hw_params, .hw_params = sun8i_codec_hw_params,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment