├── .gitignore
├── ComboJack_Installer
├── hda-verb
├── ComboJack
├── ComboJack.orig
├── Headphone.icns
├── Screen_Shot.png
├── VerbStub.kext
│ └── Contents
│ │ ├── MacOS
│ │ └── VerbStub
│ │ └── Info.plist
├── com.XPS.ComboJack.plist
├── l10n.json
├── Information.rtf
├── install.sh
└── LICENSE
├── ComboJack_Source
├── Headphone.icns
├── ComboJack.xcodeproj
│ ├── xcuserdata
│ │ ├── karl.xcuserdatad
│ │ │ ├── xcdebugger
│ │ │ │ └── Breakpoints_v2.xcbkptlist
│ │ │ └── xcschemes
│ │ │ │ ├── xcschememanagement.plist
│ │ │ │ └── Combo Jack.xcscheme
│ │ ├── andre.xcuserdatad
│ │ │ └── xcschemes
│ │ │ │ └── xcschememanagement.plist
│ │ └── ling.xcuserdatad
│ │ │ └── xcschemes
│ │ │ └── xcschememanagement.plist
│ ├── project.xcworkspace
│ │ ├── xcuserdata
│ │ │ ├── karl.xcuserdatad
│ │ │ │ └── UserInterfaceState.xcuserstate
│ │ │ ├── ling.xcuserdatad
│ │ │ │ └── UserInterfaceState.xcuserstate
│ │ │ └── andre.xcuserdatad
│ │ │ │ └── UserInterfaceState.xcuserstate
│ │ ├── contents.xcworkspacedata
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── project.pbxproj
├── build.sh
├── Combo Jack
│ ├── hda_hwdep.h
│ ├── PCI.h
│ ├── rt298.h
│ └── PCI.m
├── l10n.json
└── LICENSE
├── VerbStub_Source
├── VerbStub.xcodeproj
│ ├── xcuserdata
│ │ ├── karl.xcuserdatad
│ │ │ ├── xcdebugger
│ │ │ │ └── Breakpoints_v2.xcbkptlist
│ │ │ └── xcschemes
│ │ │ │ ├── xcschememanagement.plist
│ │ │ │ ├── VerbStub.xcscheme
│ │ │ │ └── hda-verb.xcscheme
│ │ └── ling.xcuserdatad
│ │ │ └── xcschemes
│ │ │ └── xcschememanagement.plist
│ ├── project.xcworkspace
│ │ ├── contents.xcworkspacedata
│ │ ├── xcuserdata
│ │ │ ├── karl.xcuserdatad
│ │ │ │ └── UserInterfaceState.xcuserstate
│ │ │ └── ling.xcuserdatad
│ │ │ │ └── UserInterfaceState.xcuserstate
│ │ └── xcshareddata
│ │ │ └── IDEWorkspaceChecks.plist
│ └── project.pbxproj
├── hda-verb
│ ├── hda_hwdep.h
│ └── hda-verb.c
├── VerbStub
│ ├── Info.plist
│ ├── VerbStub.hpp
│ ├── VerbStub.cpp
│ ├── IntelHDA.h
│ └── IntelHDA.cpp
└── LICENSE
├── uninstall.sh
└── README.txt
/.gitignore:
--------------------------------------------------------------------------------
1 | ComboJack_Source/build/
2 | VerbStub_Source/build/
3 | .DS_Store
4 | *.tmproj
5 |
--------------------------------------------------------------------------------
/ComboJack_Installer/hda-verb:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackintosh-stuff/ComboJack/HEAD/ComboJack_Installer/hda-verb
--------------------------------------------------------------------------------
/ComboJack_Installer/ComboJack:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackintosh-stuff/ComboJack/HEAD/ComboJack_Installer/ComboJack
--------------------------------------------------------------------------------
/ComboJack_Source/Headphone.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackintosh-stuff/ComboJack/HEAD/ComboJack_Source/Headphone.icns
--------------------------------------------------------------------------------
/ComboJack_Installer/ComboJack.orig:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackintosh-stuff/ComboJack/HEAD/ComboJack_Installer/ComboJack.orig
--------------------------------------------------------------------------------
/ComboJack_Installer/Headphone.icns:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackintosh-stuff/ComboJack/HEAD/ComboJack_Installer/Headphone.icns
--------------------------------------------------------------------------------
/ComboJack_Installer/Screen_Shot.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackintosh-stuff/ComboJack/HEAD/ComboJack_Installer/Screen_Shot.png
--------------------------------------------------------------------------------
/ComboJack_Installer/VerbStub.kext/Contents/MacOS/VerbStub:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackintosh-stuff/ComboJack/HEAD/ComboJack_Installer/VerbStub.kext/Contents/MacOS/VerbStub
--------------------------------------------------------------------------------
/ComboJack_Source/ComboJack.xcodeproj/xcuserdata/karl.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/VerbStub_Source/VerbStub.xcodeproj/xcuserdata/karl.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
--------------------------------------------------------------------------------
/VerbStub_Source/VerbStub.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/VerbStub_Source/VerbStub.xcodeproj/project.xcworkspace/xcuserdata/karl.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackintosh-stuff/ComboJack/HEAD/VerbStub_Source/VerbStub.xcodeproj/project.xcworkspace/xcuserdata/karl.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/VerbStub_Source/VerbStub.xcodeproj/project.xcworkspace/xcuserdata/ling.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackintosh-stuff/ComboJack/HEAD/VerbStub_Source/VerbStub.xcodeproj/project.xcworkspace/xcuserdata/ling.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/ComboJack_Source/ComboJack.xcodeproj/project.xcworkspace/xcuserdata/karl.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackintosh-stuff/ComboJack/HEAD/ComboJack_Source/ComboJack.xcodeproj/project.xcworkspace/xcuserdata/karl.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/ComboJack_Source/ComboJack.xcodeproj/project.xcworkspace/xcuserdata/ling.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackintosh-stuff/ComboJack/HEAD/ComboJack_Source/ComboJack.xcodeproj/project.xcworkspace/xcuserdata/ling.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/ComboJack_Source/ComboJack.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
4 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/ComboJack_Source/ComboJack.xcodeproj/project.xcworkspace/xcuserdata/andre.xcuserdatad/UserInterfaceState.xcuserstate:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/hackintosh-stuff/ComboJack/HEAD/ComboJack_Source/ComboJack.xcodeproj/project.xcworkspace/xcuserdata/andre.xcuserdatad/UserInterfaceState.xcuserstate
--------------------------------------------------------------------------------
/VerbStub_Source/VerbStub.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ComboJack_Source/ComboJack.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | IDEDidComputeMac32BitWarning
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/ComboJack_Source/ComboJack.xcodeproj/xcuserdata/andre.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | ComboJack.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/ComboJack_Source/ComboJack.xcodeproj/xcuserdata/ling.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | ComboJack.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 0
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/ComboJack_Source/build.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 | cd `dirname $0`
3 |
4 | xcodebuild -configuration Release || exit 1
5 | rm -f ../ComboJack_Installer/ComboJack
6 | rm -f ../ComboJack_Installer/Headphone.icns
7 | rm -f ../ComboJack_Installer/l10n.json
8 | cp -f build/Release/ComboJack ../ComboJack_Installer/
9 | cp -f ./Headphone.icns ../ComboJack_Installer/
10 | cp -f ./l10n.json ../ComboJack_Installer/
11 | # exec ./build/Release/ComboJack
12 | rm -rf ./build
13 | # exec bash ../ComboJack_Installer/install.sh
14 |
--------------------------------------------------------------------------------
/ComboJack_Installer/com.XPS.ComboJack.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | KeepAlive
6 |
7 | Label
8 | com.XPS.ComboJack
9 | ProgramArguments
10 |
11 | /usr/local/sbin/ComboJack
12 |
13 | RunAtLoad
14 |
15 | ServiceIPC
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/VerbStub_Source/VerbStub.xcodeproj/xcuserdata/ling.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | VerbStub.xcscheme_^#shared#^_
8 |
9 | orderHint
10 | 1
11 |
12 | hda-verb.xcscheme_^#shared#^_
13 |
14 | orderHint
15 | 0
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/ComboJack_Source/ComboJack.xcodeproj/xcuserdata/karl.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | Combo Jack.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 |
13 | SuppressBuildableAutocreation
14 |
15 | CB3D58421F0A7DE000F741BA
16 |
17 | primary
18 |
19 |
20 |
21 |
22 |
23 |
--------------------------------------------------------------------------------
/uninstall.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | if [[ $EUID -ne 0 ]];
4 | then
5 | exec sudo /bin/bash "$0" "$@"
6 | fi
7 |
8 | cd "$( dirname "${BASH_SOURCE[0]}" )"
9 |
10 | # uninstall
11 | sudo launchctl unload /Library/LaunchDaemons/com.XPS.ComboJack.plist
12 | sudo rm /Library/LaunchDaemons/com.XPS.ComboJack.plist
13 | sudo rm /usr/local/share/ComboJack/l10n.json
14 | sudo rm /usr/local/share/ComboJack/Headphone.icns
15 | sudo rm -r /usr/local/share/ComboJack
16 | sudo rm /usr/local/sbin/hda-verb
17 | sudo spctl --remove /usr/local/sbin/ComboJack
18 | sudo rm /usr/local/sbin/ComboJack
19 | echo
20 | echo "Please reboot! Remember to remove VerbStub.kext as well."
21 | echo
22 | exit 0
23 |
--------------------------------------------------------------------------------
/README.txt:
--------------------------------------------------------------------------------
1 | Hackintosh combojack support for alc256/alc255.
2 | Confirmed to work on dell xps 13 9350/9360(alc256) and Xiaomi Air(i5-7200U, alc255)
3 | 1. Delete CodecCommander.kext,put ComboJack_Installer/VerbStub.kext in Clover/kexts/Other
4 | 2. Run ComboJack_Installer/install.sh in terminal and reboot
5 | 3. Done. When you attach a headphone there will be a popup asking about headphone type.
6 |
7 | I know CleanMyMac reports this as mining malware, but I don't think CleanMyMac is a serious anti-malware. If you really believe these false alarms then compile by yourself (don't ask how).
8 |
9 |
10 | 黑苹果上alc256/alc255的耳麦支持
11 | 在xps 13 9350/9360(alc256)和小米Air(i5-7200U, alc255)上测试可用
12 | 1. 删除 CodecCommander.kext,把ComboJack_Installer文件夹的VerbStub.kext放进Clover/kexts/Other
13 | 2. 终端运行 ComboJack_Installer/install.sh,重启
14 | 3. 插入耳机的时候,会弹出对话框询问你插入的是耳机还是耳塞
15 |
--------------------------------------------------------------------------------
/VerbStub_Source/VerbStub.xcodeproj/xcuserdata/karl.xcuserdatad/xcschemes/xcschememanagement.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | SchemeUserState
6 |
7 | VerbStub.xcscheme
8 |
9 | orderHint
10 | 0
11 |
12 | hda-verb.xcscheme
13 |
14 | orderHint
15 | 1
16 |
17 |
18 | SuppressBuildableAutocreation
19 |
20 | CB3C1C101F08A20200F26D79
21 |
22 | primary
23 |
24 |
25 | CB3C1C2A1F08A5D200F26D79
26 |
27 | primary
28 |
29 |
30 | CB3C1C351F08A67000F26D79
31 |
32 | primary
33 |
34 |
35 | CB3C1C441F08A73100F26D79
36 |
37 | primary
38 |
39 |
40 | CB3C1C761F0979D800F26D79
41 |
42 | primary
43 |
44 |
45 |
46 |
47 |
48 |
--------------------------------------------------------------------------------
/ComboJack_Source/Combo Jack/hda_hwdep.h:
--------------------------------------------------------------------------------
1 | /*
2 | * HWDEP Interface for HD-audio codec
3 | *
4 | * Copyright (c) 2007 Takashi Iwai
5 | *
6 | * This driver is free software; you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation; either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This driver is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program; if not, write to the Free Software
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 | */
20 |
21 | //
22 | // Adapted from hda-verb from alsa-tools:
23 | // https://www.alsa-project.org/main/index.php/Main_Page
24 | //
25 |
26 | #ifndef __SOUND_HDA_HWDEP_H
27 | #define __SOUND_HDA_HWDEP_H
28 |
29 | #define HDA_HWDEP_VERSION 0x2710 /* Darwin */
30 |
31 | /* verb */
32 | #define HDA_REG_NID_SHIFT 20
33 | #define HDA_REG_VERB_SHIFT 8
34 | #define HDA_REG_VAL_SHIFT 0
35 | #define HDA_VERB(nid,verb,param) ((nid)<<20 | (verb)<<8 | (param))
36 |
37 | struct hda_verb_ioctl {
38 | u32 verb; /* HDA_VERB() */
39 | u32 res; /* response */
40 | };
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/VerbStub_Source/hda-verb/hda_hwdep.h:
--------------------------------------------------------------------------------
1 | /*
2 | * HWDEP Interface for HD-audio codec
3 | *
4 | * Copyright (c) 2007 Takashi Iwai
5 | *
6 | * This driver is free software; you can redistribute it and/or modify
7 | * it under the terms of the GNU General Public License as published by
8 | * the Free Software Foundation; either version 2 of the License, or
9 | * (at your option) any later version.
10 | *
11 | * This driver is distributed in the hope that it will be useful,
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 | * GNU General Public License for more details.
15 | *
16 | * You should have received a copy of the GNU General Public License
17 | * along with this program; if not, write to the Free Software
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 | */
20 |
21 | //
22 | // Adapted from hda-verb from alsa-tools:
23 | // https://www.alsa-project.org/main/index.php/Main_Page
24 | //
25 |
26 | #ifndef __SOUND_HDA_HWDEP_H
27 | #define __SOUND_HDA_HWDEP_H
28 |
29 | #define HDA_HWDEP_VERSION 0x2710 /* Darwin */
30 |
31 | /* verb */
32 | #define HDA_REG_NID_SHIFT 20
33 | #define HDA_REG_VERB_SHIFT 8
34 | #define HDA_REG_VAL_SHIFT 0
35 | #define HDA_VERB(nid,verb,param) ((nid)<<20 | (verb)<<8 | (param))
36 |
37 | struct hda_verb_ioctl {
38 | u32 verb; /* HDA_VERB() */
39 | u32 res; /* response */
40 | };
41 |
42 | #endif
43 |
--------------------------------------------------------------------------------
/ComboJack_Source/l10n.json:
--------------------------------------------------------------------------------
1 | {
2 | "zh_CN": {
3 | "dialogTitle" : "耳机接入通知",
4 | "dialogMsg" : "请选择接入的设备类型(按ESC键取消)",
5 | "btnHeadphone" : "耳机",
6 | "btnLinein" : "线路输入",
7 | "btnHeadset" : "耳麦",
8 | "btnCancel" : "取消"
9 | },
10 | "en_US": {
11 | "dialogTitle" : "Combo Jack Notification",
12 | "dialogMsg" : "What did you just plug in? (Press ESC to cancel)",
13 | "btnHeadphone" : "Headphones",
14 | "btnLinein" : "Line-In",
15 | "btnHeadset" : "Headset",
16 | "btnCancel" : "Cancel"
17 | },
18 | "ru_RU": {
19 | "dialogTitle" : "Combo Jack Notification",
20 | "dialogMsg" : "Какое устройство было подключено? (ESC для отмены)",
21 | "btnHeadphone" : "Наушники",
22 | "btnLinein" : "Линейный вход",
23 | "btnHeadset" : "Гарнитура",
24 | "btnCancel" : "Отмена"
25 | },
26 | "ru_UA": {
27 | "dialogTitle" : "Combo Jack Notification",
28 | "dialogMsg" : "Какое устройство было подключено? (ESC для отмены)",
29 | "btnHeadphone" : "Наушники",
30 | "btnLinein" : "Линейный вход",
31 | "btnHeadset" : "Гарнитура",
32 | "btnCancel" : "Отмена"
33 | },
34 | "uk_UA": {
35 | "dialogTitle" : "Combo Jack Notification",
36 | "dialogMsg" : "Який пристрій було підключено? (ESC для скасування)",
37 | "btnHeadphone" : "Навушники",
38 | "btnLinein" : "Лінійний вхід",
39 | "btnHeadset" : "Гарнітура",
40 | "btnCancel" : "Скасувати"
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/ComboJack_Installer/l10n.json:
--------------------------------------------------------------------------------
1 | {
2 | "zh_CN": {
3 | "dialogTitle" : "耳机接入通知",
4 | "dialogMsg" : "请选择接入的设备类型(按ESC键取消)",
5 | "btnHeadphone" : "耳机",
6 | "btnLinein" : "线路输入",
7 | "btnHeadset" : "耳麦",
8 | "btnCancel" : "取消"
9 | },
10 | "en_US": {
11 | "dialogTitle" : "Combo Jack Notification",
12 | "dialogMsg" : "What did you just plug in? (Press ESC to cancel)",
13 | "btnHeadphone" : "Headphones",
14 | "btnLinein" : "Line-In",
15 | "btnHeadset" : "Headset",
16 | "btnCancel" : "Cancel"
17 | },
18 | "ru_RU": {
19 | "dialogTitle" : "Combo Jack Notification",
20 | "dialogMsg" : "Какое устройство было подключено? (ESC для отмены)",
21 | "btnHeadphone" : "Наушники",
22 | "btnLinein" : "Линейный вход",
23 | "btnHeadset" : "Гарнитура",
24 | "btnCancel" : "Отмена"
25 | },
26 | "ru_UA": {
27 | "dialogTitle" : "Combo Jack Notification",
28 | "dialogMsg" : "Какое устройство было подключено? (ESC для отмены)",
29 | "btnHeadphone" : "Наушники",
30 | "btnLinein" : "Линейный вход",
31 | "btnHeadset" : "Гарнитура",
32 | "btnCancel" : "Отмена"
33 | },
34 | "uk_UA": {
35 | "dialogTitle" : "Combo Jack Notification",
36 | "dialogMsg" : "Який пристрій було підключено? (ESC для скасування)",
37 | "btnHeadphone" : "Навушники",
38 | "btnLinein" : "Лінійний вхід",
39 | "btnHeadset" : "Гарнітура",
40 | "btnCancel" : "Скасувати"
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/ComboJack_Installer/Information.rtf:
--------------------------------------------------------------------------------
1 | {\rtf1\ansi\ansicpg1252\cocoartf1504\cocoasubrtf830
2 | {\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Verdana;}
3 | {\colortbl;\red255\green255\blue255;\red0\green0\blue0;\red255\green255\blue255;\red17\green90\blue209;
4 | }
5 | {\*\expandedcolortbl;;\cssrgb\c0\c0\c0;\cssrgb\c100000\c100000\c100000;\cssrgb\c5882\c44706\c85490;
6 | }
7 | \margl1440\margr1440\vieww10800\viewh8400\viewkind0
8 | \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
9 |
10 | \f0\fs24 \cf0 Allows complete configuration of unsupported codecs (this version enables full functionality of the Dell XPS 15 9560\'92s ALC3266 3.5mm combination jack).\
11 | \
12 | Based on the idea of
13 | \f1 \cf2 \cb3 \expnd0\expndtw0\kerning0
14 | \'a0{\field{\*\fldinst{HYPERLINK "https://github.com/goodwin/ALCPlugFix"}}{\fldrslt \cf4 \ul \ulc4 https://github.com/goodwin/ALCPlugFix}}\
15 | Implemented by way of porting hda-verb from alsa-tools:\
16 | {\field{\*\fldinst{HYPERLINK "https://www.alsa-project.org/main/index.php/Main_Page"}}{\fldrslt https://www.alsa-project.org/main/index.php/Main_Page}}\
17 | \
18 | Portions of code adapted from CodecCommander ({\field{\*\fldinst{HYPERLINK "https://github.com/RehabMan/EAPD-Codec-Commander"}}{\fldrslt https://github.com/RehabMan/EAPD-Codec-Commander}}) and the Linux kernel ({\field{\*\fldinst{HYPERLINK "https://github.com/torvalds/linux"}}{\fldrslt https://github.com/torvalds/linux}}). All copyrights belong to their respective owners.\
19 | \
20 | Uses layout-id 72. VerbStub.kext goes into EFI/Clover/kexts/Other.}
--------------------------------------------------------------------------------
/VerbStub_Source/VerbStub/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDevelopmentRegion
6 | en
7 | CFBundleExecutable
8 | $(EXECUTABLE_NAME)
9 | CFBundleIdentifier
10 | ${MODULE_NAME}
11 | CFBundleInfoDictionaryVersion
12 | 6.0
13 | CFBundleName
14 | $(PRODUCT_NAME)
15 | CFBundlePackageType
16 | KEXT
17 | CFBundleShortVersionString
18 | ${MODULE_VERSION}
19 | CFBundleVersion
20 | ${MODULE_VERSION}
21 | IOKitPersonalities
22 |
23 | VerbStubResidency
24 |
25 | CFBundleIdentifier
26 | ${MODULE_NAME}
27 | IOClass
28 | VerbStubResidency
29 | IOMatchCategory
30 | VerbStubResidency
31 | IOProviderClass
32 | IOResources
33 |
34 | VerbStub
35 |
36 | CFBundleIdentifier
37 | ${MODULE_NAME}
38 | IOClass
39 | com_XPS_VerbStub
40 | IOProviderClass
41 | IOHDACodecFunction
42 | IOMatchCategory
43 | com_XPS_VerbStub
44 | IOUserClientClass
45 | VerbStubUserClient
46 |
47 |
48 | NSHumanReadableCopyright
49 | Copyright © 2017 VerbStub. All rights reserved.
50 | OSBundleLibraries
51 |
52 | com.apple.iokit.IOPCIFamily
53 | 2.9
54 | com.apple.kpi.iokit
55 | 16.6
56 | com.apple.kpi.libkern
57 | 16.6
58 |
59 |
60 |
61 |
--------------------------------------------------------------------------------
/ComboJack_Installer/install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | if [[ $EUID -ne 0 ]];
4 | then
5 | exec sudo /bin/bash "$0" "$@"
6 | fi
7 |
8 | cd "$( dirname "${BASH_SOURCE[0]}" )"
9 |
10 | # Clean legacy stuff
11 | #
12 | sudo launchctl unload /Library/LaunchDaemons/com.XPS.ComboJack.plist 2>/dev/null
13 | sudo rm -rf /Library/Extensions/CodecCommander.kext
14 | sudo rm -f /usr/local/bin/ALCPlugFix
15 | sudo rm -f /Library/LaunchAgents/good.win.ALCPlugFix
16 | sudo rm -f /Library/LaunchDaemons/good.win.ALCPlugFix
17 | sudo rm -f /usr/local/sbin/hda-verb
18 | sudo rm -f /usr/local/share/ComboJack/Headphone.icns
19 | sudo rm -f /usr/local/share/ComboJack/l10n.json
20 |
21 | # install
22 | mkdir -p /usr/local/sbin
23 | sudo cp ComboJack /usr/local/sbin
24 | sudo chmod 755 /usr/local/sbin/ComboJack
25 | sudo chown root:wheel /usr/local/sbin/ComboJack
26 | sudo spctl --add /usr/local/sbin/ComboJack
27 | sudo cp hda-verb /usr/local/sbin
28 | #sudo chmod 755 /usr/local/sbin/hda-verb
29 | #sudo chown root:wheel /usr/local/sbin/hda-verb
30 | sudo mkdir -p /usr/local/share/ComboJack/
31 | sudo cp Headphone.icns /usr/local/share/ComboJack/
32 | sudo chmod 644 /usr/local/share/ComboJack/Headphone.icns
33 | sudo cp l10n.json /usr/local/share/ComboJack/
34 | sudo chmod 644 /usr/local/share/ComboJack/l10n.json
35 | sudo cp com.XPS.ComboJack.plist /Library/LaunchDaemons/
36 | sudo chmod 644 /Library/LaunchDaemons/com.XPS.ComboJack.plist
37 | sudo chown root:wheel /Library/LaunchDaemons/com.XPS.ComboJack.plist
38 | sudo launchctl load /Library/LaunchDaemons/com.XPS.ComboJack.plist
39 | echo
40 | echo "Please reboot! Also, it may be a good idea to turn off \"Use"
41 | echo "ambient noise reduction\" when using an input method other than"
42 | echo "the internal mic (meaning line-in, headset mic). As always: YMMV."
43 | echo
44 | echo "You can check to see if the watcher is working in the IORegistry:"
45 | echo "there should be a device named \"VerbStubUserClient\" attached to"
46 | echo "\"com_XPS_SetVerb\" somewhere within the \"HDEF\" entry's hierarchy."
47 | echo
48 | echo "Enjoy!"
49 | echo
50 | exit 0
51 |
--------------------------------------------------------------------------------
/ComboJack_Source/Combo Jack/PCI.h:
--------------------------------------------------------------------------------
1 | //
2 | // pci.h
3 | // DPCIManager
4 | //
5 | // Created by PHPdev32 on 10/8/12.
6 | // Licensed under GPLv3, full text at http://www.gnu.org/licenses/gpl-3.0.txt
7 | //
8 |
9 | #import
10 | #import
11 |
12 | @interface pciDevice : NSObject
13 |
14 | @property uint64_t entryID;
15 | @property NSNumber *shadowVendor;
16 | @property NSNumber *shadowDevice;
17 | @property NSNumber *revision;
18 | @property NSArray *bus;
19 | @property NSNumber *vendor;
20 | @property NSNumber *device;
21 | @property NSNumber *subVendor;
22 | @property NSNumber *subDevice;
23 | @property NSNumber *pciClassCode;
24 | @property NSNumber *pciClass;
25 | @property NSNumber *pciSubClass;
26 | @property NSString *vendorString;
27 | @property NSString *deviceString;
28 | @property NSString *classString;
29 | @property NSString *subClassString;
30 | @property (readonly) NSString *fullClassString;
31 | @property (readonly) NSString *lspciString;
32 | @property (readonly) NSDictionary *lspciDictionary;
33 | @property (readonly) long fullID;
34 | @property (readonly) long fullSubID;
35 | @property (readonly) short bdf;
36 |
37 | +(long)nameToLong:(NSString *)name;
38 | +(bool)isPCI:(io_service_t)service;
39 | +(NSNumber *)grabNumber:(CFStringRef)entry forService:(io_service_t)service;
40 | +(NSString *)grabString:(CFStringRef)entry forService:(io_service_t)service;
41 | +(NSDictionary *)match:(pciDevice *)pci;
42 | +(pciDevice *)create:(io_service_t)service classes:(NSMutableDictionary *)classes vendors:(NSMutableDictionary *)vendors;
43 | +(pciDevice *)create:(io_service_t)service;
44 | +(NSArray *)readIDs;
45 |
46 | @end
47 |
48 | @interface pciVendor : NSObject
49 | @property NSString *name;
50 | @property NSMutableDictionary *devices;
51 | +(pciVendor *)create:(NSString *)name;
52 | @end
53 |
54 | @interface pciClass : NSObject
55 | @property NSString *name;
56 | @property NSMutableDictionary *subClasses;
57 | +(pciClass *)create:(NSString *)name;
58 | @end
59 |
60 | @interface efiObject : NSObject
61 | @property NSDictionary *properties;
62 | @property pciDevice *device;
63 | +(efiObject *)create:(pciDevice *)device injecting:(NSDictionary *)properties;
64 | +(NSString *)stringWithArray:(NSArray *)array;
65 | @end
66 |
67 | @interface hexFormatter : NSValueTransformer
68 | +(BOOL)allowsReverseTransformation;
69 | +(Class)transformedValueClass;
70 | -(id)transformedValue:(id)value;
71 | @end
72 |
--------------------------------------------------------------------------------
/ComboJack_Installer/VerbStub.kext/Contents/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | BuildMachineOSBuild
6 | 20D91
7 | CFBundleDevelopmentRegion
8 | en
9 | CFBundleExecutable
10 | VerbStub
11 | CFBundleIdentifier
12 | com.XPS.VerbStub
13 | CFBundleInfoDictionaryVersion
14 | 6.0
15 | CFBundleName
16 | VerbStub
17 | CFBundlePackageType
18 | KEXT
19 | CFBundleShortVersionString
20 | 1.0.4
21 | CFBundleSupportedPlatforms
22 |
23 | MacOSX
24 |
25 | CFBundleVersion
26 | 1.0.4
27 | DTCompiler
28 | com.apple.compilers.llvm.clang.1_0
29 | DTPlatformBuild
30 | 12D4e
31 | DTPlatformName
32 | macosx
33 | DTPlatformVersion
34 | 11.1
35 | DTSDKBuild
36 | 20C63
37 | DTSDKName
38 | macosx11.1
39 | DTXcode
40 | 1240
41 | DTXcodeBuild
42 | 12D4e
43 | IOKitPersonalities
44 |
45 | VerbStub
46 |
47 | CFBundleIdentifier
48 | com.XPS.VerbStub
49 | IOClass
50 | com_XPS_VerbStub
51 | IOMatchCategory
52 | com_XPS_VerbStub
53 | IOProviderClass
54 | IOHDACodecFunction
55 | IOUserClientClass
56 | VerbStubUserClient
57 |
58 | VerbStubResidency
59 |
60 | CFBundleIdentifier
61 | com.XPS.VerbStub
62 | IOClass
63 | VerbStubResidency
64 | IOMatchCategory
65 | VerbStubResidency
66 | IOProviderClass
67 | IOResources
68 |
69 |
70 | LSMinimumSystemVersion
71 | 10.12
72 | NSHumanReadableCopyright
73 | Copyright © 2017 VerbStub. All rights reserved.
74 | OSBundleLibraries
75 |
76 | com.apple.iokit.IOPCIFamily
77 | 2.9
78 | com.apple.kpi.iokit
79 | 16.6
80 | com.apple.kpi.libkern
81 | 16.6
82 |
83 |
84 |
85 |
--------------------------------------------------------------------------------
/VerbStub_Source/VerbStub.xcodeproj/xcuserdata/karl.xcuserdatad/xcschemes/VerbStub.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
34 |
35 |
45 |
46 |
52 |
53 |
54 |
55 |
56 |
57 |
63 |
64 |
70 |
71 |
72 |
73 |
75 |
76 |
79 |
80 |
81 |
--------------------------------------------------------------------------------
/VerbStub_Source/VerbStub.xcodeproj/xcuserdata/karl.xcuserdatad/xcschemes/hda-verb.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/ComboJack_Source/ComboJack.xcodeproj/xcuserdata/karl.xcuserdatad/xcschemes/Combo Jack.xcscheme:
--------------------------------------------------------------------------------
1 |
2 |
5 |
8 |
9 |
15 |
21 |
22 |
23 |
24 |
25 |
30 |
31 |
32 |
33 |
39 |
40 |
41 |
42 |
43 |
44 |
54 |
56 |
62 |
63 |
64 |
65 |
66 |
67 |
73 |
75 |
81 |
82 |
83 |
84 |
86 |
87 |
90 |
91 |
92 |
--------------------------------------------------------------------------------
/VerbStub_Source/VerbStub/VerbStub.hpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Released under "The GNU General Public License (GPL-2.0)"
3 | *
4 | * This program is free software; you can redistribute it and/or modify it
5 | * under the terms of the GNU General Public License as published by the
6 | * Free Software Foundation; either version 2 of the License, or (at your
7 | * option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 | * for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License along
15 | * with this program; if not, write to the Free Software Foundation, Inc.,
16 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 | *
18 | */
19 |
20 | //
21 | // Adapted from CodecCommander:
22 | // https://github.com/Dolnor/EAPD-Codec-Commander
23 | //
24 | // Apple Driver Documentation
25 | //
26 | // Writing a kernel extension:
27 | // https://developer.apple.com/library/content/documentation/Darwin/Conceptual/KEXTConcept/KEXTConceptIOKit/iokit_tutorial.html
28 | // IOKit Fundamentals:
29 | // https://developer.apple.com/library/content/documentation/DeviceDrivers/Conceptual/IOKitFundamentals/Introduction/Introduction.html
30 | // Writing an IOKit driver:
31 | // https://developer.apple.com/library/content/documentation/DeviceDrivers/Conceptual/WritingDeviceDriver/Introduction/Intro.html
32 | // Accessing Hardware:
33 | // https://developer.apple.com/library/content/documentation/DeviceDrivers/Conceptual/AccessingHardware/AH_Intro/AH_Intro.html
34 | // User Client Info (sample user client driver interface):
35 | // https://developer.apple.com/library/content/samplecode/SimpleUserClient/Listings/User_Client_Info_txt.html
36 | //
37 |
38 | #include
39 | #include
40 | #include "IntelHDA.h"
41 |
42 | // External client methods
43 | enum
44 | {
45 | kClientExecuteVerb = 0,
46 | kClientNumMethods
47 | };
48 |
49 | class com_XPS_VerbStub : public IOService
50 | {
51 | OSDeclareDefaultStructors(com_XPS_VerbStub)
52 | public:
53 | virtual bool init(OSDictionary *dictionary = 0);
54 | virtual void free(void);
55 | virtual IOService *probe(IOService *provider, SInt32 *score);
56 | virtual bool start(IOService *provider);
57 | virtual void stop(IOService *provider);
58 |
59 | UInt32 ExternalCommand(UInt32 command);
60 |
61 | private: // Only for use by com_XPS_VerbStub::functions
62 | IOService *AudioDevc = NULL;
63 | IntelHDA *HDADevice = NULL;
64 |
65 | };
66 |
67 | class VerbStubUserClient : public IOUserClient
68 | {
69 | /*
70 | * Declare the metaclass information that is used for runtime
71 | * typechecking of IOKit objects.
72 | */
73 |
74 | OSDeclareDefaultStructors(VerbStubUserClient)
75 |
76 | private:
77 | com_XPS_VerbStub* providertarget;
78 | task_t mTask;
79 | SInt32 mOpenCount;
80 |
81 | static const IOExternalMethodDispatch sMethods[kClientNumMethods];
82 |
83 | public:
84 |
85 | /* IOService overrides */
86 |
87 | virtual bool start(IOService* provider);
88 | virtual void stop(IOService* provider);
89 |
90 | /* IOUserClient overrides */
91 |
92 | virtual bool initWithTask(task_t owningTask, void * securityID, UInt32 type, OSDictionary* properties);
93 | virtual IOReturn clientClose(void);
94 |
95 | virtual IOReturn externalMethod(uint32_t selector, IOExternalMethodArguments *arguments, IOExternalMethodDispatch* dispatch = 0,
96 | OSObject* target = 0, void* reference = 0);
97 | /* External methods */
98 |
99 | static IOReturn executeVerb(com_XPS_VerbStub* target, void* reference, IOExternalMethodArguments* arguments);
100 | };
101 |
102 | class VerbStubResidency : public IOService
103 | {
104 | private:
105 |
106 | /*
107 | * Declare the metaclass information that is used for runtime
108 | * typechecking of IOKit objects.
109 | */
110 |
111 | OSDeclareDefaultStructors(VerbStubResidency);
112 |
113 | // standard IOKit methods
114 | virtual bool start(IOService *provider);
115 | };
116 |
--------------------------------------------------------------------------------
/ComboJack_Source/Combo Jack/rt298.h:
--------------------------------------------------------------------------------
1 | /*
2 | * rt298.h -- RT298 ALSA SoC audio driver
3 | *
4 | * Copyright 2011 Realtek Microelectronics
5 | * Author: Johnny Hsu
6 | *
7 | * This program is free software; you can redistribute it and/or modify
8 | * it under the terms of the GNU General Public License version 2 as
9 | * published by the Free Software Foundation.
10 | */
11 |
12 | //
13 | // Very lightly adapted from the Linux kernel:
14 | // https://github.com/torvalds/linux
15 | //
16 |
17 | #ifndef __RT298_H__
18 | #define __RT298_H__
19 |
20 | #define VERB_CMD(V, N, D) ((N << 20) | (V << 8) | D)
21 |
22 | #define RT298_AUDIO_FUNCTION_GROUP 0x01
23 | #define RT298_DAC_OUT1 0x02
24 | #define RT298_DAC_OUT2 0x03
25 | #define RT298_DIG_CVT 0x06
26 | #define RT298_ADC_IN1 0x09
27 | #define RT298_ADC_IN2 0x08
28 | #define RT298_MIXER_IN 0x0b
29 | #define RT298_MIXER_OUT1 0x0c
30 | #define RT298_MIXER_OUT2 0x0d
31 | #define RT298_DMIC1 0x12
32 | #define RT298_DMIC2 0x13
33 | #define RT298_SPK_OUT 0x14 // 0x17 for ALC3266
34 | #define RT298_MIC1 0x18
35 | #define RT298_LINE1 0x1a
36 | #define RT298_BEEP 0x1d
37 | #define RT298_SPDIF 0x1e
38 | #define RT298_VENDOR_REGISTERS 0x20
39 | #define RT298_HP_OUT 0x21
40 | #define RT298_MIXER_IN1 0x22
41 | #define RT298_MIXER_IN2 0x23
42 | #define RT298_INLINE_CMD 0x55
43 |
44 | #define RT298_SET_PIN_SFT 6
45 | #define RT298_SET_PIN_ENABLE 0x40
46 | #define RT298_SET_PIN_DISABLE 0
47 | #define RT298_SET_EAPD_HIGH 0x2
48 | #define RT298_SET_EAPD_LOW 0
49 |
50 | #define RT298_MUTE_SFT 7
51 |
52 | /* Verb commands */
53 | #define RT298_GET_PARAM(NID, PARAM) VERB_CMD(AC_VERB_PARAMETERS, NID, PARAM)
54 | #define RT298_SET_POWER(NID) VERB_CMD(AC_VERB_SET_POWER_STATE, NID, 0)
55 | #define RT298_SET_AUDIO_POWER RT298_SET_POWER(RT298_AUDIO_FUNCTION_GROUP)
56 | #define RT298_SET_HPO_POWER RT298_SET_POWER(RT298_HP_OUT)
57 | #define RT298_SET_SPK_POWER RT298_SET_POWER(RT298_SPK_OUT)
58 | #define RT298_SET_DMIC1_POWER RT298_SET_POWER(RT298_DMIC1)
59 | #define RT298_SPK_MUX\
60 | VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT298_SPK_OUT, 0)
61 | #define RT298_HPO_MUX\
62 | VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT298_HP_OUT, 0)
63 | #define RT298_ADC0_MUX\
64 | VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT298_MIXER_IN1, 0)
65 | #define RT298_ADC1_MUX\
66 | VERB_CMD(AC_VERB_SET_CONNECT_SEL, RT298_MIXER_IN2, 0)
67 | #define RT298_SET_MIC1\
68 | VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT298_MIC1, 0)
69 | #define RT298_SET_PIN_HPO\
70 | VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT298_HP_OUT, 0)
71 | #define RT298_SET_PIN_SPK\
72 | VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT298_SPK_OUT, 0)
73 | #define RT298_SET_PIN_DMIC1\
74 | VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT298_DMIC1, 0)
75 | #define RT298_SET_PIN_SPDIF\
76 | VERB_CMD(AC_VERB_SET_PIN_WIDGET_CONTROL, RT298_SPDIF, 0)
77 | #define RT298_SET_PIN_DIG_CVT\
78 | VERB_CMD(AC_VERB_SET_DIGI_CONVERT_1, RT298_DIG_CVT, 0)
79 | #define RT298_SPK_EAPD\
80 | VERB_CMD(AC_VERB_SET_EAPD_BTLENABLE, RT298_SPK_OUT, 0)
81 | #define RT298_SET_AMP_GAIN_HPO\
82 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_HP_OUT, 0)
83 | #define RT298_SET_AMP_GAIN_ADC_IN1\
84 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_ADC_IN1, 0)
85 | #define RT298_SET_AMP_GAIN_ADC_IN2\
86 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_ADC_IN2, 0)
87 | #define RT298_GET_HP_SENSE\
88 | VERB_CMD(AC_VERB_GET_PIN_SENSE, RT298_HP_OUT, 0)
89 | #define RT298_GET_MIC1_SENSE\
90 | VERB_CMD(AC_VERB_GET_PIN_SENSE, RT298_MIC1, 0)
91 | #define RT298_SET_DMIC2_DEFAULT\
92 | VERB_CMD(AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, RT298_DMIC2, 0)
93 | #define RT298_SET_SPDIF_DEFAULT\
94 | VERB_CMD(AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, RT298_SPDIF, 0)
95 | #define RT298_DACL_GAIN\
96 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_DAC_OUT1, 0xa000)
97 | #define RT298_DACR_GAIN\
98 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_DAC_OUT1, 0x9000)
99 | #define RT298_ADCL_GAIN\
100 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_ADC_IN1, 0x6000)
101 | #define RT298_ADCR_GAIN\
102 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_ADC_IN1, 0x5000)
103 | #define RT298_MIC_GAIN\
104 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIC1, 0x7000)
105 | #define RT298_SPOL_GAIN\
106 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_SPK_OUT, 0xa000)
107 | #define RT298_SPOR_GAIN\
108 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_SPK_OUT, 0x9000)
109 | #define RT298_HPOL_GAIN\
110 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_HP_OUT, 0xa000)
111 | #define RT298_HPOR_GAIN\
112 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_HP_OUT, 0x9000)
113 | #define RT298_F_DAC_SWITCH\
114 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIXER_OUT1, 0x7000)
115 | #define RT298_F_RECMIX_SWITCH\
116 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIXER_OUT1, 0x7100)
117 | #define RT298_REC_MIC_SWITCH\
118 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIXER_IN, 0x7000)
119 | #define RT298_REC_I2S_SWITCH\
120 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIXER_IN, 0x7100)
121 | #define RT298_REC_LINE_SWITCH\
122 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIXER_IN, 0x7200)
123 | #define RT298_REC_BEEP_SWITCH\
124 | VERB_CMD(AC_VERB_SET_AMP_GAIN_MUTE, RT298_MIXER_IN, 0x7300)
125 | #define RT298_DAC_FORMAT\
126 | VERB_CMD(AC_VERB_SET_STREAM_FORMAT, RT298_DAC_OUT1, 0)
127 | #define RT298_ADC_FORMAT\
128 | VERB_CMD(AC_VERB_SET_STREAM_FORMAT, RT298_ADC_IN1, 0)
129 | #define RT298_COEF_INDEX\
130 | VERB_CMD(AC_VERB_SET_COEF_INDEX, RT298_VENDOR_REGISTERS, 0)
131 | #define RT298_PROC_COEF\
132 | VERB_CMD(AC_VERB_SET_PROC_COEF, RT298_VENDOR_REGISTERS, 0)
133 | #define RT298_UNSOLICITED_INLINE_CMD\
134 | VERB_CMD(AC_VERB_SET_UNSOLICITED_ENABLE, RT298_INLINE_CMD, 0)
135 | #define RT298_UNSOLICITED_HP_OUT\
136 | VERB_CMD(AC_VERB_SET_UNSOLICITED_ENABLE, RT298_HP_OUT, 0)
137 | #define RT298_UNSOLICITED_MIC1\
138 | VERB_CMD(AC_VERB_SET_UNSOLICITED_ENABLE, RT298_MIC1, 0)
139 |
140 | /* Index registers */
141 | #define RT298_A_BIAS_CTRL1 0x01
142 | #define RT298_A_BIAS_CTRL2 0x02
143 | #define RT298_POWER_CTRL1 0x03
144 | #define RT298_A_BIAS_CTRL3 0x04
145 | #define RT298_D_FILTER_CTRL 0x05
146 | #define RT298_POWER_CTRL2 0x08
147 | #define RT298_I2S_CTRL1 0x09
148 | #define RT298_I2S_CTRL2 0x0a
149 | #define RT298_CLK_DIV 0x0b
150 | #define RT298_DC_GAIN 0x0d
151 | #define RT298_POWER_CTRL3 0x0f
152 | #define RT298_MIC1_DET_CTRL 0x19
153 | #define RT298_MISC_CTRL1 0x20
154 | #define RT298_IRQ_CTRL 0x33
155 | #define RT298_WIND_FILTER_CTRL 0x46
156 | #define RT298_PLL_CTRL1 0x49
157 | #define RT298_VAD_CTRL 0x4e
158 | #define RT298_CBJ_CTRL1 0x4f
159 | #define RT298_CBJ_CTRL2 0x50
160 | #define RT298_PLL_CTRL 0x63
161 | #define RT298_DEPOP_CTRL1 0x66
162 | #define RT298_DEPOP_CTRL2 0x67
163 | #define RT298_DEPOP_CTRL3 0x68
164 | #define RT298_DEPOP_CTRL4 0x69
165 | #define RT298_IRQ_FLAG_CTRL 0x7c
166 |
167 | /* SPDIF (0x06) */
168 | #define RT298_SPDIF_SEL_SFT 0
169 | #define RT298_SPDIF_SEL_PCM0 0
170 | #define RT298_SPDIF_SEL_PCM1 1
171 | #define RT298_SPDIF_SEL_SPOUT 2
172 | #define RT298_SPDIF_SEL_PP 3
173 |
174 | /* RECMIX (0x0b) */
175 | #define RT298_M_REC_BEEP_SFT 0
176 | #define RT298_M_REC_LINE1_SFT 1
177 | #define RT298_M_REC_MIC1_SFT 2
178 | #define RT298_M_REC_I2S_SFT 3
179 |
180 | /* Front (0x0c) */
181 | #define RT298_M_FRONT_DAC_SFT 0
182 | #define RT298_M_FRONT_REC_SFT 1
183 |
184 | /* SPK-OUT (0x14) */
185 | #define RT298_M_SPK_MUX_SFT 14
186 | #define RT298_SPK_SEL_MASK 0x1
187 | #define RT298_SPK_SEL_SFT 0
188 | #define RT298_SPK_SEL_F 0
189 | #define RT298_SPK_SEL_S 1
190 |
191 | /* HP-OUT (0x21) */
192 | #define RT298_M_HP_MUX_SFT 14
193 | #define RT298_HP_SEL_MASK 0x1
194 | #define RT298_HP_SEL_SFT 0
195 | #define RT298_HP_SEL_F 0
196 | #define RT298_HP_SEL_S 1
197 |
198 | /* ADC (0x22) (0x23) */
199 | #define RT298_ADC_SEL_MASK 0x7
200 | #define RT298_ADC_SEL_SFT 0
201 | #define RT298_ADC_SEL_SURR 0
202 | #define RT298_ADC_SEL_FRONT 1
203 | #define RT298_ADC_SEL_DMIC 2
204 | #define RT298_ADC_SEL_BEEP 4
205 | #define RT298_ADC_SEL_LINE1 5
206 | #define RT298_ADC_SEL_I2S 6
207 | #define RT298_ADC_SEL_MIC1 7
208 |
209 | #define RT298_SCLK_S_MCLK 0
210 | #define RT298_SCLK_S_PLL 1
211 |
212 | enum {
213 | RT298_AIF1,
214 | RT298_AIF2,
215 | RT298_AIFS,
216 | };
217 |
218 | #endif /* __RT298_H__ */
219 |
220 |
--------------------------------------------------------------------------------
/VerbStub_Source/VerbStub/VerbStub.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Released under "The GNU General Public License (GPL-2.0)"
3 | *
4 | * This program is free software; you can redistribute it and/or modify it
5 | * under the terms of the GNU General Public License as published by the
6 | * Free Software Foundation; either version 2 of the License, or (at your
7 | * option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 | * for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License along
15 | * with this program; if not, write to the Free Software Foundation, Inc.,
16 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 | *
18 | */
19 |
20 | //
21 | // Adapted from CodecCommander:
22 | // https://github.com/Dolnor/EAPD-Codec-Commander
23 | //
24 | // Apple Driver Documentation
25 | //
26 | // Writing a kernel extension:
27 | // https://developer.apple.com/library/content/documentation/Darwin/Conceptual/KEXTConcept/KEXTConceptIOKit/iokit_tutorial.html
28 | // IOKit Fundamentals:
29 | // https://developer.apple.com/library/content/documentation/DeviceDrivers/Conceptual/IOKitFundamentals/Introduction/Introduction.html
30 | // Writing an IOKit driver:
31 | // https://developer.apple.com/library/content/documentation/DeviceDrivers/Conceptual/WritingDeviceDriver/Introduction/Intro.html
32 | // Accessing Hardware:
33 | // https://developer.apple.com/library/content/documentation/DeviceDrivers/Conceptual/AccessingHardware/AH_Intro/AH_Intro.html
34 | // User Client Info (sample user client driver interface):
35 | // https://developer.apple.com/library/content/samplecode/SimpleUserClient/Listings/User_Client_Info_txt.html
36 | //
37 |
38 | #include
39 | #include "VerbStub.hpp"
40 |
41 | //*********************************************************************
42 | // VerbStub Main Kernel Driver:
43 | //*********************************************************************
44 |
45 | // This required macro defines the class's constructors, destructors,
46 | // and several other methods I/O Kit requires.
47 | OSDefineMetaClassAndStructors(com_XPS_VerbStub, IOService)
48 |
49 | // Define the driver's superclass.
50 | #define super IOService
51 |
52 | //
53 | // IOKit driver init override (for logging)
54 | //
55 |
56 | bool com_XPS_VerbStub::init(OSDictionary *dict)
57 | {
58 | bool result = super::init(dict);
59 | IOLog("Initializing...\n");
60 | return result;
61 | }
62 |
63 | //
64 | // IOkit driver free override (for logging)
65 | //
66 |
67 | void com_XPS_VerbStub::free(void)
68 | {
69 | IOLog("Freeing...\n");
70 | super::free();
71 | }
72 |
73 | //
74 | // IOkit driver probe override (for logging)
75 | //
76 |
77 | IOService *com_XPS_VerbStub::probe(IOService *provider,
78 | SInt32 *score)
79 | {
80 | IOService *result = super::probe(provider, score);
81 | IOLog("Probing...\n");
82 | return result;
83 | }
84 |
85 | // This function only gets used by 'start' to set IORegistry properties
86 | static void setNumberProperty(IOService* service, const char* key, UInt32 value)
87 | {
88 | OSNumber* num = OSNumber::withNumber(value, 32);
89 | if (num)
90 | {
91 | service->setProperty(key, num);
92 | num->release();
93 | }
94 | }
95 |
96 | //
97 | // IOkit driver start override
98 | //
99 |
100 | bool com_XPS_VerbStub::start(IOService *provider)
101 | {
102 | bool result = super::start(provider);
103 | IOLog("Starting...\n");
104 | if (!result)
105 | {
106 | IOLog("Error starting driver.\n");
107 | return result;
108 | }
109 |
110 | // cache the provider
111 | AudioDevc = provider;
112 |
113 | HDADevice = new IntelHDA(provider, PIO);
114 | if (!HDADevice)
115 | {
116 | IOLog("Error malloc HDADevice instance.\n");
117 | stop(provider);
118 | return false;
119 | }
120 | if ((HDADevice->getCodecVendorId() & 0xFFFF0000) == 0x80860000)
121 | {
122 | IOLog("Skip initializing HDMI/DP instance.\n");
123 | stop(provider);
124 | return false;
125 | }
126 | if (!HDADevice->initialize())
127 | {
128 | IOLog("Error initializing HDADevice instance.\n");
129 | stop(provider);
130 | return false;
131 | }
132 |
133 | // Populate HDA properties in IORegistry
134 | setNumberProperty(this, kCodecVendorID, HDADevice->getCodecVendorId());
135 | setNumberProperty(this, kCodecAddress, HDADevice->getCodecAddress());
136 | setNumberProperty(this, kCodecFuncGroupType, HDADevice->getCodecGroupType());
137 | setNumberProperty(this, kCodecSubsystemID, HDADevice->getCodecSubsystemId());
138 | setNumberProperty(this, kCodecRevisionID, HDADevice->getCodecRevisionId());
139 |
140 | this->registerService(0);
141 | return result;
142 | }
143 |
144 | //
145 | // IOkit driver stop override
146 | //
147 |
148 | void com_XPS_VerbStub::stop(IOService *provider)
149 | {
150 | IOLog("Stopping...\n");
151 |
152 | // Free HDADevice
153 | delete HDADevice;
154 | HDADevice = NULL;
155 |
156 | AudioDevc = NULL;
157 |
158 | super::stop(provider);
159 | }
160 |
161 | //
162 | // Execute external command from user client
163 | //
164 |
165 | UInt32 com_XPS_VerbStub::ExternalCommand(UInt32 command)
166 | {
167 | if (HDADevice)
168 | {
169 | UInt32 response;
170 | response = HDADevice->sendCommand(command);
171 | return response;
172 | }
173 | return -1;
174 | }
175 |
176 | //*********************************************************************
177 | // VerbStub Userspace Client:
178 | //*********************************************************************
179 |
180 | //
181 | // This should match IOConnectCallScalarMethod in hda-verb.c because this
182 | // is the link to user-space.
183 | //
184 |
185 | const IOExternalMethodDispatch VerbStubUserClient::sMethods[kClientNumMethods] =
186 | {
187 | { // kClientExecuteVerb
188 | (IOExternalMethodAction)&VerbStubUserClient::executeVerb,
189 | 1, // One scalar input value
190 | 0, // No struct inputs
191 | 1, // One scalar output value
192 | 0 // No struct outputs
193 | }
194 | };
195 |
196 | // Structure of IOExternalMethodDispatch:
197 | // https://developer.apple.com/library/content/samplecode/SimpleUserClient/Listings/User_Client_Info_txt.html
198 | /*
199 | struct IOExternalMethodDispatch
200 | {
201 | IOExternalMethodAction function;
202 | uint32_t checkScalarInputCount;
203 | uint32_t checkStructureInputSize;
204 | uint32_t checkScalarOutputCount;
205 | uint32_t checkStructureOutputSize;
206 | };
207 | */
208 |
209 | /*
210 | * Define the metaclass information that is used for runtime
211 | * typechecking of IOKit objects. We're a subclass of IOUserClient.
212 | */
213 |
214 | OSDefineMetaClassAndStructors(VerbStubUserClient, IOUserClient)
215 |
216 | //
217 | // IOUserClient user-kernel boundary interface init (initWithTask)
218 | //
219 |
220 | bool VerbStubUserClient::initWithTask(task_t owningTask, void* securityID, UInt32 type, OSDictionary* properties)
221 | {
222 | IOLog("Client::initWithTask(type %u)\n", (unsigned int)type);
223 |
224 | mTask = owningTask;
225 |
226 | return IOUserClient::initWithTask(owningTask, securityID, type, properties);
227 | }
228 |
229 | //
230 | // IOUserClient user-kernel boundary interface start
231 | //
232 |
233 | bool VerbStubUserClient::start(IOService * provider)
234 | {
235 | bool result = IOUserClient::start(provider);
236 | IOLog("Client::start\n");
237 |
238 | if(!result)
239 | return(result);
240 |
241 | /*
242 | * Provider is always com_XPS_VerbStub
243 | */
244 | assert(OSDynamicCast(com_XPS_VerbStub, provider));
245 | providertarget = (com_XPS_VerbStub*) provider;
246 |
247 | mOpenCount = 1;
248 |
249 | return result;
250 | }
251 |
252 | //
253 | // IOUserClient user-kernel boundary interface client exit behavior
254 | //
255 |
256 | IOReturn VerbStubUserClient::clientClose(void)
257 | {
258 | if (!isInactive())
259 | terminate();
260 |
261 | return kIOReturnSuccess;
262 | }
263 |
264 | //
265 | // IOUserClient user-kernel boundary interface stop override
266 | //
267 |
268 | void VerbStubUserClient::stop(IOService * provider)
269 | {
270 | IOLog("Client::stop\n");
271 |
272 | IOUserClient::stop(provider);
273 | }
274 |
275 | //
276 | // IOUserClient handle external method
277 | //
278 |
279 | IOReturn VerbStubUserClient::externalMethod(uint32_t selector, IOExternalMethodArguments* arguments,
280 | IOExternalMethodDispatch* dispatch, OSObject* target, void* reference)
281 | {
282 | DebugLog("%s[%p]::%s(%d, %p, %p, %p, %p)\n", getName(), this, __FUNCTION__, selector, arguments, dispatch, target, reference);
283 |
284 | if (selector < (uint32_t)kClientNumMethods)
285 | {
286 | dispatch = (IOExternalMethodDispatch *)&sMethods[selector];
287 |
288 | if (!target)
289 | {
290 | if (selector == kClientExecuteVerb)
291 | target = providertarget;
292 | else
293 | target = this;
294 | }
295 | }
296 |
297 | return IOUserClient::externalMethod(selector, arguments, dispatch, target, reference);
298 | }
299 |
300 | IOReturn VerbStubUserClient::executeVerb(com_XPS_VerbStub* target, void* reference, IOExternalMethodArguments* arguments)
301 | {
302 | arguments->scalarOutput[0] = target->ExternalCommand((UInt32)arguments->scalarInput[0]);
303 | return kIOReturnSuccess;
304 | }
305 |
306 | //*********************************************************************
307 | // VerbStub Boot-Time Residency Component:
308 | //*********************************************************************
309 |
310 | //
311 | // Stay resident to load the kext when needed
312 | //
313 |
314 | OSDefineMetaClassAndStructors(VerbStubResidency, IOService)
315 |
316 | bool VerbStubResidency::start(IOService *provider)
317 | {
318 | // announce version
319 | extern kmod_info_t kmod_info;
320 |
321 | // place version in ioreg properties
322 | char buf[128];
323 | snprintf(buf, sizeof(buf), "%s %s", kmod_info.name, kmod_info.version);
324 | setProperty("VerbStub,Version", buf);
325 |
326 | return super::start(provider);
327 | }
328 |
--------------------------------------------------------------------------------
/ComboJack_Source/ComboJack.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 54;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | 3D086A6C21BD498700FFD44C /* PCI.m in Sources */ = {isa = PBXBuildFile; fileRef = 3D086A6A21BD498700FFD44C /* PCI.m */; };
11 | CB3D2DA81F0DFEDE00CF6EBA /* hda-verb.m in Sources */ = {isa = PBXBuildFile; fileRef = CB3D2DA71F0DFEDE00CF6EBA /* hda-verb.m */; };
12 | /* End PBXBuildFile section */
13 |
14 | /* Begin PBXFileReference section */
15 | 3D086A6A21BD498700FFD44C /* PCI.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = PCI.m; sourceTree = ""; };
16 | 3D086A6B21BD498700FFD44C /* PCI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PCI.h; sourceTree = ""; };
17 | 3D2BE1A921BD50C300FA7A55 /* Tables.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Tables.h; sourceTree = ""; };
18 | CB3D2DA71F0DFEDE00CF6EBA /* hda-verb.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "hda-verb.m"; sourceTree = ""; };
19 | CB3D58431F0A7DE000F741BA /* ComboJack */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ComboJack; sourceTree = BUILT_PRODUCTS_DIR; };
20 | CB3D58641F0A835500F741BA /* hda_hwdep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hda_hwdep.h; sourceTree = ""; };
21 | CB3D58671F0B219000F741BA /* rt298.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rt298.h; sourceTree = ""; };
22 | /* End PBXFileReference section */
23 |
24 | /* Begin PBXFrameworksBuildPhase section */
25 | CB3D58401F0A7DE000F741BA /* Frameworks */ = {
26 | isa = PBXFrameworksBuildPhase;
27 | buildActionMask = 2147483647;
28 | files = (
29 | );
30 | runOnlyForDeploymentPostprocessing = 0;
31 | };
32 | /* End PBXFrameworksBuildPhase section */
33 |
34 | /* Begin PBXGroup section */
35 | CB3D583A1F0A7DE000F741BA = {
36 | isa = PBXGroup;
37 | children = (
38 | CB3D58451F0A7DE000F741BA /* ComboJack */,
39 | CB3D58441F0A7DE000F741BA /* Products */,
40 | );
41 | sourceTree = "";
42 | };
43 | CB3D58441F0A7DE000F741BA /* Products */ = {
44 | isa = PBXGroup;
45 | children = (
46 | CB3D58431F0A7DE000F741BA /* ComboJack */,
47 | );
48 | name = Products;
49 | sourceTree = "";
50 | };
51 | CB3D58451F0A7DE000F741BA /* ComboJack */ = {
52 | isa = PBXGroup;
53 | children = (
54 | 3D2BE1A921BD50C300FA7A55 /* Tables.h */,
55 | 3D086A6B21BD498700FFD44C /* PCI.h */,
56 | 3D086A6A21BD498700FFD44C /* PCI.m */,
57 | CB3D2DA71F0DFEDE00CF6EBA /* hda-verb.m */,
58 | CB3D58671F0B219000F741BA /* rt298.h */,
59 | CB3D58641F0A835500F741BA /* hda_hwdep.h */,
60 | );
61 | name = ComboJack;
62 | path = "Combo Jack";
63 | sourceTree = "";
64 | };
65 | /* End PBXGroup section */
66 |
67 | /* Begin PBXNativeTarget section */
68 | CB3D58421F0A7DE000F741BA /* ComboJack */ = {
69 | isa = PBXNativeTarget;
70 | buildConfigurationList = CB3D584A1F0A7DE000F741BA /* Build configuration list for PBXNativeTarget "ComboJack" */;
71 | buildPhases = (
72 | CB3D583F1F0A7DE000F741BA /* Sources */,
73 | CB3D58401F0A7DE000F741BA /* Frameworks */,
74 | 3DF6155621AAD40A0057F150 /* ShellScript */,
75 | );
76 | buildRules = (
77 | );
78 | dependencies = (
79 | );
80 | name = ComboJack;
81 | productName = "Combo Jack";
82 | productReference = CB3D58431F0A7DE000F741BA /* ComboJack */;
83 | productType = "com.apple.product-type.tool";
84 | };
85 | /* End PBXNativeTarget section */
86 |
87 | /* Begin PBXProject section */
88 | CB3D583B1F0A7DE000F741BA /* Project object */ = {
89 | isa = PBXProject;
90 | attributes = {
91 | LastUpgradeCheck = 1200;
92 | ORGANIZATIONNAME = VerbStub;
93 | TargetAttributes = {
94 | CB3D58421F0A7DE000F741BA = {
95 | CreatedOnToolsVersion = 8.3.3;
96 | ProvisioningStyle = Automatic;
97 | };
98 | };
99 | };
100 | buildConfigurationList = CB3D583E1F0A7DE000F741BA /* Build configuration list for PBXProject "ComboJack" */;
101 | compatibilityVersion = "Xcode 12.0";
102 | developmentRegion = en;
103 | hasScannedForEncodings = 0;
104 | knownRegions = (
105 | en,
106 | Base,
107 | );
108 | mainGroup = CB3D583A1F0A7DE000F741BA;
109 | productRefGroup = CB3D58441F0A7DE000F741BA /* Products */;
110 | projectDirPath = "";
111 | projectRoot = "";
112 | targets = (
113 | CB3D58421F0A7DE000F741BA /* ComboJack */,
114 | );
115 | };
116 | /* End PBXProject section */
117 |
118 | /* Begin PBXShellScriptBuildPhase section */
119 | 3DF6155621AAD40A0057F150 /* ShellScript */ = {
120 | isa = PBXShellScriptBuildPhase;
121 | buildActionMask = 2147483647;
122 | files = (
123 | );
124 | inputFileListPaths = (
125 | );
126 | inputPaths = (
127 | );
128 | outputFileListPaths = (
129 | );
130 | outputPaths = (
131 | );
132 | runOnlyForDeploymentPostprocessing = 0;
133 | shellPath = /bin/sh;
134 | shellScript = "# Type a script or drag a script file from your workspace to insert its path.\n#cd \"${TARGET_BUILD_DIR}\"\n#cp -f ComboJack ../../../ComboJack_Installer/\n";
135 | };
136 | /* End PBXShellScriptBuildPhase section */
137 |
138 | /* Begin PBXSourcesBuildPhase section */
139 | CB3D583F1F0A7DE000F741BA /* Sources */ = {
140 | isa = PBXSourcesBuildPhase;
141 | buildActionMask = 2147483647;
142 | files = (
143 | 3D086A6C21BD498700FFD44C /* PCI.m in Sources */,
144 | CB3D2DA81F0DFEDE00CF6EBA /* hda-verb.m in Sources */,
145 | );
146 | runOnlyForDeploymentPostprocessing = 0;
147 | };
148 | /* End PBXSourcesBuildPhase section */
149 |
150 | /* Begin XCBuildConfiguration section */
151 | CB3D58481F0A7DE000F741BA /* Debug */ = {
152 | isa = XCBuildConfiguration;
153 | buildSettings = {
154 | ALWAYS_SEARCH_USER_PATHS = NO;
155 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
156 | CLANG_ANALYZER_NONNULL = YES;
157 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
158 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
159 | CLANG_CXX_LIBRARY = "libc++";
160 | CLANG_ENABLE_MODULES = YES;
161 | CLANG_ENABLE_OBJC_ARC = YES;
162 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
163 | CLANG_WARN_BOOL_CONVERSION = YES;
164 | CLANG_WARN_COMMA = YES;
165 | CLANG_WARN_CONSTANT_CONVERSION = YES;
166 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
167 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
168 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
169 | CLANG_WARN_EMPTY_BODY = YES;
170 | CLANG_WARN_ENUM_CONVERSION = YES;
171 | CLANG_WARN_INFINITE_RECURSION = YES;
172 | CLANG_WARN_INT_CONVERSION = YES;
173 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
174 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
175 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
176 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
177 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
178 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
179 | CLANG_WARN_STRICT_PROTOTYPES = YES;
180 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
181 | CLANG_WARN_UNREACHABLE_CODE = YES;
182 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
183 | CODE_SIGN_IDENTITY = "-";
184 | COPY_PHASE_STRIP = NO;
185 | DEBUG_INFORMATION_FORMAT = dwarf;
186 | ENABLE_STRICT_OBJC_MSGSEND = YES;
187 | ENABLE_TESTABILITY = NO;
188 | GCC_C_LANGUAGE_STANDARD = gnu99;
189 | GCC_DYNAMIC_NO_PIC = NO;
190 | GCC_NO_COMMON_BLOCKS = YES;
191 | GCC_OPTIMIZATION_LEVEL = 0;
192 | GCC_PREPROCESSOR_DEFINITIONS = (
193 | "DEBUG=1",
194 | "$(inherited)",
195 | );
196 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
197 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
198 | GCC_WARN_UNDECLARED_SELECTOR = YES;
199 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
200 | GCC_WARN_UNUSED_FUNCTION = YES;
201 | GCC_WARN_UNUSED_VARIABLE = YES;
202 | MACOSX_DEPLOYMENT_TARGET = 10.15;
203 | MTL_ENABLE_DEBUG_INFO = YES;
204 | ONLY_ACTIVE_ARCH = NO;
205 | SDKROOT = macosx;
206 | };
207 | name = Debug;
208 | };
209 | CB3D58491F0A7DE000F741BA /* Release */ = {
210 | isa = XCBuildConfiguration;
211 | buildSettings = {
212 | ALWAYS_SEARCH_USER_PATHS = NO;
213 | CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES;
214 | CLANG_ANALYZER_NONNULL = YES;
215 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
216 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
217 | CLANG_CXX_LIBRARY = "libc++";
218 | CLANG_ENABLE_MODULES = YES;
219 | CLANG_ENABLE_OBJC_ARC = YES;
220 | CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES;
221 | CLANG_WARN_BOOL_CONVERSION = YES;
222 | CLANG_WARN_COMMA = YES;
223 | CLANG_WARN_CONSTANT_CONVERSION = YES;
224 | CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES;
225 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
226 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
227 | CLANG_WARN_EMPTY_BODY = YES;
228 | CLANG_WARN_ENUM_CONVERSION = YES;
229 | CLANG_WARN_INFINITE_RECURSION = YES;
230 | CLANG_WARN_INT_CONVERSION = YES;
231 | CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES;
232 | CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES;
233 | CLANG_WARN_OBJC_LITERAL_CONVERSION = YES;
234 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
235 | CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;
236 | CLANG_WARN_RANGE_LOOP_ANALYSIS = YES;
237 | CLANG_WARN_STRICT_PROTOTYPES = YES;
238 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
239 | CLANG_WARN_UNREACHABLE_CODE = YES;
240 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
241 | CODE_SIGN_IDENTITY = "-";
242 | COPY_PHASE_STRIP = NO;
243 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
244 | ENABLE_NS_ASSERTIONS = NO;
245 | ENABLE_STRICT_OBJC_MSGSEND = YES;
246 | ENABLE_TESTABILITY = YES;
247 | GCC_C_LANGUAGE_STANDARD = gnu99;
248 | GCC_NO_COMMON_BLOCKS = YES;
249 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
250 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
251 | GCC_WARN_UNDECLARED_SELECTOR = YES;
252 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
253 | GCC_WARN_UNUSED_FUNCTION = YES;
254 | GCC_WARN_UNUSED_VARIABLE = YES;
255 | MACOSX_DEPLOYMENT_TARGET = 10.15;
256 | MTL_ENABLE_DEBUG_INFO = NO;
257 | ONLY_ACTIVE_ARCH = YES;
258 | SDKROOT = macosx;
259 | };
260 | name = Release;
261 | };
262 | CB3D584B1F0A7DE000F741BA /* Debug */ = {
263 | isa = XCBuildConfiguration;
264 | buildSettings = {
265 | CODE_SIGN_IDENTITY = "-";
266 | PRODUCT_NAME = "$(TARGET_NAME)";
267 | };
268 | name = Debug;
269 | };
270 | CB3D584C1F0A7DE000F741BA /* Release */ = {
271 | isa = XCBuildConfiguration;
272 | buildSettings = {
273 | CODE_SIGN_IDENTITY = "-";
274 | PRODUCT_NAME = "$(TARGET_NAME)";
275 | };
276 | name = Release;
277 | };
278 | /* End XCBuildConfiguration section */
279 |
280 | /* Begin XCConfigurationList section */
281 | CB3D583E1F0A7DE000F741BA /* Build configuration list for PBXProject "ComboJack" */ = {
282 | isa = XCConfigurationList;
283 | buildConfigurations = (
284 | CB3D58481F0A7DE000F741BA /* Debug */,
285 | CB3D58491F0A7DE000F741BA /* Release */,
286 | );
287 | defaultConfigurationIsVisible = 0;
288 | defaultConfigurationName = Release;
289 | };
290 | CB3D584A1F0A7DE000F741BA /* Build configuration list for PBXNativeTarget "ComboJack" */ = {
291 | isa = XCConfigurationList;
292 | buildConfigurations = (
293 | CB3D584B1F0A7DE000F741BA /* Debug */,
294 | CB3D584C1F0A7DE000F741BA /* Release */,
295 | );
296 | defaultConfigurationIsVisible = 0;
297 | defaultConfigurationName = Release;
298 | };
299 | /* End XCConfigurationList section */
300 | };
301 | rootObject = CB3D583B1F0A7DE000F741BA /* Project object */;
302 | }
303 |
--------------------------------------------------------------------------------
/VerbStub_Source/VerbStub/IntelHDA.h:
--------------------------------------------------------------------------------
1 | /*
2 | * Released under "The GNU General Public License (GPL-2.0)"
3 | *
4 | * This program is free software; you can redistribute it and/or modify it
5 | * under the terms of the GNU General Public License as published by the
6 | * Free Software Foundation; either version 2 of the License, or (at your
7 | * option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 | * for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License along
15 | * with this program; if not, write to the Free Software Foundation, Inc.,
16 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 | *
18 | */
19 |
20 | //
21 | // Adapted from CodecCommander:
22 | // https://github.com/Dolnor/EAPD-Codec-Commander
23 | //
24 |
25 | #ifndef CodecCommander_IntelHDA_h
26 | #define CodecCommander_IntelHDA_h
27 |
28 | #include
29 |
30 | #ifdef DEBUG
31 | # define DebugLog(args...) do { IOLog("VerbStub: " args); } while (0)
32 | #else
33 | # define DebugLog(args...)
34 | #endif
35 |
36 | #define AlwaysLog(args...) do { IOLog("VerbStub: " args); } while (0)
37 |
38 | #define kCodecProfile "Codec Profile"
39 | #define kCodecVendorID "IOHDACodecVendorID"
40 | #define kCodecAddress "IOHDACodecAddress"
41 | #define kCodecRevisionID "IOHDACodecRevisionID"
42 | #define kCodecFuncGroupType "IOHDACodecFunctionGroupType"
43 | #define kCodecSubsystemID "IOHDACodecFunctionSubsystemID"
44 |
45 | // Intel HDA Verbs
46 | #define HDA_VERB_GET_PARAM (UInt16)0xF00 // Get Parameter
47 | #define HDA_VERB_SET_PSTATE (UInt16)0x705 // Set Power State
48 | #define HDA_VERB_GET_PSTATE (UInt16)0xF05 // Get Power State
49 | #define HDA_VERB_EAPDBTL_GET (UInt16)0xF0C // EAPD/BTL Enable Get
50 | #define HDA_VERB_EAPDBTL_SET (UInt16)0x70C // EAPD/BTL Enable Set
51 | #define HDA_VERB_RESET (UInt16)0x7FF // Function Reset Execute
52 | #define HDA_VERB_GET_SUBSYSTEM_ID (UInt16)0xF20 // Get codec subsystem ID
53 |
54 | #define HDA_VERB_SET_AMP_GAIN (UInt8)0x3 // Set Amp Gain / Mute
55 | #define HDA_VERB_GET_AMP_GAIN (Uint8)0xB // Get Amp Gain / Mute
56 |
57 | #define HDA_PARM_NULL (UInt8)0x00 // Empty or NULL payload
58 |
59 | #define HDA_PARM_VENDOR (UInt8)0x00 // Vendor ID
60 | #define HDA_PARM_REVISION (UInt8)0x02 // Revision ID
61 | #define HDA_PARM_NODECOUNT (UInt8)0x04 // Subordinate Node Count
62 | #define HDA_PARM_FUNCGRP (UInt8)0x05 // Function Group Type
63 | #define HDA_PARM_PINCAP (UInt8)0x0C // Pin Capabilities
64 | #define HDA_PARM_PWRSTS (UInt8)0x0F // Supported Power States
65 |
66 | #define HDA_PARM_PS_D0 (UInt8)0x00 // Powerstate D0: Fully on
67 | #define HDA_PARM_PS_D1 (UInt8)0x01 // Powerstate D1
68 | #define HDA_PARM_PS_D2 (UInt8)0x02 // Powerstate D2
69 | #define HDA_PARM_PS_D3_HOT (UInt8)0x03 // Powerstate D3Hot
70 | #define HDA_PARM_PS_D3_COLD (UInt8)0x04 // Powerstate D3Cold
71 |
72 | #define HDA_TYPE_AFG 1 // return from PARM_FUNCGRP is 1 for Audio
73 |
74 | // Dynamic payload parameters
75 | #define HDA_PARM_AMP_GAIN_GET(Index, Left, Output) \
76 | (UInt16)((Output & 0x1) << 15 | (Left & 0x01) << 13 | Index & 0xF) // Get Amp gain / mute
77 |
78 | #define HDA_PARM_AMP_GAIN_SET(Gain, Mute, Index, SetRight, SetLeft, SetInput, SetOutput) \
79 | (UInt16)((SetOutput & 0x01) << 15 | (SetInput & 0x01) << 14 | (SetLeft & 0x01) << 13 | (SetRight & 0x01) << 12 | \
80 | (Index & 0xF) << 8 | (Mute & 0x1) << 7 | Gain & 0x7F) // Set Amp gain / mute
81 |
82 | // Determine Immediate Command Busy (ICB) of Immediate Command Status (ICS)
83 | #define HDA_ICS_IS_BUSY(status) ((status) & (1<<0))
84 |
85 | // Determine Immediate Result Valid (IRV) of Immediate Command Status (ICS)
86 | #define HDA_ICS_IS_VALID(status) ((status) & (1<<1))
87 |
88 | // Determine if this Pin widget capabilities is marked EAPD capable
89 | #define HDA_PINCAP_IS_EAPD_CAPABLE(capabilities) ((capabilities) & (1<<16))
90 |
91 | typedef struct __attribute__((packed))
92 | {
93 | // 00h: GCAP – Global Capabilities
94 | volatile UInt16 GCAP_OSS : 4; // Number of Output Streams Supported
95 | volatile UInt16 GCAP_ISS : 4; // Number of Input Streams Supported
96 | volatile UInt16 GCAP_BSS : 5; // Number of Bidirectional Streams Supported
97 | volatile UInt16 GCAP_NSDO : 2; // Number of Serial Data Out Signals
98 | volatile UInt16 GCAP_64OK : 1; // 64 Bit Address Supported
99 | // 02h: VMIN – Minor Version
100 | volatile UInt8 VMIN; // Minor Version
101 | // 03h: VMAJ – Major Version
102 | volatile UInt8 VMAJ; // Major Version
103 | // 04h: OUTPAY – Output Payload Capability
104 | volatile UInt16 OUTPAY; // Output Payload Capability
105 | // 06h: INPAY – Input Payload Capability
106 | volatile UInt16 INPAY; // Input Payload Capability
107 | // 08h: GCTL – Global Control
108 | UInt32 : 23; // Reserved
109 | volatile UInt32 GCTL_UNSOL : 1; // Accept Unsolicited Response Enable
110 | UInt32 : 6; // Reserved
111 | volatile UInt32 GCTL_FCNTRL : 1; // Flush Control
112 | volatile UInt32 GCTL_CRST : 1; // Controller Reset
113 | // 0Ch: WAKEEN – Wake Enable
114 | UInt16 : 1; // Reserved
115 | volatile UInt16 WAKEEN_SDIWEN : 15; // SDIN Wake Enable Flags
116 | // 0Eh: STATESTS – State Change Status
117 | UInt16 : 1; // Reserved
118 | volatile UInt16 STATESTS_SDIWAKE: 15; // SDIN State Change Status Flags
119 | // 10h: GSTS – Global Status
120 | UInt16 : 14; // Reserved
121 | volatile UInt16 GSTS_FSTS : 1; // Flush Status
122 | UInt16 : 1; // Reserved
123 |
124 | UInt32 : 32; // Spacer
125 | UInt16 : 16; // Spacer
126 |
127 | // 18h: OUTSTRMPAY – Output Stream Payload Capability
128 | volatile UInt16 OUTSTRMPAY; // Output Stream Payload Capability
129 | // 1Ah: INSTRMPAY – Input Stream Payload Capability
130 | volatile UInt16 INSTRMPAY; // Input Stream Payload Capability
131 |
132 | UInt32 : 32; // Spacer
133 |
134 | // 20h: INTCTL – Interrupt Control
135 | volatile UInt32 INTCTL_GIE : 1; // Global Interrupt Enable
136 | volatile UInt32 INTCTL_CIE : 1; // Controller Interrupt Enable
137 | volatile UInt32 INTCTL_SIE : 30; // Stream Interrupt Enable
138 | // 24h: INTSTS – Interrupt Status
139 | volatile UInt32 INTSTS_GIS : 1; // Global Interrupt Status
140 | volatile UInt32 INTSTS_CIS : 1; // Controller Interrupt Status
141 | volatile UInt32 INTSTS_SIS : 30; // Stream Interrupt Status
142 |
143 | UInt32 : 32; // Spacer
144 | UInt32 : 32; // Spacer
145 |
146 | // 30h: Wall Clock Counter
147 | volatile UInt32 WALL_CLOCK_COUNTER; // Wall Clock Counter
148 | UInt32 : 32; // Spacer
149 | // 38h: SSYNC – Stream Synchronization
150 | UInt32 : 2; // Reserved
151 | volatile UInt32 SSYNC : 30; // Stream Synchronization Bits
152 |
153 | UInt32 : 32; // Spacer
154 |
155 | // 40h: CORB Lower Base Address
156 | volatile UInt32 CORBLBASE; // CORB Lower Base Address
157 | // 44h: CORB Upper Base Address
158 | volatile UInt32 CORBUBASE; // CORB Upper Base Address
159 | // 48h: CORBWP – CORB Write Pointer
160 | UInt16 : 8; // Reserved
161 | volatile UInt16 CORBWP : 8; // CORB Write Pointer
162 | // 4Ah: CORBRP – CORB Read Pointer
163 | volatile UInt16 CORBRPRST : 1; // CORB Read Pointer Reset
164 | UInt16 : 7; // Reserved
165 | volatile UInt16 CORBRP : 8; // CORB Read Pointer
166 | // 4Ch: CORBCTL – CORB Control
167 | UInt8 : 6; // Reserved
168 | volatile UInt8 CORBRUN : 1; // Enable CORB DMA Engine
169 | volatile UInt8 CMEIE : 1; // CORB Memory Error Interrupt Enable
170 | // 4Dh: CORBSTS – CORB Status
171 | UInt8 : 7; // Reserved
172 | volatile UInt8 CMEI : 1; // CORB Memory Error Indication
173 | // 4Eh: CORBSIZE – CORB Size
174 | volatile UInt8 CORBSZCAP : 4; // CORB Size Capability
175 | UInt8 : 2; // Reserved
176 | volatile UInt8 CORBSIZE : 2; // CORB Size
177 |
178 | UInt8 : 8; // Spacer
179 |
180 | // 50h: RIRBLBASE – RIRB Lower Base Address
181 | volatile UInt32 RIRBLBASE; // RIRB Lower Base Address
182 | // 54h: RIRBUBASE – RIRB Upper Base Address
183 | volatile UInt32 RIRBUBASE; // RIRB Upper Base Address
184 | // 58h: RIRBWP – RIRB Write Pointer
185 | volatile UInt16 RIRBWPRST : 1; // RIRB Write Pointer Reset
186 | UInt16 : 7; // Reserved
187 | volatile UInt16 RIRBWP : 8; // RIRB Write Pointer
188 | // 5Ah: RINTCNT – Response Interrupt Count
189 | UInt16 : 8;
190 | volatile UInt16 RINTCNT : 8; // N Response Interrupt Count
191 | // 5Ch: RIRBCTL – RIRB Control
192 | UInt8 : 5; // Reserved
193 | volatile UInt8 RINTCNT_RIRBOIC : 1; // Response Overrun Interrupt Control
194 | volatile UInt8 RINTCNT_RIRBDMAEN: 1; // RIRB DMA Enable
195 | volatile UInt8 RINTCNT_RINTCTL : 1; // Response Interrupt Control
196 | // 5Dh: RIRBSTS – RIRB Status
197 | UInt8 : 5; // Reserved
198 | volatile UInt8 RIRBSTS_RIRBOIS : 1; // Response Overrun Interrupt Status
199 | UInt8 : 1; // Reserved
200 | volatile UInt8 RIRBSTS_RINTFL : 1; // Response Interrupt
201 | // 5Eh: RIRBSIZE – RIRB Size
202 | volatile UInt8 RIRBSIZE_RIRBSZCAP: 4; // RIRB Size Capability
203 | UInt8 : 2; // Reserved
204 | volatile UInt8 RIRBSIZE : 2; // RIRB Size
205 |
206 | UInt8 : 8; // Spacer
207 |
208 | // 60h: Immediate Command Output Interface
209 | volatile UInt32 ICW; // Immediate Command Write
210 | // 64h: Immediate Response Input Interface
211 | volatile UInt32 IRR; // Immediate Response Read
212 | // 68h: Immediate Command Status
213 | union
214 | {
215 | volatile UInt16 ICS; // Immediate Command Status
216 | UInt16 : 8; // Reserved
217 | volatile UInt16 ICS_IRRADD : 4; // Immediate Response Result Address
218 | volatile UInt16 ICS_IRRUNSOL : 1; // Immediate Response Result Unsolicited
219 | volatile UInt16 ICS_ICV : 1; // Immediate Command Version
220 | volatile UInt16 ICS_IRV : 1; // Immediate Result Valid
221 | volatile UInt16 ICS_ICB : 1; // Immediate Command Busy
222 | };
223 |
224 | UInt32 : 32; // Spacer
225 | UInt16 : 16; // Spacer
226 |
227 | // 70h: DPLBASE – DMA Position Lower Base Address
228 | volatile UInt32 DPLBASE_ADDR : 25; // DMA Position Lower Base Address
229 | UInt32 : 6;
230 | volatile UInt32 DPLBASE_ENBL : 1; // DMA Position Buffer Enable
231 | // 74h: DPUBASE – DMA Position Upper Base Address
232 | volatile UInt32 DPUBASE; // DMA Position Upper Base Address
233 | } HDA_REG, *pHDA_REG;
234 |
235 | // Global Capabilities response
236 | struct HDA_GCAP
237 | {
238 | UInt16 NumOutputStreamsSupported : 4;
239 | UInt16 NumInputStreamsSupported : 4;
240 | UInt16 NumBidirectionalStreamsSupported : 5;
241 | UInt16 NumSerialDataOutSignals : 2;
242 | UInt16 Supports64bits : 1;
243 | };
244 |
245 | // Global Capabilities & HDA Version response
246 | struct HDA_GCAP_EXT : HDA_GCAP
247 | {
248 | UInt8 MinorVersion;
249 | UInt8 MajorVersion;
250 | };
251 |
252 | enum HDACommandMode
253 | {
254 | PIO,
255 | DMA
256 | };
257 |
258 | class IntelHDA
259 | {
260 | IOPCIDevice* mDevice = NULL;
261 | IODeviceMemory* mDeviceMemory = NULL;
262 | IOMemoryMap* mMemoryMap = NULL;
263 |
264 | pHDA_REG mRegMap = NULL;
265 |
266 | // Initialized in constructor
267 | HDACommandMode mCommandMode;
268 | UInt32 mCodecVendorId;
269 | UInt32 mCodecSubsystemId;
270 | UInt32 mCodecRevisionId;
271 | UInt8 mCodecGroupType;
272 | UInt8 mCodecAddress;
273 |
274 | // Read-once parameters
275 | UInt32 mNodes = -1;
276 | UInt16 mAudioRoot = -1;
277 |
278 | public:
279 | // Constructor
280 | IntelHDA(IOService *provider, HDACommandMode commandMode);
281 | // Destructor
282 | ~IntelHDA();
283 |
284 | bool initialize();
285 |
286 | void applyIntelTCSEL();
287 |
288 | // 12-bit verb and 8-bit payload
289 | UInt32 sendCommand(UInt8 nodeId, UInt16 verb, UInt8 payload);
290 | // 4-bit verb and 16-bit payload
291 | UInt32 sendCommand(UInt8 nodeId, UInt8 verb, UInt16 payload);
292 |
293 | // Send a raw command (verb and payload combined)
294 | UInt32 sendCommand(UInt32 command);
295 |
296 | void resetCodec();
297 |
298 | UInt32 getCodecVendorId() { return mCodecVendorId; }
299 | UInt8 getCodecAddress() { return mCodecAddress; }
300 | UInt8 getCodecGroupType() { return mCodecGroupType; }
301 | UInt32 getCodecSubsystemId() { return mCodecSubsystemId; }
302 | UInt32 getCodecRevisionId() { return mCodecRevisionId; }
303 |
304 | UInt16 getVendorId();
305 | UInt16 getDeviceId();
306 | UInt32 getPCISubId();
307 | UInt32 getSubsystemId();
308 | UInt32 getRevisionId();
309 |
310 | UInt8 getTotalNodes();
311 | UInt8 getStartingNode();
312 |
313 | private:
314 | UInt32 executePIO(UInt32 command);
315 | UInt16 getAudioRoot();
316 | };
317 |
318 | #endif
319 |
--------------------------------------------------------------------------------
/VerbStub_Source/VerbStub/IntelHDA.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * Released under "The GNU General Public License (GPL-2.0)"
3 | *
4 | * This program is free software; you can redistribute it and/or modify it
5 | * under the terms of the GNU General Public License as published by the
6 | * Free Software Foundation; either version 2 of the License, or (at your
7 | * option) any later version.
8 | *
9 | * This program is distributed in the hope that it will be useful, but
10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 | * for more details.
13 | *
14 | * You should have received a copy of the GNU General Public License along
15 | * with this program; if not, write to the Free Software Foundation, Inc.,
16 | * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 | *
18 | */
19 |
20 | //
21 | // Adapted from CodecCommander:
22 | // https://github.com/Dolnor/EAPD-Codec-Commander
23 | //
24 |
25 | #include "IntelHDA.h"
26 |
27 | #define kIntelVendorID 0x8086
28 | #define kIntelRegTCSEL 0x44
29 |
30 | static IOPCIDevice* getPCIDevice(IORegistryEntry* registryEntry)
31 | {
32 | IOPCIDevice* result = NULL;
33 | while (registryEntry)
34 | {
35 | result = OSDynamicCast(IOPCIDevice, registryEntry);
36 | if (result)
37 | break;
38 | registryEntry = registryEntry->getParentEntry(gIOServicePlane);
39 | }
40 | return result;
41 | }
42 |
43 | static UInt32 getPropertyValue(IORegistryEntry* registryEntry, const char* propertyName)
44 | {
45 | UInt32 result = -1;
46 | while (registryEntry)
47 | {
48 | if (OSNumber* value = OSDynamicCast(OSNumber, registryEntry->getProperty(propertyName)))
49 | {
50 | result = value->unsigned32BitValue();
51 | break;
52 | }
53 | registryEntry = registryEntry->getParentEntry(gIOServicePlane);
54 | }
55 | return result;
56 | }
57 |
58 | IntelHDA::IntelHDA(IOService* provider, HDACommandMode commandMode)
59 | {
60 | mCommandMode = commandMode;
61 | mDevice = getPCIDevice(provider);
62 |
63 | mCodecVendorId = getPropertyValue(provider, kCodecVendorID);
64 | mCodecGroupType = getPropertyValue(provider, kCodecFuncGroupType);
65 | mCodecAddress = getPropertyValue(provider, kCodecAddress);
66 | mCodecSubsystemId = getPropertyValue(provider, kCodecSubsystemID);
67 | mCodecRevisionId = getPropertyValue(provider, kCodecRevisionID);
68 |
69 | // defaults for VoodooHDA...
70 | if (0xFF == mCodecGroupType) mCodecGroupType = 1;
71 | if (0xFF == mCodecAddress) mCodecAddress = 0;
72 | }
73 |
74 | IntelHDA::~IntelHDA()
75 | {
76 | OSSafeReleaseNULL(mMemoryMap);
77 | }
78 |
79 | bool IntelHDA::initialize()
80 | {
81 | DebugLog("IntelHDA::initialize\n");
82 |
83 | if (mDevice == NULL)
84 | {
85 | AlwaysLog("mDevice is NULL in IntelHDA::initialize\n");
86 | return false;
87 | }
88 | if (mDevice->getDeviceMemoryCount() == 0)
89 | {
90 | AlwaysLog("getDeviceMemoryCount returned 0 in IntelHDA::initialize\n");
91 | return false;
92 | }
93 | if (mCodecAddress == 0xFF)
94 | {
95 | AlwaysLog("mCodecAddress is 0xFF in IntelHDA::initialize\n");
96 | return false;
97 | }
98 | if (mCodecGroupType != HDA_TYPE_AFG)
99 | {
100 | DebugLog("mCodecGroupType is %d (must be 1) in IntelHDA::initialize\n", mCodecGroupType);
101 | return false;
102 | }
103 |
104 | mDevice->setMemoryEnable(true);
105 |
106 | mDeviceMemory = mDevice->getDeviceMemoryWithIndex(0);
107 |
108 | if (mDeviceMemory == NULL)
109 | {
110 | AlwaysLog("Failed to access device memory.\n");
111 | return false;
112 | }
113 |
114 | DebugLog("Device memory @ 0x%08llx, size 0x%08llx\n", mDeviceMemory->getPhysicalAddress(), mDeviceMemory->getLength());
115 |
116 | mMemoryMap = mDeviceMemory->map();
117 |
118 | if (mMemoryMap == NULL)
119 | {
120 | AlwaysLog("Failed to map device memory.\n");
121 | return false;
122 | }
123 |
124 | DebugLog("Memory mapped at @ 0x%08llx\n", mMemoryMap->getVirtualAddress());
125 |
126 | mRegMap = (pHDA_REG)mMemoryMap->getVirtualAddress();
127 |
128 | char devicePath[1024];
129 | int pathLen = sizeof(devicePath);
130 | bzero(devicePath, sizeof(devicePath));
131 |
132 | uint32_t deviceInfo = mDevice->configRead32(0);
133 |
134 | if (mDevice->getPath(devicePath, &pathLen, gIOServicePlane))
135 | AlwaysLog("Evaluating device \"%s\" [%04x:%04x].\n",
136 | devicePath,
137 | deviceInfo & 0xFFFF,
138 | deviceInfo >> 16);
139 |
140 | // Note: Must reset the codec here for getVendorId to work.
141 | // If the computer is restarted when the codec is in fugue state (D3cold),
142 | // it will not respond without the Double Function Group Reset.
143 | if (mCodecVendorId == -1 && this->getVendorId() == 0xFFFF)
144 | this->resetCodec();
145 |
146 | if (mRegMap->VMAJ == 1 && mRegMap->VMIN == 0 && this->getVendorId() != 0xFFFF)
147 | {
148 | UInt16 vendor = this->getVendorId();
149 | UInt16 device = this->getDeviceId();
150 | UInt32 subsystem = this->getSubsystemId();
151 | UInt32 revision = this->getRevisionId();
152 |
153 | if (mCodecVendorId == (UInt32)-1)
154 | mCodecVendorId = (UInt32)vendor << 16 | device;
155 |
156 | // avoid logging HDMI audio (except in DEBUG build) as it is disabled anyway
157 | #ifndef DEBUG
158 | if (vendor != 0x8086)
159 | #endif
160 | {
161 | AlwaysLog("....Codec Vendor ID: 0x%08x\n", mCodecVendorId);
162 | AlwaysLog("....Codec Address: %d\n", mCodecAddress);
163 | AlwaysLog("....Subsystem ID: 0x%08x\n", subsystem);
164 | AlwaysLog("....Revision ID: 0x%08x\n", revision);
165 | AlwaysLog("....PCI Sub ID: 0x%08x\n", getPCISubId());
166 | DebugLog("....Output Streams: %d\n", mRegMap->GCAP_OSS);
167 | DebugLog("....Input Streams: %d\n", mRegMap->GCAP_ISS);
168 | DebugLog("....Bidi Streams: %d\n", mRegMap->GCAP_BSS);
169 | DebugLog("....Serial Data: %d\n", mRegMap->GCAP_NSDO);
170 | DebugLog("....x64 Support: %d\n", mRegMap->GCAP_64OK);
171 | DebugLog("....Codec Version: %d.%d\n", mRegMap->VMAJ, mRegMap->VMIN);
172 | DebugLog("....Vendor ID: 0x%04x\n", vendor);
173 | DebugLog("....Device ID: 0x%04x\n", device);
174 | }
175 |
176 | return true;
177 | }
178 |
179 | return false;
180 | }
181 |
182 | void IntelHDA::resetCodec()
183 | {
184 | /*
185 | Reset is created by sending two Function Group resets, potentially separated
186 | by an undefined number of idle frames, but no other valid commands.
187 | This Function Group “Double” reset shall do a full initialization and reset
188 | most settings to their power on defaults.
189 | */
190 |
191 | DebugLog("--> resetting codec\n");
192 |
193 | UInt16 audioRoot = getAudioRoot();
194 | this->sendCommand(audioRoot, HDA_VERB_RESET, HDA_PARM_NULL);
195 | IOSleep(1);
196 | this->sendCommand(audioRoot, HDA_VERB_RESET, HDA_PARM_NULL);
197 | IOSleep(220); // per-HDA spec, device must respond (D0) within 200ms
198 |
199 | // forcefully set power state to D3
200 | this->sendCommand(audioRoot, HDA_VERB_SET_PSTATE, HDA_PARM_PS_D3_HOT);
201 | DebugLog("--> hda codec power restored\n");
202 | }
203 |
204 | void IntelHDA::applyIntelTCSEL()
205 | {
206 | if (mDevice && mDevice->configRead16(kIOPCIConfigVendorID) == kIntelVendorID)
207 | {
208 | /* Clear bits 0-2 of PCI register TCSEL (at offset 0x44)
209 | * TCSEL == Traffic Class Select Register, which sets PCI express QOS
210 | * Ensuring these bits are 0 clears playback static on some HD Audio
211 | * codecs.
212 | * The PCI register TCSEL is defined in the Intel manuals.
213 | */
214 | UInt8 value = mDevice->configRead8(kIntelRegTCSEL);
215 | UInt8 newValue = value & ~0x07;
216 | if (newValue != value)
217 | {
218 | mDevice->configWrite8(kIntelRegTCSEL, newValue);
219 | DebugLog("Intel TCSEL: 0x%02x -> 0x%02x\n", value, newValue);
220 | }
221 | }
222 | }
223 |
224 | UInt16 IntelHDA::getVendorId()
225 | {
226 | if (mCodecVendorId == -1)
227 | mCodecVendorId = this->sendCommand(0, HDA_VERB_GET_PARAM, HDA_PARM_VENDOR);
228 |
229 | return mCodecVendorId >> 16;
230 | }
231 |
232 | UInt16 IntelHDA::getDeviceId()
233 | {
234 | if (mCodecVendorId == -1)
235 | mCodecVendorId = this->sendCommand(0, HDA_VERB_GET_PARAM, HDA_PARM_VENDOR);
236 |
237 | return mCodecVendorId & 0xFFFF;
238 | }
239 |
240 | UInt16 IntelHDA::getAudioRoot()
241 | {
242 | if (mAudioRoot == (UInt16)-1)
243 | {
244 | UInt32 nodes = this->sendCommand(0, HDA_VERB_GET_PARAM, HDA_PARM_NODECOUNT);
245 | if (nodes != -1)
246 | {
247 | UInt16 start = nodes & 0xFF;
248 | UInt16 end = start + ((nodes & 0xFF0000) >> 16);
249 | for (UInt16 node = start; node < end; node++)
250 | {
251 | UInt32 type = this->sendCommand(node, HDA_VERB_GET_PARAM, HDA_PARM_FUNCGRP);
252 | if ((type & 0xFF) == HDA_TYPE_AFG)
253 | {
254 | DebugLog("getAudioRoot found audio root = 0x%02x\n", node);
255 | mAudioRoot = node;
256 | break;
257 | }
258 | }
259 | }
260 | if (mAudioRoot == (UInt16)-1)
261 | {
262 | DebugLog("getAudioRoot failed to find audio root... using default root of 1\n");
263 | mAudioRoot = 1;
264 | }
265 | }
266 | return mAudioRoot;
267 | }
268 |
269 | UInt8 IntelHDA::getTotalNodes()
270 | {
271 | if (mNodes == -1)
272 | {
273 | UInt16 audioRoot = getAudioRoot();
274 | mNodes = this->sendCommand(audioRoot, HDA_VERB_GET_PARAM, HDA_PARM_NODECOUNT);
275 | // in the case of an invalid response, use zero
276 | if (mNodes == -1) mNodes = 0;
277 | }
278 | return mNodes & 0x0000FF;
279 | }
280 |
281 | UInt8 IntelHDA::getStartingNode()
282 | {
283 | if (mNodes == -1)
284 | {
285 | UInt16 audioRoot = getAudioRoot();
286 | mNodes = this->sendCommand(audioRoot, HDA_VERB_GET_PARAM, HDA_PARM_NODECOUNT);
287 | // in the case of an invalid response, use zero
288 | if (mNodes == -1) mNodes = 0;
289 | }
290 | return (mNodes & 0xFF0000) >> 16;
291 | }
292 |
293 | UInt32 IntelHDA::getSubsystemId()
294 | {
295 | if (mCodecSubsystemId == -1)
296 | {
297 | UInt16 audioRoot = getAudioRoot();
298 | mCodecSubsystemId = this->sendCommand(audioRoot, HDA_VERB_GET_SUBSYSTEM_ID, HDA_PARM_NULL);
299 | // in the case of an invalid response, use zero
300 | if (mCodecSubsystemId == -1) mCodecSubsystemId = 0;
301 | }
302 | return mCodecSubsystemId;
303 | }
304 |
305 | UInt32 IntelHDA::getPCISubId()
306 | {
307 | UInt32 result = mDevice->configRead32(kIOPCIConfigSubSystemVendorID);
308 | // flip words to be consistent with other 32-bit identifiers
309 | return ((result & 0xFFFF) << 16) | result >> 16;
310 | }
311 |
312 | UInt32 IntelHDA::getRevisionId()
313 | {
314 | if (mCodecRevisionId == -1)
315 | {
316 | UInt16 audioRoot = getAudioRoot();
317 | mCodecRevisionId = this->sendCommand(audioRoot, HDA_VERB_GET_PARAM, HDA_PARM_REVISION);
318 | // in the case of an invalid response, use zero
319 | if (mCodecRevisionId == -1) mCodecRevisionId = 0;
320 | }
321 | return mCodecRevisionId;
322 | }
323 |
324 | UInt32 IntelHDA::sendCommand(UInt8 nodeId, UInt16 verb, UInt8 payload)
325 | {
326 | DebugLog("SendCommand: node 0x%02x, verb 0x%06x, payload 0x%02x.\n", nodeId, verb, payload);
327 | return this->sendCommand((nodeId & 0xFF) << 20 | (verb & 0xFFF) << 8 | payload);
328 | }
329 |
330 | UInt32 IntelHDA::sendCommand(UInt8 nodeId, UInt8 verb, UInt16 payload)
331 | {
332 | DebugLog("SendCommand: node 0x%02x, verb 0x%02x, payload 0x%04x.\n", nodeId, verb, payload);
333 | return this->sendCommand((nodeId & 0xFF) << 20 | (verb & 0xF) << 16 | payload);
334 | }
335 |
336 | UInt32 IntelHDA::sendCommand(UInt32 command)
337 | {
338 | UInt32 fullCommand = (mCodecAddress & 0xF) << 28 | (command & 0x0FFFFFFF);
339 |
340 | if (mDeviceMemory == NULL)
341 | return -1;
342 |
343 | DebugLog("SendCommand: (w) --> 0x%08x\n", fullCommand);
344 |
345 | UInt32 response = -1;
346 |
347 | switch (mCommandMode)
348 | {
349 | case PIO:
350 | response = this->executePIO(fullCommand);
351 | break;
352 | case DMA:
353 | AlwaysLog("Unsupported command mode DMA requested.\n");
354 | response = -1;
355 | break;
356 | default:
357 | response = -1;
358 | break;
359 | }
360 |
361 | DebugLog("SendCommand: (r) <-- 0x%08x\n", response);
362 |
363 | return response;
364 | }
365 |
366 | UInt32 IntelHDA::executePIO(UInt32 command)
367 | {
368 | UInt16 status;
369 |
370 | status = 0x1; // Busy status
371 |
372 | for (int i = 0; i < 1000; i++)
373 | {
374 | status = mRegMap->ICS;
375 |
376 | if (!HDA_ICS_IS_BUSY(status))
377 | break;
378 |
379 | ::IODelay(100);
380 | }
381 |
382 | // HDA controller was not ready to receive PIO commands
383 | if (HDA_ICS_IS_BUSY(status))
384 | {
385 | DebugLog("ExecutePIO timed out waiting for ICS readiness.\n");
386 | return -1;
387 | }
388 |
389 | //DEBUG_LOG("IntelHDA::ExecutePIO ICB bit clear.\n");
390 |
391 | // Queue the verb for the HDA controller
392 | mRegMap->ICW = command;
393 |
394 | status = 0x1; // Busy status
395 | mRegMap->ICS = status;
396 |
397 | //DEBUG_LOG("IntelHDA::ExecutePIO Wrote verb and set ICB bit.\n");
398 |
399 | // Wait for HDA controller to return with a response
400 | for (int i = 0; i < 1000; i++)
401 | {
402 | status = mRegMap->ICS;
403 |
404 | if (!HDA_ICS_IS_BUSY(status))
405 | break;
406 |
407 | ::IODelay(100);
408 | }
409 |
410 | // Store the result validity while IRV is cleared
411 | bool validResult = HDA_ICS_IS_VALID(status);
412 |
413 | UInt32 response = 0xdeadbeef; //Obvious indication that something weird occurred
414 |
415 | if (validResult)
416 | response = mRegMap->IRR;
417 |
418 | // Reset IRV
419 | status = 0x02; // Valid, Non-busy status
420 | mRegMap->ICS = status;
421 |
422 | if (!validResult)
423 | {
424 | DebugLog("ExecutePIO Invalid result received.\n");
425 | return -1;
426 | }
427 |
428 | return response;
429 | }
430 |
--------------------------------------------------------------------------------
/VerbStub_Source/hda-verb/hda-verb.c:
--------------------------------------------------------------------------------
1 | /*
2 | * Accessing HD-audio verbs via hwdep interface
3 | * Version 0.3
4 | *
5 | * Copyright (c) 2008 Takashi Iwai
6 | *
7 | * Licensed under GPL v2 or later.
8 | */
9 |
10 | //
11 | // Adapted from hda-verb from alsa-tools:
12 | // https://www.alsa-project.org/main/index.php/Main_Page
13 | //
14 |
15 | #include
16 | #include
17 | #include
18 | #include
19 | #include
20 | #include
21 | #include
22 | #include
23 |
24 | typedef uint8_t u8;
25 | typedef uint16_t u16;
26 | typedef uint32_t u32;
27 | typedef uint64_t u64;
28 |
29 | #include "hda_hwdep.h"
30 |
31 | #define AC_VERB_GET_STREAM_FORMAT 0x0a00
32 | #define AC_VERB_GET_AMP_GAIN_MUTE 0x0b00
33 | #define AC_VERB_GET_PROC_COEF 0x0c00
34 | #define AC_VERB_GET_COEF_INDEX 0x0d00
35 | #define AC_VERB_PARAMETERS 0x0f00
36 | #define AC_VERB_GET_CONNECT_SEL 0x0f01
37 | #define AC_VERB_GET_CONNECT_LIST 0x0f02
38 | #define AC_VERB_GET_PROC_STATE 0x0f03
39 | #define AC_VERB_GET_SDI_SELECT 0x0f04
40 | #define AC_VERB_GET_POWER_STATE 0x0f05
41 | #define AC_VERB_GET_CONV 0x0f06
42 | #define AC_VERB_GET_PIN_WIDGET_CONTROL 0x0f07
43 | #define AC_VERB_GET_UNSOLICITED_RESPONSE 0x0f08
44 | #define AC_VERB_GET_PIN_SENSE 0x0f09
45 | #define AC_VERB_GET_BEEP_CONTROL 0x0f0a
46 | #define AC_VERB_GET_EAPD_BTLENABLE 0x0f0c
47 | #define AC_VERB_GET_DIGI_CONVERT_1 0x0f0d
48 | #define AC_VERB_GET_DIGI_CONVERT_2 0x0f0e
49 | #define AC_VERB_GET_VOLUME_KNOB_CONTROL 0x0f0f
50 | #define AC_VERB_GET_GPIO_DATA 0x0f15
51 | #define AC_VERB_GET_GPIO_MASK 0x0f16
52 | #define AC_VERB_GET_GPIO_DIRECTION 0x0f17
53 | #define AC_VERB_GET_GPIO_WAKE_MASK 0x0f18
54 | #define AC_VERB_GET_GPIO_UNSOLICITED_RSP_MASK 0x0f19
55 | #define AC_VERB_GET_GPIO_STICKY_MASK 0x0f1a
56 | #define AC_VERB_GET_CONFIG_DEFAULT 0x0f1c
57 | #define AC_VERB_GET_SUBSYSTEM_ID 0x0f20
58 |
59 | #define AC_VERB_SET_STREAM_FORMAT 0x200
60 | #define AC_VERB_SET_AMP_GAIN_MUTE 0x300
61 | #define AC_VERB_SET_PROC_COEF 0x400
62 | #define AC_VERB_SET_COEF_INDEX 0x500
63 | #define AC_VERB_SET_CONNECT_SEL 0x701
64 | #define AC_VERB_SET_PROC_STATE 0x703
65 | #define AC_VERB_SET_SDI_SELECT 0x704
66 | #define AC_VERB_SET_POWER_STATE 0x705
67 | #define AC_VERB_SET_CHANNEL_STREAMID 0x706
68 | #define AC_VERB_SET_PIN_WIDGET_CONTROL 0x707
69 | #define AC_VERB_SET_UNSOLICITED_ENABLE 0x708
70 | #define AC_VERB_SET_PIN_SENSE 0x709
71 | #define AC_VERB_SET_BEEP_CONTROL 0x70a
72 | #define AC_VERB_SET_EAPD_BTLENABLE 0x70c
73 | #define AC_VERB_SET_DIGI_CONVERT_1 0x70d
74 | #define AC_VERB_SET_DIGI_CONVERT_2 0x70e
75 | #define AC_VERB_SET_VOLUME_KNOB_CONTROL 0x70f
76 | #define AC_VERB_SET_GPIO_DATA 0x715
77 | #define AC_VERB_SET_GPIO_MASK 0x716
78 | #define AC_VERB_SET_GPIO_DIRECTION 0x717
79 | #define AC_VERB_SET_GPIO_WAKE_MASK 0x718
80 | #define AC_VERB_SET_GPIO_UNSOLICITED_RSP_MASK 0x719
81 | #define AC_VERB_SET_GPIO_STICKY_MASK 0x71a
82 | #define AC_VERB_SET_CONFIG_DEFAULT_BYTES_0 0x71c
83 | #define AC_VERB_SET_CONFIG_DEFAULT_BYTES_1 0x71d
84 | #define AC_VERB_SET_CONFIG_DEFAULT_BYTES_2 0x71e
85 | #define AC_VERB_SET_CONFIG_DEFAULT_BYTES_3 0x71f
86 | #define AC_VERB_SET_CODEC_RESET 0x7ff
87 |
88 | #define AC_PAR_VENDOR_ID 0x00
89 | #define AC_PAR_SUBSYSTEM_ID 0x01
90 | #define AC_PAR_REV_ID 0x02
91 | #define AC_PAR_NODE_COUNT 0x04
92 | #define AC_PAR_FUNCTION_TYPE 0x05
93 | #define AC_PAR_AUDIO_FG_CAP 0x08
94 | #define AC_PAR_AUDIO_WIDGET_CAP 0x09
95 | #define AC_PAR_PCM 0x0a
96 | #define AC_PAR_STREAM 0x0b
97 | #define AC_PAR_PIN_CAP 0x0c
98 | #define AC_PAR_AMP_IN_CAP 0x0d
99 | #define AC_PAR_CONNLIST_LEN 0x0e
100 | #define AC_PAR_POWER_STATE 0x0f
101 | #define AC_PAR_PROC_CAP 0x10
102 | #define AC_PAR_GPIO_CAP 0x11
103 | #define AC_PAR_AMP_OUT_CAP 0x12
104 | #define AC_PAR_VOL_KNB_CAP 0x13
105 |
106 | /*
107 | */
108 | #define VERBSTR(x) { .val = AC_VERB_##x, .str = #x }
109 | #define PARMSTR(x) { .val = AC_PAR_##x, .str = #x }
110 |
111 | struct strtbl {
112 | int val;
113 | const char *str;
114 | };
115 |
116 | static struct strtbl hda_verbs[] = {
117 | VERBSTR(GET_STREAM_FORMAT),
118 | VERBSTR(GET_AMP_GAIN_MUTE),
119 | VERBSTR(GET_PROC_COEF),
120 | VERBSTR(GET_COEF_INDEX),
121 | VERBSTR(PARAMETERS),
122 | VERBSTR(GET_CONNECT_SEL),
123 | VERBSTR(GET_CONNECT_LIST),
124 | VERBSTR(GET_PROC_STATE),
125 | VERBSTR(GET_SDI_SELECT),
126 | VERBSTR(GET_POWER_STATE),
127 | VERBSTR(GET_CONV),
128 | VERBSTR(GET_PIN_WIDGET_CONTROL),
129 | VERBSTR(GET_UNSOLICITED_RESPONSE),
130 | VERBSTR(GET_PIN_SENSE),
131 | VERBSTR(GET_BEEP_CONTROL),
132 | VERBSTR(GET_EAPD_BTLENABLE),
133 | VERBSTR(GET_DIGI_CONVERT_1),
134 | VERBSTR(GET_DIGI_CONVERT_2),
135 | VERBSTR(GET_VOLUME_KNOB_CONTROL),
136 | VERBSTR(GET_GPIO_DATA),
137 | VERBSTR(GET_GPIO_MASK),
138 | VERBSTR(GET_GPIO_DIRECTION),
139 | VERBSTR(GET_GPIO_WAKE_MASK),
140 | VERBSTR(GET_GPIO_UNSOLICITED_RSP_MASK),
141 | VERBSTR(GET_GPIO_STICKY_MASK),
142 | VERBSTR(GET_CONFIG_DEFAULT),
143 | VERBSTR(GET_SUBSYSTEM_ID),
144 |
145 | VERBSTR(SET_STREAM_FORMAT),
146 | VERBSTR(SET_AMP_GAIN_MUTE),
147 | VERBSTR(SET_PROC_COEF),
148 | VERBSTR(SET_COEF_INDEX),
149 | VERBSTR(SET_CONNECT_SEL),
150 | VERBSTR(SET_PROC_STATE),
151 | VERBSTR(SET_SDI_SELECT),
152 | VERBSTR(SET_POWER_STATE),
153 | VERBSTR(SET_CHANNEL_STREAMID),
154 | VERBSTR(SET_PIN_WIDGET_CONTROL),
155 | VERBSTR(SET_UNSOLICITED_ENABLE),
156 | VERBSTR(SET_PIN_SENSE),
157 | VERBSTR(SET_BEEP_CONTROL),
158 | VERBSTR(SET_EAPD_BTLENABLE),
159 | VERBSTR(SET_DIGI_CONVERT_1),
160 | VERBSTR(SET_DIGI_CONVERT_2),
161 | VERBSTR(SET_VOLUME_KNOB_CONTROL),
162 | VERBSTR(SET_GPIO_DATA),
163 | VERBSTR(SET_GPIO_MASK),
164 | VERBSTR(SET_GPIO_DIRECTION),
165 | VERBSTR(SET_GPIO_WAKE_MASK),
166 | VERBSTR(SET_GPIO_UNSOLICITED_RSP_MASK),
167 | VERBSTR(SET_GPIO_STICKY_MASK),
168 | VERBSTR(SET_CONFIG_DEFAULT_BYTES_0),
169 | VERBSTR(SET_CONFIG_DEFAULT_BYTES_1),
170 | VERBSTR(SET_CONFIG_DEFAULT_BYTES_2),
171 | VERBSTR(SET_CONFIG_DEFAULT_BYTES_3),
172 | VERBSTR(SET_CODEC_RESET),
173 | { }, /* end */
174 | };
175 |
176 | static struct strtbl hda_params[] = {
177 | PARMSTR(VENDOR_ID),
178 | PARMSTR(SUBSYSTEM_ID),
179 | PARMSTR(REV_ID),
180 | PARMSTR(NODE_COUNT),
181 | PARMSTR(FUNCTION_TYPE),
182 | PARMSTR(AUDIO_FG_CAP),
183 | PARMSTR(AUDIO_WIDGET_CAP),
184 | PARMSTR(PCM),
185 | PARMSTR(STREAM),
186 | PARMSTR(PIN_CAP),
187 | PARMSTR(AMP_IN_CAP),
188 | PARMSTR(CONNLIST_LEN),
189 | PARMSTR(POWER_STATE),
190 | PARMSTR(PROC_CAP),
191 | PARMSTR(GPIO_CAP),
192 | PARMSTR(AMP_OUT_CAP),
193 | PARMSTR(VOL_KNB_CAP),
194 | { }, /* end */
195 | };
196 |
197 | //
198 | // Global Variables
199 | //
200 |
201 | io_service_t VerbStubIOService;
202 | io_connect_t DataConnection;
203 | uint32_t connectiontype = 0;
204 |
205 | //
206 | // Open connection to IOService
207 | //
208 |
209 | uint32_t OpenServiceConnection()
210 | {
211 | //
212 | // Having a kernel-side server (VerbStub) and a user-side client (hda-verb) is really the only way to ensure that hda-
213 | // verb won't break when IOAudioFamily changes. This 2-component solution is necessary because we can't compile kernel
214 | // libraries into user-space programs on macOS and expect them to work generically.
215 | //
216 | // Additionally, if this program were made as a single executable that accessed device memory regions directly, it would
217 | // only be guaranteed to work for one machine on one BIOS version since memory regions change depending on hardware
218 | // configurations. This is why Raspberry Pis, STM32s, and other embedded platforms are nice to program on: They don't
219 | // change much between versions so programs can be made extremely lightweight. Linux also does a pretty good job
220 | // achieving a similar situation, since everything (devices, buses, etc.) on Linux is represented by an easily
221 | // accessible file (just look at how simple the hda-verb program in alsa-tools is! All it uses is ioctl).
222 | //
223 |
224 | CFMutableDictionaryRef dict = IOServiceMatching("com_XPS_VerbStub");
225 |
226 | // Use IOServiceGetMatchingService since we can reasonably expect "VerbStub" is the only IORegistryEntry of its kind.
227 | // Otherwise IOServiceGetMatchingServices with an iterating algorithm must be used to find the kernel extension.
228 |
229 | VerbStubIOService = IOServiceGetMatchingService(kIOMasterPortDefault, dict);
230 |
231 | // Hopefully the kernel extension loaded properly so it can be found.
232 |
233 | if (!VerbStubIOService)
234 | {
235 | fprintf(stderr, "Could not locate VerbStub kext. Ensure it is loaded; verbs cannot be sent otherwise.\n");
236 | return -1;
237 | }
238 |
239 | // Connect to the IOService object
240 | // Note: kern_return_t is just an int
241 | kern_return_t kernel_return_status = IOServiceOpen(VerbStubIOService, mach_task_self(), connectiontype, &DataConnection);
242 |
243 | if (kernel_return_status != kIOReturnSuccess)
244 | {
245 | fprintf(stderr, "Failed to open VerbStub IOService: %08x.\n", kernel_return_status);
246 | return -1;
247 | }
248 |
249 | return kernel_return_status; // 0 if successful
250 | }
251 |
252 | //
253 | // Send verb command
254 | //
255 |
256 | static uint32_t VerbCommand(uint32_t command)
257 | {
258 | //
259 | // Call the function ultimately responsible for sending commands in the kernel extension. That function will return the
260 | // response we also want.
261 | // https://lists.apple.com/archives/darwin-drivers/2008/Mar/msg00007.html
262 | //
263 |
264 | uint32_t inputCount = 1; // Number of input arguments
265 | uint32_t outputCount = 1; // Number of elements in output
266 | uint64_t input = command; // Array of input scalars
267 | uint64_t output; // Array of output scalars
268 |
269 | // IOConnectCallScalarMethod was introduced in Mac OS X 10.5
270 |
271 | kern_return_t kernel_return_status = IOConnectCallScalarMethod(DataConnection, connectiontype, &input, inputCount, &output, &outputCount);
272 |
273 | if (kernel_return_status != kIOReturnSuccess)
274 | {
275 | fprintf(stderr, "Error sending command.\n");
276 | return -1;
277 | }
278 |
279 | // Return command response
280 | return (uint32_t)output;
281 | }
282 |
283 | //
284 | // Close connection to IOService
285 | //
286 |
287 | void CloseServiceConnection()
288 | {
289 | // Done with the VerbStub IOService object, so we don't need to hold on to it anymore
290 | IOObjectRelease(VerbStubIOService);
291 | }
292 |
293 | static void list_keys(struct strtbl *tbl, int one_per_line)
294 | {
295 | int c = 0;
296 | for (; tbl->str; tbl++) {
297 | size_t len = strlen(tbl->str) + 2;
298 | if (!one_per_line && c + len >= 80) {
299 | fprintf(stderr, "\n");
300 | c = 0;
301 | }
302 | if (one_per_line)
303 | fprintf(stderr, " %s\n", tbl->str);
304 | else if (!c)
305 | fprintf(stderr, " %s", tbl->str);
306 | else
307 | fprintf(stderr, ", %s", tbl->str);
308 | c += 2 + len;
309 | }
310 | if (!one_per_line)
311 | fprintf(stderr, "\n");
312 | }
313 |
314 | /* look up a value from the given string table */
315 | static int lookup_str(struct strtbl *tbl, const char *str)
316 | {
317 | struct strtbl *p, *found;
318 | size_t len = strlen(str);
319 |
320 | found = NULL;
321 | for (p = tbl; p->str; p++) {
322 | if (!strncmp(str, p->str, len)) {
323 | if (found) {
324 | fprintf(stderr, "No unique key '%s'\n", str);
325 | return -1;
326 | }
327 | found = p;
328 | }
329 | }
330 | if (!found) {
331 | fprintf(stderr, "No key matching with '%s'\n", str);
332 | return -1;
333 | }
334 | return found->val;
335 | }
336 |
337 | /* convert a string to upper letters */
338 | static void strtoupper(char *str)
339 | {
340 | for (; *str; str++)
341 | *str = toupper(*str);
342 | }
343 |
344 | static void usage(void)
345 | {
346 | fprintf(stderr, "usage: hda-verb [option] nid verb param\n");
347 | fprintf(stderr, " -l List known verbs and parameters\n");
348 | fprintf(stderr, " -L List known verbs and parameters (one per line)\n");
349 | }
350 |
351 | static void list_verbs(int one_per_line)
352 | {
353 | fprintf(stderr, "known verbs:\n");
354 | list_keys(hda_verbs, one_per_line);
355 | fprintf(stderr, "known parameters:\n");
356 | list_keys(hda_params, one_per_line);
357 | }
358 |
359 | //
360 | // Main
361 | //
362 |
363 | int main(int argc, char **argv)
364 | {
365 | // Local variables
366 | kern_return_t ServiceConnectionStatus;
367 | int version, c, timeout;
368 | int nid, verb, param;
369 | struct hda_verb_ioctl val;
370 | char **p;
371 | int trylimit = 5;
372 |
373 | // Check for -l or -L flag
374 | while ((c = getopt(argc, argv, "lL")) >= 0) {
375 | switch (c) {
376 | case 'l':
377 | list_verbs(0);
378 | return 0;
379 | case 'L':
380 | list_verbs(1);
381 | return 0;
382 | default:
383 | usage();
384 | return 1;
385 | }
386 | }
387 |
388 | // Check for correct number of command-line arguments
389 | if (argc - optind < 3) {
390 | usage();
391 | return 1;
392 | }
393 |
394 | // Mac version of hda-verb
395 | version = 0x2710; // Darwin
396 |
397 | // If this error appears, the program was compiled incorrectly
398 | if (version < HDA_HWDEP_VERSION) {
399 | fprintf(stderr, "Invalid version number 0x%x\n", version);
400 | return 1;
401 | }
402 |
403 | p = argv + optind;
404 | nid = strtol(*p, NULL, 0); // Don't worry about the warning here. This should never be bigger than an int.
405 | if (nid < 0 || nid > 0xff) {
406 | fprintf(stderr, "invalid nid %s\n", *p);
407 | return 1;
408 | }
409 |
410 | p++;
411 | if (!isdigit(**p)) {
412 | strtoupper(*p);
413 | verb = lookup_str(hda_verbs, *p);
414 | if (verb < 0)
415 | return 1;
416 | } else {
417 | verb = strtol(*p, NULL, 0); // Don't worry about the warning here. This should never be bigger than an int.
418 | if (verb < 0 || verb > 0xfff) {
419 | fprintf(stderr, "invalid verb %s\n", *p);
420 | return 1;
421 | }
422 | }
423 | p++;
424 | if (!isdigit(**p)) {
425 | strtoupper(*p);
426 | param = lookup_str(hda_params, *p);
427 | if (param < 0)
428 | return 1;
429 | } else {
430 | param = strtol(*p, NULL, 0); // Don't worry about the warning here. This should never be bigger than an int.
431 | if (param < 0 || param > 0xffff) {
432 | fprintf(stderr, "invalid param %s\n", *p);
433 | return 1;
434 | }
435 | }
436 | // Establish user-kernel connection
437 | timeout = 0;
438 | ServiceConnectionStatus = OpenServiceConnection();
439 | if (ServiceConnectionStatus != kIOReturnSuccess)
440 | {
441 | while (ServiceConnectionStatus != kIOReturnSuccess && timeout < trylimit)
442 | {
443 | timeout++;
444 | fprintf(stderr, "Error establshing IOService connection. Retrying in 1 second... (Attempt #%d/%d)\n", timeout, trylimit);
445 | sleep (1);
446 | ServiceConnectionStatus = OpenServiceConnection();
447 | }
448 | }
449 |
450 | if (timeout == trylimit)
451 | {
452 | return kIOReturnError;
453 | }
454 |
455 | // Parameter display indicates successful connection
456 | fprintf(stderr, "nid = 0x%x, verb = 0x%x, param = 0x%x\n",
457 | nid, verb, param);
458 |
459 | // Properly format command
460 | val.verb = HDA_VERB(nid, verb, param);
461 | fprintf(stderr, "Verb Command = 0x%x\n", val.verb);
462 |
463 | // Send command
464 | val.res = VerbCommand(val.verb);
465 | fprintf(stderr, "Response = 0x%x\n", val.res);
466 |
467 | // Clean up and exit
468 | CloseServiceConnection();
469 | return 0;
470 | }
471 |
--------------------------------------------------------------------------------
/ComboJack_Source/Combo Jack/PCI.m:
--------------------------------------------------------------------------------
1 | //
2 | // pci.m
3 | // DPCIManager
4 | //
5 | // Created by PHPdev32 on 10/8/12.
6 | // Licensed under GPLv3, full text at http://www.gnu.org/licenses/gpl-3.0.txt
7 | //
8 |
9 | #import "PCI.h"
10 | #import "Tables.h"
11 | #define h64tob32(x) (unsigned)(CFSwapInt64HostToBig(x)>>32)
12 | #define strHexDec(x) strtol([x UTF8String], NULL, 16)
13 |
14 | #pragma mark Device Class
15 | @implementation pciDevice
16 |
17 | @synthesize vendor;
18 | @synthesize device;
19 | @synthesize subVendor;
20 | @synthesize subDevice;
21 | @synthesize pciClassCode;
22 | @synthesize pciClass;
23 | @synthesize pciSubClass;
24 | @synthesize bus;
25 | @synthesize revision;
26 | @synthesize shadowDevice;
27 | @synthesize shadowVendor;
28 | @synthesize vendorString;
29 | @synthesize deviceString;
30 | @synthesize classString;
31 | @synthesize subClassString;
32 |
33 | +(long)nameToLong:(NSString *)name{
34 | if (![name hasPrefix:@"pci"] || [name rangeOfString:@","].location == NSNotFound) return 0;
35 | NSArray *temp = [[name stringByReplacingOccurrencesOfString:@"pci" withString:@""] componentsSeparatedByString:@","];
36 | return strHexDec([temp objectAtIndex:1]) << 16 | strHexDec([temp objectAtIndex:0]);
37 | }
38 | +(bool)isPCI:(io_service_t)service{
39 | return [@"IOPCIDevice" isEqualToString:(__bridge_transfer NSString *)IOObjectCopyClass(service)];
40 | }
41 | +(NSNumber *)grabNumber:(CFStringRef)entry forService:(io_service_t)service{//FIXME: shift bridge
42 | id number = (__bridge_transfer id)IORegistryEntryCreateCFProperty(service, entry, kCFAllocatorDefault, 0);
43 | NSNumber *temp = @0;
44 | if (!number) return temp;
45 | if ([number isKindOfClass:[NSNumber class]]) return number;
46 | else if ([number isKindOfClass:[NSData class]])
47 | temp = @(*(NSInteger *)[number bytes]);
48 | return temp;
49 | }
50 | +(NSString *)grabString:(CFStringRef)entry forService:(io_service_t)service{
51 | id string = (__bridge_transfer id)IORegistryEntryCreateCFProperty(service, entry, kCFAllocatorDefault, 0);
52 | NSString *temp = @"";
53 | if (!string) return temp;
54 | if ([string isKindOfClass:[NSString class]]) return string;
55 | else if ([string isKindOfClass:[NSData class]])
56 | if (!(temp = [[NSString alloc] initWithData:string encoding:NSUTF8StringEncoding]))
57 | temp = [[NSString alloc] initWithData:string encoding:NSASCIIStringEncoding];
58 | return temp;
59 | }
60 | +(NSDictionary *)match:(pciDevice *)pci{
61 | NSInteger vendor = pci.vendor.integerValue;
62 | NSInteger device = pci.device.integerValue;
63 | return @{@kIOPropertyMatchKey:@{@"vendor-id":[NSData dataWithBytes:&vendor length:4], @"device-id":[NSData dataWithBytes:&device length:4]}};
64 | }
65 | +(pciDevice *)create:(io_service_t)service classes:(NSMutableDictionary *)classes vendors:(NSMutableDictionary *)vendors{
66 | pciDevice *temp = [pciDevice create:service];
67 | temp.vendorString = [[vendors objectForKey:temp.shadowVendor] name];
68 | temp.deviceString = [[[vendors objectForKey:temp.shadowVendor] devices] objectForKey:temp.shadowDevice];
69 | temp.classString = [[classes objectForKey:temp.pciClass] name];
70 | temp.subClassString = [[[classes objectForKey:temp.pciClass] subClasses] objectForKey:temp.pciSubClass];
71 | return temp;
72 | }
73 | +(pciDevice *)create:(io_service_t)service{//FIXME: add validator option?
74 | pciDevice *temp = [pciDevice new];//!!!: agreements are base&compat, sub&compatsub, IOName&name
75 | @try {
76 | IORegistryEntryGetRegistryEntryID(service, &temp->_entryID);
77 | temp.vendor = [self grabNumber:CFSTR("vendor-id") forService:service];
78 | temp.device = [self grabNumber:CFSTR("device-id") forService:service];
79 | temp.bus = [[[[pciDevice grabString:CFSTR("pcidebug") forService:service] stringByReplacingOccurrencesOfString:@"(" withString:@":"] componentsSeparatedByString:@":"] valueForKey:@"integerValue"];
80 | if (![pciDevice isPCI:service]) [NSException raise:@"notpci" format:@"Not a real pci device!"];
81 | temp.subVendor = [self grabNumber:CFSTR("subsystem-vendor-id") forService:service];
82 | temp.subDevice = [self grabNumber:CFSTR("subsystem-id") forService:service];
83 | temp.pciClassCode = [self grabNumber:CFSTR("class-code") forService:service];
84 | temp.pciClass = @((temp.pciClassCode.integerValue >> 16) &0xFF);
85 | temp.pciSubClass = @((temp.pciClassCode.integerValue >> 8) &0xFF);
86 | temp.revision = [self grabNumber:CFSTR("revision-id") forService:service];
87 | long ids = 0;
88 | NSString *string = [pciDevice grabString:CFSTR("IOName") forService:service];
89 | if (string.length) ids = [self nameToLong:string];
90 | //else [NSException raise:@"noioname" format:@"Missing IOName"];
91 | if (!ids) {
92 | string = [pciDevice grabString:CFSTR("name") forService:service];
93 | if (string.length) ids = [self nameToLong:string];
94 | //else [NSException raise:@"noioname" format:@"Missing name"];
95 | }
96 | temp.shadowVendor = !ids?temp.vendor:@(ids & 0xFFFF);
97 | temp.shadowDevice = !ids?temp.device:@(ids >> 16);
98 | }
99 | @catch (NSException *e) {
100 | //NSRunCriticalAlertPanel(@"PCI Error", @"%@ 0x%04X%04X", nil, nil, nil, e.reason, temp.vendor.intValue, temp.device.intValue);
101 | temp.vendor = temp.device = temp.subVendor = temp.subDevice = temp.pciClassCode = temp.pciClass = temp.pciSubClass = temp.revision = temp.shadowVendor = temp.shadowDevice = @0;
102 | temp.bus = @[temp.vendor, temp.vendor, temp.vendor];
103 | }
104 | @finally {
105 | return temp;
106 | }
107 | }
108 | -(NSString *)fullClassString{
109 | return [NSString stringWithFormat:@"%@, %@", classString, subClassString];
110 | }
111 | -(NSString *)lspciString{
112 | return [NSString stringWithFormat:@"%02lx:%02lx.%01lx %@ [%04lx]: %@ %@ [%04lx:%04lx]%@%@", [[bus objectAtIndex:0] integerValue], [[bus objectAtIndex:1] integerValue], [[bus objectAtIndex:2] integerValue], subClassString, pciClassCode.integerValue>>8, vendorString, deviceString, shadowVendor.integerValue, shadowDevice.integerValue, !revision.integerValue?@"":[NSString stringWithFormat:@" (rev %02lx)", revision.integerValue], !subDevice.integerValue?@"":[NSString stringWithFormat:@" (subsys %04lx:%04lx)", subVendor.integerValue, subDevice.integerValue]];
113 | }
114 | -(NSDictionary *)lspciDictionary{
115 | NSDictionary *lspci_dict = @{
116 | // BusNumber:DeviceNumber.FunctionNumber
117 | @"BDF": [NSString stringWithFormat:@"%02lx:%02lx.%01lx", [[bus objectAtIndex:0] integerValue], [[bus objectAtIndex:1] integerValue], [[bus objectAtIndex:2] integerValue]],
118 | // Device's Class
119 | @"Class": @{
120 | @"ClassName": [NSString stringWithFormat:@"%@", classString],
121 | @"SubclassName": [NSString stringWithFormat:@"%@", subClassString],
122 | @"ID": [NSString stringWithFormat:@"%04lx", pciClassCode.integerValue>>8]
123 | },
124 | // Device Info
125 | @"Info": @{
126 | @"Name": [NSString stringWithFormat:@"%@", deviceString],
127 | @"Vendor": [NSString stringWithFormat:@"%@", vendorString]
128 | },
129 | // Device ID
130 | @"ID": @{
131 | @"DeviceID": [NSString stringWithFormat:@"%04lx", shadowDevice.integerValue],
132 | @"VendorID": [NSString stringWithFormat:@"%04lx", shadowVendor.integerValue]
133 | },
134 | // Subsystem ID
135 | @"SubsysID": @{
136 | @"DeviceID": [NSString stringWithFormat:@"%04lx", subDevice.integerValue],
137 | @"VendorID": [NSString stringWithFormat:@"%04lx", subVendor.integerValue]
138 | },
139 | // Revision
140 | @"Rev": [NSString stringWithFormat:@"%02lx", revision.integerValue]
141 | };
142 | return lspci_dict;
143 | }
144 | -(long)fullID{
145 | return device.integerValue<<16 | vendor.integerValue;
146 | }
147 | -(long)fullSubID{
148 | return subDevice.integerValue<<16 | subVendor.integerValue;
149 | }
150 | -(short)bdf {
151 | if (self.bus.count > 2)
152 | return [[self.bus objectAtIndex:0] unsignedCharValue] << 8 | [[self.bus objectAtIndex:1] unsignedCharValue] << 3 | [[self.bus objectAtIndex:2] unsignedCharValue];
153 | return -1;
154 | }
155 |
156 | +(NSArray *)readIDs{
157 | FILE *handle = fopen([[NSBundle.mainBundle pathForResource:@"pci" ofType:@"ids"] fileSystemRepresentation], "rb");
158 | NSMutableDictionary *classes = [NSMutableDictionary dictionary];
159 | NSMutableDictionary *vendors = [NSMutableDictionary dictionary];
160 | NSNumber *currentClass;
161 | NSNumber *currentVendor;
162 | char buffer[LINE_MAX];
163 | long device_id, subclass_id;
164 | char *buf;
165 | bool class_parse = false;
166 | while((buf = fgets(buffer, LINE_MAX, handle)) != NULL) {
167 | if (buf[0] == '#' || strlen(buf) <= 4) continue;
168 | buf[strlen(buf)-1]='\0';
169 | if (*buf == 'C') class_parse = true;
170 | if (class_parse) {
171 | if (*buf == '\t') {
172 | buf++;
173 | if (*buf != '\t') {
174 | subclass_id = strtol(buf, NULL, 16);
175 | buf += 4;
176 | while (*buf == ' ' || *buf == '\t') buf++;
177 | [[[classes objectForKey:currentClass] subClasses] setObject:@(buf) forKey:@(subclass_id)];
178 | }
179 | }
180 | else if (*buf == 'C') {
181 | buf += 2;
182 | currentClass = @(strtol(buf, NULL, 16));
183 | buf += 4;
184 | while (*buf == ' ' || *buf == '\t') buf++;
185 | [classes setObject:[pciClass create:@(buf)] forKey:currentClass];
186 | }
187 | }
188 | else {
189 | if (*buf == '\t') {
190 | buf++;
191 | if (*buf != '\t') {
192 | device_id = strtol(buf, NULL, 16);
193 | buf += 4;
194 | while (*buf == ' ' || *buf == '\t') buf++;
195 | [[[vendors objectForKey:currentVendor] devices] setObject:@(buf) forKey:@(device_id)];
196 | }
197 | }
198 | else if (*buf != '\\') {
199 | currentVendor = @(strtol(buf, NULL, 16));
200 | buf += 4;
201 | while (*buf == ' ' || *buf == '\t') buf++;
202 | [vendors setObject:[pciVendor create:@(buf)] forKey:currentVendor];
203 | }
204 | }
205 | }
206 | fclose(handle);
207 | NSMutableArray *pcis = [NSMutableArray array];
208 | io_iterator_t itThis;
209 | if (IOServiceGetMatchingServices(kIOMasterPortDefault, IOServiceMatching("IOPCIDevice"), &itThis) == KERN_SUCCESS) {
210 | io_service_t service;
211 | while((service = IOIteratorNext(itThis))){
212 | pciDevice *pci = [pciDevice create:service classes:classes vendors:vendors];
213 | if (pci.fullID+pci.fullSubID > 0) [pcis addObject:pci];
214 | IOObjectRelease(service);
215 | }
216 | IOObjectRelease(itThis);
217 | }
218 | return [pcis copy];
219 | }
220 | @end
221 |
222 | #pragma mark ID Classes
223 | @implementation pciVendor
224 | @synthesize name;
225 | @synthesize devices;
226 | +(pciVendor *)create:(NSString *)name{
227 | pciVendor *temp = [pciVendor new];
228 | temp.name = name;
229 | temp.devices = [NSMutableDictionary dictionary];
230 | return temp;
231 | }
232 | @end
233 |
234 | @implementation pciClass
235 | @synthesize name;
236 | @synthesize subClasses;
237 | +(pciClass *)create:(NSString *)name{
238 | pciClass *temp = [pciClass new];
239 | temp.name = name;
240 | temp.subClasses = [NSMutableDictionary dictionary];
241 | return temp;
242 | }
243 | @end
244 |
245 | @implementation efiObject
246 | @synthesize properties;
247 | @synthesize device;
248 | +(efiObject *)create:(pciDevice *)device injecting:(NSDictionary *)properties{
249 | efiObject *temp = [efiObject new];
250 | temp.properties = properties;
251 | temp.device = device;
252 | return temp;
253 | }
254 | +(NSString *)stringWithArray:(NSArray *)array{
255 | NSMutableString *str = [NSMutableString stringWithFormat:@"%08x%08x", CFSwapInt32HostToBig(1), h64tob32(array.count)];
256 | for (efiObject *obj in array) {
257 | NSMutableString *efi = [NSMutableString stringWithFormat:@"%08x", 0x7fff0400];
258 | io_service_t service = IOServiceGetMatchingService(kIOMasterPortDefault, (__bridge_retained CFDictionaryRef)[pciDevice match:obj.device]);
259 | while (true) {
260 | NSString *property;
261 | if ((property = [pciDevice grabString:CFSTR("pcidebug") forService:service]) && property.length) {
262 | NSArray *bus = [[[property stringByReplacingOccurrencesOfString:@"(" withString:@":"] componentsSeparatedByString:@":"] valueForKey:@"integerValue"];
263 | [efi insertString:[NSString stringWithFormat:@"%08x%02x%02x", 0x01010600, [[bus objectAtIndex:2] intValue], [[bus objectAtIndex:1] intValue]] atIndex:0];
264 | }
265 | else if ((property = [pciDevice grabString:CFSTR("name") forService:service]).length) {
266 | unsigned pnp = 0;
267 | sscanf(property.UTF8String, "PNP%X", &pnp);
268 | if (!pnp) {
269 | efi = nil;
270 | break;
271 | }
272 | if (!(property = [pciDevice grabString:CFSTR("_UID") forService:service]).length) property = @"0";
273 | unsigned uid = property.intValue;
274 | [efi insertString:[NSString stringWithFormat:@"%08x%04x%04x%08x", 0x02010C00, 0xD041, CFSwapInt16HostToBig(pnp), CFSwapInt32HostToBig(uid)] atIndex:0];
275 | break;
276 | }
277 | io_service_t parent;
278 | IORegistryEntryGetParentEntry(service, kIOServicePlane, &parent);
279 | IOObjectRelease(service);
280 | service = parent;
281 | }
282 | IOObjectRelease(service);
283 | if (!efi) return nil;
284 | for(NSString *property in obj.properties) {
285 | NSUInteger i = 0, j = property.length+1;
286 | [efi appendFormat:@"%08x", h64tob32(4+j*2)];
287 | const char *prop = property.UTF8String;
288 | while (i>(64-i*8)];
291 | }
292 | [str appendFormat:@"%08x%08x%@", h64tob32(8+efi.length/2), h64tob32(obj.properties.count), efi];
293 | }
294 | return [NSString stringWithFormat:@"%08x%@", h64tob32(4+str.length/2), str];
295 | }
296 | +(int)NumberSize:(NSNumber *)number {
297 | switch (number.objCType[0]) {
298 | case 'c':
299 | return sizeof(char);
300 | case 'i':
301 | return sizeof(int);
302 | case 's':
303 | return sizeof(short);
304 | case 'l':
305 | return sizeof(long);
306 | case 'q':
307 | return sizeof(long long);
308 | case 'f':
309 | return sizeof(float);
310 | case 'd':
311 | return sizeof(double);
312 | case 'C':
313 | return sizeof(unsigned char);
314 | case 'I':
315 | return sizeof(unsigned int);
316 | case 'S':
317 | return sizeof(unsigned short);
318 | case 'L':
319 | return sizeof(unsigned long);
320 | case 'Q':
321 | return sizeof(unsigned long long);
322 | default:
323 | return 0;
324 | }
325 | }
326 | @end
327 |
328 | #pragma mark Formatter
329 | @implementation hexFormatter
330 | +(BOOL)allowsReverseTransformation{
331 | return false;
332 | }
333 | +(Class)transformedValueClass{
334 | return [NSString class];
335 | }
336 | -(id)transformedValue:(id)value{
337 | return [NSString stringWithFormat:@"%04lX", [(NSNumber *)value integerValue]];
338 | }
339 | @end
340 |
--------------------------------------------------------------------------------
/VerbStub_Source/VerbStub.xcodeproj/project.pbxproj:
--------------------------------------------------------------------------------
1 | // !$*UTF8*$!
2 | {
3 | archiveVersion = 1;
4 | classes = {
5 | };
6 | objectVersion = 46;
7 | objects = {
8 |
9 | /* Begin PBXBuildFile section */
10 | CB3C1C3F1F08A6B500F26D79 /* hda-verb.c in Sources */ = {isa = PBXBuildFile; fileRef = CB3C1C3E1F08A6B500F26D79 /* hda-verb.c */; };
11 | CB3C1C581F0967CA00F26D79 /* IOKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB3C1C561F08AA4300F26D79 /* IOKit.framework */; };
12 | CB3C1C5A1F0967D200F26D79 /* CoreFoundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CB3C1C521F08AA3600F26D79 /* CoreFoundation.framework */; };
13 | CB3C1C7A1F0979D900F26D79 /* VerbStub.hpp in Headers */ = {isa = PBXBuildFile; fileRef = CB3C1C791F0979D900F26D79 /* VerbStub.hpp */; };
14 | CB3C1C7C1F0979D900F26D79 /* VerbStub.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CB3C1C7B1F0979D900F26D79 /* VerbStub.cpp */; };
15 | CB3C1C831F0979E900F26D79 /* IntelHDA.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CB3C1C811F0979E900F26D79 /* IntelHDA.cpp */; };
16 | CB3C1C841F0979E900F26D79 /* IntelHDA.h in Headers */ = {isa = PBXBuildFile; fileRef = CB3C1C821F0979E900F26D79 /* IntelHDA.h */; };
17 | /* End PBXBuildFile section */
18 |
19 | /* Begin PBXFileReference section */
20 | CB3C1C361F08A67000F26D79 /* hda-verb */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "hda-verb"; sourceTree = BUILT_PRODUCTS_DIR; };
21 | CB3C1C3D1F08A6B500F26D79 /* hda_hwdep.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = hda_hwdep.h; sourceTree = ""; };
22 | CB3C1C3E1F08A6B500F26D79 /* hda-verb.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = "hda-verb.c"; sourceTree = ""; };
23 | CB3C1C521F08AA3600F26D79 /* CoreFoundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreFoundation.framework; path = System/Library/Frameworks/CoreFoundation.framework; sourceTree = SDKROOT; };
24 | CB3C1C541F08AA3D00F26D79 /* Kernel.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Kernel.framework; path = System/Library/Frameworks/Kernel.framework; sourceTree = SDKROOT; };
25 | CB3C1C561F08AA4300F26D79 /* IOKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = IOKit.framework; path = System/Library/Frameworks/IOKit.framework; sourceTree = SDKROOT; };
26 | CB3C1C771F0979D800F26D79 /* VerbStub.kext */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = VerbStub.kext; sourceTree = BUILT_PRODUCTS_DIR; };
27 | CB3C1C791F0979D900F26D79 /* VerbStub.hpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.h; path = VerbStub.hpp; sourceTree = ""; };
28 | CB3C1C7B1F0979D900F26D79 /* VerbStub.cpp */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = VerbStub.cpp; sourceTree = ""; };
29 | CB3C1C7D1F0979D900F26D79 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; };
30 | CB3C1C811F0979E900F26D79 /* IntelHDA.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = IntelHDA.cpp; sourceTree = ""; };
31 | CB3C1C821F0979E900F26D79 /* IntelHDA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = IntelHDA.h; sourceTree = ""; };
32 | /* End PBXFileReference section */
33 |
34 | /* Begin PBXFrameworksBuildPhase section */
35 | CB3C1C331F08A67000F26D79 /* Frameworks */ = {
36 | isa = PBXFrameworksBuildPhase;
37 | buildActionMask = 2147483647;
38 | files = (
39 | CB3C1C5A1F0967D200F26D79 /* CoreFoundation.framework in Frameworks */,
40 | CB3C1C581F0967CA00F26D79 /* IOKit.framework in Frameworks */,
41 | );
42 | runOnlyForDeploymentPostprocessing = 0;
43 | };
44 | CB3C1C731F0979D800F26D79 /* Frameworks */ = {
45 | isa = PBXFrameworksBuildPhase;
46 | buildActionMask = 2147483647;
47 | files = (
48 | );
49 | runOnlyForDeploymentPostprocessing = 0;
50 | };
51 | /* End PBXFrameworksBuildPhase section */
52 |
53 | /* Begin PBXGroup section */
54 | CB3C1C071F08A20200F26D79 = {
55 | isa = PBXGroup;
56 | children = (
57 | CB3C1C371F08A67100F26D79 /* hda_verb */,
58 | CB3C1C781F0979D900F26D79 /* VerbStub */,
59 | CB3C1C121F08A20200F26D79 /* Products */,
60 | CB3C1C511F08AA3600F26D79 /* Frameworks */,
61 | );
62 | sourceTree = "";
63 | };
64 | CB3C1C121F08A20200F26D79 /* Products */ = {
65 | isa = PBXGroup;
66 | children = (
67 | CB3C1C361F08A67000F26D79 /* hda-verb */,
68 | CB3C1C771F0979D800F26D79 /* VerbStub.kext */,
69 | );
70 | name = Products;
71 | sourceTree = "";
72 | };
73 | CB3C1C371F08A67100F26D79 /* hda_verb */ = {
74 | isa = PBXGroup;
75 | children = (
76 | CB3C1C3D1F08A6B500F26D79 /* hda_hwdep.h */,
77 | CB3C1C3E1F08A6B500F26D79 /* hda-verb.c */,
78 | );
79 | name = hda_verb;
80 | path = "hda-verb";
81 | sourceTree = "";
82 | };
83 | CB3C1C511F08AA3600F26D79 /* Frameworks */ = {
84 | isa = PBXGroup;
85 | children = (
86 | CB3C1C561F08AA4300F26D79 /* IOKit.framework */,
87 | CB3C1C541F08AA3D00F26D79 /* Kernel.framework */,
88 | CB3C1C521F08AA3600F26D79 /* CoreFoundation.framework */,
89 | );
90 | name = Frameworks;
91 | sourceTree = "";
92 | };
93 | CB3C1C781F0979D900F26D79 /* VerbStub */ = {
94 | isa = PBXGroup;
95 | children = (
96 | CB3C1C811F0979E900F26D79 /* IntelHDA.cpp */,
97 | CB3C1C821F0979E900F26D79 /* IntelHDA.h */,
98 | CB3C1C791F0979D900F26D79 /* VerbStub.hpp */,
99 | CB3C1C7B1F0979D900F26D79 /* VerbStub.cpp */,
100 | CB3C1C7D1F0979D900F26D79 /* Info.plist */,
101 | );
102 | path = VerbStub;
103 | sourceTree = "";
104 | };
105 | /* End PBXGroup section */
106 |
107 | /* Begin PBXHeadersBuildPhase section */
108 | CB3C1C741F0979D800F26D79 /* Headers */ = {
109 | isa = PBXHeadersBuildPhase;
110 | buildActionMask = 2147483647;
111 | files = (
112 | CB3C1C7A1F0979D900F26D79 /* VerbStub.hpp in Headers */,
113 | CB3C1C841F0979E900F26D79 /* IntelHDA.h in Headers */,
114 | );
115 | runOnlyForDeploymentPostprocessing = 0;
116 | };
117 | /* End PBXHeadersBuildPhase section */
118 |
119 | /* Begin PBXNativeTarget section */
120 | CB3C1C351F08A67000F26D79 /* hda-verb */ = {
121 | isa = PBXNativeTarget;
122 | buildConfigurationList = CB3C1C3A1F08A67100F26D79 /* Build configuration list for PBXNativeTarget "hda-verb" */;
123 | buildPhases = (
124 | CB3C1C321F08A67000F26D79 /* Sources */,
125 | CB3C1C331F08A67000F26D79 /* Frameworks */,
126 | 3DF6155721AAD4BA0057F150 /* ShellScript */,
127 | );
128 | buildRules = (
129 | );
130 | dependencies = (
131 | );
132 | name = "hda-verb";
133 | productName = "hda-verb";
134 | productReference = CB3C1C361F08A67000F26D79 /* hda-verb */;
135 | productType = "com.apple.product-type.tool";
136 | };
137 | CB3C1C761F0979D800F26D79 /* VerbStub */ = {
138 | isa = PBXNativeTarget;
139 | buildConfigurationList = CB3C1C7E1F0979D900F26D79 /* Build configuration list for PBXNativeTarget "VerbStub" */;
140 | buildPhases = (
141 | CB3C1C721F0979D800F26D79 /* Sources */,
142 | CB3C1C731F0979D800F26D79 /* Frameworks */,
143 | CB3C1C741F0979D800F26D79 /* Headers */,
144 | CB3C1C751F0979D800F26D79 /* Resources */,
145 | 3DF6155821AAD4DB0057F150 /* ShellScript */,
146 | );
147 | buildRules = (
148 | );
149 | dependencies = (
150 | );
151 | name = VerbStub;
152 | productName = VerbStub;
153 | productReference = CB3C1C771F0979D800F26D79 /* VerbStub.kext */;
154 | productType = "com.apple.product-type.kernel-extension";
155 | };
156 | /* End PBXNativeTarget section */
157 |
158 | /* Begin PBXProject section */
159 | CB3C1C081F08A20200F26D79 /* Project object */ = {
160 | isa = PBXProject;
161 | attributes = {
162 | LastUpgradeCheck = 0830;
163 | ORGANIZATIONNAME = VerbStub;
164 | TargetAttributes = {
165 | CB3C1C351F08A67000F26D79 = {
166 | CreatedOnToolsVersion = 8.3.3;
167 | ProvisioningStyle = Automatic;
168 | };
169 | CB3C1C761F0979D800F26D79 = {
170 | CreatedOnToolsVersion = 8.3.3;
171 | ProvisioningStyle = Automatic;
172 | };
173 | };
174 | };
175 | buildConfigurationList = CB3C1C0B1F08A20200F26D79 /* Build configuration list for PBXProject "VerbStub" */;
176 | compatibilityVersion = "Xcode 3.2";
177 | developmentRegion = English;
178 | hasScannedForEncodings = 0;
179 | knownRegions = (
180 | en,
181 | );
182 | mainGroup = CB3C1C071F08A20200F26D79;
183 | productRefGroup = CB3C1C121F08A20200F26D79 /* Products */;
184 | projectDirPath = "";
185 | projectRoot = "";
186 | targets = (
187 | CB3C1C351F08A67000F26D79 /* hda-verb */,
188 | CB3C1C761F0979D800F26D79 /* VerbStub */,
189 | );
190 | };
191 | /* End PBXProject section */
192 |
193 | /* Begin PBXResourcesBuildPhase section */
194 | CB3C1C751F0979D800F26D79 /* Resources */ = {
195 | isa = PBXResourcesBuildPhase;
196 | buildActionMask = 2147483647;
197 | files = (
198 | );
199 | runOnlyForDeploymentPostprocessing = 0;
200 | };
201 | /* End PBXResourcesBuildPhase section */
202 |
203 | /* Begin PBXShellScriptBuildPhase section */
204 | 3DF6155721AAD4BA0057F150 /* ShellScript */ = {
205 | isa = PBXShellScriptBuildPhase;
206 | buildActionMask = 2147483647;
207 | files = (
208 | );
209 | inputFileListPaths = (
210 | );
211 | inputPaths = (
212 | );
213 | outputFileListPaths = (
214 | );
215 | outputPaths = (
216 | );
217 | runOnlyForDeploymentPostprocessing = 0;
218 | shellPath = /bin/sh;
219 | shellScript = "# Type a script or drag a script file from your workspace to insert its path.\ncd \"${TARGET_BUILD_DIR}\"\ncp -f hda-verb ../../../ComboJack_Installer/\n";
220 | };
221 | 3DF6155821AAD4DB0057F150 /* ShellScript */ = {
222 | isa = PBXShellScriptBuildPhase;
223 | buildActionMask = 2147483647;
224 | files = (
225 | );
226 | inputFileListPaths = (
227 | );
228 | inputPaths = (
229 | );
230 | outputFileListPaths = (
231 | );
232 | outputPaths = (
233 | );
234 | runOnlyForDeploymentPostprocessing = 0;
235 | shellPath = /bin/sh;
236 | shellScript = "# Type a script or drag a script file from your workspace to insert its path.\ncd \"${TARGET_BUILD_DIR}\"\ncp -rf VerbStub.kext ../../../ComboJack_Installer/\n";
237 | };
238 | /* End PBXShellScriptBuildPhase section */
239 |
240 | /* Begin PBXSourcesBuildPhase section */
241 | CB3C1C321F08A67000F26D79 /* Sources */ = {
242 | isa = PBXSourcesBuildPhase;
243 | buildActionMask = 2147483647;
244 | files = (
245 | CB3C1C3F1F08A6B500F26D79 /* hda-verb.c in Sources */,
246 | );
247 | runOnlyForDeploymentPostprocessing = 0;
248 | };
249 | CB3C1C721F0979D800F26D79 /* Sources */ = {
250 | isa = PBXSourcesBuildPhase;
251 | buildActionMask = 2147483647;
252 | files = (
253 | CB3C1C831F0979E900F26D79 /* IntelHDA.cpp in Sources */,
254 | CB3C1C7C1F0979D900F26D79 /* VerbStub.cpp in Sources */,
255 | );
256 | runOnlyForDeploymentPostprocessing = 0;
257 | };
258 | /* End PBXSourcesBuildPhase section */
259 |
260 | /* Begin XCBuildConfiguration section */
261 | CB3C1C171F08A20200F26D79 /* Debug */ = {
262 | isa = XCBuildConfiguration;
263 | buildSettings = {
264 | ALWAYS_SEARCH_USER_PATHS = NO;
265 | CLANG_ANALYZER_NONNULL = YES;
266 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
267 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
268 | CLANG_CXX_LIBRARY = "libc++";
269 | CLANG_ENABLE_MODULES = YES;
270 | CLANG_ENABLE_OBJC_ARC = YES;
271 | CLANG_WARN_BOOL_CONVERSION = YES;
272 | CLANG_WARN_CONSTANT_CONVERSION = YES;
273 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
274 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
275 | CLANG_WARN_EMPTY_BODY = YES;
276 | CLANG_WARN_ENUM_CONVERSION = YES;
277 | CLANG_WARN_INFINITE_RECURSION = YES;
278 | CLANG_WARN_INT_CONVERSION = YES;
279 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
280 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
281 | CLANG_WARN_UNREACHABLE_CODE = YES;
282 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
283 | CODE_SIGN_IDENTITY = "";
284 | COPY_PHASE_STRIP = NO;
285 | DEBUG_INFORMATION_FORMAT = dwarf;
286 | ENABLE_STRICT_OBJC_MSGSEND = YES;
287 | ENABLE_TESTABILITY = YES;
288 | GCC_C_LANGUAGE_STANDARD = gnu99;
289 | GCC_DYNAMIC_NO_PIC = NO;
290 | GCC_NO_COMMON_BLOCKS = YES;
291 | GCC_OPTIMIZATION_LEVEL = 0;
292 | GCC_PREPROCESSOR_DEFINITIONS = (
293 | "DEBUG=1",
294 | "$(inherited)",
295 | );
296 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
297 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
298 | GCC_WARN_UNDECLARED_SELECTOR = YES;
299 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
300 | GCC_WARN_UNUSED_FUNCTION = YES;
301 | GCC_WARN_UNUSED_VARIABLE = YES;
302 | MACOSX_DEPLOYMENT_TARGET = 10.12;
303 | MTL_ENABLE_DEBUG_INFO = YES;
304 | ONLY_ACTIVE_ARCH = YES;
305 | SDKROOT = macosx;
306 | };
307 | name = Debug;
308 | };
309 | CB3C1C181F08A20200F26D79 /* Release */ = {
310 | isa = XCBuildConfiguration;
311 | buildSettings = {
312 | ALWAYS_SEARCH_USER_PATHS = NO;
313 | CLANG_ANALYZER_NONNULL = YES;
314 | CLANG_ANALYZER_NUMBER_OBJECT_CONVERSION = YES_AGGRESSIVE;
315 | CLANG_CXX_LANGUAGE_STANDARD = "gnu++0x";
316 | CLANG_CXX_LIBRARY = "libc++";
317 | CLANG_ENABLE_MODULES = YES;
318 | CLANG_ENABLE_OBJC_ARC = YES;
319 | CLANG_WARN_BOOL_CONVERSION = YES;
320 | CLANG_WARN_CONSTANT_CONVERSION = YES;
321 | CLANG_WARN_DIRECT_OBJC_ISA_USAGE = YES_ERROR;
322 | CLANG_WARN_DOCUMENTATION_COMMENTS = YES;
323 | CLANG_WARN_EMPTY_BODY = YES;
324 | CLANG_WARN_ENUM_CONVERSION = YES;
325 | CLANG_WARN_INFINITE_RECURSION = YES;
326 | CLANG_WARN_INT_CONVERSION = YES;
327 | CLANG_WARN_OBJC_ROOT_CLASS = YES_ERROR;
328 | CLANG_WARN_SUSPICIOUS_MOVE = YES;
329 | CLANG_WARN_UNREACHABLE_CODE = YES;
330 | CLANG_WARN__DUPLICATE_METHOD_MATCH = YES;
331 | CODE_SIGN_IDENTITY = "";
332 | COPY_PHASE_STRIP = NO;
333 | DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
334 | ENABLE_NS_ASSERTIONS = NO;
335 | ENABLE_STRICT_OBJC_MSGSEND = YES;
336 | GCC_C_LANGUAGE_STANDARD = gnu99;
337 | GCC_NO_COMMON_BLOCKS = YES;
338 | GCC_WARN_64_TO_32_BIT_CONVERSION = YES;
339 | GCC_WARN_ABOUT_RETURN_TYPE = YES_ERROR;
340 | GCC_WARN_UNDECLARED_SELECTOR = YES;
341 | GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
342 | GCC_WARN_UNUSED_FUNCTION = YES;
343 | GCC_WARN_UNUSED_VARIABLE = YES;
344 | MACOSX_DEPLOYMENT_TARGET = 10.12;
345 | MTL_ENABLE_DEBUG_INFO = NO;
346 | SDKROOT = macosx;
347 | };
348 | name = Release;
349 | };
350 | CB3C1C3B1F08A67100F26D79 /* Debug */ = {
351 | isa = XCBuildConfiguration;
352 | buildSettings = {
353 | PRODUCT_NAME = "$(TARGET_NAME)";
354 | };
355 | name = Debug;
356 | };
357 | CB3C1C3C1F08A67100F26D79 /* Release */ = {
358 | isa = XCBuildConfiguration;
359 | buildSettings = {
360 | PRODUCT_NAME = "$(TARGET_NAME)";
361 | };
362 | name = Release;
363 | };
364 | CB3C1C7F1F0979D900F26D79 /* Debug */ = {
365 | isa = XCBuildConfiguration;
366 | buildSettings = {
367 | CODE_SIGN_IDENTITY = "";
368 | COMBINE_HIDPI_IMAGES = YES;
369 | CURRENT_PROJECT_VERSION = 1.0.4;
370 | INFOPLIST_FILE = VerbStub/Info.plist;
371 | MODULE_NAME = com.XPS.VerbStub;
372 | MODULE_VERSION = 1.0.4;
373 | OTHER_CPLUSPLUSFLAGS = (
374 | "$(OTHER_CFLAGS)",
375 | "-Wno-inconsistent-missing-override",
376 | );
377 | PRODUCT_BUNDLE_IDENTIFIER = XPS.VerbStub;
378 | PRODUCT_NAME = "$(TARGET_NAME)";
379 | WRAPPER_EXTENSION = kext;
380 | };
381 | name = Debug;
382 | };
383 | CB3C1C801F0979D900F26D79 /* Release */ = {
384 | isa = XCBuildConfiguration;
385 | buildSettings = {
386 | CODE_SIGN_IDENTITY = "";
387 | COMBINE_HIDPI_IMAGES = YES;
388 | CURRENT_PROJECT_VERSION = 1.0.4;
389 | INFOPLIST_FILE = VerbStub/Info.plist;
390 | MODULE_NAME = com.XPS.VerbStub;
391 | MODULE_VERSION = 1.0.4;
392 | OTHER_CPLUSPLUSFLAGS = (
393 | "$(OTHER_CFLAGS)",
394 | "-Wno-inconsistent-missing-override",
395 | );
396 | PRODUCT_BUNDLE_IDENTIFIER = XPS.VerbStub;
397 | PRODUCT_NAME = "$(TARGET_NAME)";
398 | WRAPPER_EXTENSION = kext;
399 | };
400 | name = Release;
401 | };
402 | /* End XCBuildConfiguration section */
403 |
404 | /* Begin XCConfigurationList section */
405 | CB3C1C0B1F08A20200F26D79 /* Build configuration list for PBXProject "VerbStub" */ = {
406 | isa = XCConfigurationList;
407 | buildConfigurations = (
408 | CB3C1C171F08A20200F26D79 /* Debug */,
409 | CB3C1C181F08A20200F26D79 /* Release */,
410 | );
411 | defaultConfigurationIsVisible = 0;
412 | defaultConfigurationName = Release;
413 | };
414 | CB3C1C3A1F08A67100F26D79 /* Build configuration list for PBXNativeTarget "hda-verb" */ = {
415 | isa = XCConfigurationList;
416 | buildConfigurations = (
417 | CB3C1C3B1F08A67100F26D79 /* Debug */,
418 | CB3C1C3C1F08A67100F26D79 /* Release */,
419 | );
420 | defaultConfigurationIsVisible = 0;
421 | defaultConfigurationName = Release;
422 | };
423 | CB3C1C7E1F0979D900F26D79 /* Build configuration list for PBXNativeTarget "VerbStub" */ = {
424 | isa = XCConfigurationList;
425 | buildConfigurations = (
426 | CB3C1C7F1F0979D900F26D79 /* Debug */,
427 | CB3C1C801F0979D900F26D79 /* Release */,
428 | );
429 | defaultConfigurationIsVisible = 0;
430 | defaultConfigurationName = Release;
431 | };
432 | /* End XCConfigurationList section */
433 | };
434 | rootObject = CB3C1C081F08A20200F26D79 /* Project object */;
435 | }
436 |
--------------------------------------------------------------------------------
/ComboJack_Installer/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 | handles EAPD state updating for power-managed HDA codecs
294 | Copyright (C) 2013 Dolnor
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | {signature of Ty Coon}, 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
340 |
--------------------------------------------------------------------------------
/ComboJack_Source/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 | handles EAPD state updating for power-managed HDA codecs
294 | Copyright (C) 2013 Dolnor
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | {signature of Ty Coon}, 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
340 |
--------------------------------------------------------------------------------
/VerbStub_Source/LICENSE:
--------------------------------------------------------------------------------
1 | GNU GENERAL PUBLIC LICENSE
2 | Version 2, June 1991
3 |
4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
6 | Everyone is permitted to copy and distribute verbatim copies
7 | of this license document, but changing it is not allowed.
8 |
9 | Preamble
10 |
11 | The licenses for most software are designed to take away your
12 | freedom to share and change it. By contrast, the GNU General Public
13 | License is intended to guarantee your freedom to share and change free
14 | software--to make sure the software is free for all its users. This
15 | General Public License applies to most of the Free Software
16 | Foundation's software and to any other program whose authors commit to
17 | using it. (Some other Free Software Foundation software is covered by
18 | the GNU Lesser General Public License instead.) You can apply it to
19 | your programs, too.
20 |
21 | When we speak of free software, we are referring to freedom, not
22 | price. Our General Public Licenses are designed to make sure that you
23 | have the freedom to distribute copies of free software (and charge for
24 | this service if you wish), that you receive source code or can get it
25 | if you want it, that you can change the software or use pieces of it
26 | in new free programs; and that you know you can do these things.
27 |
28 | To protect your rights, we need to make restrictions that forbid
29 | anyone to deny you these rights or to ask you to surrender the rights.
30 | These restrictions translate to certain responsibilities for you if you
31 | distribute copies of the software, or if you modify it.
32 |
33 | For example, if you distribute copies of such a program, whether
34 | gratis or for a fee, you must give the recipients all the rights that
35 | you have. You must make sure that they, too, receive or can get the
36 | source code. And you must show them these terms so they know their
37 | rights.
38 |
39 | We protect your rights with two steps: (1) copyright the software, and
40 | (2) offer you this license which gives you legal permission to copy,
41 | distribute and/or modify the software.
42 |
43 | Also, for each author's protection and ours, we want to make certain
44 | that everyone understands that there is no warranty for this free
45 | software. If the software is modified by someone else and passed on, we
46 | want its recipients to know that what they have is not the original, so
47 | that any problems introduced by others will not reflect on the original
48 | authors' reputations.
49 |
50 | Finally, any free program is threatened constantly by software
51 | patents. We wish to avoid the danger that redistributors of a free
52 | program will individually obtain patent licenses, in effect making the
53 | program proprietary. To prevent this, we have made it clear that any
54 | patent must be licensed for everyone's free use or not licensed at all.
55 |
56 | The precise terms and conditions for copying, distribution and
57 | modification follow.
58 |
59 | GNU GENERAL PUBLIC LICENSE
60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
61 |
62 | 0. This License applies to any program or other work which contains
63 | a notice placed by the copyright holder saying it may be distributed
64 | under the terms of this General Public License. The "Program", below,
65 | refers to any such program or work, and a "work based on the Program"
66 | means either the Program or any derivative work under copyright law:
67 | that is to say, a work containing the Program or a portion of it,
68 | either verbatim or with modifications and/or translated into another
69 | language. (Hereinafter, translation is included without limitation in
70 | the term "modification".) Each licensee is addressed as "you".
71 |
72 | Activities other than copying, distribution and modification are not
73 | covered by this License; they are outside its scope. The act of
74 | running the Program is not restricted, and the output from the Program
75 | is covered only if its contents constitute a work based on the
76 | Program (independent of having been made by running the Program).
77 | Whether that is true depends on what the Program does.
78 |
79 | 1. You may copy and distribute verbatim copies of the Program's
80 | source code as you receive it, in any medium, provided that you
81 | conspicuously and appropriately publish on each copy an appropriate
82 | copyright notice and disclaimer of warranty; keep intact all the
83 | notices that refer to this License and to the absence of any warranty;
84 | and give any other recipients of the Program a copy of this License
85 | along with the Program.
86 |
87 | You may charge a fee for the physical act of transferring a copy, and
88 | you may at your option offer warranty protection in exchange for a fee.
89 |
90 | 2. You may modify your copy or copies of the Program or any portion
91 | of it, thus forming a work based on the Program, and copy and
92 | distribute such modifications or work under the terms of Section 1
93 | above, provided that you also meet all of these conditions:
94 |
95 | a) You must cause the modified files to carry prominent notices
96 | stating that you changed the files and the date of any change.
97 |
98 | b) You must cause any work that you distribute or publish, that in
99 | whole or in part contains or is derived from the Program or any
100 | part thereof, to be licensed as a whole at no charge to all third
101 | parties under the terms of this License.
102 |
103 | c) If the modified program normally reads commands interactively
104 | when run, you must cause it, when started running for such
105 | interactive use in the most ordinary way, to print or display an
106 | announcement including an appropriate copyright notice and a
107 | notice that there is no warranty (or else, saying that you provide
108 | a warranty) and that users may redistribute the program under
109 | these conditions, and telling the user how to view a copy of this
110 | License. (Exception: if the Program itself is interactive but
111 | does not normally print such an announcement, your work based on
112 | the Program is not required to print an announcement.)
113 |
114 | These requirements apply to the modified work as a whole. If
115 | identifiable sections of that work are not derived from the Program,
116 | and can be reasonably considered independent and separate works in
117 | themselves, then this License, and its terms, do not apply to those
118 | sections when you distribute them as separate works. But when you
119 | distribute the same sections as part of a whole which is a work based
120 | on the Program, the distribution of the whole must be on the terms of
121 | this License, whose permissions for other licensees extend to the
122 | entire whole, and thus to each and every part regardless of who wrote it.
123 |
124 | Thus, it is not the intent of this section to claim rights or contest
125 | your rights to work written entirely by you; rather, the intent is to
126 | exercise the right to control the distribution of derivative or
127 | collective works based on the Program.
128 |
129 | In addition, mere aggregation of another work not based on the Program
130 | with the Program (or with a work based on the Program) on a volume of
131 | a storage or distribution medium does not bring the other work under
132 | the scope of this License.
133 |
134 | 3. You may copy and distribute the Program (or a work based on it,
135 | under Section 2) in object code or executable form under the terms of
136 | Sections 1 and 2 above provided that you also do one of the following:
137 |
138 | a) Accompany it with the complete corresponding machine-readable
139 | source code, which must be distributed under the terms of Sections
140 | 1 and 2 above on a medium customarily used for software interchange; or,
141 |
142 | b) Accompany it with a written offer, valid for at least three
143 | years, to give any third party, for a charge no more than your
144 | cost of physically performing source distribution, a complete
145 | machine-readable copy of the corresponding source code, to be
146 | distributed under the terms of Sections 1 and 2 above on a medium
147 | customarily used for software interchange; or,
148 |
149 | c) Accompany it with the information you received as to the offer
150 | to distribute corresponding source code. (This alternative is
151 | allowed only for noncommercial distribution and only if you
152 | received the program in object code or executable form with such
153 | an offer, in accord with Subsection b above.)
154 |
155 | The source code for a work means the preferred form of the work for
156 | making modifications to it. For an executable work, complete source
157 | code means all the source code for all modules it contains, plus any
158 | associated interface definition files, plus the scripts used to
159 | control compilation and installation of the executable. However, as a
160 | special exception, the source code distributed need not include
161 | anything that is normally distributed (in either source or binary
162 | form) with the major components (compiler, kernel, and so on) of the
163 | operating system on which the executable runs, unless that component
164 | itself accompanies the executable.
165 |
166 | If distribution of executable or object code is made by offering
167 | access to copy from a designated place, then offering equivalent
168 | access to copy the source code from the same place counts as
169 | distribution of the source code, even though third parties are not
170 | compelled to copy the source along with the object code.
171 |
172 | 4. You may not copy, modify, sublicense, or distribute the Program
173 | except as expressly provided under this License. Any attempt
174 | otherwise to copy, modify, sublicense or distribute the Program is
175 | void, and will automatically terminate your rights under this License.
176 | However, parties who have received copies, or rights, from you under
177 | this License will not have their licenses terminated so long as such
178 | parties remain in full compliance.
179 |
180 | 5. You are not required to accept this License, since you have not
181 | signed it. However, nothing else grants you permission to modify or
182 | distribute the Program or its derivative works. These actions are
183 | prohibited by law if you do not accept this License. Therefore, by
184 | modifying or distributing the Program (or any work based on the
185 | Program), you indicate your acceptance of this License to do so, and
186 | all its terms and conditions for copying, distributing or modifying
187 | the Program or works based on it.
188 |
189 | 6. Each time you redistribute the Program (or any work based on the
190 | Program), the recipient automatically receives a license from the
191 | original licensor to copy, distribute or modify the Program subject to
192 | these terms and conditions. You may not impose any further
193 | restrictions on the recipients' exercise of the rights granted herein.
194 | You are not responsible for enforcing compliance by third parties to
195 | this License.
196 |
197 | 7. If, as a consequence of a court judgment or allegation of patent
198 | infringement or for any other reason (not limited to patent issues),
199 | conditions are imposed on you (whether by court order, agreement or
200 | otherwise) that contradict the conditions of this License, they do not
201 | excuse you from the conditions of this License. If you cannot
202 | distribute so as to satisfy simultaneously your obligations under this
203 | License and any other pertinent obligations, then as a consequence you
204 | may not distribute the Program at all. For example, if a patent
205 | license would not permit royalty-free redistribution of the Program by
206 | all those who receive copies directly or indirectly through you, then
207 | the only way you could satisfy both it and this License would be to
208 | refrain entirely from distribution of the Program.
209 |
210 | If any portion of this section is held invalid or unenforceable under
211 | any particular circumstance, the balance of the section is intended to
212 | apply and the section as a whole is intended to apply in other
213 | circumstances.
214 |
215 | It is not the purpose of this section to induce you to infringe any
216 | patents or other property right claims or to contest validity of any
217 | such claims; this section has the sole purpose of protecting the
218 | integrity of the free software distribution system, which is
219 | implemented by public license practices. Many people have made
220 | generous contributions to the wide range of software distributed
221 | through that system in reliance on consistent application of that
222 | system; it is up to the author/donor to decide if he or she is willing
223 | to distribute software through any other system and a licensee cannot
224 | impose that choice.
225 |
226 | This section is intended to make thoroughly clear what is believed to
227 | be a consequence of the rest of this License.
228 |
229 | 8. If the distribution and/or use of the Program is restricted in
230 | certain countries either by patents or by copyrighted interfaces, the
231 | original copyright holder who places the Program under this License
232 | may add an explicit geographical distribution limitation excluding
233 | those countries, so that distribution is permitted only in or among
234 | countries not thus excluded. In such case, this License incorporates
235 | the limitation as if written in the body of this License.
236 |
237 | 9. The Free Software Foundation may publish revised and/or new versions
238 | of the General Public License from time to time. Such new versions will
239 | be similar in spirit to the present version, but may differ in detail to
240 | address new problems or concerns.
241 |
242 | Each version is given a distinguishing version number. If the Program
243 | specifies a version number of this License which applies to it and "any
244 | later version", you have the option of following the terms and conditions
245 | either of that version or of any later version published by the Free
246 | Software Foundation. If the Program does not specify a version number of
247 | this License, you may choose any version ever published by the Free Software
248 | Foundation.
249 |
250 | 10. If you wish to incorporate parts of the Program into other free
251 | programs whose distribution conditions are different, write to the author
252 | to ask for permission. For software which is copyrighted by the Free
253 | Software Foundation, write to the Free Software Foundation; we sometimes
254 | make exceptions for this. Our decision will be guided by the two goals
255 | of preserving the free status of all derivatives of our free software and
256 | of promoting the sharing and reuse of software generally.
257 |
258 | NO WARRANTY
259 |
260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
268 | REPAIR OR CORRECTION.
269 |
270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
278 | POSSIBILITY OF SUCH DAMAGES.
279 |
280 | END OF TERMS AND CONDITIONS
281 |
282 | How to Apply These Terms to Your New Programs
283 |
284 | If you develop a new program, and you want it to be of the greatest
285 | possible use to the public, the best way to achieve this is to make it
286 | free software which everyone can redistribute and change under these terms.
287 |
288 | To do so, attach the following notices to the program. It is safest
289 | to attach them to the start of each source file to most effectively
290 | convey the exclusion of warranty; and each file should have at least
291 | the "copyright" line and a pointer to where the full notice is found.
292 |
293 | handles EAPD state updating for power-managed HDA codecs
294 | Copyright (C) 2013 Dolnor
295 |
296 | This program is free software; you can redistribute it and/or modify
297 | it under the terms of the GNU General Public License as published by
298 | the Free Software Foundation; either version 2 of the License, or
299 | (at your option) any later version.
300 |
301 | This program is distributed in the hope that it will be useful,
302 | but WITHOUT ANY WARRANTY; without even the implied warranty of
303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
304 | GNU General Public License for more details.
305 |
306 | You should have received a copy of the GNU General Public License along
307 | with this program; if not, write to the Free Software Foundation, Inc.,
308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
309 |
310 | Also add information on how to contact you by electronic and paper mail.
311 |
312 | If the program is interactive, make it output a short notice like this
313 | when it starts in an interactive mode:
314 |
315 | Gnomovision version 69, Copyright (C) year name of author
316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
317 | This is free software, and you are welcome to redistribute it
318 | under certain conditions; type `show c' for details.
319 |
320 | The hypothetical commands `show w' and `show c' should show the appropriate
321 | parts of the General Public License. Of course, the commands you use may
322 | be called something other than `show w' and `show c'; they could even be
323 | mouse-clicks or menu items--whatever suits your program.
324 |
325 | You should also get your employer (if you work as a programmer) or your
326 | school, if any, to sign a "copyright disclaimer" for the program, if
327 | necessary. Here is a sample; alter the names:
328 |
329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program
330 | `Gnomovision' (which makes passes at compilers) written by James Hacker.
331 |
332 | {signature of Ty Coon}, 1 April 1989
333 | Ty Coon, President of Vice
334 |
335 | This General Public License does not permit incorporating your program into
336 | proprietary programs. If your program is a subroutine library, you may
337 | consider it more useful to permit linking proprietary applications with the
338 | library. If this is what you want to do, use the GNU Lesser General
339 | Public License instead of this License.
340 |
--------------------------------------------------------------------------------