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. |
| 16 | * |
| 17 | * You should have received a copy of the GNU General Public License |
| 18 | * along with this program; if not, write to the Free Software |
| 19 | * Foundation, Inc. |
| 20 | */ |
| 21 | |
| 22 | Scope (\_SB.PCI0.SBUS) |
| 23 | { |
| 24 | Device (LEDS) |
| 25 | { |
| 26 | Name (_HID, "PRP0001") |
| 27 | |
| 28 | Name (_CRS, ResourceTemplate () { |
| 29 | GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionOutputOnly, |
| 30 | "\\_SB.PCI0.SBUS.GPIO", 0, ResourceConsumer) {189, 190, 191} |
| 31 | }) |
| 32 | |
| 33 | Name (_DSD, Package () { |
| 34 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 35 | Package () { |
| 36 | Package () {"compatible", Package () {"gpio-leds"}}, |
| 37 | } |
| 38 | }) |
| 39 | |
| 40 | Device (LED1) |
| 41 | { |
| 42 | Name (_DSD, Package () { |
| 43 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 44 | Package () { |
| 45 | /* |
| 46 | * From Linux Documentation/leds/leds-class.txt: |
| 47 | * LED Device Naming |
| 48 | * Is currently of the form: |
| 49 | * "devicename:colour:function" |
| 50 | */ |
| 51 | Package () {"label", "apu1:green:led1"}, |
| 52 | Package () {"gpios", Package () {^^LEDS, 0, 0, 1 /* low-active */}}, |
| 53 | Package () {"default-state", "keep"}, |
| 54 | } }) } |
| 55 | |
| 56 | Device (LED2) |
| 57 | { |
| 58 | Name (_DSD, Package () { |
| 59 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 60 | Package () { |
| 61 | Package () {"label", "apu1:green:led2"}, |
| 62 | Package () {"gpios", Package () {^^LEDS, 0, 1, 1 /* low-active */}}, |
| 63 | Package () {"default-state", "keep"}, |
| 64 | } |
| 65 | }) |
| 66 | } |
| 67 | |
| 68 | Device (LED3) |
| 69 | { |
| 70 | Name (_DSD, Package () { |
| 71 | ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), |
| 72 | Package () { |
| 73 | Package () {"label", "apu1:green:led3"}, |
| 74 | Package () {"gpios", Package () {^^LEDS, 0, 2, 1 /* low-active */}}, |
| 75 | Package () {"default-state", "keep"}, |
| 76 | } |
| 77 | }) |
| 78 | } |
| 79 | } |
| 80 | } |