Angel Pons | 89ab250 | 2020-04-03 01:22:28 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Tobias Diedrich | cee930a | 2017-02-12 14:09:06 +0100 | [diff] [blame] | 2 | |
| 3 | Scope (_GPE) |
| 4 | { |
Tobias Diedrich | cee930a | 2017-02-12 14:09:06 +0100 | [diff] [blame] | 5 | Name (PDET, Zero) |
| 6 | Method (PNOT, 2, Serialized) { |
Felix Singer | 3c9291b | 2022-12-16 02:43:56 +0100 | [diff] [blame] | 7 | Local0 = Arg0 << Arg1 |
Felix Singer | 372573e | 2022-12-16 03:49:55 +0100 | [diff] [blame] | 8 | Not(One << Arg1, Local1) |
Felix Singer | d252776 | 2022-12-16 07:54:16 +0100 | [diff] [blame^] | 9 | PDET = Local0 | (Local1 & PDET) |
Felix Singer | c191370 | 2022-12-11 21:01:06 +0100 | [diff] [blame] | 10 | If (PDET == Zero) { |
Tobias Diedrich | cee930a | 2017-02-12 14:09:06 +0100 | [diff] [blame] | 11 | // Palm removed |
| 12 | \_SB.PCI0.LPCB.EC0.HKEY.MHKQ (0x60B1) |
| 13 | } Else { |
| 14 | // Palm detected |
| 15 | \_SB.PCI0.LPCB.EC0.HKEY.MHKQ (0x60B0) |
| 16 | } |
| 17 | } |
| 18 | |
Martin Roth | 2f0bbbf | 2019-05-11 12:51:44 -0600 | [diff] [blame] | 19 | Method (TINV, 2, Serialized) { |
Felix Singer | 3c9291b | 2022-12-16 02:43:56 +0100 | [diff] [blame] | 20 | Local0 = One << Arg1 |
Felix Singer | c191370 | 2022-12-11 21:01:06 +0100 | [diff] [blame] | 21 | If (Arg0 == Zero) { |
Martin Roth | 2f0bbbf | 2019-05-11 12:51:44 -0600 | [diff] [blame] | 22 | Not (Local0, Local0) |
Felix Singer | 35e65a8 | 2022-12-16 07:11:17 +0100 | [diff] [blame] | 23 | GIV0 &= Local0 |
Martin Roth | 2f0bbbf | 2019-05-11 12:51:44 -0600 | [diff] [blame] | 24 | } Else { |
Felix Singer | 86bc2e7 | 2022-12-16 04:40:39 +0100 | [diff] [blame] | 25 | GIV0 |= Local0 |
Martin Roth | 2f0bbbf | 2019-05-11 12:51:44 -0600 | [diff] [blame] | 26 | } |
| 27 | } |
| 28 | |
Tobias Diedrich | cee930a | 2017-02-12 14:09:06 +0100 | [diff] [blame] | 29 | /* Palm detect sensor 1 */ |
| 30 | Method (_L12, 0, NotSerialized) { |
| 31 | // Invert trigger |
Martin Roth | 2f0bbbf | 2019-05-11 12:51:44 -0600 | [diff] [blame] | 32 | TINV (GP02, 2) |
Tobias Diedrich | cee930a | 2017-02-12 14:09:06 +0100 | [diff] [blame] | 33 | |
| 34 | PNOT (GP02, 0) |
| 35 | } |
| 36 | |
| 37 | /* Palm detect sensor 2 */ |
| 38 | Method (_L14, 0, NotSerialized) { |
| 39 | // Invert trigger |
Martin Roth | 2f0bbbf | 2019-05-11 12:51:44 -0600 | [diff] [blame] | 40 | TINV (GP04, 4) |
Tobias Diedrich | cee930a | 2017-02-12 14:09:06 +0100 | [diff] [blame] | 41 | |
| 42 | PNOT (GP04, 1) |
| 43 | } |
| 44 | } |