Nico Huber | 53ec8c5 | 2020-03-21 19:50:26 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Vladimir Serbinenko | dd2bc3f | 2014-10-31 09:16:31 +0100 | [diff] [blame] | 2 | |
| 3 | External(LCD0, DeviceObj) |
| 4 | |
| 5 | Name (BRCT, 0) |
| 6 | |
| 7 | Method(BRID, 1, NotSerialized) |
| 8 | { |
Felix Singer | 52f4652 | 2022-12-12 02:25:37 +0100 | [diff] [blame^] | 9 | Local0 = Match (BRIG, MEQ, Arg0, MTR, Zero, 2) |
Felix Singer | 6041543 | 2022-01-02 00:43:21 +0100 | [diff] [blame] | 10 | If (Local0 == Ones) |
Vladimir Serbinenko | dd2bc3f | 2014-10-31 09:16:31 +0100 | [diff] [blame] | 11 | { |
Felix Singer | 1eba196 | 2021-12-30 02:09:31 +0100 | [diff] [blame] | 12 | Return (SizeOf(BRIG) - 1) |
Vladimir Serbinenko | dd2bc3f | 2014-10-31 09:16:31 +0100 | [diff] [blame] | 13 | } |
| 14 | Return (Local0) |
| 15 | } |
| 16 | |
| 17 | Method (XBCL, 0, NotSerialized) |
| 18 | { |
Felix Singer | 52f4652 | 2022-12-12 02:25:37 +0100 | [diff] [blame^] | 19 | BRCT = 1 |
Vladimir Serbinenko | dd2bc3f | 2014-10-31 09:16:31 +0100 | [diff] [blame] | 20 | Return (BRIG) |
| 21 | } |
| 22 | |
| 23 | /* Display Output Switching */ |
| 24 | Method (_DOS, 1) |
| 25 | { |
Vladimir Serbinenko | dd2bc3f | 2014-10-31 09:16:31 +0100 | [diff] [blame] | 26 | } |
| 27 | |
Patrick Rudolph | 6838aae | 2018-07-29 10:53:01 +0200 | [diff] [blame] | 28 | /* |
| 29 | * Decrement display brightness. |
| 30 | * |
| 31 | * Using Notify is the right way. But Windows doesn't handle |
| 32 | * 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] | 33 | */ |
| 34 | Method (DECB, 0, NotSerialized) |
| 35 | { |
| 36 | If (BRCT) |
| 37 | { |
| 38 | Notify (LCD0, 0x87) |
| 39 | } Else { |
Felix Singer | 52f4652 | 2022-12-12 02:25:37 +0100 | [diff] [blame^] | 40 | Local0 = BRID (XBQC ()) |
Felix Singer | 1225083 | 2022-01-02 02:45:44 +0100 | [diff] [blame] | 41 | If (Local0 != 2) |
Vladimir Serbinenko | dd2bc3f | 2014-10-31 09:16:31 +0100 | [diff] [blame] | 42 | { |
Felix Singer | 66e2630 | 2021-12-31 14:13:47 +0100 | [diff] [blame] | 43 | Local0-- |
Vladimir Serbinenko | dd2bc3f | 2014-10-31 09:16:31 +0100 | [diff] [blame] | 44 | } |
Felix Singer | e55a7d1 | 2021-12-29 13:56:36 +0100 | [diff] [blame] | 45 | XBCM (DerefOf (BRIG[Local0])) |
Vladimir Serbinenko | dd2bc3f | 2014-10-31 09:16:31 +0100 | [diff] [blame] | 46 | } |
| 47 | } |
| 48 | |
Patrick Rudolph | 6838aae | 2018-07-29 10:53:01 +0200 | [diff] [blame] | 49 | /* |
| 50 | * Increment display brightness. |
| 51 | */ |
Vladimir Serbinenko | dd2bc3f | 2014-10-31 09:16:31 +0100 | [diff] [blame] | 52 | Method (INCB, 0, NotSerialized) |
| 53 | { |
| 54 | If (BRCT) |
| 55 | { |
| 56 | Notify (LCD0, 0x86) |
| 57 | } Else { |
Felix Singer | 52f4652 | 2022-12-12 02:25:37 +0100 | [diff] [blame^] | 58 | Local0 = BRID (XBQC ()) |
Felix Singer | 1225083 | 2022-01-02 02:45:44 +0100 | [diff] [blame] | 59 | If (Local0 != SizeOf(BRIG) - 1) |
Vladimir Serbinenko | dd2bc3f | 2014-10-31 09:16:31 +0100 | [diff] [blame] | 60 | { |
Felix Singer | 42fcf5a | 2021-12-31 13:49:03 +0100 | [diff] [blame] | 61 | Local0++ |
Vladimir Serbinenko | dd2bc3f | 2014-10-31 09:16:31 +0100 | [diff] [blame] | 62 | } |
Felix Singer | e55a7d1 | 2021-12-29 13:56:36 +0100 | [diff] [blame] | 63 | XBCM (DerefOf (BRIG[Local0])) |
Vladimir Serbinenko | dd2bc3f | 2014-10-31 09:16:31 +0100 | [diff] [blame] | 64 | } |
| 65 | } |