- merge CONFIG_HOOK_OUT and CONFIG_HOOK_SET and CONFIG_HOOK_POWERCONTROL
to CONFIG_HOOK_SET. - merge CONFIG_HOOK_GET and CONFIG_HOOK_GETPOWER to CONFIG_HOOK_GET. - merge CONFIG_HOOK_EVENT and CONFIG_HOOK_BUTTONEVENT to CONFIG_HOOK_ENENT. - new CONFIG_HOOK_EVENT and CONFIG_HOOK_GET and CONFIG_HOOK_SET always have msg argument as pointer. - new CONFIG_HOOK_EVENT and CONFIG_HOOK_GET and CONFIG_HOOK_SET use same event ids. - CONFIG_HOOK_POWERCONTROL and CONFIG_HOOK_BUTTONEVENT still exist. i shall rewite codes by using new CONFIG_HOOK_SET and CONFIG_HOOK_EVENT.
This commit is contained in:
parent
4e15bd1d3a
commit
22b3467f71
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: config_hook.h,v 1.9 2000/10/27 08:04:49 sato Exp $ */
|
||||
/* $NetBSD: config_hook.h,v 1.10 2000/12/27 12:04:02 sato Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1999
|
||||
@ -63,7 +63,6 @@ int config_hook_call __P((int type, long id, void *msg));
|
||||
#define CONFIG_HOOK_POWERCONTROL_LCDLIGHT 4
|
||||
#define CONFIG_HOOK_POWERCONTROL_LCD 5
|
||||
#define CONFIG_HOOK_POWERCONTROL_SPEAKER 6
|
||||
#define CONFIG_HOOK_POWERCONTROL_LED 7
|
||||
|
||||
#define CONFIG_HOOK_BUTTONEVENT 1
|
||||
#define CONFIG_HOOK_BUTTONEVENT_POWER 0
|
||||
@ -86,64 +85,77 @@ int config_hook_call __P((int type, long id, void *msg));
|
||||
#define CONFIG_HOOK_BUTTONEVENT_LIGHT_UP 17
|
||||
#define CONFIG_HOOK_BUTTONEVENT_LIGHT_DOWN 18
|
||||
|
||||
/* apm releted events */
|
||||
#define CONFIG_HOOK_PMEVENT 2
|
||||
#define CONFIG_HOOK_PMEVENT_STANDBYREQ 0
|
||||
#define CONFIG_HOOK_PMEVENT_SUSPENDREQ 1
|
||||
#define CONFIG_HOOK_PMEVENT_HARDPOWER 2
|
||||
#define CONFIG_HOOK_PMEVENT_BATTERY 3
|
||||
#define CONFIG_HOOK_PMEVENT_AC 4
|
||||
#define CONFIG_HOOK_PMEVENT_BATTERYVAL 5
|
||||
#define CONFIG_HOOK_PMEVENT_ACADAPTER 6
|
||||
#define CONFIG_HOOK_PMEVENT_CHARGE 7
|
||||
|
||||
/* misc event */
|
||||
#define CONFIG_HOOK_EVENT 3
|
||||
#define CONFIG_HOOK_EVENT_COM0_CTS 0
|
||||
#define CONFIG_HOOK_EVENT_COM1_CTS 1
|
||||
#define CONFIG_HOOK_EVENT_COM2_CTS 2
|
||||
#define CONFIG_HOOK_EVENT_COM3_CTS 3
|
||||
#define CONFIG_HOOK_EVENT_COM0_DCD 4
|
||||
#define CONFIG_HOOK_EVENT_COM1_DCD 5
|
||||
#define CONFIG_HOOK_EVENT_COM2_DCD 6
|
||||
#define CONFIG_HOOK_EVENT_COM3_DCD 7
|
||||
|
||||
/* misc output port */
|
||||
#define CONFIG_HOOK_OUT 4
|
||||
#define CONFIG_HOOK_OUT_COM0_RTS 0
|
||||
#define CONFIG_HOOK_OUT_COM1_RTS 1
|
||||
#define CONFIG_HOOK_OUT_COM2_RTS 2
|
||||
#define CONFIG_HOOK_OUT_COM3_RTS 3
|
||||
#define CONFIG_HOOK_OUT_COM0_DTR 4
|
||||
#define CONFIG_HOOK_OUT_COM1_DTR 5
|
||||
#define CONFIG_HOOK_OUT_COM2_DTR 6
|
||||
#define CONFIG_HOOK_OUT_COM3_DTR 7
|
||||
/* get value */
|
||||
#define CONFIG_HOOK_GET 3
|
||||
/* set value and send event */
|
||||
#define CONFIG_HOOK_SET 4
|
||||
/* external event */
|
||||
#define CONFIG_HOOK_EVENT CONFIG_HOOK_SET
|
||||
|
||||
/* get power value */
|
||||
#define CONFIG_HOOK_GETPOWER 5
|
||||
#define CONFIG_HOOK_GETPOWER_COM0 0
|
||||
#define CONFIG_HOOK_GETPOWER_COM1 1
|
||||
#define CONFIG_HOOK_GETPOWER_COM2 2
|
||||
#define CONFIG_HOOK_GETPOWER_COM3 3
|
||||
#define CONFIG_HOOK_GETPOWER_LCDLIGHT 4
|
||||
#define CONFIG_HOOK_GETPOWER_LCD 5
|
||||
#define CONFIG_HOOK_GETPOWER_SPEAKER 6
|
||||
|
||||
/* misc get value */
|
||||
#define CONFIG_HOOK_GET 6
|
||||
#define CONFIG_HOOK_GET_LED 0
|
||||
#define CONFIG_HOOK_GETMAX_LED 1
|
||||
#define CONFIG_HOOK_GET_CONTRAST 2
|
||||
#define CONFIG_HOOK_GETMAX_CONTRAST 3
|
||||
#define CONFIG_HOOK_GET_BRIGHTNESS 4
|
||||
#define CONFIG_HOOK_GETMAX_BRIGHTNESS 5
|
||||
/* CONFIG_HOOK_GET/CONFIG_HOOK_SET/CONFIG_HOOK_EVENT event id's */
|
||||
#define CONFIG_HOOK_POWER_COM0 0
|
||||
#define CONFIG_HOOK_POWER_COM1 1
|
||||
#define CONFIG_HOOK_POWER_COM2 2
|
||||
#define CONFIG_HOOK_POWER_COM3 3
|
||||
#define CONFIG_HOOK_POWER_LCDLIGHT 4
|
||||
#define CONFIG_HOOK_POWER_LCD 5
|
||||
#define CONFIG_HOOK_POWER_SPEAKER 6
|
||||
#define CONFIG_HOOK_BUTTON_POWER 7
|
||||
#define CONFIG_HOOK_BUTTON_OK 8
|
||||
#define CONFIG_HOOK_BUTTON_CANCEL 9
|
||||
#define CONFIG_HOOK_BUTTON_UP 10
|
||||
#define CONFIG_HOOK_BUTTON_DOWN 11
|
||||
#define CONFIG_HOOK_BUTTON_REC 12
|
||||
#define CONFIG_HOOK_BUTTON_COVER 13
|
||||
#define CONFIG_HOOK_BUTTON_LIGHT 14
|
||||
#define CONFIG_HOOK_BUTTON_CONTRAST 15
|
||||
#define CONFIG_HOOK_BUTTON_APP0 16
|
||||
#define CONFIG_HOOK_BUTTON_APP1 17
|
||||
#define CONFIG_HOOK_BUTTON_APP2 18
|
||||
#define CONFIG_HOOK_BUTTON_APP3 19
|
||||
#define CONFIG_HOOK_BUTTON_LEFT 20
|
||||
#define CONFIG_HOOK_BUTTON_RIGHT 21
|
||||
#define CONFIG_HOOK_BUTTON_CONTRAST_UP 22
|
||||
#define CONFIG_HOOK_BUTTON_CONTRAST_DOWN 23
|
||||
#define CONFIG_HOOK_BUTTON_LIGHT_UP 24
|
||||
#define CONFIG_HOOK_BUTTON_LIGHT_DOWN 25
|
||||
#define CONFIG_HOOK_LED 26
|
||||
#define CONFIG_HOOK_LED_MAX 27
|
||||
#define CONFIG_HOOK_CONTRAST 28
|
||||
#define CONFIG_HOOK_CONTRAST_MAX 29
|
||||
#define CONFIG_HOOK_BRIGHTNESS 30
|
||||
#define CONFIG_HOOK_BRIGHTNESS_MAX 31
|
||||
#define CONFIG_HOOK_COM0_CTS 32
|
||||
#define CONFIG_HOOK_COM1_CTS 33
|
||||
#define CONFIG_HOOK_COM2_CTS 34
|
||||
#define CONFIG_HOOK_COM3_CTS 35
|
||||
#define CONFIG_HOOK_COM0_DCD 36
|
||||
#define CONFIG_HOOK_COM1_DCD 37
|
||||
#define CONFIG_HOOK_COM2_DCD 38
|
||||
#define CONFIG_HOOK_COM3_DCD 39
|
||||
#define CONFIG_HOOK_COM0_RTS 40
|
||||
#define CONFIG_HOOK_COM1_RTS 41
|
||||
#define CONFIG_HOOK_COM2_RTS 42
|
||||
#define CONFIG_HOOK_COM3_RTS 43
|
||||
#define CONFIG_HOOK_COM0_DTR 44
|
||||
#define CONFIG_HOOK_COM1_DTR 45
|
||||
#define CONFIG_HOOK_COM2_DTR 46
|
||||
#define CONFIG_HOOK_COM3_DTR 47
|
||||
#define CONFIG_HOOK_BATTERYVAL 48
|
||||
#define CONFIG_HOOK_ACADAPTER 49
|
||||
#define CONFIG_HOOK_CHARGE 50
|
||||
|
||||
/* misc set value */
|
||||
#define CONFIG_HOOK_SET 7
|
||||
#define CONFIG_HOOK_SET_LED 0
|
||||
#define CONFIG_HOOK_SET_CONTRAST 1
|
||||
#define CONFIG_HOOK_SET_BRIGHTNESS 2
|
||||
|
||||
#define CONFIG_HOOK_NTYPES 8
|
||||
#define CONFIG_HOOK_NTYPES 5
|
||||
|
||||
/*
|
||||
* nicknames for including from configration file.
|
||||
@ -152,8 +164,6 @@ int config_hook_call __P((int type, long id, void *msg));
|
||||
#define POWER CONFIG_HOOK_POWERCONTROL
|
||||
#define BUTTON CONFIG_HOOK_BUTTONEVENT
|
||||
#define PMEVENT CONFIG_HOOK_PMEVENT
|
||||
#define EVENT CONFIG_HOOK_EVENT
|
||||
#define OUT CONFIG_HOOK_OUT
|
||||
|
||||
#define PWCTL_COM0 CONFIG_HOOK_POWERCONTROL_COM0
|
||||
#define PWCTL_COM1 CONFIG_HOOK_POWERCONTROL_COM1
|
||||
@ -185,28 +195,6 @@ int config_hook_call __P((int type, long id, void *msg));
|
||||
#define PME_STANBY CONFIG_HOOK_PMEVENT_STANDBYREQ
|
||||
#define PME_SUSPEND CONFIG_HOOK_PMEVENT_SUSPENDREQ
|
||||
#define PME_HARDPOWER CONFIG_HOOK_PMEVENT_HARDPOWER
|
||||
#define PME_BATTERY CONFIG_HOOK_PMEVENT_BATTERY
|
||||
#define PME_AC CONFIG_HOOK_PMEVENT_AC
|
||||
#define PME_BATTVAL CONFIG_HOOK_PMEVENT_BATTERYVAL
|
||||
#define PME_ACADAPTER CONFIG_HOOK_PMEVENT_ACADAPTER
|
||||
#define PME_CHARGE CONFIG_HOOK_PMEVENT_CHAEGE
|
||||
#define COM0_CTS CONFIG_HOOK_EVENT_COM0_CTS
|
||||
#define COM1_CTS CONFIG_HOOK_EVENT_COM1_CTS
|
||||
#define COM2_CTS CONFIG_HOOK_EVENT_COM2_CTS
|
||||
#define COM3_CTS CONFIG_HOOK_EVENT_COM3_CTS
|
||||
#define COM0_DCD CONFIG_HOOK_EVENT_COM0_DCD
|
||||
#define COM1_DCD CONFIG_HOOK_EVENT_COM1_DCD
|
||||
#define COM2_DCD CONFIG_HOOK_EVENT_COM2_DCD
|
||||
#define COM3_DCD CONFIG_HOOK_EVENT_COM3_DCD
|
||||
#define COM0_RTS CONFIG_HOOK_OUT_COM0_RTS
|
||||
#define COM1_RTS CONFIG_HOOK_OUT_COM1_RTS
|
||||
#define COM2_RTS CONFIG_HOOK_OUT_COM2_RTS
|
||||
#define COM3_RTS CONFIG_HOOK_OUT_COM3_RTS
|
||||
#define COM0_DTR CONFIG_HOOK_OUT_COM0_DTR
|
||||
#define COM1_DTR CONFIG_HOOK_OUT_COM1_DTR
|
||||
#define COM2_DTR CONFIG_HOOK_OUT_COM2_DTR
|
||||
#define COM3_DTR CONFIG_HOOK_OUT_COM3_DTR
|
||||
|
||||
|
||||
#endif /* CONFIG_HOOK_DEFINE_NICKNAME */
|
||||
|
||||
@ -216,37 +204,37 @@ int config_hook_call __P((int type, long id, void *msg));
|
||||
#define PWCTL_ON ((void *)1)
|
||||
#define PWCTL_OFF ((void *)0)
|
||||
|
||||
/*
|
||||
* POWERCTONROL_LED value
|
||||
*/
|
||||
#define PWCTL_LED_OFF PWCTL_OFF
|
||||
#define PWCTL_LED_ON PWCTL_ON
|
||||
#define PWCTL_LED_FLASH ((void *)2) /* flash 100msec */
|
||||
#define PWCTL_LED_FLASH2 ((void *)3) /* flash 200msec */
|
||||
#define PWCTL_LED_FLASH5 ((void *)4) /* flash 500msec */
|
||||
#define PWCTL_LED_BLINK ((void *)5) /* blink 1sec interval */
|
||||
#define PWCTL_LED_BLINK2 ((void *)6) /* blink 2sec interval */
|
||||
#define PWCTL_LED_VALUE_P(x) (PWCTL_LED_OFF >= (x) \
|
||||
&& (x) <= PWCTL_LED_BLINK2)
|
||||
/* CONFIG_HOOK typical value */
|
||||
#define CONFIG_HOOK_ON 1
|
||||
#define CONFIG_HOOK_OFF 0
|
||||
|
||||
/*
|
||||
* PMEVENT_AC event value
|
||||
* CONFIG_HOOK_LED value
|
||||
*/
|
||||
#define PMEVENT_AC_OFF ((void *)0)
|
||||
#define PMEVENT_AC_ON_CHARGE ((void *)1)
|
||||
#define PMEVENT_AC_ON_NOCHARGE ((void *)2)
|
||||
#define PMEVENT_AC_VALUE_P(x) (PMEVENT_AC_OFF >= (x) \
|
||||
&& (x) <= PMEVENT_AC_ON_NOCHARGE)
|
||||
#define CONFIG_HOOK_LED_ON 0
|
||||
#define CONFIG_HOOK_LED_OFF 1
|
||||
#define CONFIG_HOOK_LED_FLASH 2 /* flash 100msec */
|
||||
#define CONFIG_HOOK_LED_FLASH2 3 /* flash 200msec */
|
||||
#define CONFIG_HOOK_LED_FLASH5 4 /* flash 500msec */
|
||||
#define CONFIG_HOOK_LED_BLINK 5 /* blink 1sec interval */
|
||||
#define CONFIG_HOOK_LED_BLINK2 6 /* blink 2sec interval */
|
||||
|
||||
/*
|
||||
* PMEVENT_BATTERY event value
|
||||
* CONFIG_HOOK_AC event value
|
||||
*/
|
||||
#define PMEVENT_BATT_CRITICAL ((void *)0)
|
||||
#define PMEVENT_BATT_LOW ((void *)1)
|
||||
#define PMEVENT_BATT_1BY4 ((void *)2)
|
||||
#define PMEVENT_BATT_HALF ((void *)3)
|
||||
#define PMEVENT_BATT_3BY4 ((void *)4)
|
||||
#define PMEVENT_BATT_FULL ((void *)5)
|
||||
#define PMEVENT_BATT_VALUE_P(x) (PMEVENT_BATT_CRITICAL >= (x) \
|
||||
&& (x) <= PMEVENT_BATT_FULL)
|
||||
#define CONFIG_HOOK_AC_OFF 0
|
||||
#define CONFIG_HOOK_AC_ON_CHARGE 1
|
||||
#define CONFIG_HOOK_AC_ON_NOCHARGE 2
|
||||
#define CONFIG_HOOK_AC_UNKNOWN 3
|
||||
|
||||
/*
|
||||
* CONFIG_HOOK_BATTERY event value
|
||||
*/
|
||||
#define CONFIG_HOOK_BATT_CRITICAL 0
|
||||
#define CONFIG_HOOK_BATT_LOW 1
|
||||
#define CONFIG_HOOK_BATT_1BY4 2
|
||||
#define CONFIG_HOOK_BATT_HALF 3
|
||||
#define CONFIG_HOOK_BATT_3BY4 4
|
||||
#define CONFIG_HOOK_BATT_FULL 5
|
||||
#define CONFIG_HOOK_BATT_UNKNOWN 6
|
||||
#endif /* _CONFIG_HOOK_H_ */
|
||||
|
Loading…
Reference in New Issue
Block a user