aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorJaroslav Kysela <perex@suse.cz>2004-05-17 19:22:44 +0200
committerJaroslav Kysela <perex@suse.cz>2004-05-17 19:22:44 +0200
commit0f2c1fd45b3c73e24a4efb69e544b0a413c323fc (patch)
tree7c2e0162c643b4209a2704256d069cb1fe5fb00c /sound
parent83632df912f096ba36e2ba31d2d1c0d66ebc1aeb (diff)
downloadhistory-0f2c1fd45b3c73e24a4efb69e544b0a413c323fc.tar.gz
ALSA CVS update - Takashi Iwai <tiwai@suse.de>
ALSA Core - added the generic PM callback registration. - rewritten ISA callbacks to use the new one.
Diffstat (limited to 'sound')
-rw-r--r--sound/core/init.c18
-rw-r--r--sound/core/sound.c4
2 files changed, 10 insertions, 12 deletions
diff --git a/sound/core/init.c b/sound/core/init.c
index 59f0231f3380fb..9c3df614ad7912 100644
--- a/sound/core/init.c
+++ b/sound/core/init.c
@@ -739,8 +739,7 @@ int snd_card_set_pm_callback(snd_card_t *card,
return 0;
}
-#ifdef CONFIG_ISA
-static int snd_isa_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data)
+static int snd_generic_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data)
{
snd_card_t *card = dev->data;
@@ -758,28 +757,29 @@ static int snd_isa_pm_callback(struct pm_dev *dev, pm_request_t rqst, void *data
}
/**
- * snd_card_set_isa_pm_callback - set the ISA power-management callbacks
+ * snd_card_set_dev_pm_callback - set the generic power-management callbacks
* @card: soundcard structure
+ * @type: PM device type (PM_XXX)
* @suspend: suspend callback function
* @resume: resume callback function
* @private_data: private data to pass to the callback functions
*
* Registers the power-management and sets the lowlevel callbacks for
- * the given ISA card. These callbacks are called from the ALSA's
- * common PM handler and from the control API.
+ * the given card with the given PM type. These callbacks are called
+ * from the ALSA's common PM handler and from the control API.
*/
-int snd_card_set_isa_pm_callback(snd_card_t *card,
+int snd_card_set_dev_pm_callback(snd_card_t *card, int type,
int (*suspend)(snd_card_t *, unsigned int),
int (*resume)(snd_card_t *, unsigned int),
void *private_data)
{
- card->pm_dev = pm_register(PM_ISA_DEV, 0, snd_isa_pm_callback);
+ card->pm_dev = pm_register(type, 0, snd_generic_pm_callback);
if (! card->pm_dev)
return -ENOMEM;
card->pm_dev->data = card;
- return snd_card_set_pm_callback(card, suspend, resume, private_data);
+ snd_card_set_pm_callback(card, suspend, resume, private_data);
+ return 0;
}
-#endif
#ifdef CONFIG_PCI
int snd_card_pci_suspend(struct pci_dev *dev, u32 state)
diff --git a/sound/core/sound.c b/sound/core/sound.c
index b8c789d405a0bc..558a8dbaae288f 100644
--- a/sound/core/sound.c
+++ b/sound/core/sound.c
@@ -467,13 +467,11 @@ EXPORT_SYMBOL(snd_card_file_remove);
#ifdef CONFIG_PM
EXPORT_SYMBOL(snd_power_wait);
EXPORT_SYMBOL(snd_card_set_pm_callback);
+EXPORT_SYMBOL(snd_card_set_dev_pm_callback);
#ifdef CONFIG_PCI
EXPORT_SYMBOL(snd_card_pci_suspend);
EXPORT_SYMBOL(snd_card_pci_resume);
#endif
-#ifdef CONFIG_ISA
-EXPORT_SYMBOL(snd_card_set_isa_pm_callback);
-#endif
#endif
/* device.c */
EXPORT_SYMBOL(snd_device_new);