Module Name:    src
Committed By:   uwe
Date:           Sun Apr  5 00:56:20 UTC 2009

Modified Files:
        src/sys/arch/hpcsh/dev/hd64461: hd64461.c hd64461pcmcia.c
            hd64461video.c

Log Message:
Register null hooks with pmf(9) for now, which is no worse than before
and allows us to test other things.


To generate a diff of this commit:
cvs rdiff -u -r1.21 -r1.22 src/sys/arch/hpcsh/dev/hd64461/hd64461.c
cvs rdiff -u -r1.45 -r1.46 src/sys/arch/hpcsh/dev/hd64461/hd64461pcmcia.c
cvs rdiff -u -r1.51 -r1.52 src/sys/arch/hpcsh/dev/hd64461/hd64461video.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/hpcsh/dev/hd64461/hd64461.c
diff -u src/sys/arch/hpcsh/dev/hd64461/hd64461.c:1.21 src/sys/arch/hpcsh/dev/hd64461/hd64461.c:1.22
--- src/sys/arch/hpcsh/dev/hd64461/hd64461.c:1.21	Sun Mar 22 02:25:11 2009
+++ src/sys/arch/hpcsh/dev/hd64461/hd64461.c	Sun Apr  5 00:56:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hd64461.c,v 1.21 2009/03/22 02:25:11 uwe Exp $	*/
+/*	$NetBSD: hd64461.c,v 1.22 2009/04/05 00:56:20 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hd64461.c,v 1.21 2009/03/22 02:25:11 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hd64461.c,v 1.22 2009/04/05 00:56:20 uwe Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -125,6 +125,10 @@
 		ha.ha_module_id = i;
 		config_found(self, &ha, hd64461_print);
 	}
+
+	/* XXX: TODO */
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }
 
 STATIC int

Index: src/sys/arch/hpcsh/dev/hd64461/hd64461pcmcia.c
diff -u src/sys/arch/hpcsh/dev/hd64461/hd64461pcmcia.c:1.45 src/sys/arch/hpcsh/dev/hd64461/hd64461pcmcia.c:1.46
--- src/sys/arch/hpcsh/dev/hd64461/hd64461pcmcia.c:1.45	Sat Mar 21 02:23:03 2009
+++ src/sys/arch/hpcsh/dev/hd64461/hd64461pcmcia.c	Sun Apr  5 00:56:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hd64461pcmcia.c,v 1.45 2009/03/21 02:23:03 uwe Exp $	*/
+/*	$NetBSD: hd64461pcmcia.c,v 1.46 2009/04/05 00:56:20 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hd64461pcmcia.c,v 1.45 2009/03/21 02:23:03 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hd64461pcmcia.c,v 1.46 2009/04/05 00:56:20 uwe Exp $");
 
 #include "opt_hd64461pcmcia.h"
 
@@ -272,6 +272,10 @@
 	KASSERT(error == 0);
 
 	config_pending_incr();
+
+	/* XXX: TODO */
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }
 
 STATIC void

Index: src/sys/arch/hpcsh/dev/hd64461/hd64461video.c
diff -u src/sys/arch/hpcsh/dev/hd64461/hd64461video.c:1.51 src/sys/arch/hpcsh/dev/hd64461/hd64461video.c:1.52
--- src/sys/arch/hpcsh/dev/hd64461/hd64461video.c:1.51	Wed Mar 18 02:49:34 2009
+++ src/sys/arch/hpcsh/dev/hd64461/hd64461video.c	Sun Apr  5 00:56:20 2009
@@ -1,4 +1,4 @@
-/*	$NetBSD: hd64461video.c,v 1.51 2009/03/18 02:49:34 uwe Exp $	*/
+/*	$NetBSD: hd64461video.c,v 1.52 2009/04/05 00:56:20 uwe Exp $	*/
 
 /*-
  * Copyright (c) 2001, 2002, 2004 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hd64461video.c,v 1.51 2009/03/18 02:49:34 uwe Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hd64461video.c,v 1.52 2009/04/05 00:56:20 uwe Exp $");
 
 #include "opt_hd64461video.h"
 // #define HD64461VIDEO_HWACCEL
@@ -271,6 +271,21 @@
 	hfa.ha_dspconflist = &hd64461video_chip.hd;
 	
 	config_found(self, &hfa, hpcfbprint);
+
+	/*
+	 * XXX: TODO: for now this device manages power using
+	 * config_hook(9) registered with hpcapm(4).
+	 *
+	 * We cannot yet switch it to pmf(9) hooks because only apm(4)
+	 * uses them, apmdev(4) doesn't, but hpcapm(4) is the parent
+	 * device for both, so its hooks are always run.
+	 *
+	 * We probably want to register shutdown hook with pmf(9) to
+	 * make sure display is powered on before we reboot in case we
+	 * end up in ddb early on.
+	 */
+	if (!pmf_device_register(self, NULL, NULL))
+		aprint_error_dev(self, "unable to establish power handler\n");
 }
 
 /* console support */

Reply via email to