Update of /cvsroot/alsa/alsa-kernel/include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19034/include

Modified Files:
        ad1848.h core.h cs4231.h cs46xx.h trident.h ymfpci.h 
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: ad1848.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/include/ad1848.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- ad1848.h    8 Jul 2003 10:41:05 -0000       1.9
+++ ad1848.h    8 Apr 2004 16:34:59 -0000       1.10
@@ -147,9 +147,6 @@
        int calibrate_mute;
        int dma_size;
        int thinkpad_flag;              /* Thinkpad CS4248 needs some extra help */
-#ifdef CONFIG_PM
-       struct pm_dev *thinkpad_pmstate;
-#endif
 
        spinlock_t reg_lock;
        struct semaphore open_mutex;

Index: core.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/include/core.h,v
retrieving revision 1.49
retrieving revision 1.50
diff -u -r1.49 -r1.50
--- core.h      21 Jan 2004 18:32:46 -0000      1.49
+++ core.h      8 Apr 2004 16:34:59 -0000       1.50
@@ -163,8 +163,10 @@
        struct device *dev;
 
 #ifdef CONFIG_PM
-       int (*set_power_state) (snd_card_t *card, unsigned int state);
-       void *power_state_private_data;
+       int (*pm_suspend)(snd_card_t *card, unsigned int state);
+       int (*pm_resume)(snd_card_t *card, unsigned int state);
+       struct pm_dev *pm_dev;          /* for ISA */
+       void *pm_private_data;
        unsigned int power_state;       /* power state */
        struct semaphore power_lock;    /* power lock */
        wait_queue_head_t power_sleep;
@@ -199,12 +201,29 @@
        card->power_state = state;
        wake_up(&card->power_sleep);
 }
+int snd_card_set_pm_callback(snd_card_t *card,
+                            int (*suspend)(snd_card_t *, unsigned int),
+                            int (*resume)(snd_card_t *, unsigned int),
+                            void *private_data);
+int snd_card_set_isa_pm_callback(snd_card_t *card,
+                                int (*suspend)(snd_card_t *, unsigned int),
+                                int (*resume)(snd_card_t *, unsigned int),
+                                void *private_data);
+#ifndef SND_PCI_PM_CALLBACKS
+int snd_card_pci_suspend(struct pci_dev *dev, u32 state);
+int snd_card_pci_resume(struct pci_dev *dev);
+#define SND_PCI_PM_CALLBACKS \
+       .suspend = snd_card_pci_suspend,  .resume = snd_card_pci_resume
+#endif
 #else
 #define snd_power_lock(card)           do { (void)(card); } while (0)
 #define snd_power_unlock(card)         do { (void)(card); } while (0)
 static inline int snd_power_wait(snd_card_t *card, unsigned int state, struct file 
*file) { return 0; }
 #define snd_power_get_state(card)      SNDRV_CTL_POWER_D0
 #define snd_power_change_state(card, state)    do { (void)(card); } while (0)
+#define snd_card_set_pm_callback(card,suspend,resume,data) -EINVAL
+#define snd_card_set_isa_pm_callback(card,suspend,resume,data) -EINVAL
+#define SND_PCI_PM_CALLBACKS
 #endif
 
 /* device.c */

Index: cs4231.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/include/cs4231.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- cs4231.h    23 Apr 2003 10:01:30 -0000      1.7
+++ cs4231.h    8 Apr 2004 16:34:59 -0000       1.8
@@ -295,7 +295,6 @@
        void (*set_capture_format) (cs4231_t *chip, snd_pcm_hw_params_t *hw_params, 
unsigned char cdfr);
        void (*trigger) (cs4231_t *chip, unsigned int what, int start);
 #ifdef CONFIG_PM
-       struct pm_dev *pm_dev;
        void (*suspend) (cs4231_t *chip);
        void (*resume) (cs4231_t *chip);
 #endif

Index: cs46xx.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/include/cs46xx.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- cs46xx.h    2 Mar 2004 15:32:36 -0000       1.18
+++ cs46xx.h    8 Apr 2004 16:34:59 -0000       1.19
@@ -1737,9 +1737,6 @@
 
        struct snd_cs46xx_gameport *gameport;
 
-#ifdef CONFIG_PM
-       struct pm_dev *pm_dev;
-#endif
 #ifdef CONFIG_SND_CS46XX_DEBUG_GPIO
        int current_gpio;
 #endif
@@ -1771,9 +1768,4 @@
 int snd_cs46xx_start_dsp(cs46xx_t *chip);
 void snd_cs46xx_gameport(cs46xx_t *chip);
 
-#ifdef CONFIG_PM
-void snd_cs46xx_suspend(cs46xx_t *chip);
-void snd_cs46xx_resume(cs46xx_t *chip);
-#endif
-
 #endif /* __SOUND_CS46XX_H */

Index: trident.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/include/trident.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- trident.h   2 Mar 2004 15:32:36 -0000       1.16
+++ trident.h   8 Apr 2004 16:34:59 -0000       1.17
@@ -488,10 +488,4 @@
 int snd_trident_synth_bzero(trident_t *trident, snd_util_memblk_t *blk, int offset, 
int size);
 int snd_trident_synth_copy_from_user(trident_t *trident, snd_util_memblk_t *blk, int 
offset, const char *data, int size);
 
-/* Power Management */
-#ifdef CONFIG_PM
-void snd_trident_suspend(trident_t *trident);
-void snd_trident_resume(trident_t *trident);
-#endif
-
 #endif /* __SOUND_TRIDENT_H */

Index: ymfpci.h
===================================================================
RCS file: /cvsroot/alsa/alsa-kernel/include/ymfpci.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- ymfpci.h    2 Mar 2004 15:32:36 -0000       1.14
+++ ymfpci.h    8 Apr 2004 16:34:59 -0000       1.15
@@ -393,11 +393,6 @@
 int snd_ymfpci_voice_alloc(ymfpci_t *chip, ymfpci_voice_type_t type, int pair, 
ymfpci_voice_t **rvoice);
 int snd_ymfpci_voice_free(ymfpci_t *chip, ymfpci_voice_t *pvoice);
 
-#ifdef CONFIG_PM
-void snd_ymfpci_suspend(ymfpci_t *chip);
-void snd_ymfpci_resume(ymfpci_t *chip);
-#endif
-
 #if defined(CONFIG_GAMEPORT) || (defined(MODULE) && defined(CONFIG_GAMEPORT_MODULE))
 #define SUPPORT_JOYSTICK
 #endif



-------------------------------------------------------
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