Update of /cvsroot/alsa/alsa-driver/acore
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19788/acore

Modified Files:
        init.patch 
Log Message:
Clean up of power-management codes.

- moved commonly used codes to the core layer.
- using the unified suspend/resume callbacks for PCI and ISA
- added snd_card_set_pm_callbacks() and snd_card_set_isa_pm_callbacks()
  as the registration functions.


Index: init.patch
===================================================================
RCS file: /cvsroot/alsa/alsa-driver/acore/init.patch,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- init.patch  30 May 2003 13:37:41 -0000      1.1
+++ init.patch  8 Apr 2004 16:38:15 -0000       1.2
@@ -1,11 +1,11 @@
---- init.c     2003-05-30 15:23:05.000000000 +0200
-+++ init.c.old 2003-05-30 15:23:30.000000000 +0200
+--- init.c     2004-04-08 15:17:39.038216193 +0200
++++ init.c     2004-04-08 16:16:07.923889354 +0200
 @@ -1,3 +1,4 @@
 +#define __NO_VERSION__
  /*
   *  Initialization routines
   *  Copyright (c) by Jaroslav Kysela <[EMAIL PROTECTED]>
-@@ -193,7 +194,9 @@
+@@ -197,7 +198,9 @@
                f_ops = &s_f_ops->f_ops;
  
                memset(f_ops, 0, sizeof(*f_ops));
@@ -15,3 +15,44 @@
                f_ops->release = file->f_op->release;
                f_ops->poll = snd_disconnect_poll;
  
+@@ -759,6 +762,31 @@
+ #endif
+ 
+ #ifdef CONFIG_PCI
++#ifdef PCI_OLD_SUSPEND
++void snd_card_pci_suspend(struct pci_dev *dev)
++{
++      snd_card_t *card = pci_get_drvdata(dev);
++      if (! card || ! card->pm_suspend)
++              return;
++      if (card->power_state == SNDRV_CTL_POWER_D3hot)
++              return;
++      /* FIXME: correct state value? */
++      card->pm_suspend(card, 0);
++}
++
++void snd_card_pci_resume(struct pci_dev *dev)
++{
++      snd_card_t *card = pci_get_drvdata(dev);
++      if (! card || ! card->pm_resume)
++              return;
++      if (card->power_state == SNDRV_CTL_POWER_D0)
++              return;
++      /* FIXME: correct state value? */
++      card->pm_resume(card, 0);
++}
++
++#else
++
+ int snd_card_pci_suspend(struct pci_dev *dev, u32 state)
+ {
+       snd_card_t *card = pci_get_drvdata(dev);
+@@ -780,6 +808,8 @@
+       /* FIXME: correct state value? */
+       return card->pm_resume(card, 0);
+ }
++
++#endif
+ #endif
+ 
+ #endif /* CONFIG_PM */



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to