aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/sound/soc.h5
-rw-r--r--sound/soc/soc-core.c34
2 files changed, 22 insertions, 17 deletions
diff --git a/include/sound/soc.h b/include/sound/soc.h
index 2d10090a08c0..7e8cf4f318a9 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -260,6 +260,9 @@ enum snd_soc_compress_type {
260 260
261int snd_soc_register_card(struct snd_soc_card *card); 261int snd_soc_register_card(struct snd_soc_card *card);
262int snd_soc_unregister_card(struct snd_soc_card *card); 262int snd_soc_unregister_card(struct snd_soc_card *card);
263int snd_soc_suspend(struct device *dev);
264int snd_soc_resume(struct device *dev);
265int snd_soc_poweroff(struct device *dev);
263int snd_soc_register_platform(struct device *dev, 266int snd_soc_register_platform(struct device *dev,
264 struct snd_soc_platform_driver *platform_drv); 267 struct snd_soc_platform_driver *platform_drv);
265void snd_soc_unregister_platform(struct device *dev); 268void snd_soc_unregister_platform(struct device *dev);
@@ -802,4 +805,6 @@ static inline void snd_soc_initialize_card_lists(struct snd_soc_card *card)
802extern struct dentry *snd_soc_debugfs_root; 805extern struct dentry *snd_soc_debugfs_root;
803#endif 806#endif
804 807
808extern const struct dev_pm_ops snd_soc_pm_ops;
809
805#endif 810#endif
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 4bc2365bf1dd..5dffc7a469c0 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -965,12 +965,11 @@ static struct snd_pcm_ops soc_pcm_ops = {
965 .pointer = soc_pcm_pointer, 965 .pointer = soc_pcm_pointer,
966}; 966};
967 967
968#ifdef CONFIG_PM 968#ifdef CONFIG_PM_SLEEP
969/* powers down audio subsystem for suspend */ 969/* powers down audio subsystem for suspend */
970static int soc_suspend(struct device *dev) 970int snd_soc_suspend(struct device *dev)
971{ 971{
972 struct platform_device *pdev = to_platform_device(dev); 972 struct snd_soc_card *card = dev_get_drvdata(dev);
973 struct snd_soc_card *card = platform_get_drvdata(pdev);
974 struct snd_soc_codec *codec; 973 struct snd_soc_codec *codec;
975 int i; 974 int i;
976 975
@@ -1082,6 +1081,7 @@ static int soc_suspend(struct device *dev)
1082 1081
1083 return 0; 1082 return 0;
1084} 1083}
1084EXPORT_SYMBOL_GPL(snd_soc_suspend);
1085 1085
1086/* deferred resume work, so resume can complete before we finished 1086/* deferred resume work, so resume can complete before we finished
1087 * setting our codec back up, which can be very slow on I2C 1087 * setting our codec back up, which can be very slow on I2C
@@ -1187,10 +1187,9 @@ static void soc_resume_deferred(struct work_struct *work)
1187} 1187}
1188 1188
1189/* powers up audio subsystem after a suspend */ 1189/* powers up audio subsystem after a suspend */
1190static int soc_resume(struct device *dev) 1190int snd_soc_resume(struct device *dev)
1191{ 1191{
1192 struct platform_device *pdev = to_platform_device(dev); 1192 struct snd_soc_card *card = dev_get_drvdata(dev);
1193 struct snd_soc_card *card = platform_get_drvdata(pdev);
1194 int i; 1193 int i;
1195 1194
1196 /* AC97 devices might have other drivers hanging off them so 1195 /* AC97 devices might have other drivers hanging off them so
@@ -1212,9 +1211,10 @@ static int soc_resume(struct device *dev)
1212 1211
1213 return 0; 1212 return 0;
1214} 1213}
1214EXPORT_SYMBOL_GPL(snd_soc_resume);
1215#else 1215#else
1216#define soc_suspend NULL 1216#define snd_soc_suspend NULL
1217#define soc_resume NULL 1217#define snd_soc_resume NULL
1218#endif 1218#endif
1219 1219
1220static struct snd_soc_dai_ops null_dai_ops = { 1220static struct snd_soc_dai_ops null_dai_ops = {
@@ -1924,10 +1924,9 @@ static int soc_remove(struct platform_device *pdev)
1924 return 0; 1924 return 0;
1925} 1925}
1926 1926
1927static int soc_poweroff(struct device *dev) 1927int snd_soc_poweroff(struct device *dev)
1928{ 1928{
1929 struct platform_device *pdev = to_platform_device(dev); 1929 struct snd_soc_card *card = dev_get_drvdata(dev);
1930 struct snd_soc_card *card = platform_get_drvdata(pdev);
1931 int i; 1930 int i;
1932 1931
1933 if (!card->instantiated) 1932 if (!card->instantiated)
@@ -1944,11 +1943,12 @@ static int soc_poweroff(struct device *dev)
1944 1943
1945 return 0; 1944 return 0;
1946} 1945}
1946EXPORT_SYMBOL_GPL(snd_soc_poweroff);
1947 1947
1948static const struct dev_pm_ops soc_pm_ops = { 1948const struct dev_pm_ops snd_soc_pm_ops = {
1949 .suspend = soc_suspend, 1949 .suspend = snd_soc_suspend,
1950 .resume = soc_resume, 1950 .resume = snd_soc_resume,
1951 .poweroff = soc_poweroff, 1951 .poweroff = snd_soc_poweroff,
1952}; 1952};
1953 1953
1954/* ASoC platform driver */ 1954/* ASoC platform driver */
@@ -1956,7 +1956,7 @@ static struct platform_driver soc_driver = {
1956 .driver = { 1956 .driver = {
1957 .name = "soc-audio", 1957 .name = "soc-audio",
1958 .owner = THIS_MODULE, 1958 .owner = THIS_MODULE,
1959 .pm = &soc_pm_ops, 1959 .pm = &snd_soc_pm_ops,
1960 }, 1960 },
1961 .probe = soc_probe, 1961 .probe = soc_probe,
1962 .remove = soc_remove, 1962 .remove = soc_remove,