Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "mb/pcengines/apu2: Remove ACPI GPIO bindings" #492

Merged
merged 1 commit into from
Nov 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions src/mainboard/pcengines/apu2/acpi/buttons.asl
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}}
}
})
}
}
}
75 changes: 75 additions & 0 deletions src/mainboard/pcengines/apu2/acpi/leds.asl
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"}
}
})
}
}
}
4 changes: 4 additions & 0 deletions src/mainboard/pcengines/apu2/dsdt.asl
Original file line number Diff line number Diff line change
Expand Up @@ -75,5 +75,9 @@ DefinitionBlock (

/* Super IO devices (COM ports) */
#include "acpi/superio.asl"

/* GPIO buttons and leds */
#include "acpi/buttons.asl"
#include "acpi/leds.asl"
}
/* End of ASL file */