This patcheset is collection of fixes for the TDM input and output the
axg audio architecture. Its fixes:
- slave mode format setting
- g12 and sm1 skew offset
- tdm clock inversion
- standard daifmt props names which don't require a specific prefix
Jerome Brunet (4):
ASoC: meson: axg-tdm-interface: fix link fmt setup
ASoC: meson: axg-tdmin: fix g12a skew
ASoC: meson: axg-tdm-formatters: fix sclk inversion
ASoC: meson: cards: remove DT_PREFIX for standard daifmt properties
sound/soc/meson/axg-tdm-formatter.c | 11 ++++++-----
sound/soc/meson/axg-tdm-formatter.h | 1 -
sound/soc/meson/axg-tdm-interface.c | 26 +++++++++++++++++---------
sound/soc/meson/axg-tdmin.c | 16 +++++++++++++++-
sound/soc/meson/axg-tdmout.c | 3 ---
sound/soc/meson/meson-card-utils.c | 2 +-
6 files changed, 39 insertions(+), 20 deletions(-)
--
2.25.4
Standard dai format property don't need the "amlogic," prefix.
There nothing amlogic specific about them. Just remove it.
Fixes: 435857e015dc ("ASoC: meson: align axg card driver with DT bindings documentation")
Signed-off-by: Jerome Brunet <[email protected]>
---
sound/soc/meson/meson-card-utils.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/sound/soc/meson/meson-card-utils.c b/sound/soc/meson/meson-card-utils.c
index 29b601a0e274..f9ce03f3921f 100644
--- a/sound/soc/meson/meson-card-utils.c
+++ b/sound/soc/meson/meson-card-utils.c
@@ -119,7 +119,7 @@ unsigned int meson_card_parse_daifmt(struct device_node *node,
struct device_node *framemaster = NULL;
unsigned int daifmt;
- daifmt = snd_soc_of_parse_daifmt(node, DT_PREFIX,
+ daifmt = snd_soc_of_parse_daifmt(node, "",
&bitclkmaster, &framemaster);
daifmt &= ~SND_SOC_DAIFMT_MASTER_MASK;
--
2.25.4
After carefully checking, it appears that both tdmout and tdmin require the
rising edge of the sclk they get to be synchronized with the frame sync
event (which should be a rising edge of lrclk).
TDMIN was improperly set before this patch. Remove the sclk_invert quirk
which is no longer needed and fix the sclk phase.
Fixes: 1a11d88f499c ("ASoC: meson: add tdm formatter base driver")
Signed-off-by: Jerome Brunet <[email protected]>
---
sound/soc/meson/axg-tdm-formatter.c | 11 ++++++-----
sound/soc/meson/axg-tdm-formatter.h | 1 -
sound/soc/meson/axg-tdmin.c | 2 --
sound/soc/meson/axg-tdmout.c | 3 ---
4 files changed, 6 insertions(+), 11 deletions(-)
diff --git a/sound/soc/meson/axg-tdm-formatter.c b/sound/soc/meson/axg-tdm-formatter.c
index 358c8c0d861c..f7e8e9da68a0 100644
--- a/sound/soc/meson/axg-tdm-formatter.c
+++ b/sound/soc/meson/axg-tdm-formatter.c
@@ -70,7 +70,7 @@ EXPORT_SYMBOL_GPL(axg_tdm_formatter_set_channel_masks);
static int axg_tdm_formatter_enable(struct axg_tdm_formatter *formatter)
{
struct axg_tdm_stream *ts = formatter->stream;
- bool invert = formatter->drv->quirks->invert_sclk;
+ bool invert;
int ret;
/* Do nothing if the formatter is already enabled */
@@ -96,11 +96,12 @@ static int axg_tdm_formatter_enable(struct axg_tdm_formatter *formatter)
return ret;
/*
- * If sclk is inverted, invert it back and provide the inversion
- * required by the formatter
+ * If sclk is inverted, it means the bit should latched on the
+ * rising edge which is what our HW expects. If not, we need to
+ * invert it before the formatter.
*/
- invert ^= axg_tdm_sclk_invert(ts->iface->fmt);
- ret = clk_set_phase(formatter->sclk, invert ? 180 : 0);
+ invert = axg_tdm_sclk_invert(ts->iface->fmt);
+ ret = clk_set_phase(formatter->sclk, invert ? 0 : 180);
if (ret)
return ret;
diff --git a/sound/soc/meson/axg-tdm-formatter.h b/sound/soc/meson/axg-tdm-formatter.h
index 9ef98e955cb2..a1f0dcc0ff13 100644
--- a/sound/soc/meson/axg-tdm-formatter.h
+++ b/sound/soc/meson/axg-tdm-formatter.h
@@ -16,7 +16,6 @@ struct snd_kcontrol;
struct axg_tdm_formatter_hw {
unsigned int skew_offset;
- bool invert_sclk;
};
struct axg_tdm_formatter_ops {
diff --git a/sound/soc/meson/axg-tdmin.c b/sound/soc/meson/axg-tdmin.c
index 3d002b4eb939..88ed95ae886b 100644
--- a/sound/soc/meson/axg-tdmin.c
+++ b/sound/soc/meson/axg-tdmin.c
@@ -228,7 +228,6 @@ static const struct axg_tdm_formatter_driver axg_tdmin_drv = {
.regmap_cfg = &axg_tdmin_regmap_cfg,
.ops = &axg_tdmin_ops,
.quirks = &(const struct axg_tdm_formatter_hw) {
- .invert_sclk = false,
.skew_offset = 2,
},
};
@@ -238,7 +237,6 @@ static const struct axg_tdm_formatter_driver g12a_tdmin_drv = {
.regmap_cfg = &axg_tdmin_regmap_cfg,
.ops = &axg_tdmin_ops,
.quirks = &(const struct axg_tdm_formatter_hw) {
- .invert_sclk = false,
.skew_offset = 3,
},
};
diff --git a/sound/soc/meson/axg-tdmout.c b/sound/soc/meson/axg-tdmout.c
index 418ec314b37d..3ceabddae629 100644
--- a/sound/soc/meson/axg-tdmout.c
+++ b/sound/soc/meson/axg-tdmout.c
@@ -238,7 +238,6 @@ static const struct axg_tdm_formatter_driver axg_tdmout_drv = {
.regmap_cfg = &axg_tdmout_regmap_cfg,
.ops = &axg_tdmout_ops,
.quirks = &(const struct axg_tdm_formatter_hw) {
- .invert_sclk = true,
.skew_offset = 1,
},
};
@@ -248,7 +247,6 @@ static const struct axg_tdm_formatter_driver g12a_tdmout_drv = {
.regmap_cfg = &axg_tdmout_regmap_cfg,
.ops = &axg_tdmout_ops,
.quirks = &(const struct axg_tdm_formatter_hw) {
- .invert_sclk = true,
.skew_offset = 2,
},
};
@@ -309,7 +307,6 @@ static const struct axg_tdm_formatter_driver sm1_tdmout_drv = {
.regmap_cfg = &axg_tdmout_regmap_cfg,
.ops = &axg_tdmout_ops,
.quirks = &(const struct axg_tdm_formatter_hw) {
- .invert_sclk = true,
.skew_offset = 2,
},
};
--
2.25.4
On Wed, 29 Jul 2020 17:44:52 +0200, Jerome Brunet wrote:
> This patcheset is collection of fixes for the TDM input and output the
> axg audio architecture. Its fixes:
> - slave mode format setting
> - g12 and sm1 skew offset
> - tdm clock inversion
> - standard daifmt props names which don't require a specific prefix
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound.git for-next
Thanks!
[1/4] ASoC: meson: axg-tdm-interface: fix link fmt setup
commit: 6878ba91ce84f7a07887a0615af70f969508839f
[2/4] ASoC: meson: axg-tdmin: fix g12a skew
commit: 80a254394fcfe55450b0351da298ca7231889219
[3/4] ASoC: meson: axg-tdm-formatters: fix sclk inversion
commit: 0d3f01dcdc234001f979a0af0b6b31cb9f25b6c1
[4/4] ASoC: meson: cards: remove DT_PREFIX for standard daifmt properties
commit: e44815a295a50027a9953f3ef62827d14631b96b
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