| 1 |
/* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 |
Name (FLAP, 0x40) /* Flag indicating device is in laptop mode */ |
| 3 |
|
| 4 |
/* Virtual events */ |
| 5 |
Name (VTBL, 0xcc) /* Tablet Mode */ |
| 6 |
Name (VLAP, 0xcd) /* Laptop Mode */ |
| 7 |
|
| 8 |
Device (VBTN) |
| 9 |
{ |
| 10 |
Name (_HID, "INT33D6") |
| 11 |
Name (_UID, 1) |
| 12 |
Name (_DDN, "Intel Virtual Button Driver") |
| 13 |
|
| 14 |
/* |
| 15 |
* This method is called at driver probe time and must exist or |
| 16 |
* the driver will not load. |
| 17 |
*/ |
| 18 |
Method (VBDL) |
| 19 |
{ |
| 20 |
} |
| 21 |
|
| 22 |
/* |
| 23 |
* This method returns flags indicating tablet and dock modes. |
| 24 |
* It is called at driver probe time so the OS knows what the |
| 25 |
* state of the device is at boot. |
| 26 |
*/ |
| 27 |
Method (VGBS) |
| 28 |
{ |
| 29 |
Local0 = 0 |
| 30 |
If (CKLP ()) { |
| 31 |
Local0 |= ^^FLAP |
| 32 |
} |
| 33 |
Return (Local0) |
| 34 |
} |
| 35 |
|
| 36 |
Method (_STA, 0) |
| 37 |
{ |
| 38 |
Return (0xF) |
| 39 |
} |
| 40 |
|
| 41 |
Method (CKLP, 0) |
| 42 |
{ |
| 43 |
/* 120 = GPP_D4 */ |
| 44 |
If (\_SB.PCI0.GRXS (120)) { |
| 45 |
Printf ("VBTN: tablet mode") |
| 46 |
Return (0) /* Tablet mode */ |
| 47 |
} Else { |
| 48 |
Printf ("VBTN: laptop mode") |
| 49 |
Return (1) /* Laptop mode */ |
| 50 |
} |
| 51 |
} |
| 52 |
|
| 53 |
Method (NTFY, 0) |
| 54 |
{ |
| 55 |
/* Notify the new state */ |
| 56 |
If (CKLP ()) { |
| 57 |
Notify (^^VBTN, ^^VLAP) |
| 58 |
} Else { |
| 59 |
Notify (^^VBTN, ^^VTBL) |
| 60 |
} |
| 61 |
} |
| 62 |
} |