[PATCH 0/2] ASoC: da7213: add .auto_selectable_formats support
Hi Mark
da7213 is still using M/S instead of P/C for SND_SOC_DAIFMT_CBx_CFx. [PATCH 1/2] will update it. [PATCH 2/2] will enable DAI format automatic select.
Kuninori Morimoto (2): ASoC: da7213: tidyup SND_SOC_DAIFMT_xxx ASoC: da7213: add .auto_selectable_formats support
sound/soc/codecs/da7213.c | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-)
We should use P/C instead of M/S for SND_SOC_DAIFMT_CBx_CFx. We should use SND_SOC_DAIFMT_xxx instead of SND_SOC_DAI_FORMAT_xxx This patch tidyup these.
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com --- sound/soc/codecs/da7213.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c index 3a6449c44b23c..d725ec25ce2be 100644 --- a/sound/soc/codecs/da7213.c +++ b/sound/soc/codecs/da7213.c @@ -1261,10 +1261,10 @@ static int da7213_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt)
/* Set master/slave mode */ switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { - case SND_SOC_DAIFMT_CBM_CFM: + case SND_SOC_DAIFMT_CBP_CFP: da7213->master = true; break; - case SND_SOC_DAIFMT_CBS_CFS: + case SND_SOC_DAIFMT_CBC_CFC: da7213->master = false; break; default: @@ -1293,8 +1293,8 @@ static int da7213_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) return -EINVAL; } break; - case SND_SOC_DAI_FORMAT_DSP_A: - case SND_SOC_DAI_FORMAT_DSP_B: + case SND_SOC_DAIFMT_DSP_A: + case SND_SOC_DAIFMT_DSP_B: /* The bclk is inverted wrt ASoC conventions */ switch (fmt & SND_SOC_DAIFMT_INV_MASK) { case SND_SOC_DAIFMT_NB_NF: @@ -1331,12 +1331,12 @@ static int da7213_set_dai_fmt(struct snd_soc_dai *codec_dai, unsigned int fmt) dai_ctrl |= DA7213_DAI_FORMAT_RIGHT_J; da7213->fmt = DA7213_DAI_FORMAT_RIGHT_J; break; - case SND_SOC_DAI_FORMAT_DSP_A: /* L data MSB after FRM LRC */ + case SND_SOC_DAIFMT_DSP_A: /* L data MSB after FRM LRC */ dai_ctrl |= DA7213_DAI_FORMAT_DSP; dai_offset = 1; da7213->fmt = DA7213_DAI_FORMAT_DSP; break; - case SND_SOC_DAI_FORMAT_DSP_B: /* L data MSB during FRM LRC */ + case SND_SOC_DAIFMT_DSP_B: /* L data MSB during FRM LRC */ dai_ctrl |= DA7213_DAI_FORMAT_DSP; da7213->fmt = DA7213_DAI_FORMAT_DSP; break;
By this patch, DAI format might be automatically selected (Depends on paired DAI, and/or Sound Card).
Signed-off-by: Kuninori Morimoto kuninori.morimoto.gx@renesas.com Cc: Linh Phung linh.phung.jy@renesas.com Tested-by: Khanh Le khanh.le.xr@renesas.com --- sound/soc/codecs/da7213.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
diff --git a/sound/soc/codecs/da7213.c b/sound/soc/codecs/da7213.c index d725ec25ce2be..49d97627abc64 100644 --- a/sound/soc/codecs/da7213.c +++ b/sound/soc/codecs/da7213.c @@ -1550,12 +1550,30 @@ static int da7213_set_component_pll(struct snd_soc_component *component, return _da7213_set_component_pll(component, pll_id, source, fref, fout); }
+/* + * Select below from Sound Card, not Auto + * SND_SOC_DAIFMT_CBC_CFC + * SND_SOC_DAIFMT_CBP_CFP + */ +static u64 da7213_dai_formats = + SND_SOC_POSSIBLE_DAIFMT_I2S | + SND_SOC_POSSIBLE_DAIFMT_LEFT_J | + SND_SOC_POSSIBLE_DAIFMT_RIGHT_J | + SND_SOC_POSSIBLE_DAIFMT_DSP_A | + SND_SOC_POSSIBLE_DAIFMT_DSP_B | + SND_SOC_POSSIBLE_DAIFMT_NB_NF | + SND_SOC_POSSIBLE_DAIFMT_NB_IF | + SND_SOC_POSSIBLE_DAIFMT_IB_NF | + SND_SOC_POSSIBLE_DAIFMT_IB_IF; + /* DAI operations */ static const struct snd_soc_dai_ops da7213_dai_ops = { .hw_params = da7213_hw_params, .set_fmt = da7213_set_dai_fmt, .mute_stream = da7213_mute, .no_capture_mute = 1, + .auto_selectable_formats = &da7213_dai_formats, + .num_auto_selectable_formats = 1, };
static struct snd_soc_dai_driver da7213_dai = {
On Mon, 11 Sep 2023 01:41:23 +0000, Kuninori Morimoto wrote:
da7213 is still using M/S instead of P/C for SND_SOC_DAIFMT_CBx_CFx. [PATCH 1/2] will update it. [PATCH 2/2] will enable DAI format automatic select.
Kuninori Morimoto (2): ASoC: da7213: tidyup SND_SOC_DAIFMT_xxx ASoC: da7213: add .auto_selectable_formats support
[...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/2] ASoC: da7213: tidyup SND_SOC_DAIFMT_xxx commit: e335f29583ac9bb3ba454a1273a3d72c6d2e1fec [2/2] ASoC: da7213: add .auto_selectable_formats support commit: 88e20c1f8c1c0018a2dad50b991b87ef028b9c1c
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 (2)
-
Kuninori Morimoto
-
Mark Brown