Skip to content

Commit 692f9e4

Browse files
authored
Take ownership of needed (#15)
1 parent e0ca3d2 commit 692f9e4

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

VoodooGPIO/VoodooGPIOIntel.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,17 @@ bool VoodooGPIOIntel::intel_pad_acpi_mode(unsigned pin) {
150150
offset = community->hostown_offset + padgrp->reg_num * 4;
151151
hostown = community->regs + offset;
152152

153+
UInt32 hostownval = readl(hostown);
154+
if ((hostownval & BIT(gpp_offset)) == 0) {
155+
IOLog("%s::Pin owned by ACPI...Attempting to take ownership\n", getName());
156+
157+
hostownval |= BIT(gpp_offset);
158+
writel(hostownval, hostown);
159+
} else {
160+
return false;
161+
}
162+
163+
// Second read to double check we actually got ownership
153164
return !(readl(hostown) & BIT(gpp_offset));
154165
}
155166

0 commit comments

Comments
 (0)