summaryrefslogtreecommitdiff
path: root/src/ec/apple/acpi/lid.asl
blob: ec91d8f1069cb70da658528534f382dd222104a3 (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
/* SPDX-License-Identifier: GPL-2.0-only */

Scope(\_SB.PCI0.LPCB.EC)
{
	Field(ERAM, ByteAcc, NoLock, Preserve)
	{
		Offset(LIDS_OFFSET),
		LIDS, 1,   /* Lid status */

		Offset(WKLD_OFFSET),
		WKLD, 1,   /* Lid wake */
	}

	Device(LID)
	{
		Name(_HID, "PNP0C0D")

		Method(_LID, 0, NotSerialized)
		{
			Return(LIDS)
		}

		Method(_PRW, 0, NotSerialized)
		{
#if LIDS_OFFSET == 0x01
			Return(Package() { 0x1d, 0x03 })
#else
			Return(Package() { 0x23, 0x04 })
#endif
		}

		Method(_PSW, 1, NotSerialized)
		{
			if (Arg0) {
				WKLD = 1
			} else {
				WKLD = 0
			}
		}
	}
}