Sat May 29 16:49:57 2021 UTC ()
Add some more Thinkpad hotkeys.


(riastradh)
diff -r1.51 -r1.52 src/sys/dev/acpi/thinkpad_acpi.c
diff -r1.21 -r1.22 src/sys/sys/power.h

cvs diff -r1.51 -r1.52 src/sys/dev/acpi/thinkpad_acpi.c (expand / switch to unified diff)

--- src/sys/dev/acpi/thinkpad_acpi.c 2021/05/29 16:49:49 1.51
+++ src/sys/dev/acpi/thinkpad_acpi.c 2021/05/29 16:49:57 1.52
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: thinkpad_acpi.c,v 1.51 2021/05/29 16:49:49 riastradh Exp $ */ 1/* $NetBSD: thinkpad_acpi.c,v 1.52 2021/05/29 16:49:57 riastradh Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2007 Jared D. McNeill <jmcneill@invisible.ca> 4 * Copyright (c) 2007 Jared D. McNeill <jmcneill@invisible.ca>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -17,27 +17,27 @@ @@ -17,27 +17,27 @@
17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 17 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 18 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 19 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 20 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26 * POSSIBILITY OF SUCH DAMAGE. 26 * POSSIBILITY OF SUCH DAMAGE.
27 */ 27 */
28 28
29#include <sys/cdefs.h> 29#include <sys/cdefs.h>
30__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.51 2021/05/29 16:49:49 riastradh Exp $"); 30__KERNEL_RCSID(0, "$NetBSD: thinkpad_acpi.c,v 1.52 2021/05/29 16:49:57 riastradh Exp $");
31 31
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/device.h> 33#include <sys/device.h>
34#include <sys/module.h> 34#include <sys/module.h>
35#include <sys/sdt.h> 35#include <sys/sdt.h>
36#include <sys/systm.h> 36#include <sys/systm.h>
37 37
38#include <dev/acpi/acpireg.h> 38#include <dev/acpi/acpireg.h>
39#include <dev/acpi/acpivar.h> 39#include <dev/acpi/acpivar.h>
40#include <dev/acpi/acpi_ecvar.h> 40#include <dev/acpi/acpi_ecvar.h>
41#include <dev/acpi/acpi_power.h> 41#include <dev/acpi/acpi_power.h>
42 42
43#include <dev/isa/isareg.h> 43#include <dev/isa/isareg.h>
@@ -66,27 +66,31 @@ typedef struct thinkpad_softc { @@ -66,27 +66,31 @@ typedef struct thinkpad_softc {
66#define TP_PSW_VENDOR_BUTTON 7 /* ThinkVantage */ 66#define TP_PSW_VENDOR_BUTTON 7 /* ThinkVantage */
67#define TP_PSW_FNF1_BUTTON 8 /* FnF1 */ 67#define TP_PSW_FNF1_BUTTON 8 /* FnF1 */
68#define TP_PSW_WIRELESS_BUTTON 9 /* FnF5 */ 68#define TP_PSW_WIRELESS_BUTTON 9 /* FnF5 */
69#define TP_PSW_WWAN_BUTTON 10 /* FnF6 */ 69#define TP_PSW_WWAN_BUTTON 10 /* FnF6 */
70#define TP_PSW_POINTER_BUTTON 11 /* FnF8 */ 70#define TP_PSW_POINTER_BUTTON 11 /* FnF8 */
71#define TP_PSW_FNF10_BUTTON 12 /* FnF10 */ 71#define TP_PSW_FNF10_BUTTON 12 /* FnF10 */
72#define TP_PSW_FNF11_BUTTON 13 /* FnF11 */ 72#define TP_PSW_FNF11_BUTTON 13 /* FnF11 */
73#define TP_PSW_BRIGHTNESS_UP 14 73#define TP_PSW_BRIGHTNESS_UP 14
74#define TP_PSW_BRIGHTNESS_DOWN 15 74#define TP_PSW_BRIGHTNESS_DOWN 15
75#define TP_PSW_THINKLIGHT 16 75#define TP_PSW_THINKLIGHT 16
76#define TP_PSW_VOLUME_UP 17 76#define TP_PSW_VOLUME_UP 17
77#define TP_PSW_VOLUME_DOWN 18 77#define TP_PSW_VOLUME_DOWN 18
78#define TP_PSW_VOLUME_MUTE 19 78#define TP_PSW_VOLUME_MUTE 19
79#define TP_PSW_LAST 20 79#define TP_PSW_STAR_BUTTON 20
 80#define TP_PSW_SCISSORS_BUTTON 21
 81#define TP_PSW_BLUETOOTH_BUTTON 22
 82#define TP_PSW_KEYBOARD_BUTTON 23
 83#define TP_PSW_LAST 24
80 84
81 struct sysmon_pswitch sc_smpsw[TP_PSW_LAST]; 85 struct sysmon_pswitch sc_smpsw[TP_PSW_LAST];
82 bool sc_smpsw_valid; 86 bool sc_smpsw_valid;
83 87
84 struct sysmon_envsys *sc_sme; 88 struct sysmon_envsys *sc_sme;
85 envsys_data_t sc_sensor[THINKPAD_NSENSORS]; 89 envsys_data_t sc_sensor[THINKPAD_NSENSORS];
86 90
87 int sc_display_state; 91 int sc_display_state;
88} thinkpad_softc_t; 92} thinkpad_softc_t;
89 93
90/* Hotkey events */ 94/* Hotkey events */
91#define THINKPAD_NOTIFY_FnF1 0x001 95#define THINKPAD_NOTIFY_FnF1 0x001
92#define THINKPAD_NOTIFY_LockScreen 0x002 96#define THINKPAD_NOTIFY_LockScreen 0x002
@@ -98,26 +102,30 @@ typedef struct thinkpad_softc { @@ -98,26 +102,30 @@ typedef struct thinkpad_softc {
98#define THINKPAD_NOTIFY_PointerSwitch 0x008 102#define THINKPAD_NOTIFY_PointerSwitch 0x008
99#define THINKPAD_NOTIFY_EjectButton 0x009 103#define THINKPAD_NOTIFY_EjectButton 0x009
100#define THINKPAD_NOTIFY_FnF10 0x00a /* XXX: Not seen on T61 */ 104#define THINKPAD_NOTIFY_FnF10 0x00a /* XXX: Not seen on T61 */
101#define THINKPAD_NOTIFY_FnF11 0x00b 105#define THINKPAD_NOTIFY_FnF11 0x00b
102#define THINKPAD_NOTIFY_HibernateButton 0x00c 106#define THINKPAD_NOTIFY_HibernateButton 0x00c
103#define THINKPAD_NOTIFY_BrightnessUp 0x010 107#define THINKPAD_NOTIFY_BrightnessUp 0x010
104#define THINKPAD_NOTIFY_BrightnessDown 0x011 108#define THINKPAD_NOTIFY_BrightnessDown 0x011
105#define THINKPAD_NOTIFY_ThinkLight 0x012 109#define THINKPAD_NOTIFY_ThinkLight 0x012
106#define THINKPAD_NOTIFY_Zoom 0x014 110#define THINKPAD_NOTIFY_Zoom 0x014
107#define THINKPAD_NOTIFY_VolumeUp 0x015 /* XXX: Not seen on T61 */ 111#define THINKPAD_NOTIFY_VolumeUp 0x015 /* XXX: Not seen on T61 */
108#define THINKPAD_NOTIFY_VolumeDown 0x016 /* XXX: Not seen on T61 */ 112#define THINKPAD_NOTIFY_VolumeDown 0x016 /* XXX: Not seen on T61 */
109#define THINKPAD_NOTIFY_VolumeMute 0x017 /* XXX: Not seen on T61 */ 113#define THINKPAD_NOTIFY_VolumeMute 0x017 /* XXX: Not seen on T61 */
110#define THINKPAD_NOTIFY_ThinkVantage 0x018 114#define THINKPAD_NOTIFY_ThinkVantage 0x018
 115#define THINKPAD_NOTIFY_Star 0x311
 116#define THINKPAD_NOTIFY_Scissors 0x312
 117#define THINKPAD_NOTIFY_Bluetooth 0x314
 118#define THINKPAD_NOTIFY_Keyboard 0x315
111 119
112#define THINKPAD_CMOS_BRIGHTNESS_UP 0x04 120#define THINKPAD_CMOS_BRIGHTNESS_UP 0x04
113#define THINKPAD_CMOS_BRIGHTNESS_DOWN 0x05 121#define THINKPAD_CMOS_BRIGHTNESS_DOWN 0x05
114 122
115#define THINKPAD_HKEY_VERSION_1 0x0100 123#define THINKPAD_HKEY_VERSION_1 0x0100
116#define THINKPAD_HKEY_VERSION_2 0x0200 124#define THINKPAD_HKEY_VERSION_2 0x0200
117 125
118#define THINKPAD_DISPLAY_LCD 0x01 126#define THINKPAD_DISPLAY_LCD 0x01
119#define THINKPAD_DISPLAY_CRT 0x02 127#define THINKPAD_DISPLAY_CRT 0x02
120#define THINKPAD_DISPLAY_DVI 0x08 128#define THINKPAD_DISPLAY_DVI 0x08
121#define THINKPAD_DISPLAY_ALL \ 129#define THINKPAD_DISPLAY_ALL \
122 (THINKPAD_DISPLAY_LCD | THINKPAD_DISPLAY_CRT | THINKPAD_DISPLAY_DVI) 130 (THINKPAD_DISPLAY_LCD | THINKPAD_DISPLAY_CRT | THINKPAD_DISPLAY_DVI)
123 131
@@ -285,26 +293,30 @@ thinkpad_attach(device_t parent, device_ @@ -285,26 +293,30 @@ thinkpad_attach(device_t parent, device_
285#ifndef THINKPAD_NORMAL_HOTKEYS 293#ifndef THINKPAD_NORMAL_HOTKEYS
286 psw[TP_PSW_FNF1_BUTTON].smpsw_name = PSWITCH_HK_FNF1_BUTTON; 294 psw[TP_PSW_FNF1_BUTTON].smpsw_name = PSWITCH_HK_FNF1_BUTTON;
287 psw[TP_PSW_WIRELESS_BUTTON].smpsw_name = PSWITCH_HK_WIRELESS_BUTTON; 295 psw[TP_PSW_WIRELESS_BUTTON].smpsw_name = PSWITCH_HK_WIRELESS_BUTTON;
288 psw[TP_PSW_WWAN_BUTTON].smpsw_name = PSWITCH_HK_WWAN_BUTTON; 296 psw[TP_PSW_WWAN_BUTTON].smpsw_name = PSWITCH_HK_WWAN_BUTTON;
289 psw[TP_PSW_POINTER_BUTTON].smpsw_name = PSWITCH_HK_POINTER_BUTTON; 297 psw[TP_PSW_POINTER_BUTTON].smpsw_name = PSWITCH_HK_POINTER_BUTTON;
290 psw[TP_PSW_FNF10_BUTTON].smpsw_name = PSWITCH_HK_FNF10_BUTTON; 298 psw[TP_PSW_FNF10_BUTTON].smpsw_name = PSWITCH_HK_FNF10_BUTTON;
291 psw[TP_PSW_FNF11_BUTTON].smpsw_name = PSWITCH_HK_FNF11_BUTTON; 299 psw[TP_PSW_FNF11_BUTTON].smpsw_name = PSWITCH_HK_FNF11_BUTTON;
292 psw[TP_PSW_BRIGHTNESS_UP].smpsw_name = PSWITCH_HK_BRIGHTNESS_UP; 300 psw[TP_PSW_BRIGHTNESS_UP].smpsw_name = PSWITCH_HK_BRIGHTNESS_UP;
293 psw[TP_PSW_BRIGHTNESS_DOWN].smpsw_name = PSWITCH_HK_BRIGHTNESS_DOWN; 301 psw[TP_PSW_BRIGHTNESS_DOWN].smpsw_name = PSWITCH_HK_BRIGHTNESS_DOWN;
294 psw[TP_PSW_THINKLIGHT].smpsw_name = PSWITCH_HK_THINKLIGHT; 302 psw[TP_PSW_THINKLIGHT].smpsw_name = PSWITCH_HK_THINKLIGHT;
295 psw[TP_PSW_VOLUME_UP].smpsw_name = PSWITCH_HK_VOLUME_UP; 303 psw[TP_PSW_VOLUME_UP].smpsw_name = PSWITCH_HK_VOLUME_UP;
296 psw[TP_PSW_VOLUME_DOWN].smpsw_name = PSWITCH_HK_VOLUME_DOWN; 304 psw[TP_PSW_VOLUME_DOWN].smpsw_name = PSWITCH_HK_VOLUME_DOWN;
297 psw[TP_PSW_VOLUME_MUTE].smpsw_name = PSWITCH_HK_VOLUME_MUTE; 305 psw[TP_PSW_VOLUME_MUTE].smpsw_name = PSWITCH_HK_VOLUME_MUTE;
 306 psw[TP_PSW_STAR_BUTTON].smpsw_name = PSWITCH_HK_STAR_BUTTON;
 307 psw[TP_PSW_SCISSORS_BUTTON].smpsw_name = PSWITCH_HK_SCISSORS_BUTTON;
 308 psw[TP_PSW_BLUETOOTH_BUTTON].smpsw_name = PSWITCH_HK_BLUETOOTH_BUTTON;
 309 psw[TP_PSW_KEYBOARD_BUTTON].smpsw_name = PSWITCH_HK_KEYBOARD_BUTTON;
298#endif /* THINKPAD_NORMAL_HOTKEYS */ 310#endif /* THINKPAD_NORMAL_HOTKEYS */
299 311
300 for (i = 0; i < TP_PSW_LAST; i++) { 312 for (i = 0; i < TP_PSW_LAST; i++) {
301 /* not supported yet */ 313 /* not supported yet */
302 if (i == TP_PSW_HIBERNATE) 314 if (i == TP_PSW_HIBERNATE)
303 continue; 315 continue;
304 if (sysmon_pswitch_register(&sc->sc_smpsw[i]) != 0) { 316 if (sysmon_pswitch_register(&sc->sc_smpsw[i]) != 0) {
305 aprint_error_dev(self, 317 aprint_error_dev(self,
306 "couldn't register with sysmon\n"); 318 "couldn't register with sysmon\n");
307 sc->sc_smpsw_valid = false; 319 sc->sc_smpsw_valid = false;
308 break; 320 break;
309 } 321 }
310 } 322 }
@@ -416,26 +428,35 @@ thinkpad_get_hotkeys(void *opaque) @@ -416,26 +428,35 @@ thinkpad_get_hotkeys(void *opaque)
416#endif 428#endif
417 break; 429 break;
418 case THINKPAD_NOTIFY_WirelessSwitch: 430 case THINKPAD_NOTIFY_WirelessSwitch:
419 thinkpad_uwb_toggle(sc); 431 thinkpad_uwb_toggle(sc);
420 thinkpad_wwan_toggle(sc); 432 thinkpad_wwan_toggle(sc);
421 thinkpad_bluetooth_toggle(sc); 433 thinkpad_bluetooth_toggle(sc);
422#ifndef THINKPAD_NORMAL_HOTKEYS 434#ifndef THINKPAD_NORMAL_HOTKEYS
423 if (sc->sc_smpsw_valid == false) 435 if (sc->sc_smpsw_valid == false)
424 break; 436 break;
425 sysmon_pswitch_event(&sc->sc_smpsw[TP_PSW_WIRELESS_BUTTON], 437 sysmon_pswitch_event(&sc->sc_smpsw[TP_PSW_WIRELESS_BUTTON],
426 PSWITCH_EVENT_PRESSED); 438 PSWITCH_EVENT_PRESSED);
427#endif 439#endif
428 break; 440 break;
 441 case THINKPAD_NOTIFY_Bluetooth:
 442 thinkpad_bluetooth_toggle(sc);
 443#ifndef THINKPAD_NORMAL_HOTKEYS
 444 if (sc->sc_smpsw_valid == false)
 445 break;
 446 sysmon_pswitch_event(&sc->sc_smpsw[TP_PSW_BLUETOOTH_BUTTON],
 447 PSWITCH_EVENT_PRESSED);
 448#endif
 449 break;
429 case THINKPAD_NOTIFY_wWANSwitch: 450 case THINKPAD_NOTIFY_wWANSwitch:
430 thinkpad_wwan_toggle(sc); 451 thinkpad_wwan_toggle(sc);
431#ifndef THINKPAD_NORMAL_HOTKEYS 452#ifndef THINKPAD_NORMAL_HOTKEYS
432 if (sc->sc_smpsw_valid == false) 453 if (sc->sc_smpsw_valid == false)
433 break; 454 break;
434 sysmon_pswitch_event(&sc->sc_smpsw[TP_PSW_WWAN_BUTTON], 455 sysmon_pswitch_event(&sc->sc_smpsw[TP_PSW_WWAN_BUTTON],
435 PSWITCH_EVENT_PRESSED); 456 PSWITCH_EVENT_PRESSED);
436#endif 457#endif
437 break; 458 break;
438 case THINKPAD_NOTIFY_SleepButton: 459 case THINKPAD_NOTIFY_SleepButton:
439 if (sc->sc_smpsw_valid == false) 460 if (sc->sc_smpsw_valid == false)
440 break; 461 break;
441 sysmon_pswitch_event(&sc->sc_smpsw[TP_PSW_SLEEP], 462 sysmon_pswitch_event(&sc->sc_smpsw[TP_PSW_SLEEP],
@@ -533,35 +554,56 @@ thinkpad_get_hotkeys(void *opaque) @@ -533,35 +554,56 @@ thinkpad_get_hotkeys(void *opaque)
533 break; 554 break;
534 case THINKPAD_NOTIFY_VolumeDown: 555 case THINKPAD_NOTIFY_VolumeDown:
535 if (sc->sc_smpsw_valid == false) 556 if (sc->sc_smpsw_valid == false)
536 break; 557 break;
537 sysmon_pswitch_event(&sc->sc_smpsw[TP_PSW_VOLUME_DOWN], 558 sysmon_pswitch_event(&sc->sc_smpsw[TP_PSW_VOLUME_DOWN],
538 PSWITCH_EVENT_PRESSED); 559 PSWITCH_EVENT_PRESSED);
539 break; 560 break;
540 case THINKPAD_NOTIFY_VolumeMute: 561 case THINKPAD_NOTIFY_VolumeMute:
541 if (sc->sc_smpsw_valid == false) 562 if (sc->sc_smpsw_valid == false)
542 break; 563 break;
543 sysmon_pswitch_event(&sc->sc_smpsw[TP_PSW_VOLUME_MUTE], 564 sysmon_pswitch_event(&sc->sc_smpsw[TP_PSW_VOLUME_MUTE],
544 PSWITCH_EVENT_PRESSED); 565 PSWITCH_EVENT_PRESSED);
545 break; 566 break;
 567 case THINKPAD_NOTIFY_Star:
 568 if (sc->sc_smpsw_valid == false)
 569 break;
 570 sysmon_pswitch_event(&sc->sc_smpsw[TP_PSW_STAR_BUTTON],
 571 PSWITCH_EVENT_PRESSED);
 572 break;
 573 case THINKPAD_NOTIFY_Scissors:
 574 if (sc->sc_smpsw_valid == false)
 575 break;
 576 sysmon_pswitch_event(&sc->sc_smpsw[TP_PSW_SCISSORS_BUTTON],
 577 PSWITCH_EVENT_PRESSED);
 578 break;
 579 case THINKPAD_NOTIFY_Keyboard:
 580 if (sc->sc_smpsw_valid == false)
 581 break;
 582 sysmon_pswitch_event(&sc->sc_smpsw[TP_PSW_KEYBOARD_BUTTON],
 583 PSWITCH_EVENT_PRESSED);
 584 break;
546#else 585#else
547 case THINKPAD_NOTIFY_FnF1: 586 case THINKPAD_NOTIFY_FnF1:
548 case THINKPAD_NOTIFY_PointerSwitch: 587 case THINKPAD_NOTIFY_PointerSwitch:
549 case THINKPAD_NOTIFY_FnF10: 588 case THINKPAD_NOTIFY_FnF10:
550 case THINKPAD_NOTIFY_FnF11: 589 case THINKPAD_NOTIFY_FnF11:
551 case THINKPAD_NOTIFY_ThinkLight: 590 case THINKPAD_NOTIFY_ThinkLight:
552 case THINKPAD_NOTIFY_VolumeUp: 591 case THINKPAD_NOTIFY_VolumeUp:
553 case THINKPAD_NOTIFY_VolumeDown: 592 case THINKPAD_NOTIFY_VolumeDown:
554 case THINKPAD_NOTIFY_VolumeMute: 593 case THINKPAD_NOTIFY_VolumeMute:
 594 case THINKPAD_NOTIFY_Star:
 595 case THINKPAD_NOTIFY_Scissors:
 596 case THINKPAD_NOTIFY_Keyboard:
555 /* XXXJDM we should deliver hotkeys as keycodes */ 597 /* XXXJDM we should deliver hotkeys as keycodes */
556 break; 598 break;
557#endif /* THINKPAD_NORMAL_HOTKEYS */ 599#endif /* THINKPAD_NORMAL_HOTKEYS */
558 default: 600 default:
559 aprint_debug_dev(self, "notify event 0x%03x\n", event); 601 aprint_debug_dev(self, "notify event 0x%03x\n", event);
560 break; 602 break;
561 } 603 }
562 } 604 }
563} 605}
564 606
565static ACPI_STATUS 607static ACPI_STATUS
566thinkpad_mask_init(thinkpad_softc_t *sc, uint32_t mask) 608thinkpad_mask_init(thinkpad_softc_t *sc, uint32_t mask)
567{ 609{

cvs diff -r1.21 -r1.22 src/sys/sys/power.h (expand / switch to unified diff)

--- src/sys/sys/power.h 2018/08/01 20:09:34 1.21
+++ src/sys/sys/power.h 2021/05/29 16:49:57 1.22
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: power.h,v 1.21 2018/08/01 20:09:34 kre Exp $ */ 1/* $NetBSD: power.h,v 1.22 2021/05/29 16:49:57 riastradh Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2003 Wasabi Systems, Inc. 4 * Copyright (c) 2003 Wasabi Systems, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Written by Jason R. Thorpe for Wasabi Systems, Inc. 7 * Written by Jason R. Thorpe for Wasabi Systems, Inc.
8 * 8 *
9 * Redistribution and use in source and binary forms, with or without 9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions 10 * modification, are permitted provided that the following conditions
11 * are met: 11 * are met:
12 * 1. Redistributions of source code must retain the above copyright 12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer. 13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright 14 * 2. Redistributions in binary form must reproduce the above copyright
@@ -104,26 +104,30 @@ @@ -104,26 +104,30 @@
104#ifndef THINKPAD_NORMAL_HOTKEYS 104#ifndef THINKPAD_NORMAL_HOTKEYS
105#define PSWITCH_HK_FNF1_BUTTON "fnf1-button" 105#define PSWITCH_HK_FNF1_BUTTON "fnf1-button"
106#define PSWITCH_HK_WIRELESS_BUTTON "wireless-button" 106#define PSWITCH_HK_WIRELESS_BUTTON "wireless-button"
107#define PSWITCH_HK_WWAN_BUTTON "wWAN-button" 107#define PSWITCH_HK_WWAN_BUTTON "wWAN-button"
108#define PSWITCH_HK_POINTER_BUTTON "pointer-button" 108#define PSWITCH_HK_POINTER_BUTTON "pointer-button"
109#define PSWITCH_HK_FNF10_BUTTON "fnf10-button" 109#define PSWITCH_HK_FNF10_BUTTON "fnf10-button"
110#define PSWITCH_HK_FNF11_BUTTON "fnf11-button" 110#define PSWITCH_HK_FNF11_BUTTON "fnf11-button"
111#define PSWITCH_HK_BRIGHTNESS_UP "brightness-up" 111#define PSWITCH_HK_BRIGHTNESS_UP "brightness-up"
112#define PSWITCH_HK_BRIGHTNESS_DOWN "brightness-down" 112#define PSWITCH_HK_BRIGHTNESS_DOWN "brightness-down"
113#define PSWITCH_HK_THINKLIGHT "thinklight" 113#define PSWITCH_HK_THINKLIGHT "thinklight"
114#define PSWITCH_HK_VOLUME_UP "volume-up" 114#define PSWITCH_HK_VOLUME_UP "volume-up"
115#define PSWITCH_HK_VOLUME_DOWN "volume-down" 115#define PSWITCH_HK_VOLUME_DOWN "volume-down"
116#define PSWITCH_HK_VOLUME_MUTE "volume-mute" 116#define PSWITCH_HK_VOLUME_MUTE "volume-mute"
 117#define PSWITCH_HK_STAR_BUTTON "star-button"
 118#define PSWITCH_HK_SCISSORS_BUTTON "scissors-button"
 119#define PSWITCH_HK_BLUETOOTH_BUTTON "bluetooth-button"
 120#define PSWITCH_HK_KEYBOARD_BUTTON "keyboard-button"
117#endif /* THINKPAD_NORMAL_HOTKEYS */ 121#endif /* THINKPAD_NORMAL_HOTKEYS */
118#define PSWITCH_TYPE_RADIO 6 /* radio switch */ 122#define PSWITCH_TYPE_RADIO 6 /* radio switch */
119 123
120#define PSWITCH_EVENT_PRESSED 0 /* button pressed, lid closed, AC off */ 124#define PSWITCH_EVENT_PRESSED 0 /* button pressed, lid closed, AC off */
121#define PSWITCH_EVENT_RELEASED 1 /* button released, lid open, AC on */ 125#define PSWITCH_EVENT_RELEASED 1 /* button released, lid open, AC on */
122 126
123/* 127/*
124 * This structure describes the state of a power switch. 128 * This structure describes the state of a power switch.
125 */ 129 */
126struct pswitch_state { 130struct pswitch_state {
127 char psws_name[16]; /* power switch name */ 131 char psws_name[16]; /* power switch name */
128 int32_t psws_type; /* type of switch (qualifier) */ 132 int32_t psws_type; /* type of switch (qualifier) */
129 int32_t psws_state; /* state of the switch/event */ 133 int32_t psws_state; /* state of the switch/event */