aboutsummaryrefslogtreecommitdiffstats
path: root/sound/arm/pxa2xx-ac97.c
diff options
context:
space:
mode:
authorJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
committerJonathan Herman <hermanjl@cs.unc.edu>2013-01-17 16:15:55 -0500
commit8dea78da5cee153b8af9c07a2745f6c55057fe12 (patch)
treea8f4d49d63b1ecc92f2fddceba0655b2472c5bd9 /sound/arm/pxa2xx-ac97.c
parent406089d01562f1e2bf9f089fd7637009ebaad589 (diff)
Patched in Tegra support.
Diffstat (limited to 'sound/arm/pxa2xx-ac97.c')
-rw-r--r--sound/arm/pxa2xx-ac97.c33
1 files changed, 23 insertions, 10 deletions
diff --git a/sound/arm/pxa2xx-ac97.c b/sound/arm/pxa2xx-ac97.c
index ec54be4efff..5d9411839cd 100644
--- a/sound/arm/pxa2xx-ac97.c
+++ b/sound/arm/pxa2xx-ac97.c
@@ -11,7 +11,6 @@
11 */ 11 */
12 12
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/io.h>
15#include <linux/module.h> 14#include <linux/module.h>
16#include <linux/platform_device.h> 15#include <linux/platform_device.h>
17 16
@@ -106,9 +105,9 @@ static struct pxa2xx_pcm_client pxa2xx_ac97_pcm_client = {
106 .prepare = pxa2xx_ac97_pcm_prepare, 105 .prepare = pxa2xx_ac97_pcm_prepare,
107}; 106};
108 107
109#ifdef CONFIG_PM_SLEEP 108#ifdef CONFIG_PM
110 109
111static int pxa2xx_ac97_do_suspend(struct snd_card *card) 110static int pxa2xx_ac97_do_suspend(struct snd_card *card, pm_message_t state)
112{ 111{
113 pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data; 112 pxa2xx_audio_ops_t *platform_ops = card->dev->platform_data;
114 113
@@ -144,7 +143,7 @@ static int pxa2xx_ac97_suspend(struct device *dev)
144 int ret = 0; 143 int ret = 0;
145 144
146 if (card) 145 if (card)
147 ret = pxa2xx_ac97_do_suspend(card); 146 ret = pxa2xx_ac97_do_suspend(card, PMSG_SUSPEND);
148 147
149 return ret; 148 return ret;
150} 149}
@@ -160,10 +159,13 @@ static int pxa2xx_ac97_resume(struct device *dev)
160 return ret; 159 return ret;
161} 160}
162 161
163static SIMPLE_DEV_PM_OPS(pxa2xx_ac97_pm_ops, pxa2xx_ac97_suspend, pxa2xx_ac97_resume); 162static const struct dev_pm_ops pxa2xx_ac97_pm_ops = {
163 .suspend = pxa2xx_ac97_suspend,
164 .resume = pxa2xx_ac97_resume,
165};
164#endif 166#endif
165 167
166static int pxa2xx_ac97_probe(struct platform_device *dev) 168static int __devinit pxa2xx_ac97_probe(struct platform_device *dev)
167{ 169{
168 struct snd_card *card; 170 struct snd_card *card;
169 struct snd_ac97_bus *ac97_bus; 171 struct snd_ac97_bus *ac97_bus;
@@ -224,7 +226,7 @@ err_dev:
224 return ret; 226 return ret;
225} 227}
226 228
227static int pxa2xx_ac97_remove(struct platform_device *dev) 229static int __devexit pxa2xx_ac97_remove(struct platform_device *dev)
228{ 230{
229 struct snd_card *card = platform_get_drvdata(dev); 231 struct snd_card *card = platform_get_drvdata(dev);
230 232
@@ -239,17 +241,28 @@ static int pxa2xx_ac97_remove(struct platform_device *dev)
239 241
240static struct platform_driver pxa2xx_ac97_driver = { 242static struct platform_driver pxa2xx_ac97_driver = {
241 .probe = pxa2xx_ac97_probe, 243 .probe = pxa2xx_ac97_probe,
242 .remove = pxa2xx_ac97_remove, 244 .remove = __devexit_p(pxa2xx_ac97_remove),
243 .driver = { 245 .driver = {
244 .name = "pxa2xx-ac97", 246 .name = "pxa2xx-ac97",
245 .owner = THIS_MODULE, 247 .owner = THIS_MODULE,
246#ifdef CONFIG_PM_SLEEP 248#ifdef CONFIG_PM
247 .pm = &pxa2xx_ac97_pm_ops, 249 .pm = &pxa2xx_ac97_pm_ops,
248#endif 250#endif
249 }, 251 },
250}; 252};
251 253
252module_platform_driver(pxa2xx_ac97_driver); 254static int __init pxa2xx_ac97_init(void)
255{
256 return platform_driver_register(&pxa2xx_ac97_driver);
257}
258
259static void __exit pxa2xx_ac97_exit(void)
260{
261 platform_driver_unregister(&pxa2xx_ac97_driver);
262}
263
264module_init(pxa2xx_ac97_init);
265module_exit(pxa2xx_ac97_exit);
253 266
254MODULE_AUTHOR("Nicolas Pitre"); 267MODULE_AUTHOR("Nicolas Pitre");
255MODULE_DESCRIPTION("AC97 driver for the Intel PXA2xx chip"); 268MODULE_DESCRIPTION("AC97 driver for the Intel PXA2xx chip");