[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190420154038.14576-1-daniel.baluta@nxp.com>
Date: Sat, 20 Apr 2019 15:41:04 +0000
From: Daniel Baluta <daniel.baluta@....com>
To: "broonie@...nel.org" <broonie@...nel.org>
CC: "lgirdwood@...il.com" <lgirdwood@...il.com>,
"timur@...nel.org" <timur@...nel.org>,
"nicoleotsuka@...il.com" <nicoleotsuka@...il.com>,
"Xiubo.Lee@...il.com" <Xiubo.Lee@...il.com>,
"festevam@...il.com" <festevam@...il.com>,
"perex@...ex.cz" <perex@...ex.cz>,
"tiwai@...e.com" <tiwai@...e.com>,
"alsa-devel@...a-project.org" <alsa-devel@...a-project.org>,
"linuxppc-dev@...ts.ozlabs.org" <linuxppc-dev@...ts.ozlabs.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
dl-linux-imx <linux-imx@....com>,
Daniel Baluta <daniel.baluta@....com>,
"S.j. Wang" <shengjiu.wang@....com>
Subject: [PATCH] ASoC: fsl: sai: Fix clock source for mclk0
SAI provide multiple master clock source options selectable
via bit MSEL of TCR2/RCR2.
All possible master clock sources are stored in sai->mclk_clk
array. Current implementation assumes that MCLK0 source is always
busclk, but this is wrong!
For example, on i.MX8QM we have:
00b - Bus Clock selected.
01b - Master Clock (MCLK) 1 option selected.
10b - Master Clock (MCLK) 2 option selected.
11b - Master Clock (MCLK) 3 option selected.
while on i.MX6SX we have:
00b - Master Clock (MCLK) 1 option selected.
01b - Master Clock (MCLK) 1 option selected.
10b - Master Clock (MCLK) 2 option selected.
11b - Master Clock (MCLK) 3 option selected.
So, this patch will read mclk0 source clock from device tree.
Signed-off-by: Shengjiu Wang <shengjiu.wang@....com>
Signed-off-by: Daniel Baluta <daniel.baluta@....com>
---
sound/soc/fsl/fsl_sai.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c
index d2a4dc744fd7..faa8de87ff83 100644
--- a/sound/soc/fsl/fsl_sai.c
+++ b/sound/soc/fsl/fsl_sai.c
@@ -829,8 +829,7 @@ static int fsl_sai_probe(struct platform_device *pdev)
sai->bus_clk = NULL;
}
- sai->mclk_clk[0] = sai->bus_clk;
- for (i = 1; i < FSL_SAI_MCLK_MAX; i++) {
+ for (i = 0; i < FSL_SAI_MCLK_MAX; i++) {
sprintf(tmp, "mclk%d", i);
sai->mclk_clk[i] = devm_clk_get(&pdev->dev, tmp);
if (IS_ERR(sai->mclk_clk[i])) {
--
2.17.1
Powered by blists - more mailing lists