summaryrefslogtreecommitdiff
path: root/src/mainboard/lenovo/s230u/acpi/gpe.asl
blob: 8124ec72c774c1e9899d3e7d70c647a327944c83 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* SPDX-License-Identifier: GPL-2.0-only */

Scope (_GPE)
{
	Name (PDET, Zero)
	Method (PNOT, 2, Serialized) {
		ShiftLeft (Arg0, Arg1, Local0)
		Not( ShiftLeft (One, Arg1), Local1)
		Or (Local0, And (Local1, PDET), PDET)
		If (LEqual (PDET, Zero)) {
			// Palm removed
			\_SB.PCI0.LPCB.EC0.HKEY.MHKQ (0x60B1)
		} Else {
			// Palm detected
			\_SB.PCI0.LPCB.EC0.HKEY.MHKQ (0x60B0)
		}
	}

	Method (TINV, 2, Serialized) {
		ShiftLeft (One, Arg1, Local0)
		If (LEqual (Arg0, Zero)) {
			Not (Local0, Local0)
			And (GIV0, Local0, GIV0)
		} Else {
			Or (GIV0, Local0, GIV0)
		}
	}

	/* Palm detect sensor 1 */
	Method (_L12, 0, NotSerialized) {
		// Invert trigger
		TINV (GP02, 2)

		PNOT (GP02, 0)
	}

	/* Palm detect sensor 2 */
	Method (_L14, 0, NotSerialized) {
		// Invert trigger
		TINV (GP04, 4)

		PNOT (GP04, 1)
	}
}