Commit 4e4f94d2 authored by Maciej S. Szmigiero's avatar Maciej S. Szmigiero Committed by Kleber Sacilotto de Souza

ASoC: fsl_ssi: AC'97 ops need regmap, clock and cleaning up on failure

BugLink: http://bugs.launchpad.net/bugs/1745069

commit 695b78b5 upstream.

AC'97 ops (register read / write) need SSI regmap and clock, so they have
to be set after them.

We also need to set these ops back to NULL if we fail the probe.
Signed-off-by: default avatarMaciej S. Szmigiero <mail@maciej.szmigiero.name>
Acked-by: default avatarNicolin Chen <nicoleotsuka@gmail.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarStefan Bader <stefan.bader@canonical.com>
parent 5db72776
...@@ -1408,12 +1408,6 @@ static int fsl_ssi_probe(struct platform_device *pdev) ...@@ -1408,12 +1408,6 @@ static int fsl_ssi_probe(struct platform_device *pdev)
sizeof(fsl_ssi_ac97_dai)); sizeof(fsl_ssi_ac97_dai));
fsl_ac97_data = ssi_private; fsl_ac97_data = ssi_private;
ret = snd_soc_set_ac97_ops_of_reset(&fsl_ssi_ac97_ops, pdev);
if (ret) {
dev_err(&pdev->dev, "could not set AC'97 ops\n");
return ret;
}
} else { } else {
/* Initialize this copy of the CPU DAI driver structure */ /* Initialize this copy of the CPU DAI driver structure */
memcpy(&ssi_private->cpu_dai_drv, &fsl_ssi_dai_template, memcpy(&ssi_private->cpu_dai_drv, &fsl_ssi_dai_template,
...@@ -1473,6 +1467,14 @@ static int fsl_ssi_probe(struct platform_device *pdev) ...@@ -1473,6 +1467,14 @@ static int fsl_ssi_probe(struct platform_device *pdev)
return ret; return ret;
} }
if (fsl_ssi_is_ac97(ssi_private)) {
ret = snd_soc_set_ac97_ops_of_reset(&fsl_ssi_ac97_ops, pdev);
if (ret) {
dev_err(&pdev->dev, "could not set AC'97 ops\n");
goto error_ac97_ops;
}
}
ret = devm_snd_soc_register_component(&pdev->dev, &fsl_ssi_component, ret = devm_snd_soc_register_component(&pdev->dev, &fsl_ssi_component,
&ssi_private->cpu_dai_drv, 1); &ssi_private->cpu_dai_drv, 1);
if (ret) { if (ret) {
...@@ -1556,6 +1558,10 @@ static int fsl_ssi_probe(struct platform_device *pdev) ...@@ -1556,6 +1558,10 @@ static int fsl_ssi_probe(struct platform_device *pdev)
fsl_ssi_debugfs_remove(&ssi_private->dbg_stats); fsl_ssi_debugfs_remove(&ssi_private->dbg_stats);
error_asoc_register: error_asoc_register:
if (fsl_ssi_is_ac97(ssi_private))
snd_soc_set_ac97_ops(NULL);
error_ac97_ops:
if (ssi_private->soc->imx) if (ssi_private->soc->imx)
fsl_ssi_imx_clean(pdev, ssi_private); fsl_ssi_imx_clean(pdev, ssi_private);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment