diff options
author | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-06-13 17:30:18 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2009-06-13 17:30:18 -0400 |
commit | b3b50b3f31775be5d2e441618bbc1c5cbee4d9f1 (patch) | |
tree | 22171b96e3138fcea12f9845bc3f26358c7bfa6a /sound/soc/codecs/wm8988.c | |
parent | 831dc0f10f7b2a4856094ff160c018bf19f77527 (diff) |
ASoC: Add suspend and resume callbacks to Wolfson CODEC drivers
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/codecs/wm8988.c')
-rw-r--r-- | sound/soc/codecs/wm8988.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/sound/soc/codecs/wm8988.c b/sound/soc/codecs/wm8988.c index c05f71803aa8..03fac6a0f805 100644 --- a/sound/soc/codecs/wm8988.c +++ b/sound/soc/codecs/wm8988.c | |||
@@ -981,6 +981,21 @@ static int wm8988_i2c_remove(struct i2c_client *client) | |||
981 | return 0; | 981 | return 0; |
982 | } | 982 | } |
983 | 983 | ||
984 | #ifdef CONFIG_PM | ||
985 | static int wm8988_i2c_suspend(struct i2c_client *client, pm_message_t msg) | ||
986 | { | ||
987 | return snd_soc_suspend_device(&client->dev); | ||
988 | } | ||
989 | |||
990 | static int wm8988_i2c_resume(struct i2c_client *client) | ||
991 | { | ||
992 | return snd_soc_resume_device(&client->dev); | ||
993 | } | ||
994 | #else | ||
995 | #define wm8988_i2c_suspend NULL | ||
996 | #define wm8988_i2c_resume NULL | ||
997 | #endif | ||
998 | |||
984 | static const struct i2c_device_id wm8988_i2c_id[] = { | 999 | static const struct i2c_device_id wm8988_i2c_id[] = { |
985 | { "wm8988", 0 }, | 1000 | { "wm8988", 0 }, |
986 | { } | 1001 | { } |
@@ -994,6 +1009,8 @@ static struct i2c_driver wm8988_i2c_driver = { | |||
994 | }, | 1009 | }, |
995 | .probe = wm8988_i2c_probe, | 1010 | .probe = wm8988_i2c_probe, |
996 | .remove = wm8988_i2c_remove, | 1011 | .remove = wm8988_i2c_remove, |
1012 | .suspend = wm8988_i2c_suspend, | ||
1013 | .resume = wm8988_i2c_resume, | ||
997 | .id_table = wm8988_i2c_id, | 1014 | .id_table = wm8988_i2c_id, |
998 | }; | 1015 | }; |
999 | #endif | 1016 | #endif |
@@ -1051,6 +1068,21 @@ static int __devexit wm8988_spi_remove(struct spi_device *spi) | |||
1051 | return 0; | 1068 | return 0; |
1052 | } | 1069 | } |
1053 | 1070 | ||
1071 | #ifdef CONFIG_PM | ||
1072 | static int wm8988_spi_suspend(struct spi_device *spi, pm_message_t msg) | ||
1073 | { | ||
1074 | return snd_soc_suspend_device(&spi->dev); | ||
1075 | } | ||
1076 | |||
1077 | static int wm8988_spi_resume(struct spi_device *spi) | ||
1078 | { | ||
1079 | return snd_soc_resume_device(&spi->dev); | ||
1080 | } | ||
1081 | #else | ||
1082 | #define wm8988_spi_suspend NULL | ||
1083 | #define wm8988_spi_resume NULL | ||
1084 | #endif | ||
1085 | |||
1054 | static struct spi_driver wm8988_spi_driver = { | 1086 | static struct spi_driver wm8988_spi_driver = { |
1055 | .driver = { | 1087 | .driver = { |
1056 | .name = "wm8988", | 1088 | .name = "wm8988", |
@@ -1059,6 +1091,8 @@ static struct spi_driver wm8988_spi_driver = { | |||
1059 | }, | 1091 | }, |
1060 | .probe = wm8988_spi_probe, | 1092 | .probe = wm8988_spi_probe, |
1061 | .remove = __devexit_p(wm8988_spi_remove), | 1093 | .remove = __devexit_p(wm8988_spi_remove), |
1094 | .suspend = wm8988_spi_suspend, | ||
1095 | .resume = wm8988_spi_resume, | ||
1062 | }; | 1096 | }; |
1063 | #endif | 1097 | #endif |
1064 | 1098 | ||