MLK-24175: ASoC: fsl_sai: instantiate snd_soc_dai_driver
instantiate snd_soc_dai_driver for independent symmetric control. Signed-off-by: Shengjiu Wang <shengjiu.wang@nxp.com> Reviewed-by: Viorel Suman <viorel.suman@nxp.com>5.4-rM2-2.2.x-imx-squashed
parent
48daa0ca63
commit
2f07bac002
|
@ -1028,7 +1028,7 @@ static int fsl_sai_dai_resume(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",
|
||||
|
@ -1382,6 +1382,9 @@ static int fsl_sai_probe(struct platform_device *pdev)
|
|||
if (sai->soc->reg_offset == 8)
|
||||
fsl_sai_regmap_config = fsl_sai_v3_regmap_config;
|
||||
|
||||
memcpy(&sai->cpu_dai_drv, &fsl_sai_dai_template,
|
||||
sizeof(fsl_sai_dai_template));
|
||||
|
||||
sai->regmap = devm_regmap_init_mmio_clk(&pdev->dev,
|
||||
NULL, base, &fsl_sai_regmap_config);
|
||||
if (IS_ERR(sai->regmap)) {
|
||||
|
@ -1467,9 +1470,9 @@ static int fsl_sai_probe(struct platform_device *pdev)
|
|||
/* 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)) {
|
||||
|
@ -1486,9 +1489,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;
|
||||
}
|
||||
|
||||
platform_set_drvdata(pdev, sai);
|
||||
|
@ -1554,7 +1557,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)
|
||||
return ret;
|
||||
|
||||
|
|
|
@ -288,6 +288,7 @@ struct fsl_sai {
|
|||
|
||||
struct fsl_sai_verid verid;
|
||||
struct fsl_sai_param param;
|
||||
struct snd_soc_dai_driver cpu_dai_drv;
|
||||
};
|
||||
|
||||
const struct attribute_group *fsl_sai_get_dev_attribute_group(bool monitor_spdif);
|
||||
|
|
Loading…
Reference in New Issue