hc
2024-03-26 e0728245c89800c2038c23308f2d88969d5b41c8
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
45
46
47
48
49
50
51
52
/** @file
*
* Copyright (c) 2014, ARM Ltd. All rights reserved.<BR>
* Copyright (c) 2018, Hisilicon Limited. All rights reserved.<BR>
* Copyright (c) 2016, Linaro Limited. All rights reserved.<BR>
*
*  SPDX-License-Identifier: BSD-2-Clause-Patent
*
**/
 
//
// Ged
//
 
//Define a control method power button
Scope(_SB)
{
  OperationRegion(IOM1, SystemMemory, 0x941900C8, 0x4)
  Field(IOM1, DWordAcc, NoLock, Preserve) {
    IMX0, 32,
  }
 
  Method (_INI) {
    Store(IMX0, Local0)
    And(Local0, 0xFFFFFFFC, Local0)
    Or(Local0, 0x4, Local0)
    Store(Local0, IMX0)
  }
 
  Device(GED1) {
    Name(_HID, "ACPI0013")
    Name(_UID, 0)
 
    Name (_CRS, ResourceTemplate ()  {
      Interrupt (ResourceConsumer, Edge, ActiveHigh, Exclusive) {
        121
      }
    })
 
    Method (_STA, 0x0, NotSerialized) {
      return (0xF);
    }
 
    Method (_EVT, 0x1) {
      Switch(ToInteger(Arg0)) {
        Case(121) {
          Notify (\_SB.PWRB, 0x80)
        }
      }
    }
  }
}