Nico Huber | 53ec8c5 | 2020-03-21 19:50:26 +0100 | [diff] [blame^] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
| 2 | /* This file is part of the coreboot project. */ |
Vladimir Serbinenko | dd2bc3f | 2014-10-31 09:16:31 +0100 | [diff] [blame] | 3 | |
| 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 Serbinenko | dd2bc3f | 2014-10-31 09:16:31 +0100 | [diff] [blame] | 27 | } |
| 28 | |
Patrick Rudolph | 6838aae | 2018-07-29 10:53:01 +0200 | [diff] [blame] | 29 | /* |
| 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 Serbinenko | dd2bc3f | 2014-10-31 09:16:31 +0100 | [diff] [blame] | 34 | */ |
| 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 Rudolph | 6838aae | 2018-07-29 10:53:01 +0200 | [diff] [blame] | 50 | /* |
| 51 | * Increment display brightness. |
| 52 | */ |
Vladimir Serbinenko | dd2bc3f | 2014-10-31 09:16:31 +0100 | [diff] [blame] | 53 | 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 | } |