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 | { |
| 38 | Name (_DSD, Package () { |
| 39 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 40 | Package () { |
| 41 | /* |
| 42 | * From Linux Documentation/leds/leds-class.txt: |
| 43 | * LED Device Naming |
| 44 | * Is currently of the form: |
| 45 | * "devicename:colour:function" |
| 46 | */ |
| 47 | Package () {"label", "apu1:green:led1"}, |
| 48 | Package () {"gpios", Package () {^^LEDS, 0, 0, 1 /* low-active */}}, |
| 49 | Package () {"default-state", "keep"}, |
| 50 | } }) } |
| 51 | |
| 52 | Device (LED2) |
| 53 | { |
| 54 | Name (_DSD, Package () { |
| 55 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 56 | Package () { |
| 57 | Package () {"label", "apu1:green:led2"}, |
| 58 | Package () {"gpios", Package () {^^LEDS, 0, 1, 1 /* low-active */}}, |
| 59 | Package () {"default-state", "keep"}, |
| 60 | } |
| 61 | }) |
| 62 | } |
| 63 | |
| 64 | Device (LED3) |
| 65 | { |
| 66 | Name (_DSD, Package () { |
| 67 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 68 | Package () { |
| 69 | Package () {"label", "apu1:green:led3"}, |
| 70 | Package () {"gpios", Package () {^^LEDS, 0, 2, 1 /* low-active */}}, |
| 71 | Package () {"default-state", "keep"}, |
| 72 | } |
| 73 | }) |
| 74 | } |
| 75 | } |
| 76 | } |