aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorVinod Koul <vinod.koul@intel.com>2011-01-14 08:52:48 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-01-17 08:50:08 -0500
commit70a7ca34dbdcc6f0ed332baf2b308bab2871424a (patch)
tree9f5effa903362d8b717bfd944551cd27e66ded4a /sound/soc
parent62ffac4d70ed996d303da0ac8e32c89b9810115c (diff)
ASoC: soc core allow machine driver to register the card
The machine driver can't register the card directly and need to do this thru soc-audio device creation This patch allows the register and unregister card to be directly called by machine drivers Signed-off-by: Vinod Koul <vinod.koul@intel.com> Signed-off-by: Harsha Priya <priya.harsha@intel.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/soc-core.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 83057127b2fa..69117b686fdc 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -58,8 +58,6 @@ static LIST_HEAD(dai_list);
58static LIST_HEAD(platform_list); 58static LIST_HEAD(platform_list);
59static LIST_HEAD(codec_list); 59static LIST_HEAD(codec_list);
60 60
61static int snd_soc_register_card(struct snd_soc_card *card);
62static int snd_soc_unregister_card(struct snd_soc_card *card);
63static int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num); 61static int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num);
64 62
65/* 63/*
@@ -1870,6 +1868,13 @@ static int soc_probe(struct platform_device *pdev)
1870 struct snd_soc_card *card = platform_get_drvdata(pdev); 1868 struct snd_soc_card *card = platform_get_drvdata(pdev);
1871 int ret = 0; 1869 int ret = 0;
1872 1870
1871 /*
1872 * no card, so machine driver should be registering card
1873 * we should not be here in that case so ret error
1874 */
1875 if (!card)
1876 return -EINVAL;
1877
1873 /* Bodge while we unpick instantiation */ 1878 /* Bodge while we unpick instantiation */
1874 card->dev = &pdev->dev; 1879 card->dev = &pdev->dev;
1875 snd_soc_initialize_card_lists(card); 1880 snd_soc_initialize_card_lists(card);
@@ -3105,11 +3110,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dai_digital_mute);
3105 * 3110 *
3106 * @card: Card to register 3111 * @card: Card to register
3107 * 3112 *
3108 * Note that currently this is an internal only function: it will be
3109 * exposed to machine drivers after further backporting of ASoC v2
3110 * registration APIs.
3111 */ 3113 */
3112static int snd_soc_register_card(struct snd_soc_card *card) 3114int snd_soc_register_card(struct snd_soc_card *card)
3113{ 3115{
3114 int i; 3116 int i;
3115 3117
@@ -3141,17 +3143,15 @@ static int snd_soc_register_card(struct snd_soc_card *card)
3141 3143
3142 return 0; 3144 return 0;
3143} 3145}
3146EXPORT_SYMBOL_GPL(snd_soc_register_card);
3144 3147
3145/** 3148/**
3146 * snd_soc_unregister_card - Unregister a card with the ASoC core 3149 * snd_soc_unregister_card - Unregister a card with the ASoC core
3147 * 3150 *
3148 * @card: Card to unregister 3151 * @card: Card to unregister
3149 * 3152 *
3150 * Note that currently this is an internal only function: it will be
3151 * exposed to machine drivers after further backporting of ASoC v2
3152 * registration APIs.
3153 */ 3153 */
3154static int snd_soc_unregister_card(struct snd_soc_card *card) 3154int snd_soc_unregister_card(struct snd_soc_card *card)
3155{ 3155{
3156 if (card->instantiated) 3156 if (card->instantiated)
3157 soc_cleanup_card_resources(card); 3157 soc_cleanup_card_resources(card);
@@ -3162,6 +3162,7 @@ static int snd_soc_unregister_card(struct snd_soc_card *card)
3162 3162
3163 return 0; 3163 return 0;
3164} 3164}
3165EXPORT_SYMBOL_GPL(snd_soc_unregister_card);
3165 3166
3166/* 3167/*
3167 * Simplify DAI link configuration by removing ".-1" from device names 3168 * Simplify DAI link configuration by removing ".-1" from device names