summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAriel D'Alessandro <ariel.dalessandro@collabora.com>2022-01-17 10:21:08 -0300
committerMark Brown <broonie@kernel.org>2022-01-24 13:31:50 +0000
commit91e4e40b59bac246c4b4f2c9baf57c30337d5c71 (patch)
tree5c9c93f6e85649c8fc671af90d7e349428a1e200
parent55915f20ad9ae92015bf7b2c4ac854e5b720d63f (diff)
downloadlinux-91e4e40b59bac246c4b4f2c9baf57c30337d5c71.tar.bz2
ASoC: fsl-asoc-card: Add optional dt property for setting mclk-id
Sound cards may allow using different main clock inputs. In the generic fsl-asoc-card driver, these values are hardcoded for each specific card configuration. Let's make it more flexible, allowing setting mclk-id from the device-tree node. Otherwise, the default value for each card configuration is used. Signed-off-by: Ariel D'Alessandro <ariel.dalessandro@collabora.com> Link: https://lore.kernel.org/r/20220117132109.283365-5-ariel.dalessandro@collabora.com Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--sound/soc/fsl/fsl-asoc-card.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c
index 5ee945505281..156d3c669274 100644
--- a/sound/soc/fsl/fsl-asoc-card.c
+++ b/sound/soc/fsl/fsl-asoc-card.c
@@ -693,6 +693,12 @@ static int fsl_asoc_card_probe(struct platform_device *pdev)
goto asrc_fail;
}
+ /*
+ * Allow setting mclk-id from the device-tree node. Otherwise, the
+ * default value for each card configuration is used.
+ */
+ of_property_read_u32(np, "mclk-id", &priv->codec_priv.mclk_id);
+
/* Format info from DT is optional. */
snd_soc_daifmt_parse_clock_provider_as_phandle(np, NULL, &bitclkprovider, &frameprovider);
if (bitclkprovider || frameprovider) {