* [RESEND PATCH] AC97 plugin suspend/resume
@ 2005-01-04 16:49 Liam Girdwood
0 siblings, 0 replies; only message in thread
From: Liam Girdwood @ 2005-01-04 16:49 UTC (permalink / raw)
To: Alan Cox; +Cc: Russell King - ARM Linux, lkml
[-- Attachment #1: Type: text/plain, Size: 304 bytes --]
Hi Alan,
Please disregard the previous AC97 suspend/resume patch.
Changes:-
- Add suspend/resume methods to the ac97 codec plugin driver structure.
- Add code to ac97_codec to allow these methods to be safely called for
the specified codec.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Liam
[-- Attachment #2: ac97_codec_pm.diff --]
[-- Type: text/x-patch, Size: 1755 bytes --]
--- a/sound/oss/ac97_codec.c 2004-12-24 21:34:00.000000000 +0000
+++ b/sound/oss/ac97_codec.c 2004-12-08 17:08:42.000000000 +0000
@@ -1391,6 +1421,33 @@
EXPORT_SYMBOL(ac97_restore_state);
+int ac97_suspend(struct ac97_codec *codec, int state)
+{
+ struct ac97_driver *driver;
+ int ret = 0;
+
+ down(&codec_sem);
+ driver = codec->driver;
+ if (driver != NULL && driver->suspend)
+ ret = driver->suspend(codec, state);
+ up(&codec_sem);
+
+ return ret;
+}
+EXPORT_SYMBOL(ac97_suspend);
+
+void ac97_resume(struct ac97_codec *codec)
+{
+ struct ac97_driver *driver;
+
+ down(&codec_sem);
+ driver = codec->driver;
+ if (driver != NULL && driver->resume)
+ driver->resume(codec);
+ up(&codec_sem);
+}
+EXPORT_SYMBOL(ac97_resume);
+
/**
* ac97_register_driver - register a codec helper
* @driver: Driver handler
--- a/include/linux/ac97_codec.h 2004-12-24 21:33:50.000000000 +0000
+++ b/include/linux/ac97_codec.h 2004-12-08 13:28:42.000000000 +0000
@@ -299,6 +300,8 @@
extern unsigned int ac97_set_dac_rate(struct ac97_codec *codec, unsigned int rate);
extern int ac97_save_state(struct ac97_codec *codec);
extern int ac97_restore_state(struct ac97_codec *codec);
+extern int ac97_suspend(struct ac97_codec *codec, int state);
+extern void ac97_resume(struct ac97_codec *codec);
extern struct ac97_codec *ac97_alloc_codec(void);
extern void ac97_release_codec(struct ac97_codec *codec);
@@ -310,6 +313,8 @@
u32 codec_mask;
int (*probe) (struct ac97_codec *codec, struct ac97_driver *driver);
void (*remove) (struct ac97_codec *codec, struct ac97_driver *driver);
+ int (*suspend) (struct ac97_codec *codec, int state);
+ void (*resume) (struct ac97_codec *codec);
};
extern int ac97_register_driver(struct ac97_driver *driver);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2005-01-04 16:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-04 16:49 [RESEND PATCH] AC97 plugin suspend/resume Liam Girdwood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox