thinkpad_acpi.c revision 1.3 1 1.3 jmcneill /* $NetBSD: thinkpad_acpi.c,v 1.3 2007/12/21 16:38:59 jmcneill Exp $ */
2 1.1 jmcneill
3 1.1 jmcneill /*-
4 1.1 jmcneill * Copyright (c) 2007 Jared D. McNeill <jmcneill (at) invisible.ca>
5 1.1 jmcneill * All rights reserved.
6 1.1 jmcneill *
7 1.1 jmcneill * Redistribution and use in source and binary forms, with or without
8 1.1 jmcneill * modification, are permitted provided that the following conditions
9 1.1 jmcneill * are met:
10 1.1 jmcneill * 1. Redistributions of source code must retain the above copyright
11 1.1 jmcneill * notice, this list of conditions and the following disclaimer.
12 1.1 jmcneill * 2. Redistributions in binary form must reproduce the above copyright
13 1.1 jmcneill * notice, this list of conditions and the following disclaimer in the
14 1.1 jmcneill * documentation and/or other materials provided with the distribution.
15 1.1 jmcneill * 3. All advertising materials mentioning features or use of this software
16 1.1 jmcneill * must display the following acknowledgement:
17 1.1 jmcneill * This product includes software developed by Jared D. McNeill.
18 1.1 jmcneill * 4. Neither the name of The NetBSD Foundation nor the names of its
19 1.1 jmcneill * contributors may be used to endorse or promote products derived
20 1.1 jmcneill * from this software without specific prior written permission.
21 1.1 jmcneill *
22 1.1 jmcneill * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
23 1.1 jmcneill * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
24 1.1 jmcneill * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25 1.1 jmcneill * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
26 1.1 jmcneill * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
27 1.1 jmcneill * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
28 1.1 jmcneill * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
29 1.1 jmcneill * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
30 1.1 jmcneill * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
31 1.1 jmcneill * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32 1.1 jmcneill * POSSIBILITY OF SUCH DAMAGE.
33 1.1 jmcneill */
34 1.1 jmcneill
35 1.1 jmcneill #include <sys/cdefs.h>
36 1.3 jmcneill __KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.3 2007/12/21 16:38:59 jmcneill Exp $");
37 1.1 jmcneill
38 1.1 jmcneill #include <sys/types.h>
39 1.1 jmcneill #include <sys/param.h>
40 1.1 jmcneill #include <sys/malloc.h>
41 1.1 jmcneill #include <sys/buf.h>
42 1.1 jmcneill #include <sys/callout.h>
43 1.1 jmcneill #include <sys/kernel.h>
44 1.1 jmcneill #include <sys/device.h>
45 1.1 jmcneill #include <sys/pmf.h>
46 1.1 jmcneill #include <sys/queue.h>
47 1.1 jmcneill #include <sys/kmem.h>
48 1.1 jmcneill
49 1.1 jmcneill #include <dev/acpi/acpivar.h>
50 1.1 jmcneill
51 1.1 jmcneill #if defined(__i386__) || defined(__amd64__)
52 1.1 jmcneill #include <machine/pio.h>
53 1.1 jmcneill #endif
54 1.1 jmcneill
55 1.1 jmcneill typedef struct thinkpad_softc {
56 1.1 jmcneill device_t sc_dev;
57 1.1 jmcneill struct acpi_devnode *sc_node;
58 1.1 jmcneill ACPI_HANDLE sc_cmoshdl;
59 1.1 jmcneill bool sc_cmoshdl_valid;
60 1.1 jmcneill
61 1.1 jmcneill struct sysmon_pswitch sc_smpsw[2];
62 1.1 jmcneill #define TP_PSW_SLEEP 0
63 1.1 jmcneill #define TP_PSW_HIBERNATE 1
64 1.1 jmcneill bool sc_smpsw_valid;
65 1.1 jmcneill } thinkpad_softc_t;
66 1.1 jmcneill
67 1.1 jmcneill /* Hotkey events */
68 1.1 jmcneill #define THINKPAD_NOTIFY_FnF1 0x001
69 1.1 jmcneill #define THINKPAD_NOTIFY_LockScreen 0x002
70 1.1 jmcneill #define THINKPAD_NOTIFY_BatteryInfo 0x003
71 1.1 jmcneill #define THINKPAD_NOTIFY_SleepButton 0x004
72 1.1 jmcneill #define THINKPAD_NOTIFY_WirelessSwitch 0x005
73 1.1 jmcneill #define THINKPAD_NOTIFY_FnF6 0x006
74 1.1 jmcneill #define THINKPAD_NOTIFY_DisplayCycle 0x007
75 1.1 jmcneill #define THINKPAD_NOTIFY_PointerSwitch 0x008
76 1.1 jmcneill #define THINKPAD_NOTIFY_EjectButton 0x009
77 1.1 jmcneill #define THINKPAD_NOTIFY_FnF10 0x00a
78 1.1 jmcneill #define THINKPAD_NOTIFY_FnF11 0x00b
79 1.1 jmcneill #define THINKPAD_NOTIFY_HibernateButton 0x00c
80 1.1 jmcneill #define THINKPAD_NOTIFY_BrightnessUp 0x010
81 1.1 jmcneill #define THINKPAD_NOTIFY_BrightnessDown 0x011
82 1.1 jmcneill #define THINKPAD_NOTIFY_ThinkLight 0x012
83 1.1 jmcneill #define THINKPAD_NOTIFY_Zoom 0x014
84 1.1 jmcneill #define THINKPAD_NOTIFY_ThinkVantage 0x018
85 1.1 jmcneill
86 1.1 jmcneill #define THINKPAD_CMOS_BRIGHTNESS_UP 0x04
87 1.1 jmcneill #define THINKPAD_CMOS_BRIGHTNESS_DOWN 0x05
88 1.1 jmcneill
89 1.2 jmcneill #define THINKPAD_HKEY_VERSION 0x0100
90 1.2 jmcneill
91 1.1 jmcneill static int thinkpad_match(device_t, struct cfdata *, void *);
92 1.1 jmcneill static void thinkpad_attach(device_t, device_t, void *);
93 1.1 jmcneill
94 1.1 jmcneill static ACPI_STATUS thinkpad_mask_init(thinkpad_softc_t *, uint32_t);
95 1.1 jmcneill static void thinkpad_notify_handler(ACPI_HANDLE, UINT32, void *);
96 1.1 jmcneill
97 1.1 jmcneill static void thinkpad_brightness_up(device_t);
98 1.1 jmcneill static void thinkpad_brightness_down(device_t);
99 1.1 jmcneill static uint8_t thinkpad_brightness_read(thinkpad_softc_t *sc);
100 1.1 jmcneill static void thinkpad_cmos(thinkpad_softc_t *, uint8_t);
101 1.1 jmcneill
102 1.1 jmcneill CFATTACH_DECL_NEW(thinkpad, sizeof(thinkpad_softc_t),
103 1.1 jmcneill thinkpad_match, thinkpad_attach, NULL, NULL);
104 1.1 jmcneill
105 1.1 jmcneill static const char * const thinkpad_ids[] = {
106 1.1 jmcneill "IBM0068",
107 1.1 jmcneill NULL
108 1.1 jmcneill };
109 1.1 jmcneill
110 1.1 jmcneill static int
111 1.1 jmcneill thinkpad_match(device_t parent, struct cfdata *match, void *opaque)
112 1.1 jmcneill {
113 1.1 jmcneill struct acpi_attach_args *aa = (struct acpi_attach_args *)opaque;
114 1.1 jmcneill ACPI_HANDLE hdl;
115 1.2 jmcneill ACPI_INTEGER ver;
116 1.1 jmcneill
117 1.1 jmcneill if (aa->aa_node->ad_type != ACPI_TYPE_DEVICE)
118 1.1 jmcneill return 0;
119 1.1 jmcneill
120 1.1 jmcneill if (!acpi_match_hid(aa->aa_node->ad_devinfo, thinkpad_ids))
121 1.1 jmcneill return 0;
122 1.1 jmcneill
123 1.1 jmcneill /* No point in attaching if we can't find the CMOS method */
124 1.1 jmcneill if (ACPI_FAILURE(AcpiGetHandle(NULL, "\\UCMS", &hdl)))
125 1.1 jmcneill return 0;
126 1.1 jmcneill
127 1.2 jmcneill /* We only support hotkey version 0x0100 */
128 1.3 jmcneill if (ACPI_FAILURE(acpi_eval_integer(aa->aa_node->ad_handle, "MHKV",
129 1.3 jmcneill &ver)))
130 1.2 jmcneill return 0;
131 1.2 jmcneill
132 1.2 jmcneill if (ver != THINKPAD_HKEY_VERSION)
133 1.2 jmcneill return 0;
134 1.2 jmcneill
135 1.1 jmcneill /* Cool, looks like we're good to go */
136 1.1 jmcneill return 1;
137 1.1 jmcneill }
138 1.1 jmcneill
139 1.1 jmcneill static void
140 1.1 jmcneill thinkpad_attach(device_t parent, device_t self, void *opaque)
141 1.1 jmcneill {
142 1.1 jmcneill thinkpad_softc_t *sc = device_private(self);
143 1.1 jmcneill struct acpi_attach_args *aa = (struct acpi_attach_args *)opaque;
144 1.1 jmcneill ACPI_STATUS rv;
145 1.1 jmcneill ACPI_INTEGER val;
146 1.1 jmcneill
147 1.1 jmcneill sc->sc_node = aa->aa_node;
148 1.1 jmcneill sc->sc_dev = self;
149 1.1 jmcneill
150 1.1 jmcneill aprint_naive("\n");
151 1.1 jmcneill aprint_normal("\n");
152 1.1 jmcneill
153 1.1 jmcneill /* T61 uses \UCMS method for issuing CMOS commands */
154 1.1 jmcneill rv = AcpiGetHandle(NULL, "\\UCMS", &sc->sc_cmoshdl);
155 1.1 jmcneill if (ACPI_FAILURE(rv))
156 1.1 jmcneill sc->sc_cmoshdl_valid = false;
157 1.1 jmcneill else {
158 1.1 jmcneill aprint_verbose_dev(self, "using CMOS at \\UCMS\n");
159 1.1 jmcneill sc->sc_cmoshdl_valid = true;
160 1.1 jmcneill }
161 1.1 jmcneill
162 1.1 jmcneill /* Get the supported event mask */
163 1.1 jmcneill rv = acpi_eval_integer(sc->sc_node->ad_handle, "MHKA", &val);
164 1.1 jmcneill if (ACPI_FAILURE(rv)) {
165 1.1 jmcneill aprint_error_dev(self, "couldn't evaluate MHKA: %s\n",
166 1.1 jmcneill AcpiFormatException(rv));
167 1.1 jmcneill goto fail;
168 1.1 jmcneill }
169 1.1 jmcneill
170 1.1 jmcneill /* Enable all supported events */
171 1.1 jmcneill rv = thinkpad_mask_init(sc, val);
172 1.1 jmcneill if (ACPI_FAILURE(rv)) {
173 1.1 jmcneill aprint_error_dev(self, "couldn't set event mask: %s\n",
174 1.1 jmcneill AcpiFormatException(rv));
175 1.1 jmcneill goto fail;
176 1.1 jmcneill }
177 1.1 jmcneill
178 1.1 jmcneill /* Install notify handler for events */
179 1.1 jmcneill rv = AcpiInstallNotifyHandler(sc->sc_node->ad_handle,
180 1.1 jmcneill ACPI_DEVICE_NOTIFY, thinkpad_notify_handler, sc);
181 1.1 jmcneill if (ACPI_FAILURE(rv))
182 1.1 jmcneill aprint_error_dev(self, "couldn't install notify handler: %s\n",
183 1.1 jmcneill AcpiFormatException(rv));
184 1.1 jmcneill
185 1.1 jmcneill /* Register with sysmon */
186 1.1 jmcneill sc->sc_smpsw_valid = true;
187 1.1 jmcneill
188 1.1 jmcneill sc->sc_smpsw[TP_PSW_SLEEP].smpsw_name = device_xname(self);
189 1.1 jmcneill sc->sc_smpsw[TP_PSW_SLEEP].smpsw_type = PSWITCH_TYPE_SLEEP;
190 1.1 jmcneill #if notyet
191 1.1 jmcneill sc->sc_smpsw[TP_PSW_HIBERNATE].smpsw_name = device_xname(self);
192 1.1 jmcneill sc->sc_smpsw[TP_PSW_HIBERNATE].smpsw_type = PSWITCH_TYPE_HIBERNATE;
193 1.1 jmcneill #endif
194 1.1 jmcneill
195 1.1 jmcneill if (sysmon_pswitch_register(&sc->sc_smpsw[TP_PSW_SLEEP]) != 0) {
196 1.1 jmcneill aprint_error_dev(self, "couldn't register with sysmon\n");
197 1.1 jmcneill sc->sc_smpsw_valid = false;
198 1.1 jmcneill }
199 1.1 jmcneill #if notyet
200 1.1 jmcneill if (sysmon_pswitch_register(&sc->sc_smpsw[TP_PSW_HIBERNATE]) != 0) {
201 1.1 jmcneill aprint_error_dev(self, "couldn't register with sysmon\n");
202 1.1 jmcneill sc->sc_smpsw_valid = false;
203 1.1 jmcneill }
204 1.1 jmcneill #endif
205 1.1 jmcneill
206 1.1 jmcneill fail:
207 1.1 jmcneill if (!pmf_device_register(self, NULL, NULL))
208 1.1 jmcneill aprint_error_dev(self, "couldn't establish power handler\n");
209 1.1 jmcneill if (!pmf_event_register(self, PMFE_DISPLAY_BRIGHTNESS_UP,
210 1.1 jmcneill thinkpad_brightness_up, true))
211 1.1 jmcneill aprint_error_dev(self, "couldn't register event handler\n");
212 1.1 jmcneill if (!pmf_event_register(self, PMFE_DISPLAY_BRIGHTNESS_DOWN,
213 1.1 jmcneill thinkpad_brightness_down, true))
214 1.1 jmcneill aprint_error_dev(self, "couldn't register event handler\n");
215 1.1 jmcneill
216 1.1 jmcneill return;
217 1.1 jmcneill }
218 1.1 jmcneill
219 1.1 jmcneill static void
220 1.1 jmcneill thinkpad_notify_handler(ACPI_HANDLE hdl, UINT32 notify, void *opaque)
221 1.1 jmcneill {
222 1.1 jmcneill thinkpad_softc_t *sc = (thinkpad_softc_t *)opaque;
223 1.1 jmcneill device_t self = sc->sc_dev;
224 1.1 jmcneill ACPI_STATUS rv;
225 1.1 jmcneill ACPI_INTEGER val;
226 1.1 jmcneill int type, event;
227 1.1 jmcneill
228 1.1 jmcneill if (notify != 0x80) {
229 1.1 jmcneill aprint_debug_dev(self, "unknown notify 0x%02x\n", notify);
230 1.1 jmcneill return;
231 1.1 jmcneill }
232 1.1 jmcneill
233 1.2 jmcneill for (;;) {
234 1.2 jmcneill rv = acpi_eval_integer(sc->sc_node->ad_handle, "MHKP", &val);
235 1.2 jmcneill if (ACPI_FAILURE(rv)) {
236 1.2 jmcneill aprint_error_dev(self, "couldn't evaluate MHKP: %s\n",
237 1.2 jmcneill AcpiFormatException(rv));
238 1.2 jmcneill return;
239 1.2 jmcneill }
240 1.2 jmcneill
241 1.2 jmcneill if (val == 0)
242 1.2 jmcneill return;
243 1.2 jmcneill
244 1.2 jmcneill type = (val & 0xf000) >> 12;
245 1.2 jmcneill event = val & 0x0fff;
246 1.2 jmcneill
247 1.2 jmcneill if (type != 1)
248 1.2 jmcneill /* Only type 1 events are supported for now */
249 1.2 jmcneill continue;
250 1.2 jmcneill
251 1.2 jmcneill switch (event) {
252 1.2 jmcneill case THINKPAD_NOTIFY_BrightnessUp:
253 1.2 jmcneill thinkpad_brightness_up(self);
254 1.2 jmcneill break;
255 1.2 jmcneill case THINKPAD_NOTIFY_BrightnessDown:
256 1.2 jmcneill thinkpad_brightness_down(self);
257 1.2 jmcneill break;
258 1.2 jmcneill case THINKPAD_NOTIFY_DisplayCycle:
259 1.1 jmcneill #if notyet
260 1.2 jmcneill pmf_event_inject(NULL, PMFE_DISPLAY_CYCLE);
261 1.1 jmcneill #endif
262 1.1 jmcneill break;
263 1.2 jmcneill case THINKPAD_NOTIFY_SleepButton:
264 1.2 jmcneill if (sc->sc_smpsw_valid == false)
265 1.2 jmcneill break;
266 1.2 jmcneill sysmon_pswitch_event(&sc->sc_smpsw[TP_PSW_SLEEP],
267 1.2 jmcneill PSWITCH_EVENT_PRESSED);
268 1.2 jmcneill break;
269 1.2 jmcneill case THINKPAD_NOTIFY_HibernateButton:
270 1.1 jmcneill #if notyet
271 1.2 jmcneill if (sc->sc_smpsw_valid == false)
272 1.2 jmcneill break;
273 1.2 jmcneill sysmon_pswitch_event(&sc->sc_smpsw[TP_PSW_HIBERNATE],
274 1.2 jmcneill PSWITCH_EVENT_PRESSED);
275 1.1 jmcneill break;
276 1.1 jmcneill #endif
277 1.2 jmcneill case THINKPAD_NOTIFY_FnF1:
278 1.2 jmcneill case THINKPAD_NOTIFY_LockScreen:
279 1.2 jmcneill case THINKPAD_NOTIFY_BatteryInfo:
280 1.2 jmcneill case THINKPAD_NOTIFY_WirelessSwitch:
281 1.2 jmcneill case THINKPAD_NOTIFY_FnF6:
282 1.2 jmcneill case THINKPAD_NOTIFY_PointerSwitch:
283 1.2 jmcneill case THINKPAD_NOTIFY_EjectButton:
284 1.2 jmcneill case THINKPAD_NOTIFY_FnF10:
285 1.2 jmcneill case THINKPAD_NOTIFY_FnF11:
286 1.2 jmcneill case THINKPAD_NOTIFY_ThinkLight:
287 1.2 jmcneill case THINKPAD_NOTIFY_Zoom:
288 1.2 jmcneill case THINKPAD_NOTIFY_ThinkVantage:
289 1.2 jmcneill /* XXXJDM we should deliver hotkeys as keycodes */
290 1.2 jmcneill break;
291 1.2 jmcneill default:
292 1.2 jmcneill aprint_debug_dev(self, "notify event 0x%03x\n", event);
293 1.2 jmcneill break;
294 1.2 jmcneill }
295 1.1 jmcneill }
296 1.1 jmcneill
297 1.1 jmcneill return;
298 1.1 jmcneill }
299 1.1 jmcneill
300 1.1 jmcneill static ACPI_STATUS
301 1.1 jmcneill thinkpad_mask_init(thinkpad_softc_t *sc, uint32_t mask)
302 1.1 jmcneill {
303 1.1 jmcneill ACPI_OBJECT param[2];
304 1.1 jmcneill ACPI_OBJECT_LIST params;
305 1.1 jmcneill ACPI_STATUS rv;
306 1.1 jmcneill int i;
307 1.1 jmcneill
308 1.1 jmcneill /* Update hotkey mask */
309 1.1 jmcneill params.Count = 2;
310 1.1 jmcneill params.Pointer = param;
311 1.1 jmcneill param[0].Type = param[1].Type = ACPI_TYPE_INTEGER;
312 1.1 jmcneill
313 1.1 jmcneill for (i = 0; i < 32; i++) {
314 1.1 jmcneill param[0].Integer.Value = i + 1;
315 1.1 jmcneill param[1].Integer.Value = (((1 << i) & mask) != 0);
316 1.1 jmcneill
317 1.1 jmcneill rv = AcpiEvaluateObject(sc->sc_node->ad_handle, "MHKM",
318 1.1 jmcneill ¶ms, NULL);
319 1.1 jmcneill if (ACPI_FAILURE(rv))
320 1.1 jmcneill return rv;
321 1.1 jmcneill }
322 1.1 jmcneill
323 1.1 jmcneill /* Enable hotkey events */
324 1.1 jmcneill params.Count = 1;
325 1.1 jmcneill param[0].Integer.Value = 1;
326 1.1 jmcneill rv = AcpiEvaluateObject(sc->sc_node->ad_handle, "MHKC", ¶ms, NULL);
327 1.1 jmcneill if (ACPI_FAILURE(rv)) {
328 1.1 jmcneill aprint_error_dev(sc->sc_dev, "couldn't enable hotkeys: %s\n",
329 1.1 jmcneill AcpiFormatException(rv));
330 1.1 jmcneill return rv;
331 1.1 jmcneill }
332 1.1 jmcneill
333 1.1 jmcneill return AE_OK;
334 1.1 jmcneill }
335 1.1 jmcneill
336 1.1 jmcneill static uint8_t
337 1.1 jmcneill thinkpad_brightness_read(thinkpad_softc_t *sc)
338 1.1 jmcneill {
339 1.1 jmcneill #if defined(__i386__) || defined(__amd64__)
340 1.1 jmcneill /*
341 1.1 jmcneill * We have two ways to get the current brightness -- either via
342 1.1 jmcneill * magic RTC registers, or using the EC. Since I don't dare mess
343 1.1 jmcneill * with the EC, and Thinkpads are x86-only, this will have to do
344 1.1 jmcneill * for now.
345 1.1 jmcneill */
346 1.1 jmcneill outb(0x70, 0x6c);
347 1.1 jmcneill return inb(0x71) & 7;
348 1.1 jmcneill #else
349 1.1 jmcneill return 0;
350 1.1 jmcneill #endif
351 1.1 jmcneill }
352 1.1 jmcneill
353 1.1 jmcneill static void
354 1.1 jmcneill thinkpad_brightness_up(device_t self)
355 1.1 jmcneill {
356 1.1 jmcneill thinkpad_softc_t *sc = device_private(self);
357 1.1 jmcneill
358 1.1 jmcneill if (thinkpad_brightness_read(sc) == 7)
359 1.1 jmcneill return;
360 1.1 jmcneill thinkpad_cmos(sc, THINKPAD_CMOS_BRIGHTNESS_UP);
361 1.1 jmcneill }
362 1.1 jmcneill
363 1.1 jmcneill static void
364 1.1 jmcneill thinkpad_brightness_down(device_t self)
365 1.1 jmcneill {
366 1.1 jmcneill thinkpad_softc_t *sc = device_private(self);
367 1.1 jmcneill
368 1.1 jmcneill if (thinkpad_brightness_read(sc) == 0)
369 1.1 jmcneill return;
370 1.1 jmcneill thinkpad_cmos(sc, THINKPAD_CMOS_BRIGHTNESS_DOWN);
371 1.1 jmcneill }
372 1.1 jmcneill
373 1.1 jmcneill static void
374 1.1 jmcneill thinkpad_cmos(thinkpad_softc_t *sc, uint8_t cmd)
375 1.1 jmcneill {
376 1.1 jmcneill ACPI_OBJECT param;
377 1.1 jmcneill ACPI_OBJECT_LIST params;
378 1.1 jmcneill ACPI_STATUS rv;
379 1.1 jmcneill
380 1.1 jmcneill if (sc->sc_cmoshdl_valid == false)
381 1.1 jmcneill return;
382 1.1 jmcneill
383 1.1 jmcneill params.Count = 1;
384 1.1 jmcneill params.Pointer = ¶m;
385 1.1 jmcneill param.Type = ACPI_TYPE_INTEGER;
386 1.1 jmcneill param.Integer.Value = cmd;
387 1.1 jmcneill rv = AcpiEvaluateObject(sc->sc_cmoshdl, NULL, ¶ms, NULL);
388 1.1 jmcneill if (ACPI_FAILURE(rv))
389 1.1 jmcneill aprint_error_dev(sc->sc_dev, "couldn't evalute CMOS: %s\n",
390 1.1 jmcneill AcpiFormatException(rv));
391 1.1 jmcneill }
392