Skip to content

Commit

Permalink
1. Added C610/X99 Audio Controller r1 support by masking to 8c20;
Browse files Browse the repository at this point in the history
2. Added C610/X99 Audio Controller r2 support by masking to 8c20;
3. Disabled Z97 controller patching on 10.10 and newer because it is supported by default.
  • Loading branch information
vit9696 committed Sep 17, 2016
1 parent 0bda930 commit 2be7854
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 45 deletions.
100 changes: 56 additions & 44 deletions AppleALC/kern_resources.cpp
Expand Up @@ -24831,67 +24831,79 @@ const size_t vendorModSize {10};

// ControllerMod section

static const uint8_t patchBuf840[] { 0x0C, 0x0C, };
static const uint8_t patchBuf841[] { 0x04, 0x0F, };
static const uint8_t patchBuf840[] { 0x20, 0x8C, };
static const uint8_t patchBuf841[] { 0x21, 0x8D, };
static const KextPatch patches64[] {
{ { &kextList[0], patchBuf840, patchBuf841, 2, 4 }, 13, KernelPatcher::KernelAny },
};
static const uint8_t patchBuf842[] { 0x20, 0x8C, };
static const uint8_t patchBuf843[] { 0xA0, 0x8C, };
static const uint8_t patchBuf843[] { 0x20, 0x8D, };
static const KextPatch patches65[] {
{ { &kextList[0], patchBuf842, patchBuf843, 2, 4 }, 13, KernelPatcher::KernelAny },
};
static const uint8_t patchBuf844[] { 0x0C, 0x0A, 0x00, 0x00, };
static const uint8_t patchBuf845[] { 0x0C, 0x0C, 0x00, 0x00, };
static const uint8_t patchBuf846[] { 0x0B, 0x0C, 0x00, 0x00, };
static const uint8_t patchBuf847[] { 0x0C, 0x0C, 0x00, 0x00, };
static const uint8_t patchBuf848[] { 0x3D, 0x0C, 0x0A, 0x00, 0x00, };
static const uint8_t patchBuf849[] { 0x3D, 0x0C, 0x0C, 0x00, 0x00, };
static const uint8_t patchBuf850[] { 0x3D, 0x0B, 0x0C, 0x00, 0x00, };
static const uint8_t patchBuf851[] { 0x3D, 0x0C, 0x0C, 0x00, 0x00, };
static const uint8_t patchBuf852[] { 0x3D, 0x0C, 0x0A, 0x00, 0x00, };
static const uint8_t patchBuf853[] { 0x3D, 0x0C, 0x0C, 0x00, 0x00, };
static const uint8_t patchBuf844[] { 0x0C, 0x0C, };
static const uint8_t patchBuf845[] { 0x04, 0x0F, };
static const KextPatch patches66[] {
{ { &kextList[0], patchBuf844, patchBuf845, 4, 4 }, 13, 13 },
{ { &kextList[0], patchBuf846, patchBuf847, 4, 2 }, 13, 13 },
{ { &kextList[0], patchBuf848, patchBuf849, 5, 3 }, 14, 14 },
{ { &kextList[0], patchBuf850, patchBuf851, 5, 1 }, 14, 14 },
{ { &kextList[0], patchBuf852, patchBuf853, 5, 5 }, 15, KernelPatcher::KernelAny },
};
static const uint8_t patchBuf854[] { 0x20, 0x8C, };
static const uint8_t patchBuf855[] { 0x20, 0x8D, };
{ { &kextList[0], patchBuf844, patchBuf845, 2, 4 }, 13, KernelPatcher::KernelAny },
};
static const uint8_t patchBuf846[] { 0x20, 0x8C, };
static const uint8_t patchBuf847[] { 0xA0, 0x8C, };
static const KextPatch patches67[] {
{ { &kextList[0], patchBuf854, patchBuf855, 2, 4 }, 13, KernelPatcher::KernelAny },
{ { &kextList[0], patchBuf846, patchBuf847, 2, 4 }, 13, 13 },
};
static const uint8_t patchBuf856[] { 0x01, 0x05, 0x09, 0x00, 0x00, 0x04, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x02, 0x04, 0x0A, 0x00, 0x00, 0x04, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x03, 0x06, 0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, };
static const uint8_t patchBuf857[] { 0x01, 0x05, 0x09, 0x00, 0x00, 0x08, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x02, 0x04, 0x0A, 0x00, 0x00, 0x08, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x03, 0x06, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, };
static const uint8_t patchBuf848[] { 0x0C, 0x0A, 0x00, 0x00, };
static const uint8_t patchBuf849[] { 0x0C, 0x0C, 0x00, 0x00, };
static const uint8_t patchBuf850[] { 0x0B, 0x0C, 0x00, 0x00, };
static const uint8_t patchBuf851[] { 0x0C, 0x0C, 0x00, 0x00, };
static const uint8_t patchBuf852[] { 0x3D, 0x0C, 0x0A, 0x00, 0x00, };
static const uint8_t patchBuf853[] { 0x3D, 0x0C, 0x0C, 0x00, 0x00, };
static const uint8_t patchBuf854[] { 0x3D, 0x0B, 0x0C, 0x00, 0x00, };
static const uint8_t patchBuf855[] { 0x3D, 0x0C, 0x0C, 0x00, 0x00, };
static const uint8_t patchBuf856[] { 0x3D, 0x0C, 0x0A, 0x00, 0x00, };
static const uint8_t patchBuf857[] { 0x3D, 0x0C, 0x0C, 0x00, 0x00, };
static const KextPatch patches68[] {
{ { &kextList[1], patchBuf856, patchBuf857, 36, 1 }, 14, KernelPatcher::KernelAny },
};
static const uint8_t patchBuf858[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x04, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x04, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, };
static const uint8_t patchBuf859[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x04, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x04, 0x06, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, };
{ { &kextList[0], patchBuf848, patchBuf849, 4, 4 }, 13, 13 },
{ { &kextList[0], patchBuf850, patchBuf851, 4, 2 }, 13, 13 },
{ { &kextList[0], patchBuf852, patchBuf853, 5, 3 }, 14, 14 },
{ { &kextList[0], patchBuf854, patchBuf855, 5, 1 }, 14, 14 },
{ { &kextList[0], patchBuf856, patchBuf857, 5, 5 }, 15, KernelPatcher::KernelAny },
};
static const uint8_t patchBuf858[] { 0x20, 0x8C, };
static const uint8_t patchBuf859[] { 0x20, 0x8D, };
static const KextPatch patches69[] {
{ { &kextList[3], patchBuf858, patchBuf859, 36, 1 }, 13, KernelPatcher::KernelAny },
{ { &kextList[0], patchBuf858, patchBuf859, 2, 4 }, 13, KernelPatcher::KernelAny },
};
static const uint8_t patchBuf860[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, };
static const uint8_t patchBuf861[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, };
static const uint8_t patchBuf860[] { 0x01, 0x05, 0x09, 0x00, 0x00, 0x04, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x02, 0x04, 0x0A, 0x00, 0x00, 0x04, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x03, 0x06, 0x08, 0x00, 0x00, 0x04, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, };
static const uint8_t patchBuf861[] { 0x01, 0x05, 0x09, 0x00, 0x00, 0x08, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x02, 0x04, 0x0A, 0x00, 0x00, 0x08, 0x00, 0x00, 0x87, 0x00, 0x00, 0x00, 0x03, 0x06, 0x08, 0x00, 0x00, 0x08, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, };
static const KextPatch patches70[] {
{ { &kextList[3], patchBuf860, patchBuf861, 24, 4 }, 13, KernelPatcher::KernelAny },
{ { &kextList[1], patchBuf860, patchBuf861, 36, 1 }, 14, KernelPatcher::KernelAny },
};
static const uint8_t patchBuf862[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, };
static const uint8_t patchBuf863[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, };
static const uint8_t patchBuf862[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x04, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x04, 0x06, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, };
static const uint8_t patchBuf863[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x04, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x04, 0x06, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, };
static const KextPatch patches71[] {
{ { &kextList[3], patchBuf862, patchBuf863, 24, 4 }, 13, KernelPatcher::KernelAny },
{ { &kextList[3], patchBuf862, patchBuf863, 36, 1 }, 13, KernelPatcher::KernelAny },
};
static const uint8_t patchBuf864[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, };
static const uint8_t patchBuf865[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, };
static const KextPatch patches72[] {
{ { &kextList[3], patchBuf864, patchBuf865, 24, 4 }, 13, KernelPatcher::KernelAny },
};
static const uint8_t patchBuf866[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, };
static const uint8_t patchBuf867[] { 0x02, 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x07, 0x01, 0x00, 0x00, };
static const KextPatch patches73[] {
{ { &kextList[3], patchBuf866, patchBuf867, 24, 4 }, 13, KernelPatcher::KernelAny },
};
ControllerModInfo controllerMod[] {
{ "Atom Z36xxx/Z37xxx Audio Controller", 0x8086, 0xF04, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches64, 1 },
{ "Z97 HDEF controller", 0x8086, 0x8CA0, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches65, 1 },
{ "HD4600 controller", 0x8086, 0xC0C, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches66, 5 },
{ "X99 HDEF controller", 0x8086, 0x8D20, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches67, 1 },
{ "Intel HD4600 HDMI (ig-platform-id 0x0d220003)", 0x8086, 0x412, nullptr, 0, 220332035, IOUtil::ComputerModel::ComputerDesktop, patches68, 1 },
{ "Intel HD4000 HDMI (ig-platform-id 0x01660003)", 0x8086, 0x166, nullptr, 0, 23461891, IOUtil::ComputerModel::ComputerLaptop, patches69, 1 },
{ "Intel HD4000 HDMI (ig-platform-id 0x01660009)", 0x8086, 0x166, nullptr, 0, 23461897, IOUtil::ComputerModel::ComputerLaptop, patches70, 1 },
{ "Intel HD4000 HDMI (ig-platform-id 0x0166000A) Desktop only", 0x8086, 0x166, nullptr, 0, 23461898, IOUtil::ComputerModel::ComputerDesktop, patches71, 1 },
{ "X99 HDEF controller r2", 0x8086, 0x8D21, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches64, 1 },
{ "X99 HDEF controller r1", 0x8086, 0x8D20, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches65, 1 },
{ "Atom Z36xxx/Z37xxx Audio Controller", 0x8086, 0xF04, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches66, 1 },
{ "Z97 HDEF controller", 0x8086, 0x24, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches67, 1 },
{ "HD4600 controller", 0x8086, 0xC0C, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches68, 5 },
{ "X99 HDEF controller", 0x8086, 0x8D20, nullptr, 0, ControllerModInfo::PlatformAny, IOUtil::ComputerModel::ComputerAny, patches69, 1 },
{ "Intel HD4600 HDMI (ig-platform-id 0x0d220003)", 0x8086, 0x412, nullptr, 0, 220332035, IOUtil::ComputerModel::ComputerDesktop, patches70, 1 },
{ "Intel HD4000 HDMI (ig-platform-id 0x01660003)", 0x8086, 0x166, nullptr, 0, 23461891, IOUtil::ComputerModel::ComputerLaptop, patches71, 1 },
{ "Intel HD4000 HDMI (ig-platform-id 0x01660009)", 0x8086, 0x166, nullptr, 0, 23461897, IOUtil::ComputerModel::ComputerLaptop, patches72, 1 },
{ "Intel HD4000 HDMI (ig-platform-id 0x0166000A) Desktop only", 0x8086, 0x166, nullptr, 0, 23461898, IOUtil::ComputerModel::ComputerDesktop, patches73, 1 },
};

const size_t controllerModSize {8};
const size_t controllerModSize {10};
5 changes: 5 additions & 0 deletions Changelog.md
@@ -1,5 +1,10 @@
AppleALC Changelog
==================
#### v1.0.17
- Added C610/X99 Audio Controller r1 support by masking to 8c20
- Added C610/X99 Audio Controller r2 support by masking to 8c20
- Disabled Z97 controller patching on 10.10 and newer because it is supported by default

#### v1.0.16
- Fixed a rare lock acquisition issue on 10.12
- Fixed a rare kernel panic on initialisation failure
Expand Down
50 changes: 49 additions & 1 deletion Resources/Controllers.plist
Expand Up @@ -2,6 +2,52 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>Device</key>
<integer>36129</integer>
<key>Name</key>
<string>X99 HDEF controller r2</string>
<key>Patches</key>
<array>
<dict>
<key>Count</key>
<integer>4</integer>
<key>Find</key>
<data>IIw=</data>
<key>MinKernel</key>
<integer>13</integer>
<key>Name</key>
<string>AppleHDAController</string>
<key>Replace</key>
<data>IY0=</data>
</dict>
</array>
<key>Vendor</key>
<string>Intel</string>
</dict>
<dict>
<key>Device</key>
<integer>36128</integer>
<key>Name</key>
<string>X99 HDEF controller r1</string>
<key>Patches</key>
<array>
<dict>
<key>Count</key>
<integer>4</integer>
<key>Find</key>
<data>IIw=</data>
<key>MinKernel</key>
<integer>13</integer>
<key>Name</key>
<string>AppleHDAController</string>
<key>Replace</key>
<data>II0=</data>
</dict>
</array>
<key>Vendor</key>
<string>Intel</string>
</dict>
<dict>
<key>Device</key>
<integer>3844</integer>
Expand All @@ -27,7 +73,7 @@
</dict>
<dict>
<key>Device</key>
<integer>36000</integer>
<integer>36</integer>
<key>Name</key>
<string>Z97 HDEF controller</string>
<key>Patches</key>
Expand All @@ -39,6 +85,8 @@
<data>IIw=</data>
<key>MinKernel</key>
<integer>13</integer>
<key>MaxKernel</key>
<integer>13</integer>
<key>Name</key>
<string>AppleHDAController</string>
<key>Replace</key>
Expand Down

0 comments on commit 2be7854

Please sign in to comment.