Skip to content

Commit 33cd0a1

Browse files
committed
Take ownership of needed
1 parent de0c9a6 commit 33cd0a1

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

VoodooGPIO/VoodooGPIO.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,17 @@ bool VoodooGPIO::intel_pad_acpi_mode(unsigned pin) {
194194
offset = community->hostown_offset + padgrp->reg_num * 4;
195195
hostown = community->regs + offset;
196196

197+
UInt32 hostownval = readl(hostown);
198+
if ((hostownval & BIT(gpp_offset)) == 0) {
199+
IOLog("%s::Pin owned by ACPI...Attempting to take ownership\n", getName());
200+
201+
hostownval |= BIT(gpp_offset);
202+
writel(hostownval, hostown);
203+
} else {
204+
return false;
205+
}
206+
207+
// Second read to double check we actually got ownership
197208
return !(readl(hostown) & BIT(gpp_offset));
198209
}
199210

0 commit comments

Comments
 (0)