Annotation of sys/arch/arm/xscale/pxa2x0_apm.h, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: pxa2x0_apm.h,v 1.7 2005/04/13 05:40:07 uwe Exp $ */
2:
3: /*
4: * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de>
5: *
6: * Permission to use, copy, modify, and distribute this software for any
7: * purpose with or without fee is hereby granted, provided that the above
8: * copyright notice and this permission notice appear in all copies.
9: *
10: * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11: * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12: * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13: * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14: * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15: * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16: * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17: */
18:
19: #ifndef _PXA2X0_APM_H_
20: #define _PXA2X0_APM_H_
21:
22: #include <sys/event.h>
23:
24: #include <machine/bus.h>
25: #include <machine/apmvar.h>
26:
27: struct pxa2x0_apm_softc {
28: struct device sc_dev;
29: struct proc *sc_thread;
30: struct lock sc_lock;
31: struct klist sc_note;
32: int sc_flags;
33: int sc_wakeon; /* enabled wakeup sources */
34: int sc_batt_life;
35: bus_space_tag_t sc_iot;
36: bus_space_handle_t sc_pm_ioh;
37: bus_space_handle_t sc_memctl_ioh;
38: int (*sc_get_event)(struct pxa2x0_apm_softc *, u_int *);
39: void (*sc_power_info)(struct pxa2x0_apm_softc *,
40: struct apm_power_info *);
41: void (*sc_suspend)(struct pxa2x0_apm_softc *);
42: int (*sc_resume)(struct pxa2x0_apm_softc *);
43: };
44:
45: void pxa2x0_apm_attach_sub(struct pxa2x0_apm_softc *);
46: void pxa2x0_apm_sleep(struct pxa2x0_apm_softc *);
47:
48: #define PXA2X0_WAKEUP_POWERON (1<<0)
49: #define PXA2X0_WAKEUP_GPIORST (1<<1)
50: #define PXA2X0_WAKEUP_SD (1<<2)
51: #define PXA2X0_WAKEUP_RC (1<<3)
52: #define PXA2X0_WAKEUP_SYNC (1<<4)
53: #define PXA2X0_WAKEUP_KEYNS0 (1<<5)
54: #define PXA2X0_WAKEUP_KEYNS1 (1<<6)
55: #define PXA2X0_WAKEUP_KEYNS2 (1<<7)
56: #define PXA2X0_WAKEUP_KEYNS3 (1<<8)
57: #define PXA2X0_WAKEUP_KEYNS4 (1<<9)
58: #define PXA2X0_WAKEUP_KEYNS5 (1<<10)
59: #define PXA2X0_WAKEUP_KEYNS6 (1<<11)
60: #define PXA2X0_WAKEUP_CF0 (1<<12)
61: #define PXA2X0_WAKEUP_CF1 (1<<13)
62: #define PXA2X0_WAKEUP_USBD (1<<14)
63: #define PXA2X0_WAKEUP_LOCKSW (1<<15)
64: #define PXA2X0_WAKEUP_JACKIN (1<<16)
65: #define PXA2X0_WAKEUP_CHRGFULL (1<<17)
66: #define PXA2X0_WAKEUP_RTC (1<<18)
67:
68: #define PXA2X0_WAKEUP_KEYNS_ALL (PXA2X0_WAKEUP_KEYNS0| \
69: PXA2X0_WAKEUP_KEYNS1|PXA2X0_WAKEUP_KEYNS2|PXA2X0_WAKEUP_KEYNS3| \
70: PXA2X0_WAKEUP_KEYNS4|PXA2X0_WAKEUP_KEYNS5|PXA2X0_WAKEUP_KEYNS6)
71:
72: #define PXA2X0_WAKEUP_CF_ALL (PXA2X0_WAKEUP_CF0|PXA2X0_WAKEUP_CF1)
73:
74: #define PXA2X0_WAKEUP_ALL (PXA2X0_WAKEUP_POWERON| \
75: PXA2X0_WAKEUP_GPIORST|PXA2X0_WAKEUP_SD|PXA2X0_WAKEUP_RC| \
76: PXA2X0_WAKEUP_SYNC|PXA2X0_WAKEUP_KEYNS_ALL|PXA2X0_WAKEUP_CF_ALL| \
77: PXA2X0_WAKEUP_USBD|PXA2X0_WAKEUP_LOCKSW|PXA2X0_WAKEUP_JACKIN| \
78: PXA2X0_WAKEUP_CHRGFULL|PXA2X0_WAKEUP_RTC)
79:
80: void pxa2x0_wakeup_config(u_int, int);
81: u_int pxa2x0_wakeup_status(void);
82:
83: #endif
CVSweb