All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] AC97 plugin suspend/resume
@ 2005-01-04 14:50 Liam Girdwood
  2005-01-04 15:19 ` Russell King
  0 siblings, 1 reply; 4+ messages in thread
From: Liam Girdwood @ 2005-01-04 14:50 UTC (permalink / raw)
  To: Alan Cox; +Cc: lkml

[-- Attachment #1: Type: text/plain, Size: 253 bytes --]

This patch adds suspend and resume support to OSS AC97 plugins.

Changes :-

  o added suspend/resume callbacks to struct ac97_driver
  o added suspend/resume handlers to ac97_codec.c

Signed-off-by: Liam Girdwood <liam.girdwood@wolfsonmicro.com>

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] 4+ messages in thread

* Re: [PATCH 1/2] AC97 plugin suspend/resume
  2005-01-04 14:50 [PATCH 1/2] AC97 plugin suspend/resume Liam Girdwood
@ 2005-01-04 15:19 ` Russell King
  2005-01-04 15:55   ` Liam Girdwood
  0 siblings, 1 reply; 4+ messages in thread
From: Russell King @ 2005-01-04 15:19 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: Alan Cox, lkml

On Tue, Jan 04, 2005 at 02:50:43PM +0000, Liam Girdwood wrote:
> This patch adds suspend and resume support to OSS AC97 plugins.
> 
> Changes :-
> 
>   o added suspend/resume callbacks to struct ac97_driver
>   o added suspend/resume handlers to ac97_codec.c
> 
> Signed-off-by: Liam Girdwood <liam.girdwood@wolfsonmicro.com>

Liam,

Please consider giving credit where credit is due.  Thanks.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] AC97 plugin suspend/resume
  2005-01-04 15:19 ` Russell King
@ 2005-01-04 15:55   ` Liam Girdwood
  2005-01-04 16:06     ` Russell King
  0 siblings, 1 reply; 4+ messages in thread
From: Liam Girdwood @ 2005-01-04 15:55 UTC (permalink / raw)
  To: Russell King; +Cc: Alan Cox, lkml, Vincent Sanders

On Tue, 2005-01-04 at 15:19, Russell King wrote:
> Liam,
> 
> Please consider giving credit where credit is due.  Thanks.

Sorry Russell,

I had no idea who in the group had originally made the change since
yourself and Vince were accepting the kernel patches. I thought it would
be better to submit it signed rather than unsigned. 

Please let me know who is responsible and if it's ok, I'll then
re-submit.

Best Regards

Liam 


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/2] AC97 plugin suspend/resume
  2005-01-04 15:55   ` Liam Girdwood
@ 2005-01-04 16:06     ` Russell King
  0 siblings, 0 replies; 4+ messages in thread
From: Russell King @ 2005-01-04 16:06 UTC (permalink / raw)
  To: Liam Girdwood; +Cc: Alan Cox, lkml, Vincent Sanders

On Tue, Jan 04, 2005 at 03:55:48PM +0000, Liam Girdwood wrote:
> On Tue, 2005-01-04 at 15:19, Russell King wrote:
> > Liam,
> > 
> > Please consider giving credit where credit is due.  Thanks.
> 
> Sorry Russell,
> 
> I had no idea who in the group had originally made the change since
> yourself and Vince were accepting the kernel patches. I thought it would
> be better to submit it signed rather than unsigned. 
> 
> Please let me know who is responsible and if it's ok, I'll then
> re-submit.

Yours truely is responsible for this code change - it was committed
into "that" CVS tree with these comments originally:

Reference: 13-wm97xx/03-ac97-pm

- 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.
- Convert ac97_plugin_wm97xx to use these two pointers for its suspend
  and resume hooks.
- Modify pxa-ac97 to call the new ac97_codec suspend/resume functions.

so what you have there is a cut down version of this patch.

If you want an archive of the cvs commit messages for "that" CVS tree,
I can throw you a copy.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2005-01-04 16:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-01-04 14:50 [PATCH 1/2] AC97 plugin suspend/resume Liam Girdwood
2005-01-04 15:19 ` Russell King
2005-01-04 15:55   ` Liam Girdwood
2005-01-04 16:06     ` Russell King

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.