Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting

kernel/3165: NeoMagic 256AV/ZX: Added reinit after suspend functionality

From: <aditya(at)dsl.cis.upenn.edu>
Date: Fri Mar 21 2003 - 12:19:30 EST


>Number: 3165
>Category: kernel
>Synopsis: Driver didn't get reinitialized after a suspend
>Confidential: yes
>Severity: non-critical
>Priority: low
>Responsible: bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: net
>Arrival-Date: Fri Mar 21 17:30:01 GMT 2003
>Closed-Date:
>Last-Modified:
>Originator: Aditya Chadha
>Release: neo.c,v 1.14
>Organization:

net
>Environment:
        

	System      : OpenBSD 3.3
	Architecture: OpenBSD.i386
	Machine     : i386

>Description:
The sound card driver for the NeoMagic 256AV/ZX family of cards (/usr/src/sys/dev/pci/neo.c) did not reinitialize itself after a suspend/resume, resulting in no sound coming out of the speaker after you suspended and subsequently resumed. The attached patch adds the neo_power function to add that functionality.
>How-To-Repeat:
Suspend the machine with zzz, and then resume it with a keystroke. Sound files play, but no sound comes out.
>Fix:
--- /home/aditya/neo.c Fri Mar 21 12:10:59 2003 +++ /usr/src/sys/dev/pci/neo.c Thu Mar 20 19:22:53 2003
@@ -155,6 +155,8 @@  
 	struct ac97_codec_if *codec_if;
 	struct ac97_host_if host_if;
+
+	void *powerhook;

 };  
 /* -------------------------------------------------------------------- */
@@ -203,7 +205,7 @@
 size_t	neo_round_buffersize(void *, int, size_t);
 int	neo_get_props(void *);
 void	neo_set_mixer(struct neo_softc *sc, int a, int d);
-
+void neo_power(int why, void *arg);    

 struct cfdriver neo_cd = {
@@ -609,10 +611,25 @@

 	if ((error = ac97_attach(&sc->host_if)) != 0)
 		return;
 
+	sc->powerhook = powerhook_establish(neo_power, sc);
+
 	audio_attach_mi(&neo_hw_if, sc, &sc->dev);
 
 	return;

 }
+
+void
+neo_power(int why, void *addr)
+{
+        struct neo_softc *sc = (struct neo_softc *)addr;
+
+	        if (why == PWR_RESUME) {
+			nm_init(sc);
+			(sc->codec_if->vtbl->restore_ports)(sc->codec_if);
+		}
+}
+
+
 

 int
 neo_match(parent, match, aux)

>Release-Note:
Received on Fri Mar 21 12:34:17 2003

This archive was generated by hypermail 2.1.8 : Wed Aug 23 2006 - 13:29:52 EDT


Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library