From: Ariel D'Alessandro Date: Mon, 17 Jan 2022 13:21:08 +0000 (-0300) Subject: ASoC: fsl-asoc-card: Add optional dt property for setting mclk-id X-Git-Tag: v5.18-rc1~152^2~7^2~188^2~3 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=91e4e40b59bac246c4b4f2c9baf57c30337d5c71;p=thirdparty%2Fkernel%2Flinux.git 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 Link: https://lore.kernel.org/r/20220117132109.283365-5-ariel.dalessandro@collabora.com Signed-off-by: Mark Brown --- diff --git a/sound/soc/fsl/fsl-asoc-card.c b/sound/soc/fsl/fsl-asoc-card.c index 5ee9455052813..156d3c6692741 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) {