From df4373de94934193ca4cbd580a9915609b08a38f Mon Sep 17 00:00:00 2001 From: Avery Black Date: Tue, 23 May 2023 21:39:36 -0700 Subject: [PATCH] Take ownership of needed --- VoodooGPIO/VoodooGPIOIntel.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/VoodooGPIO/VoodooGPIOIntel.cpp b/VoodooGPIO/VoodooGPIOIntel.cpp index 536c6a5..1505b92 100644 --- a/VoodooGPIO/VoodooGPIOIntel.cpp +++ b/VoodooGPIO/VoodooGPIOIntel.cpp @@ -150,6 +150,17 @@ bool VoodooGPIOIntel::intel_pad_acpi_mode(unsigned pin) { offset = community->hostown_offset + padgrp->reg_num * 4; hostown = community->regs + offset; + UInt32 hostownval = readl(hostown); + if ((hostownval & BIT(gpp_offset)) == 0) { + IOLog("%s::Pin owned by ACPI...Attempting to take ownership\n", getName()); + + hostownval |= BIT(gpp_offset); + writel(hostownval, hostown); + } else { + return false; + } + + // Second read to double check we actually got ownership return !(readl(hostown) & BIT(gpp_offset)); }