blob: a2120a98e285fa82e89899fbeb25226c99633835 [file] [log] [blame]
Tobias Diedrich2a385512015-06-13 13:29:50 +02001/*
2 * This file is part of the coreboot project.
3 *
4 * Based on the example of Mika Westerberg: https://lwn.net/Articles/612062/
5 *
6 * Copyright (C) 2015 Tobias Diedrich, Mika Westerberg
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; version 2 of the License.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
Tobias Diedrich2a385512015-06-13 13:29:50 +020016 */
17
18Scope (\_SB.PCI0.SBUS)
19{
20 Device (BTNS)
21 {
22 Name (_HID, "PRP0001")
23
24 Name (_CRS, ResourceTemplate () {
25 GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionInputOnly,
26 "\\_SB.PCI0.SBUS.GPIO", 0, ResourceConsumer) {187}
27 })
28
29 Name (_DSD, Package () {
30 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
31 Package () {
32 Package () {"compatible", Package () {"gpio-keys-polled"}},
33 Package () {"poll-interval", 100},
34 Package () {"autorepeat", 1}
35 }
36 })
37
38 Device (BTN1)
39 {
Martin Rotheca844b2015-12-01 10:46:33 -070040 Name (_HID, "PRP0001")
Tobias Diedrich2a385512015-06-13 13:29:50 +020041 Name (_DSD, Package () {
42 ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"),
43 Package () {
44 /* BTN_1 is 0x101 in linux/input.h */
45 Package () {"linux,code", 257},
46 Package () {"linux,input-type", 1},
47 /* labeled S1 on the board, MODESW in the gpio header files */
48 Package () {"label", "switch1"},
49 Package () {"gpios", Package () {^^BTNS, 0, 0, 1 /* low-active */}},
50 }
51 })
52 }
53 }
54}