[PATCH 1/4] ASoC: pcm1681: Use modern ASoC DAI format terminology
As part of moving to remove the old style defines for the bus clocks update the pcm1681 driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/codecs/pcm1681.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/sound/soc/codecs/pcm1681.c b/sound/soc/codecs/pcm1681.c index 5b78e9299c95..9eb65f94fc4d 100644 --- a/sound/soc/codecs/pcm1681.c +++ b/sound/soc/codecs/pcm1681.c @@ -136,8 +136,8 @@ static int pcm1681_set_dai_fmt(struct snd_soc_dai *codec_dai, struct snd_soc_component *component = codec_dai->component; struct pcm1681_private *priv = snd_soc_component_get_drvdata(component);
- /* The PCM1681 can only be slave to all clocks */ - if ((format & SND_SOC_DAIFMT_MASTER_MASK) != SND_SOC_DAIFMT_CBS_CFS) { + /* The PCM1681 can only be consumer to all clocks */ + if ((format & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) != SND_SOC_DAIFMT_CBC_CFC) { dev_err(component->dev, "Invalid clocking mode\n"); return -EINVAL; }
As part of moving to remove the old style defines for the bus clocks update the pcm186x driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/codecs/pcm186x.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/sound/soc/codecs/pcm186x.c b/sound/soc/codecs/pcm186x.c index b8845f45549e..2c78dccb3f62 100644 --- a/sound/soc/codecs/pcm186x.c +++ b/sound/soc/codecs/pcm186x.c @@ -39,7 +39,7 @@ struct pcm186x_priv { unsigned int sysclk; unsigned int tdm_offset; bool is_tdm_mode; - bool is_master_mode; + bool is_provider_mode; };
static const DECLARE_TLV_DB_SCALE(pcm186x_pga_tlv, -1200, 50, 0); @@ -340,8 +340,8 @@ static int pcm186x_hw_params(struct snd_pcm_substream *substream, PCM186X_PCM_CFG_TDM_LRCK_MODE); }
- /* Only configure clock dividers in master mode. */ - if (priv->is_master_mode) { + /* Only configure clock dividers in provider mode. */ + if (priv->is_provider_mode) { div_bck = priv->sysclk / (div_lrck * rate);
dev_dbg(component->dev, @@ -364,18 +364,17 @@ static int pcm186x_set_fmt(struct snd_soc_dai *dai, unsigned int format)
dev_dbg(component->dev, "%s() format=0x%x\n", __func__, format);
- /* set master/slave audio interface */ - switch (format & SND_SOC_DAIFMT_MASTER_MASK) { - case SND_SOC_DAIFMT_CBM_CFM: + switch (format & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) { + case SND_SOC_DAIFMT_CBP_CFP: if (!priv->sysclk) { - dev_err(component->dev, "operating in master mode requires sysclock to be configured\n"); + dev_err(component->dev, "operating in provider mode requires sysclock to be configured\n"); return -EINVAL; } clk_ctrl |= PCM186X_CLK_CTRL_MST_MODE; - priv->is_master_mode = true; + priv->is_provider_mode = true; break; - case SND_SOC_DAIFMT_CBS_CFS: - priv->is_master_mode = false; + case SND_SOC_DAIFMT_CBC_CFC: + priv->is_provider_mode = false; break; default: dev_err(component->dev, "Invalid DAI master/slave interface\n");
As part of moving to remove the old style defines for the bus clocks update the pcm3168a driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/codecs/pcm3168a.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-)
diff --git a/sound/soc/codecs/pcm3168a.c b/sound/soc/codecs/pcm3168a.c index 7417cf45d916..cf27f05dc46a 100644 --- a/sound/soc/codecs/pcm3168a.c +++ b/sound/soc/codecs/pcm3168a.c @@ -48,7 +48,7 @@ static const char *const pcm3168a_supply_names[] = {
/* ADC/DAC side parameters */ struct pcm3168a_io_params { - bool master_mode; + bool provider_mode; unsigned int format; int tdm_slots; u32 tdm_mask; @@ -357,7 +357,7 @@ static int pcm3168a_set_dai_fmt(struct snd_soc_dai *dai, unsigned int format) struct snd_soc_component *component = dai->component; struct pcm3168a_priv *pcm3168a = snd_soc_component_get_drvdata(component); struct pcm3168a_io_params *io_params = &pcm3168a->io_params[dai->id]; - bool master_mode; + bool provider_mode;
switch (format & SND_SOC_DAIFMT_FORMAT_MASK) { case SND_SOC_DAIFMT_LEFT_J: @@ -371,15 +371,15 @@ static int pcm3168a_set_dai_fmt(struct snd_soc_dai *dai, unsigned int format) return -EINVAL; }
- switch (format & SND_SOC_DAIFMT_MASTER_MASK) { - case SND_SOC_DAIFMT_CBS_CFS: - master_mode = false; + switch (format & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) { + case SND_SOC_DAIFMT_CBC_CFC: + provider_mode = false; break; - case SND_SOC_DAIFMT_CBM_CFM: - master_mode = true; + case SND_SOC_DAIFMT_CBP_CFP: + provider_mode = true; break; default: - dev_err(component->dev, "unsupported master/slave mode\n"); + dev_err(component->dev, "unsupported provider mode\n"); return -EINVAL; }
@@ -390,7 +390,7 @@ static int pcm3168a_set_dai_fmt(struct snd_soc_dai *dai, unsigned int format) return -EINVAL; }
- io_params->master_mode = master_mode; + io_params->provider_mode = provider_mode; io_params->format = format & SND_SOC_DAIFMT_FORMAT_MASK;
pcm3168a_update_fixup_pcm_stream(dai); @@ -440,7 +440,7 @@ static int pcm3168a_hw_params(struct snd_pcm_substream *substream, struct snd_soc_component *component = dai->component; struct pcm3168a_priv *pcm3168a = snd_soc_component_get_drvdata(component); struct pcm3168a_io_params *io_params = &pcm3168a->io_params[dai->id]; - bool master_mode, tdm_mode; + bool provider_mode, tdm_mode; unsigned int format; unsigned int reg, mask, ms, ms_shift, fmt, fmt_shift, ratio, tdm_slots; int i, num_scki_ratios, slot_width; @@ -459,9 +459,9 @@ static int pcm3168a_hw_params(struct snd_pcm_substream *substream, fmt_shift = PCM3168A_ADC_FMTAD_SHIFT; }
- master_mode = io_params->master_mode; + provider_mode = io_params->provider_mode;
- if (master_mode) { + if (provider_mode) { ratio = pcm3168a->sysclk / params_rate(params);
for (i = 0; i < num_scki_ratios; i++) { @@ -488,15 +488,15 @@ static int pcm3168a_hw_params(struct snd_pcm_substream *substream,
switch (slot_width) { case 16: - if (master_mode || (format != SND_SOC_DAIFMT_RIGHT_J)) { - dev_err(component->dev, "16-bit slots are supported only for slave mode using right justified\n"); + if (provider_mode || (format != SND_SOC_DAIFMT_RIGHT_J)) { + dev_err(component->dev, "16-bit slots are supported only for consumer mode using right justified\n"); return -EINVAL; } break; case 24: - if (master_mode || (format == SND_SOC_DAIFMT_DSP_A) || - (format == SND_SOC_DAIFMT_DSP_B)) { - dev_err(component->dev, "24-bit slots not supported in master mode, or slave mode using DSP\n"); + if (provider_mode || (format == SND_SOC_DAIFMT_DSP_A) || + (format == SND_SOC_DAIFMT_DSP_B)) { + dev_err(component->dev, "24-bit slots not supported in provider mode, or consumer mode using DSP\n"); return -EINVAL; } break;
As part of moving to remove the old style defines for the bus clocks update the pcm512x driver to use more modern terminology for clocking.
Signed-off-by: Mark Brown broonie@kernel.org --- sound/soc/codecs/pcm512x.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/sound/soc/codecs/pcm512x.c b/sound/soc/codecs/pcm512x.c index 60dee41816dc..a3ff4a07aff7 100644 --- a/sound/soc/codecs/pcm512x.c +++ b/sound/soc/codecs/pcm512x.c @@ -652,12 +652,12 @@ static int pcm512x_dai_startup(struct snd_pcm_substream *substream, struct snd_soc_component *component = dai->component; struct pcm512x_priv *pcm512x = snd_soc_component_get_drvdata(component);
- switch (pcm512x->fmt & SND_SOC_DAIFMT_MASTER_MASK) { - case SND_SOC_DAIFMT_CBM_CFM: - case SND_SOC_DAIFMT_CBM_CFS: + switch (pcm512x->fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) { + case SND_SOC_DAIFMT_CBP_CFP: + case SND_SOC_DAIFMT_CBP_CFC: return pcm512x_dai_startup_master(substream, dai);
- case SND_SOC_DAIFMT_CBS_CFS: + case SND_SOC_DAIFMT_CBC_CFC: return pcm512x_dai_startup_slave(substream, dai);
default: @@ -1202,8 +1202,8 @@ static int pcm512x_hw_params(struct snd_pcm_substream *substream, return ret; }
- if ((pcm512x->fmt & SND_SOC_DAIFMT_MASTER_MASK) == - SND_SOC_DAIFMT_CBS_CFS) { + if ((pcm512x->fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) == + SND_SOC_DAIFMT_CBC_CFC) { ret = regmap_update_bits(pcm512x->regmap, PCM512x_ERROR_DETECT, PCM512x_DCAS, 0); if (ret != 0) { @@ -1340,21 +1340,21 @@ static int pcm512x_set_fmt(struct snd_soc_dai *dai, unsigned int fmt) int afmt; int offset = 0; int clock_output; - int master_mode; + int provider_mode; int ret;
- switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { - case SND_SOC_DAIFMT_CBS_CFS: + switch (fmt & SND_SOC_DAIFMT_CLOCK_PROVIDER_MASK) { + case SND_SOC_DAIFMT_CBC_CFC: clock_output = 0; - master_mode = 0; + provider_mode = 0; break; - case SND_SOC_DAIFMT_CBM_CFM: + case SND_SOC_DAIFMT_CBP_CFP: clock_output = PCM512x_BCKO | PCM512x_LRKO; - master_mode = PCM512x_RLRK | PCM512x_RBCK; + provider_mode = PCM512x_RLRK | PCM512x_RBCK; break; - case SND_SOC_DAIFMT_CBM_CFS: + case SND_SOC_DAIFMT_CBP_CFC: clock_output = PCM512x_BCKO; - master_mode = PCM512x_RBCK; + provider_mode = PCM512x_RBCK; break; default: return -EINVAL; @@ -1370,9 +1370,9 @@ static int pcm512x_set_fmt(struct snd_soc_dai *dai, unsigned int fmt)
ret = regmap_update_bits(pcm512x->regmap, PCM512x_MASTER_MODE, PCM512x_RLRK | PCM512x_RBCK, - master_mode); + provider_mode); if (ret != 0) { - dev_err(component->dev, "Failed to enable master mode: %d\n", ret); + dev_err(component->dev, "Failed to enable provider mode: %d\n", ret); return ret; }
On Wed, 23 Feb 2022 01:48:43 +0000, Mark Brown wrote:
As part of moving to remove the old style defines for the bus clocks update the pcm1681 driver to use more modern terminology for clocking.
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/4] ASoC: pcm1681: Use modern ASoC DAI format terminology commit: 1900cb5375c3e95382601deed6ef95fb7b121a2e [2/4] ASoC: pcm186x: Use modern ASoC DAI format terminology commit: 765e30ac665777d7d7ad4fe75490138a85931d3a [3/4] ASoC: pcm3168a: Use modern ASoC DAI format terminology commit: 9231bb1b25348bff738181e4614c997bcdeba7cf [4/4] ASoC: pcm512x: Use modern ASoC DAI format terminology commit: e0dab08973c890d554e14089b756e81b50ed8af4
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
participants (1)
-
Mark Brown