aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Ujfalusi <peter.ujfalusi@ti.com>2014-04-16 08:46:20 -0400
committerMark Brown <broonie@linaro.org>2014-04-18 13:03:02 -0400
commitd5c6c59a9d46113aebfd71f995b9e6e9af6a12b8 (patch)
tree7cdaa0713595de2bf6b217fc24503965f9943a09
parentab052d465bf7d52c1db176b762a91448e16d62c3 (diff)
ASoC: davinci-mcasp: Update MCASP_VERSION_4 platform driver registration
Version 4 of McASP is using omap-pcm as platform driver and the omap-pcm platform need to be registered using the cpu dai's device. Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com> Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r--sound/soc/davinci/davinci-mcasp.c37
1 files changed, 31 insertions, 6 deletions
diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c
index af92d3e8671d..d505fe7292a4 100644
--- a/sound/soc/davinci/davinci-mcasp.c
+++ b/sound/soc/davinci/davinci-mcasp.c
@@ -36,6 +36,7 @@
36 36
37#include "davinci-pcm.h" 37#include "davinci-pcm.h"
38#include "davinci-mcasp.h" 38#include "davinci-mcasp.h"
39#include "../omap/omap-pcm.h"
39 40
40#define MCASP_MAX_AFIFO_DEPTH 64 41#define MCASP_MAX_AFIFO_DEPTH 64
41 42
@@ -1220,12 +1221,25 @@ static int davinci_mcasp_probe(struct platform_device *pdev)
1220 if (ret != 0) 1221 if (ret != 0)
1221 goto err_release_clk; 1222 goto err_release_clk;
1222 1223
1223 if (mcasp->version != MCASP_VERSION_4) { 1224 switch (mcasp->version) {
1225 case MCASP_VERSION_1:
1226 case MCASP_VERSION_2:
1227 case MCASP_VERSION_3:
1224 ret = davinci_soc_platform_register(&pdev->dev); 1228 ret = davinci_soc_platform_register(&pdev->dev);
1225 if (ret) { 1229 break;
1226 dev_err(&pdev->dev, "register PCM failed: %d\n", ret); 1230 case MCASP_VERSION_4:
1227 goto err_unregister_component; 1231 ret = omap_pcm_platform_register(&pdev->dev);
1228 } 1232 break;
1233 default:
1234 dev_err(&pdev->dev, "Invalid McASP version: %d\n",
1235 mcasp->version);
1236 ret = -EINVAL;
1237 break;
1238 }
1239
1240 if (ret) {
1241 dev_err(&pdev->dev, "register PCM failed: %d\n", ret);
1242 goto err_unregister_component;
1229 } 1243 }
1230 1244
1231 return 0; 1245 return 0;
@@ -1243,8 +1257,19 @@ static int davinci_mcasp_remove(struct platform_device *pdev)
1243 struct davinci_mcasp *mcasp = dev_get_drvdata(&pdev->dev); 1257 struct davinci_mcasp *mcasp = dev_get_drvdata(&pdev->dev);
1244 1258
1245 snd_soc_unregister_component(&pdev->dev); 1259 snd_soc_unregister_component(&pdev->dev);
1246 if (mcasp->version != MCASP_VERSION_4) 1260
1261 switch (mcasp->version) {
1262 case MCASP_VERSION_1:
1263 case MCASP_VERSION_2:
1264 case MCASP_VERSION_3:
1247 davinci_soc_platform_unregister(&pdev->dev); 1265 davinci_soc_platform_unregister(&pdev->dev);
1266 break;
1267 case MCASP_VERSION_4:
1268 /* Using the resource managed omap-pcm as platform driver */
1269 break;
1270 default:
1271 break;
1272 }
1248 1273
1249 pm_runtime_put_sync(&pdev->dev); 1274 pm_runtime_put_sync(&pdev->dev);
1250 pm_runtime_disable(&pdev->dev); 1275 pm_runtime_disable(&pdev->dev);