Subject: hpckbd diff
To: None <port-hpcmips@NetBSD.org, port-hpcsh@NetBSD.org>
From: Peter Postma <peter@pointless.nl>
List: port-hpcsh
Date: 06/27/2006 12:39:46
I'd like to put the attached diffs into the tree if there are no objections.
It enables the "off" button and runs config hook for "button event power"
when pressed. This will change operation on the following models:
- tc5165_mobilon (hpcmips)
- hp620lx (hpcsh)
- persona_hpw50pad (hpcsh)
- persona_hpw200ec (hpcsh)
By judging from code inspection, those models will then try to suspend
when the off button is pressed but because their machine_sleep function
is empty, it will resume immediately. That might not be desirable so we
can either set the off button to -1 for those models or implement the
machine_sleep function. The former is the easiest for now, see 2nd diff.
[please CC me on replies]
Index: hpckbd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/hpc/hpckbd.c,v
retrieving revision 1.17
diff -u -r1.17 hpckbd.c
--- hpckbd.c 29 Mar 2006 06:37:35 -0000 1.17
+++ hpckbd.c 27 Jun 2006 10:34:16 -0000
@@ -367,9 +367,8 @@
return (0);
if (scancode == hc->hc_special[KEY_SPECIAL_OFF]) {
-#ifdef DEBUG
- printf("off button\n"); // XXX notyet -uch
-#endif
+ config_hook_call(CONFIG_HOOK_BUTTONEVENT,
+ CONFIG_HOOK_BUTTONEVENT_POWER, NULL);
} else if (scancode == hc->hc_special[KEY_SPECIAL_LIGHT]) {
static int onoff; /* XXX -uch */
config_hook_call(CONFIG_HOOK_BUTTONEVENT,
Index: hpckbdkeymap.h
===================================================================
RCS file: /cvsroot/src/sys/dev/hpc/hpckbdkeymap.h,v
retrieving revision 1.42
diff -u -r1.42 hpckbdkeymap.h
--- hpckbdkeymap.h 8 Apr 2006 15:03:19 -0000 1.42
+++ hpckbdkeymap.h 27 Jun 2006 10:23:26 -0000
@@ -90,7 +90,7 @@
};
const int tc5165_mobilon_special_keymap[] = {
- [KEY_SPECIAL_OFF] = 60,
+ [KEY_SPECIAL_OFF] = -1, /* 60 */
[KEY_SPECIAL_LIGHT] = 47
};
@@ -691,7 +691,7 @@
};
const int hp620lx_special_keymap[] = {
- [KEY_SPECIAL_OFF] = 88,
+ [KEY_SPECIAL_OFF] = -1, /* 88 */
[KEY_SPECIAL_LIGHT] = 120
};
@@ -721,7 +721,7 @@
};
const int persona_hpw50pad_special_keymap[] = {
- [KEY_SPECIAL_OFF] = 5,
+ [KEY_SPECIAL_OFF] = -1, /* 5 */
[KEY_SPECIAL_LIGHT] = -1
};
@@ -763,7 +763,7 @@
};
const int persona_hpw200ec_special_keymap[] = {
- [KEY_SPECIAL_OFF] = 5,
+ [KEY_SPECIAL_OFF] = -1, /* 5 */
[KEY_SPECIAL_LIGHT] = -1
};
--
Peter Postma