blob: 6a26335d8ba0f3367a27854ed721ee708636412b [file] [log] [blame]
Nico Huber53ec8c52020-03-21 19:50:26 +01001/* SPDX-License-Identifier: GPL-2.0-only */
2/* This file is part of the coreboot project. */
Vladimir Serbinenkodd2bc3f2014-10-31 09:16:31 +01003
4 External(LCD0, DeviceObj)
5
6 Name (BRCT, 0)
7
8 Method(BRID, 1, NotSerialized)
9 {
10 Store (Match (BRIG, MEQ, Arg0, MTR, Zero, 2), Local0)
11 If (LEqual (Local0, Ones))
12 {
13 Return (Subtract(SizeOf(BRIG), One))
14 }
15 Return (Local0)
16 }
17
18 Method (XBCL, 0, NotSerialized)
19 {
20 Store (1, BRCT)
21 Return (BRIG)
22 }
23
24 /* Display Output Switching */
25 Method (_DOS, 1)
26 {
Vladimir Serbinenkodd2bc3f2014-10-31 09:16:31 +010027 }
28
Patrick Rudolph6838aae2018-07-29 10:53:01 +020029 /*
30 * Decrement display brightness.
31 *
32 * Using Notify is the right way. But Windows doesn't handle
33 * it well. So use both method in a way to avoid double action.
Vladimir Serbinenkodd2bc3f2014-10-31 09:16:31 +010034 */
35 Method (DECB, 0, NotSerialized)
36 {
37 If (BRCT)
38 {
39 Notify (LCD0, 0x87)
40 } Else {
41 Store (BRID (XBQC ()), Local0)
42 If (LNotEqual (Local0, 2))
43 {
44 Decrement (Local0)
45 }
46 XBCM (DerefOf (Index (BRIG, Local0)))
47 }
48 }
49
Patrick Rudolph6838aae2018-07-29 10:53:01 +020050 /*
51 * Increment display brightness.
52 */
Vladimir Serbinenkodd2bc3f2014-10-31 09:16:31 +010053 Method (INCB, 0, NotSerialized)
54 {
55 If (BRCT)
56 {
57 Notify (LCD0, 0x86)
58 } Else {
59 Store (BRID (XBQC ()), Local0)
60 If (LNotEqual (Local0, Subtract(SizeOf(BRIG), One)))
61 {
62 Increment (Local0)
63 }
64 XBCM (DerefOf (Index (BRIG, Local0)))
65 }
66 }