Tobias Diedrich | cee930a | 2017-02-12 14:09:06 +0100 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Copyright (c) 2017 Tobias Diedrich <ranma+coreboot@tdiedrich.de> |
| 5 | * |
| 6 | * This program is free software; you can redistribute it and/or |
| 7 | * modify it under the terms of the GNU General Public License as |
| 8 | * published by the Free Software Foundation; version 2 of |
| 9 | * the License. |
| 10 | * |
| 11 | * This program is distributed in the hope that it will be useful, |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 14 | * GNU General Public License for more details. |
| 15 | */ |
| 16 | |
| 17 | Scope (_GPE) |
| 18 | { |
| 19 | Field(GPIO, ByteAcc, NoLock, Preserve) |
| 20 | { |
| 21 | Offset(0x2c), // GPIO Invert |
| 22 | , 2, |
| 23 | GV02, 1, |
| 24 | , 1, |
| 25 | GV04, 1, |
| 26 | } |
| 27 | |
| 28 | Name (PDET, Zero) |
| 29 | Method (PNOT, 2, Serialized) { |
| 30 | ShiftLeft (Arg0, Arg1, Local0) |
| 31 | Not( ShiftLeft (One, Arg1), Local1) |
| 32 | Or (Local0, And (Local1, PDET), PDET) |
| 33 | If (LEqual (PDET, Zero)) { |
| 34 | // Palm removed |
| 35 | \_SB.PCI0.LPCB.EC0.HKEY.MHKQ (0x60B1) |
| 36 | } Else { |
| 37 | // Palm detected |
| 38 | \_SB.PCI0.LPCB.EC0.HKEY.MHKQ (0x60B0) |
| 39 | } |
| 40 | } |
| 41 | |
| 42 | /* Palm detect sensor 1 */ |
| 43 | Method (_L12, 0, NotSerialized) { |
| 44 | // Invert trigger |
| 45 | Store(GP02, GV02) |
| 46 | |
| 47 | PNOT (GP02, 0) |
| 48 | } |
| 49 | |
| 50 | /* Palm detect sensor 2 */ |
| 51 | Method (_L14, 0, NotSerialized) { |
| 52 | // Invert trigger |
| 53 | Store(GP04, GV04) |
| 54 | |
| 55 | PNOT (GP04, 1) |
| 56 | } |
| 57 | } |