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 | { |
Felix Singer | fa06bcb | 2022-12-26 09:32:47 +0100 | [diff] [blame^] | 5 | Name (PDET, 0) |
Tobias Diedrich | cee930a | 2017-02-12 14:09:06 +0100 | [diff] [blame] | 6 | Method (PNOT, 2, Serialized) { |
Felix Singer | 3c9291b | 2022-12-16 02:43:56 +0100 | [diff] [blame] | 7 | Local0 = Arg0 << Arg1 |
Felix Singer | eaa31d9 | 2022-12-25 16:39:49 +0100 | [diff] [blame] | 8 | Local1 = ~(1 << Arg1) |
Felix Singer | d252776 | 2022-12-16 07:54:16 +0100 | [diff] [blame] | 9 | PDET = Local0 | (Local1 & PDET) |
Felix Singer | fa06bcb | 2022-12-26 09:32:47 +0100 | [diff] [blame^] | 10 | If (PDET == 0) { |
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 | dfbb634 | 2022-12-26 08:39:35 +0100 | [diff] [blame] | 20 | Local0 = 1 << Arg1 |
Felix Singer | fa06bcb | 2022-12-26 09:32:47 +0100 | [diff] [blame^] | 21 | If (Arg0 == 0) { |
Felix Singer | eaa31d9 | 2022-12-25 16:39:49 +0100 | [diff] [blame] | 22 | 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 | } |