ASoC: fsl_sai: Instantiate snd_soc_dai_driver
Instantiate snd_soc_dai_driver for independent symmetric control.
Otherwise the symmetric setting may be overwritten by other
instance.
Fixes: 08fdf65e37
("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>
This commit is contained in:
parent
b03acae25e
commit
22a16145af
@ -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",
|
||||
@ -966,12 +966,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)) {
|
||||
@ -988,9 +991,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) &&
|
||||
@ -1020,7 +1023,7 @@ static int fsl_sai_probe(struct platform_device *pdev)
|
||||
regcache_cache_only(sai->regmap, true);
|
||||
|
||||
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…
Reference in New Issue
Block a user