aboutsummaryrefslogtreecommitdiffstats
path: root/sound/oss/cs4281
diff options
context:
space:
mode:
Diffstat (limited to 'sound/oss/cs4281')
-rw-r--r--sound/oss/cs4281/cs4281m.c21
-rw-r--r--sound/oss/cs4281/cs4281pm-24.c39
2 files changed, 1 insertions, 59 deletions
diff --git a/sound/oss/cs4281/cs4281m.c b/sound/oss/cs4281/cs4281m.c
index adc689649fe1..46dd41dc2a34 100644
--- a/sound/oss/cs4281/cs4281m.c
+++ b/sound/oss/cs4281/cs4281m.c
@@ -298,7 +298,6 @@ struct cs4281_state {
298 struct cs4281_pipeline pl[CS4281_NUMBER_OF_PIPELINES]; 298 struct cs4281_pipeline pl[CS4281_NUMBER_OF_PIPELINES];
299}; 299};
300 300
301#include <linux/pm_legacy.h>
302#include "cs4281pm-24.c" 301#include "cs4281pm-24.c"
303 302
304#if CSDEBUG 303#if CSDEBUG
@@ -4256,9 +4255,6 @@ static void __devinit cs4281_InitPM(struct cs4281_state *s)
4256static int __devinit cs4281_probe(struct pci_dev *pcidev, 4255static int __devinit cs4281_probe(struct pci_dev *pcidev,
4257 const struct pci_device_id *pciid) 4256 const struct pci_device_id *pciid)
4258{ 4257{
4259#ifndef NOT_CS4281_PM
4260 struct pm_dev *pmdev;
4261#endif
4262 struct cs4281_state *s; 4258 struct cs4281_state *s;
4263 dma_addr_t dma_mask; 4259 dma_addr_t dma_mask;
4264 mm_segment_t fs; 4260 mm_segment_t fs;
@@ -4374,19 +4370,7 @@ static int __devinit cs4281_probe(struct pci_dev *pcidev,
4374 } 4370 }
4375#ifndef NOT_CS4281_PM 4371#ifndef NOT_CS4281_PM
4376 cs4281_InitPM(s); 4372 cs4281_InitPM(s);
4377 pmdev = cs_pm_register(PM_PCI_DEV, PM_PCI_ID(pcidev), cs4281_pm_callback); 4373 s->pm.flags |= CS4281_PM_NOT_REGISTERED;
4378 if (pmdev)
4379 {
4380 CS_DBGOUT(CS_INIT | CS_PM, 4, printk(KERN_INFO
4381 "cs4281: probe() pm_register() succeeded (%p).\n", pmdev));
4382 pmdev->data = s;
4383 }
4384 else
4385 {
4386 CS_DBGOUT(CS_INIT | CS_PM | CS_ERROR, 0, printk(KERN_INFO
4387 "cs4281: probe() pm_register() failed (%p).\n", pmdev));
4388 s->pm.flags |= CS4281_PM_NOT_REGISTERED;
4389 }
4390#endif 4374#endif
4391 4375
4392 pci_set_master(pcidev); // enable bus mastering 4376 pci_set_master(pcidev); // enable bus mastering
@@ -4487,9 +4471,6 @@ static int __init cs4281_init_module(void)
4487static void __exit cs4281_cleanup_module(void) 4471static void __exit cs4281_cleanup_module(void)
4488{ 4472{
4489 pci_unregister_driver(&cs4281_pci_driver); 4473 pci_unregister_driver(&cs4281_pci_driver);
4490#ifndef NOT_CS4281_PM
4491 cs_pm_unregister_all(cs4281_pm_callback);
4492#endif
4493 CS_DBGOUT(CS_INIT | CS_FUNCTION, 2, 4474 CS_DBGOUT(CS_INIT | CS_FUNCTION, 2,
4494 printk(KERN_INFO "cs4281: cleanup_cs4281() finished\n")); 4475 printk(KERN_INFO "cs4281: cleanup_cs4281() finished\n"));
4495} 4476}
diff --git a/sound/oss/cs4281/cs4281pm-24.c b/sound/oss/cs4281/cs4281pm-24.c
index d2a453aff0aa..90cbd7679534 100644
--- a/sound/oss/cs4281/cs4281pm-24.c
+++ b/sound/oss/cs4281/cs4281pm-24.c
@@ -27,9 +27,6 @@
27#ifndef NOT_CS4281_PM 27#ifndef NOT_CS4281_PM
28#include <linux/pm.h> 28#include <linux/pm.h>
29 29
30#define cs_pm_register(a, b, c) pm_register((a), (b), (c));
31#define cs_pm_unregister_all(a) pm_unregister_all((a));
32
33static int cs4281_suspend(struct cs4281_state *s); 30static int cs4281_suspend(struct cs4281_state *s);
34static int cs4281_resume(struct cs4281_state *s); 31static int cs4281_resume(struct cs4281_state *s);
35/* 32/*
@@ -41,42 +38,6 @@ static int cs4281_resume(struct cs4281_state *s);
41#define CS4281_SUSPEND_TBL cs4281_suspend_null 38#define CS4281_SUSPEND_TBL cs4281_suspend_null
42#define CS4281_RESUME_TBL cs4281_resume_null 39#define CS4281_RESUME_TBL cs4281_resume_null
43 40
44static int cs4281_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data)
45{
46 struct cs4281_state *state;
47
48 CS_DBGOUT(CS_PM, 2, printk(KERN_INFO
49 "cs4281: cs4281_pm_callback dev=%p rqst=0x%x state=%p\n",
50 dev,(unsigned)rqst,data));
51 state = (struct cs4281_state *) dev->data;
52 if (state) {
53 switch(rqst) {
54 case PM_SUSPEND:
55 CS_DBGOUT(CS_PM, 2, printk(KERN_INFO
56 "cs4281: PM suspend request\n"));
57 if(cs4281_suspend(state))
58 {
59 CS_DBGOUT(CS_ERROR, 2, printk(KERN_INFO
60 "cs4281: PM suspend request refused\n"));
61 return 1;
62 }
63 break;
64 case PM_RESUME:
65 CS_DBGOUT(CS_PM, 2, printk(KERN_INFO
66 "cs4281: PM resume request\n"));
67 if(cs4281_resume(state))
68 {
69 CS_DBGOUT(CS_ERROR, 2, printk(KERN_INFO
70 "cs4281: PM resume request refused\n"));
71 return 1;
72 }
73 break;
74 }
75 }
76
77 return 0;
78}
79
80#else /* CS4281_PM */ 41#else /* CS4281_PM */
81#define CS4281_SUSPEND_TBL cs4281_suspend_null 42#define CS4281_SUSPEND_TBL cs4281_suspend_null
82#define CS4281_RESUME_TBL cs4281_resume_null 43#define CS4281_RESUME_TBL cs4281_resume_null