diff options
author | Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> | 2014-03-03 23:50:33 -0500 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2014-03-05 01:07:52 -0500 |
commit | 7681f6ac6b6338932621f842d68e54f6267b785f (patch) | |
tree | 71970ac5d695d998e6c00de82590e293c04f82b8 | |
parent | 221bf523e31306c1095b28932e079950108e3887 (diff) |
ASoC: rsnd: add probe/remove callback on rsnd_mod_ops
Each rsnd mod needs specific probe method,
and its best timing is DAI probe timing.
But current code runs it mod probe timing.
This patch adds new probe/remove callback to solve it.
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
-rw-r--r-- | sound/soc/sh/rcar/core.c | 23 | ||||
-rw-r--r-- | sound/soc/sh/rcar/rsnd.h | 6 |
2 files changed, 29 insertions, 0 deletions
diff --git a/sound/soc/sh/rcar/core.c b/sound/soc/sh/rcar/core.c index 7316d10e4649..e8e585de7251 100644 --- a/sound/soc/sh/rcar/core.c +++ b/sound/soc/sh/rcar/core.c | |||
@@ -842,6 +842,7 @@ static int rsnd_probe(struct platform_device *pdev) | |||
842 | struct rcar_snd_info *info; | 842 | struct rcar_snd_info *info; |
843 | struct rsnd_priv *priv; | 843 | struct rsnd_priv *priv; |
844 | struct device *dev = &pdev->dev; | 844 | struct device *dev = &pdev->dev; |
845 | struct rsnd_dai *rdai; | ||
845 | int (*probe_func[])(struct platform_device *pdev, | 846 | int (*probe_func[])(struct platform_device *pdev, |
846 | struct rsnd_priv *priv) = { | 847 | struct rsnd_priv *priv) = { |
847 | rsnd_gen_probe, | 848 | rsnd_gen_probe, |
@@ -880,6 +881,16 @@ static int rsnd_probe(struct platform_device *pdev) | |||
880 | return ret; | 881 | return ret; |
881 | } | 882 | } |
882 | 883 | ||
884 | for_each_rsnd_dai(rdai, priv, i) { | ||
885 | ret = rsnd_dai_call(rdai, &rdai->playback, probe); | ||
886 | if (ret) | ||
887 | return ret; | ||
888 | |||
889 | ret = rsnd_dai_call(rdai, &rdai->capture, probe); | ||
890 | if (ret) | ||
891 | return ret; | ||
892 | } | ||
893 | |||
883 | /* | 894 | /* |
884 | * asoc register | 895 | * asoc register |
885 | */ | 896 | */ |
@@ -912,9 +923,21 @@ exit_snd_soc: | |||
912 | static int rsnd_remove(struct platform_device *pdev) | 923 | static int rsnd_remove(struct platform_device *pdev) |
913 | { | 924 | { |
914 | struct rsnd_priv *priv = dev_get_drvdata(&pdev->dev); | 925 | struct rsnd_priv *priv = dev_get_drvdata(&pdev->dev); |
926 | struct rsnd_dai *rdai; | ||
927 | int ret, i; | ||
915 | 928 | ||
916 | pm_runtime_disable(&pdev->dev); | 929 | pm_runtime_disable(&pdev->dev); |
917 | 930 | ||
931 | for_each_rsnd_dai(rdai, priv, i) { | ||
932 | ret = rsnd_dai_call(rdai, &rdai->playback, remove); | ||
933 | if (ret) | ||
934 | return ret; | ||
935 | |||
936 | ret = rsnd_dai_call(rdai, &rdai->capture, remove); | ||
937 | if (ret) | ||
938 | return ret; | ||
939 | } | ||
940 | |||
918 | /* | 941 | /* |
919 | * remove each module | 942 | * remove each module |
920 | */ | 943 | */ |
diff --git a/sound/soc/sh/rcar/rsnd.h b/sound/soc/sh/rcar/rsnd.h index 9205f96da2f4..db20b3721953 100644 --- a/sound/soc/sh/rcar/rsnd.h +++ b/sound/soc/sh/rcar/rsnd.h | |||
@@ -167,6 +167,12 @@ enum rsnd_mod_type { | |||
167 | 167 | ||
168 | struct rsnd_mod_ops { | 168 | struct rsnd_mod_ops { |
169 | char *name; | 169 | char *name; |
170 | int (*probe)(struct rsnd_mod *mod, | ||
171 | struct rsnd_dai *rdai, | ||
172 | struct rsnd_dai_stream *io); | ||
173 | int (*remove)(struct rsnd_mod *mod, | ||
174 | struct rsnd_dai *rdai, | ||
175 | struct rsnd_dai_stream *io); | ||
170 | int (*init)(struct rsnd_mod *mod, | 176 | int (*init)(struct rsnd_mod *mod, |
171 | struct rsnd_dai *rdai, | 177 | struct rsnd_dai *rdai, |
172 | struct rsnd_dai_stream *io); | 178 | struct rsnd_dai_stream *io); |