ASoC: fsl_sai: Instantiate snd_soc_dai_driver
[ Upstream commit 22a16145af824f91014d07f8664114859900b9e6 ] Instantiate snd_soc_dai_driver for independent symmetric control. Otherwise the symmetric setting may be overwritten by other instance. Fixes: 08fdf65e37d5 ("ASoC: fsl_sai: Add asynchronous mode support") Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Link: https://lore.kernel.org/r/1600424760-32071-1-git-send-email-shengjiu.wang@nxp.com Signed-off-by: Mark Brown <broonie@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
56c1c45bb8
commit
1ad7f52fe6
@ -694,7 +694,7 @@ static int fsl_sai_dai_probe(struct snd_soc_dai *cpu_dai)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct snd_soc_dai_driver fsl_sai_dai = {
|
||||
static struct snd_soc_dai_driver fsl_sai_dai_template = {
|
||||
.probe = fsl_sai_dai_probe,
|
||||
.playback = {
|
||||
.stream_name = "CPU-Playback",
|
||||
@ -965,12 +965,15 @@ static int fsl_sai_probe(struct platform_device *pdev)
|
||||
return ret;
|
||||
}
|
||||
|
||||
memcpy(&sai->cpu_dai_drv, &fsl_sai_dai_template,
|
||||
sizeof(fsl_sai_dai_template));
|
||||
|
||||
/* Sync Tx with Rx as default by following old DT binding */
|
||||
sai->synchronous[RX] = true;
|
||||
sai->synchronous[TX] = false;
|
||||
fsl_sai_dai.symmetric_rates = 1;
|
||||
fsl_sai_dai.symmetric_channels = 1;
|
||||
fsl_sai_dai.symmetric_samplebits = 1;
|
||||
sai->cpu_dai_drv.symmetric_rates = 1;
|
||||
sai->cpu_dai_drv.symmetric_channels = 1;
|
||||
sai->cpu_dai_drv.symmetric_samplebits = 1;
|
||||
|
||||
if (of_find_property(np, "fsl,sai-synchronous-rx", NULL) &&
|
||||
of_find_property(np, "fsl,sai-asynchronous", NULL)) {
|
||||
@ -987,9 +990,9 @@ static int fsl_sai_probe(struct platform_device *pdev)
|
||||
/* Discard all settings for asynchronous mode */
|
||||
sai->synchronous[RX] = false;
|
||||
sai->synchronous[TX] = false;
|
||||
fsl_sai_dai.symmetric_rates = 0;
|
||||
fsl_sai_dai.symmetric_channels = 0;
|
||||
fsl_sai_dai.symmetric_samplebits = 0;
|
||||
sai->cpu_dai_drv.symmetric_rates = 0;
|
||||
sai->cpu_dai_drv.symmetric_channels = 0;
|
||||
sai->cpu_dai_drv.symmetric_samplebits = 0;
|
||||
}
|
||||
|
||||
if (of_find_property(np, "fsl,sai-mclk-direction-output", NULL) &&
|
||||
@ -1018,7 +1021,7 @@ static int fsl_sai_probe(struct platform_device *pdev)
|
||||
pm_runtime_enable(&pdev->dev);
|
||||
|
||||
ret = devm_snd_soc_register_component(&pdev->dev, &fsl_component,
|
||||
&fsl_sai_dai, 1);
|
||||
&sai->cpu_dai_drv, 1);
|
||||
if (ret)
|
||||
goto err_pm_disable;
|
||||
|
||||
|
@ -180,6 +180,7 @@ struct fsl_sai {
|
||||
unsigned int bclk_ratio;
|
||||
|
||||
const struct fsl_sai_soc_data *soc_data;
|
||||
struct snd_soc_dai_driver cpu_dai_drv;
|
||||
struct snd_dmaengine_dai_dma_data dma_params_rx;
|
||||
struct snd_dmaengine_dai_dma_data dma_params_tx;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user