Tobias Diedrich | 2a38551 | 2015-06-13 13:29:50 +0200 | [diff] [blame] | 1 | /* |
| 2 | * This file is part of the coreboot project. |
| 3 | * |
| 4 | * Based on the example of Mika Westerberg: https://lwn.net/Articles/612062/ |
| 5 | * |
| 6 | * Copyright (C) 2015 Tobias Diedrich, Mika Westerberg |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; version 2 of the License. |
| 11 | * |
| 12 | * This program is distributed in the hope that it will be useful, |
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 15 | * GNU General Public License for more details. |
Tobias Diedrich | 2a38551 | 2015-06-13 13:29:50 +0200 | [diff] [blame] | 16 | */ |
| 17 | |
| 18 | Scope (\_SB.PCI0.SBUS) |
| 19 | { |
| 20 | Device (LEDS) |
| 21 | { |
| 22 | Name (_HID, "PRP0001") |
| 23 | |
| 24 | Name (_CRS, ResourceTemplate () { |
| 25 | GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionOutputOnly, |
| 26 | "\\_SB.PCI0.SBUS.GPIO", 0, ResourceConsumer) {189, 190, 191} |
| 27 | }) |
| 28 | |
| 29 | Name (_DSD, Package () { |
| 30 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 31 | Package () { |
| 32 | Package () {"compatible", Package () {"gpio-leds"}}, |
| 33 | } |
| 34 | }) |
| 35 | |
| 36 | Device (LED1) |
| 37 | { |
Martin Roth | eca844b | 2015-12-01 10:46:33 -0700 | [diff] [blame] | 38 | Name (_HID, "PRP0001") |
Tobias Diedrich | 2a38551 | 2015-06-13 13:29:50 +0200 | [diff] [blame] | 39 | Name (_DSD, Package () { |
| 40 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 41 | Package () { |
| 42 | /* |
| 43 | * From Linux Documentation/leds/leds-class.txt: |
| 44 | * LED Device Naming |
| 45 | * Is currently of the form: |
| 46 | * "devicename:colour:function" |
| 47 | */ |
| 48 | Package () {"label", "apu1:green:led1"}, |
| 49 | Package () {"gpios", Package () {^^LEDS, 0, 0, 1 /* low-active */}}, |
| 50 | Package () {"default-state", "keep"}, |
| 51 | } }) } |
| 52 | |
| 53 | Device (LED2) |
| 54 | { |
Martin Roth | eca844b | 2015-12-01 10:46:33 -0700 | [diff] [blame] | 55 | Name (_HID, "PRP0001") |
Tobias Diedrich | 2a38551 | 2015-06-13 13:29:50 +0200 | [diff] [blame] | 56 | Name (_DSD, Package () { |
| 57 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 58 | Package () { |
| 59 | Package () {"label", "apu1:green:led2"}, |
| 60 | Package () {"gpios", Package () {^^LEDS, 0, 1, 1 /* low-active */}}, |
| 61 | Package () {"default-state", "keep"}, |
| 62 | } |
| 63 | }) |
| 64 | } |
| 65 | |
| 66 | Device (LED3) |
| 67 | { |
Martin Roth | eca844b | 2015-12-01 10:46:33 -0700 | [diff] [blame] | 68 | Name (_HID, "PRP0001") |
Tobias Diedrich | 2a38551 | 2015-06-13 13:29:50 +0200 | [diff] [blame] | 69 | Name (_DSD, Package () { |
| 70 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 71 | Package () { |
| 72 | Package () {"label", "apu1:green:led3"}, |
| 73 | Package () {"gpios", Package () {^^LEDS, 0, 2, 1 /* low-active */}}, |
| 74 | Package () {"default-state", "keep"}, |
| 75 | } |
| 76 | }) |
| 77 | } |
| 78 | } |
| 79 | } |