hpcapm.c revision 1.16 1 1.16 uwe /* $NetBSD: hpcapm.c,v 1.16 2009/04/05 02:04:40 uwe Exp $ */
2 1.1 uch
3 1.1 uch /*
4 1.1 uch * Copyright (c) 2000 Takemura Shin
5 1.1 uch * Copyright (c) 2000-2001 SATO Kazumi
6 1.1 uch * All rights reserved.
7 1.1 uch *
8 1.1 uch * Redistribution and use in source and binary forms, with or without
9 1.1 uch * modification, are permitted provided that the following conditions
10 1.1 uch * are met:
11 1.1 uch * 1. Redistributions of source code must retain the above copyright
12 1.1 uch * notice, this list of conditions and the following disclaimer.
13 1.1 uch * 2. Redistributions in binary form must reproduce the above copyright
14 1.1 uch * notice, this list of conditions and the following disclaimer in the
15 1.1 uch * documentation and/or other materials provided with the distribution.
16 1.1 uch *
17 1.1 uch * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
18 1.1 uch * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 1.1 uch * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 1.1 uch * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
21 1.1 uch * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 1.1 uch * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 1.1 uch * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 1.1 uch * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 1.1 uch * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 1.1 uch * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 1.1 uch * SUCH DAMAGE.
28 1.1 uch *
29 1.1 uch */
30 1.1 uch
31 1.1 uch #include <sys/cdefs.h>
32 1.16 uwe __KERNEL_RCSID(0, "$NetBSD: hpcapm.c,v 1.16 2009/04/05 02:04:40 uwe Exp $");
33 1.10 peter
34 1.10 peter #ifdef _KERNEL_OPT
35 1.10 peter #include "opt_hpcapm.h"
36 1.10 peter #endif
37 1.1 uch
38 1.1 uch #include <sys/param.h>
39 1.1 uch #include <sys/device.h>
40 1.1 uch #include <sys/kernel.h>
41 1.1 uch #include <sys/systm.h>
42 1.15 uwe #include <sys/selinfo.h> /* XXX: for apm_softc that is exposed here */
43 1.1 uch
44 1.1 uch #include <dev/hpc/apm/apmvar.h>
45 1.1 uch
46 1.13 ad #include <sys/bus.h>
47 1.1 uch #include <machine/config_hook.h>
48 1.1 uch #include <machine/platid.h>
49 1.1 uch #include <machine/platid_mask.h>
50 1.1 uch
51 1.1 uch #ifdef HPCAPMDEBUG
52 1.1 uch #ifndef HPCAPMDEBUG_CONF
53 1.1 uch #define HPCAPMDEBUG_CONF 1
54 1.1 uch #endif
55 1.1 uch int hpcapm_debug = HPCAPMDEBUG_CONF;
56 1.1 uch #define DPRINTF(arg) do { if (hpcapm_debug) printf arg; } while(0);
57 1.1 uch #define DPRINTFN(n, arg) do { if (hpcapm_debug > (n)) printf arg; } while (0);
58 1.1 uch #else
59 1.1 uch #define DPRINTF(arg) do { } while (0);
60 1.1 uch #define DPRINTFN(n, arg) do { } while (0);
61 1.1 uch #endif
62 1.1 uch
63 1.1 uch /* Definition of the driver for autoconfig. */
64 1.1 uch static int hpcapm_match(struct device *, struct cfdata *, void *);
65 1.1 uch static void hpcapm_attach(struct device *, struct device *, void *);
66 1.1 uch static int hpcapm_hook(void *, int, long, void *);
67 1.1 uch
68 1.1 uch static void hpcapm_disconnect(void *);
69 1.1 uch static void hpcapm_enable(void *, int);
70 1.1 uch static int hpcapm_set_powstate(void *, u_int, u_int);
71 1.15 uwe static int hpcapm_get_powstat(void *, u_int, struct apm_power_info *);
72 1.1 uch static int hpcapm_get_event(void *, u_int *, u_int *);
73 1.1 uch static void hpcapm_cpu_busy(void *);
74 1.1 uch static void hpcapm_cpu_idle(void *);
75 1.1 uch static void hpcapm_get_capabilities(void *, u_int *, u_int *);
76 1.1 uch
77 1.1 uch struct apmhpc_softc {
78 1.1 uch struct device sc_dev;
79 1.1 uch void *sc_apmdev;
80 1.1 uch volatile unsigned int events;
81 1.1 uch volatile int power_state;
82 1.14 uwe volatile int battery_flags;
83 1.1 uch volatile int ac_state;
84 1.1 uch config_hook_tag sc_standby_hook;
85 1.1 uch config_hook_tag sc_suspend_hook;
86 1.1 uch config_hook_tag sc_battery_hook;
87 1.1 uch config_hook_tag sc_ac_hook;
88 1.1 uch int battery_life;
89 1.1 uch int minutes_left;
90 1.1 uch };
91 1.1 uch
92 1.1 uch CFATTACH_DECL(hpcapm, sizeof (struct apmhpc_softc),
93 1.1 uch hpcapm_match, hpcapm_attach, NULL, NULL);
94 1.1 uch
95 1.1 uch struct apm_accessops hpcapm_accessops = {
96 1.1 uch hpcapm_disconnect,
97 1.1 uch hpcapm_enable,
98 1.1 uch hpcapm_set_powstate,
99 1.1 uch hpcapm_get_powstat,
100 1.1 uch hpcapm_get_event,
101 1.1 uch hpcapm_cpu_busy,
102 1.1 uch hpcapm_cpu_idle,
103 1.1 uch hpcapm_get_capabilities,
104 1.1 uch };
105 1.1 uch
106 1.1 uch extern struct cfdriver hpcapm_cd;
107 1.1 uch
108 1.1 uch static int
109 1.12 christos hpcapm_match(struct device *parent,
110 1.12 christos struct cfdata *cf, void *aux)
111 1.1 uch {
112 1.11 uwe
113 1.5 cube return 1;
114 1.1 uch }
115 1.1 uch
116 1.1 uch static void
117 1.12 christos hpcapm_attach(struct device *parent,
118 1.12 christos struct device *self, void *aux)
119 1.1 uch {
120 1.1 uch struct apmhpc_softc *sc;
121 1.1 uch struct apmdev_attach_args aaa;
122 1.1 uch
123 1.7 thorpej sc = device_private(self);
124 1.1 uch printf(": pseudo power management module\n");
125 1.1 uch
126 1.1 uch sc->events = 0;
127 1.1 uch sc->power_state = APM_SYS_READY;
128 1.14 uwe sc->battery_flags = APM_BATT_FLAG_UNKNOWN;
129 1.1 uch sc->ac_state = APM_AC_UNKNOWN;
130 1.1 uch sc->battery_life = APM_BATT_LIFE_UNKNOWN;
131 1.1 uch sc->minutes_left = 0;
132 1.1 uch sc->sc_standby_hook = config_hook(CONFIG_HOOK_PMEVENT,
133 1.1 uch CONFIG_HOOK_PMEVENT_STANDBYREQ,
134 1.1 uch CONFIG_HOOK_EXCLUSIVE,
135 1.1 uch hpcapm_hook, sc);
136 1.1 uch sc->sc_suspend_hook = config_hook(CONFIG_HOOK_PMEVENT,
137 1.1 uch CONFIG_HOOK_PMEVENT_SUSPENDREQ,
138 1.1 uch CONFIG_HOOK_EXCLUSIVE,
139 1.1 uch hpcapm_hook, sc);
140 1.1 uch
141 1.1 uch sc->sc_battery_hook = config_hook(CONFIG_HOOK_PMEVENT,
142 1.1 uch CONFIG_HOOK_PMEVENT_BATTERY,
143 1.1 uch CONFIG_HOOK_SHARE,
144 1.1 uch hpcapm_hook, sc);
145 1.1 uch
146 1.8 uwe sc->sc_ac_hook = config_hook(CONFIG_HOOK_PMEVENT,
147 1.8 uwe CONFIG_HOOK_PMEVENT_AC,
148 1.8 uwe CONFIG_HOOK_SHARE,
149 1.8 uwe hpcapm_hook, sc);
150 1.1 uch
151 1.1 uch aaa.accessops = &hpcapm_accessops;
152 1.1 uch aaa.accesscookie = sc;
153 1.1 uch aaa.apm_detail = 0x0102;
154 1.1 uch
155 1.5 cube sc->sc_apmdev = config_found_ia(self, "apmdevif", &aaa, apmprint);
156 1.16 uwe
157 1.16 uwe if (!pmf_device_register(self, NULL, NULL))
158 1.16 uwe aprint_error_dev(self, "unable to establish power handler\n");
159 1.1 uch }
160 1.1 uch
161 1.1 uch static int
162 1.1 uch hpcapm_hook(void *ctx, int type, long id, void *msg)
163 1.1 uch {
164 1.1 uch struct apmhpc_softc *sc;
165 1.1 uch int s;
166 1.1 uch int charge;
167 1.1 uch int message;
168 1.1 uch
169 1.1 uch sc = ctx;
170 1.1 uch
171 1.1 uch if (type != CONFIG_HOOK_PMEVENT)
172 1.2 perry return 1;
173 1.1 uch
174 1.1 uch if (CONFIG_HOOK_VALUEP(msg))
175 1.1 uch message = (int)msg;
176 1.1 uch else
177 1.1 uch message = *(int *)msg;
178 1.1 uch
179 1.1 uch s = splhigh();
180 1.1 uch switch (id) {
181 1.1 uch case CONFIG_HOOK_PMEVENT_STANDBYREQ:
182 1.1 uch if (sc->power_state != APM_SYS_STANDBY) {
183 1.1 uch sc->events |= (1 << APM_USER_STANDBY_REQ);
184 1.1 uch } else {
185 1.1 uch sc->events |= (1 << APM_NORMAL_RESUME);
186 1.1 uch }
187 1.1 uch break;
188 1.1 uch case CONFIG_HOOK_PMEVENT_SUSPENDREQ:
189 1.1 uch if (sc->power_state != APM_SYS_SUSPEND) {
190 1.9 peter DPRINTF(("hpcapm: suspend request\n"));
191 1.1 uch sc->events |= (1 << APM_USER_SUSPEND_REQ);
192 1.1 uch } else {
193 1.1 uch sc->events |= (1 << APM_NORMAL_RESUME);
194 1.1 uch }
195 1.1 uch break;
196 1.2 perry case CONFIG_HOOK_PMEVENT_BATTERY:
197 1.1 uch switch (message) {
198 1.1 uch case CONFIG_HOOK_BATT_CRITICAL:
199 1.1 uch DPRINTF(("hpcapm: battery state critical\n"));
200 1.14 uwe charge = sc->battery_flags & APM_BATT_FLAG_CHARGING;
201 1.14 uwe sc->battery_flags = APM_BATT_FLAG_CRITICAL;
202 1.14 uwe sc->battery_flags |= charge;
203 1.1 uch sc->battery_life = 0;
204 1.1 uch break;
205 1.1 uch case CONFIG_HOOK_BATT_LOW:
206 1.1 uch DPRINTF(("hpcapm: battery state low\n"));
207 1.14 uwe charge = sc->battery_flags & APM_BATT_FLAG_CHARGING;
208 1.14 uwe sc->battery_flags = APM_BATT_FLAG_LOW;
209 1.14 uwe sc->battery_flags |= charge;
210 1.1 uch break;
211 1.1 uch case CONFIG_HOOK_BATT_HIGH:
212 1.1 uch DPRINTF(("hpcapm: battery state high\n"));
213 1.14 uwe charge = sc->battery_flags & APM_BATT_FLAG_CHARGING;
214 1.14 uwe sc->battery_flags = APM_BATT_FLAG_HIGH;
215 1.14 uwe sc->battery_flags |= charge;
216 1.1 uch break;
217 1.1 uch case CONFIG_HOOK_BATT_10P:
218 1.1 uch DPRINTF(("hpcapm: battery life 10%%\n"));
219 1.1 uch sc->battery_life = 10;
220 1.1 uch break;
221 1.1 uch case CONFIG_HOOK_BATT_20P:
222 1.1 uch DPRINTF(("hpcapm: battery life 20%%\n"));
223 1.1 uch sc->battery_life = 20;
224 1.1 uch break;
225 1.1 uch case CONFIG_HOOK_BATT_30P:
226 1.1 uch DPRINTF(("hpcapm: battery life 30%%\n"));
227 1.1 uch sc->battery_life = 30;
228 1.1 uch break;
229 1.1 uch case CONFIG_HOOK_BATT_40P:
230 1.1 uch DPRINTF(("hpcapm: battery life 40%%\n"));
231 1.1 uch sc->battery_life = 40;
232 1.1 uch break;
233 1.1 uch case CONFIG_HOOK_BATT_50P:
234 1.1 uch DPRINTF(("hpcapm: battery life 50%%\n"));
235 1.1 uch sc->battery_life = 50;
236 1.1 uch break;
237 1.1 uch case CONFIG_HOOK_BATT_60P:
238 1.1 uch DPRINTF(("hpcapm: battery life 60%%\n"));
239 1.1 uch sc->battery_life = 60;
240 1.1 uch break;
241 1.1 uch case CONFIG_HOOK_BATT_70P:
242 1.1 uch DPRINTF(("hpcapm: battery life 70%%\n"));
243 1.1 uch sc->battery_life = 70;
244 1.1 uch break;
245 1.1 uch case CONFIG_HOOK_BATT_80P:
246 1.1 uch DPRINTF(("hpcapm: battery life 80%%\n"));
247 1.1 uch sc->battery_life = 80;
248 1.1 uch break;
249 1.1 uch case CONFIG_HOOK_BATT_90P:
250 1.1 uch DPRINTF(("hpcapm: battery life 90%%\n"));
251 1.1 uch sc->battery_life = 90;
252 1.1 uch break;
253 1.1 uch case CONFIG_HOOK_BATT_100P:
254 1.1 uch DPRINTF(("hpcapm: battery life 100%%\n"));
255 1.1 uch sc->battery_life = 100;
256 1.1 uch break;
257 1.1 uch case CONFIG_HOOK_BATT_UNKNOWN:
258 1.1 uch DPRINTF(("hpcapm: battery state unknown\n"));
259 1.14 uwe sc->battery_flags = APM_BATT_FLAG_UNKNOWN;
260 1.1 uch sc->battery_life = APM_BATT_LIFE_UNKNOWN;
261 1.1 uch break;
262 1.1 uch case CONFIG_HOOK_BATT_NO_SYSTEM_BATTERY:
263 1.1 uch DPRINTF(("hpcapm: battery state no system battery?\n"));
264 1.14 uwe sc->battery_flags = APM_BATT_FLAG_NO_SYSTEM_BATTERY;
265 1.1 uch sc->battery_life = APM_BATT_LIFE_UNKNOWN;
266 1.1 uch break;
267 1.1 uch }
268 1.1 uch break;
269 1.1 uch case CONFIG_HOOK_PMEVENT_AC:
270 1.1 uch switch (message) {
271 1.1 uch case CONFIG_HOOK_AC_OFF:
272 1.9 peter DPRINTF(("hpcapm: ac not connected\n"));
273 1.14 uwe sc->battery_flags &= ~APM_BATT_FLAG_CHARGING;
274 1.1 uch sc->ac_state = APM_AC_OFF;
275 1.1 uch break;
276 1.1 uch case CONFIG_HOOK_AC_ON_CHARGE:
277 1.1 uch DPRINTF(("hpcapm: charging\n"));
278 1.14 uwe sc->battery_flags |= APM_BATT_FLAG_CHARGING;
279 1.1 uch sc->ac_state = APM_AC_ON;
280 1.1 uch break;
281 1.1 uch case CONFIG_HOOK_AC_ON_NOCHARGE:
282 1.9 peter DPRINTF(("hpcapm: ac connected\n"));
283 1.14 uwe sc->battery_flags &= ~APM_BATT_FLAG_CHARGING;
284 1.1 uch sc->ac_state = APM_AC_ON;
285 1.1 uch break;
286 1.1 uch case CONFIG_HOOK_AC_UNKNOWN:
287 1.1 uch sc->ac_state = APM_AC_UNKNOWN;
288 1.1 uch break;
289 1.1 uch }
290 1.1 uch break;
291 1.1 uch }
292 1.1 uch splx(s);
293 1.1 uch
294 1.1 uch return (0);
295 1.1 uch }
296 1.1 uch
297 1.1 uch static void
298 1.1 uch hpcapm_disconnect(void *scx)
299 1.1 uch {
300 1.1 uch struct apmhpc_softc *sc;
301 1.1 uch
302 1.1 uch sc = scx;
303 1.1 uch }
304 1.1 uch
305 1.1 uch static void
306 1.12 christos hpcapm_enable(void *scx, int onoff)
307 1.1 uch {
308 1.1 uch struct apmhpc_softc *sc;
309 1.1 uch
310 1.1 uch sc = scx;
311 1.1 uch }
312 1.1 uch
313 1.1 uch static int
314 1.1 uch hpcapm_set_powstate(void *scx, u_int devid, u_int powstat)
315 1.1 uch {
316 1.1 uch struct apmhpc_softc *sc;
317 1.1 uch int s;
318 1.1 uch
319 1.1 uch sc = scx;
320 1.1 uch
321 1.1 uch if (devid != APM_DEV_ALLDEVS)
322 1.1 uch return APM_ERR_UNRECOG_DEV;
323 1.1 uch
324 1.1 uch switch (powstat) {
325 1.1 uch case APM_SYS_READY:
326 1.1 uch DPRINTF(("hpcapm: set power state READY\n"));
327 1.1 uch sc->power_state = APM_SYS_READY;
328 1.1 uch break;
329 1.1 uch case APM_SYS_STANDBY:
330 1.1 uch DPRINTF(("hpcapm: set power state STANDBY\n"));
331 1.1 uch s = splhigh();
332 1.2 perry config_hook_call(CONFIG_HOOK_PMEVENT,
333 1.1 uch CONFIG_HOOK_PMEVENT_HARDPOWER,
334 1.1 uch (void *)PWR_STANDBY);
335 1.1 uch sc->power_state = APM_SYS_STANDBY;
336 1.1 uch machine_standby();
337 1.2 perry config_hook_call_reverse(CONFIG_HOOK_PMEVENT,
338 1.1 uch CONFIG_HOOK_PMEVENT_HARDPOWER,
339 1.1 uch (void *)PWR_RESUME);
340 1.1 uch DPRINTF(("hpcapm: resume\n"));
341 1.1 uch splx(s);
342 1.1 uch break;
343 1.1 uch case APM_SYS_SUSPEND:
344 1.1 uch DPRINTF(("hpcapm: set power state SUSPEND...\n"));
345 1.1 uch s = splhigh();
346 1.2 perry config_hook_call(CONFIG_HOOK_PMEVENT,
347 1.1 uch CONFIG_HOOK_PMEVENT_HARDPOWER,
348 1.1 uch (void *)PWR_SUSPEND);
349 1.1 uch sc->power_state = APM_SYS_SUSPEND;
350 1.1 uch machine_sleep();
351 1.2 perry config_hook_call_reverse(CONFIG_HOOK_PMEVENT,
352 1.1 uch CONFIG_HOOK_PMEVENT_HARDPOWER,
353 1.1 uch (void *)PWR_RESUME);
354 1.1 uch DPRINTF(("hpcapm: resume\n"));
355 1.1 uch splx(s);
356 1.1 uch break;
357 1.1 uch case APM_SYS_OFF:
358 1.1 uch DPRINTF(("hpcapm: set power state OFF\n"));
359 1.1 uch sc->power_state = APM_SYS_OFF;
360 1.1 uch break;
361 1.1 uch case APM_LASTREQ_INPROG:
362 1.1 uch /*DPRINTF(("hpcapm: set power state INPROG\n"));
363 1.1 uch */
364 1.1 uch break;
365 1.1 uch case APM_LASTREQ_REJECTED:
366 1.1 uch DPRINTF(("hpcapm: set power state REJECTED\n"));
367 1.1 uch break;
368 1.1 uch }
369 1.1 uch
370 1.1 uch return (0);
371 1.1 uch }
372 1.1 uch
373 1.1 uch static int
374 1.15 uwe hpcapm_get_powstat(void *scx, u_int batteryid, struct apm_power_info *pinfo)
375 1.1 uch {
376 1.1 uch struct apmhpc_softc *sc;
377 1.3 nakayama int val;
378 1.1 uch
379 1.1 uch sc = scx;
380 1.1 uch
381 1.14 uwe pinfo->nbattery = 0;
382 1.14 uwe pinfo->batteryid = 0;
383 1.14 uwe pinfo->minutes_valid = 0;
384 1.14 uwe pinfo->minutes_left = 0;
385 1.14 uwe pinfo->battery_state = APM_BATT_UNKNOWN; /* XXX: ignored */
386 1.14 uwe
387 1.3 nakayama if (config_hook_call(CONFIG_HOOK_GET,
388 1.3 nakayama CONFIG_HOOK_ACADAPTER, &val) != -1)
389 1.3 nakayama pinfo->ac_state = val;
390 1.3 nakayama else
391 1.3 nakayama pinfo->ac_state = sc->ac_state;
392 1.14 uwe
393 1.3 nakayama if (config_hook_call(CONFIG_HOOK_GET,
394 1.3 nakayama CONFIG_HOOK_CHARGE, &val) != -1)
395 1.14 uwe pinfo->battery_flags = val;
396 1.3 nakayama else
397 1.14 uwe pinfo->battery_flags = sc->battery_flags;
398 1.14 uwe
399 1.3 nakayama if (config_hook_call(CONFIG_HOOK_GET,
400 1.3 nakayama CONFIG_HOOK_BATTERYVAL, &val) != -1)
401 1.3 nakayama pinfo->battery_life = val;
402 1.3 nakayama else
403 1.3 nakayama pinfo->battery_life = sc->battery_life;
404 1.14 uwe
405 1.1 uch return (0);
406 1.1 uch }
407 1.1 uch
408 1.1 uch static int
409 1.1 uch hpcapm_get_event(void *scx, u_int *event_type, u_int *event_info)
410 1.1 uch {
411 1.1 uch struct apmhpc_softc *sc;
412 1.1 uch int s, i;
413 1.1 uch
414 1.1 uch sc = scx;
415 1.1 uch s = splhigh();
416 1.1 uch for (i = APM_STANDBY_REQ; i <= APM_CAP_CHANGE; i++) {
417 1.1 uch if (sc->events & (1 << i)) {
418 1.1 uch sc->events &= ~(1 << i);
419 1.1 uch *event_type = i;
420 1.1 uch if (*event_type == APM_NORMAL_RESUME ||
421 1.1 uch *event_type == APM_CRIT_RESUME) {
422 1.1 uch /* pccard power off in the suspend state */
423 1.1 uch *event_info = 1;
424 1.1 uch sc->power_state = APM_SYS_READY;
425 1.1 uch } else
426 1.1 uch *event_info = 0;
427 1.1 uch return (0);
428 1.1 uch }
429 1.1 uch }
430 1.1 uch splx(s);
431 1.1 uch
432 1.1 uch return APM_ERR_NOEVENTS;
433 1.1 uch }
434 1.1 uch
435 1.1 uch static void
436 1.1 uch hpcapm_cpu_busy(void *scx)
437 1.1 uch {
438 1.1 uch struct apmhpc_softc *sc;
439 1.1 uch
440 1.1 uch sc = scx;
441 1.1 uch }
442 1.1 uch
443 1.1 uch static void
444 1.1 uch hpcapm_cpu_idle(void *scx)
445 1.1 uch {
446 1.1 uch struct apmhpc_softc *sc;
447 1.1 uch
448 1.1 uch sc = scx;
449 1.1 uch }
450 1.1 uch
451 1.1 uch static void
452 1.1 uch hpcapm_get_capabilities(void *scx, u_int *numbatts, u_int *capflags)
453 1.1 uch {
454 1.1 uch struct apmhpc_softc *sc;
455 1.1 uch
456 1.1 uch *numbatts = 0;
457 1.1 uch *capflags = APM_GLOBAL_STANDBY | APM_GLOBAL_SUSPEND;
458 1.1 uch
459 1.1 uch sc = scx;
460 1.1 uch }
461