forked from coreboot/coreboot
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #492 from pcengines/restore-gpio-bindings
Revert "mb/pcengines/apu2: Remove ACPI GPIO bindings"
- Loading branch information
Showing
3 changed files
with
139 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* | ||
* This file is part of the coreboot project. | ||
* | ||
* Based on the example of Mika Westerberg: https://lwn.net/Articles/612062/ | ||
* | ||
* Copyright (C) 2015 Tobias Diedrich, Mika Westerberg | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; version 2 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
*/ | ||
|
||
Scope (\_SB.PCI0) | ||
{ | ||
Device (BTNS) | ||
{ | ||
Name (_HID, "PRP0001") | ||
|
||
Name (_CRS, ResourceTemplate () { | ||
GpioInt (Edge, ActiveLow, Shared, PullUp, , | ||
"\\_SB.PCI0.GPIO") { | ||
#if CONFIG(BOARD_PCENGINES_APU5) | ||
9 | ||
#else | ||
89 | ||
#endif | ||
} | ||
}) | ||
|
||
Name (_DSD, Package () { | ||
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), | ||
Package () { | ||
Package () {"compatible", "gpio-keys"}, | ||
Package () {"autorepeat", 1} | ||
} | ||
}) | ||
|
||
Device (BTN1) | ||
{ | ||
Name (_HID, "PRP0001") | ||
Name (_DSD, Package () { | ||
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), | ||
Package () { | ||
Package () {"linux,code", 257}, | ||
Package () {"linux,input-type", 1}, | ||
Package () {"debounce-interval", 100}, | ||
Package () {"label", "switch1"}, | ||
Package () {"interrupts", 7}, | ||
Package () {"gpios", Package () | ||
{^^BTNS, 0, 0, 1}} | ||
} | ||
}) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
/* | ||
* This file is part of the coreboot project. | ||
* | ||
* Based on the example of Mika Westerberg: https://lwn.net/Articles/612062/ | ||
* | ||
* Copyright (C) 2015 Tobias Diedrich, Mika Westerberg | ||
* | ||
* This program is free software; you can redistribute it and/or modify | ||
* it under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation; version 2 of the License. | ||
* | ||
* This program is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU General Public License for more details. | ||
*/ | ||
|
||
Scope (\_SB.PCI0) | ||
{ | ||
Device (LEDS) | ||
{ | ||
Name (_HID, "PRP0001") | ||
|
||
Name (_CRS, ResourceTemplate () { | ||
GpioIo (Exclusive, PullUp, 0, 0, IoRestrictionOutputOnly, "\\_SB.PCI0.GPIO", 0, ResourceConsumer) { 68, 69, 70 } | ||
}) | ||
|
||
Name (_DSD, Package () { | ||
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), | ||
Package () { | ||
Package () {"compatible","gpio-leds"} | ||
} | ||
}) | ||
|
||
Device (LED1) | ||
{ | ||
Name (_HID, "PRP0001") | ||
Name (_DSD, Package () { | ||
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), | ||
Package () { | ||
Package () {"label", DEVICE_NAME:green:led1"}, | ||
Package () {"gpios", Package () {^^LEDS, 0, 0, 1 }}, | ||
Package () {"default-state", "on"} | ||
} | ||
|
||
}) | ||
} | ||
|
||
Device (LED2) | ||
{ | ||
Name (_HID, "PRP0001") | ||
Name (_DSD, Package () { | ||
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), | ||
Package () { | ||
Package () {"label", DEVICE_NAME:green:led2"}, | ||
Package () {"gpios", Package () {^^LEDS, 0, 1, 1 }}, | ||
Package () {"default-state", "off"} | ||
} | ||
}) | ||
} | ||
|
||
Device (LED3) | ||
{ | ||
Name (_HID, "PRP0001") | ||
Name (_DSD, Package () { | ||
ToUUID("daffd814-6eba-4d8c-8a91-bc9bbf4aa301"), | ||
Package () { | ||
Package () {"label", DEVICE_NAME:green:led3"}, | ||
Package () {"gpios", Package () {^^LEDS, 0, 2, 1 }}, | ||
Package () {"linux,default-trigger", "heartbeat"} | ||
} | ||
}) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters