未验证 提交 69b9c5c1 编写于 作者: C Curi0 提交者: GitHub

AudioDxe: Add --force-codec (#460)

上级 154d8457
......@@ -7019,6 +7019,11 @@ the driver within the \texttt{UEFI/Drivers} section:
will be achieved by using \texttt{Audio} section \texttt{SetupDelay} if any audio setup delay
is required. Where required, values of up to one second may be needed. \medskip
\item \texttt{-{}-force-codec} - Integer value, default \texttt{0}. \medskip
Force use of an audio codec, this value should be equal to \texttt{Audio} section \texttt{AudioCodec}.
Can result in faster boot especially when used in conjuction with \texttt{-{}-force-device}. \medskip
\item \texttt{-{}-force-device} - String value, no default. \medskip
When this option is present and has a value (e.g. \texttt{-{}-force-device=PciRoot(0x0)/Pci(0x1f,0x3)}), it
......
......@@ -47,6 +47,12 @@ EFI_DEVICE_PATH_PROTOCOL *
UINTN
gCodecSetupDelay = 0;
BOOLEAN
gUseForcedCodec = FALSE;
UINTN
gForcedCodec = 0;
/**
HdaController Driver Binding.
**/
......@@ -120,6 +126,11 @@ AudioDxeInit (
OcParsedVarsGetInt (ParsedLoadOptions, L"--codec-setup-delay", &gCodecSetupDelay, OcStringFormatUnicode);
Status = OcParsedVarsGetInt (ParsedLoadOptions, L"--force-codec", &gForcedCodec, OcStringFormatUnicode);
if (Status != EFI_NOT_FOUND) {
gUseForcedCodec = TRUE;
}
OcFlexArrayFree (&ParsedLoadOptions);
} else if (Status != EFI_NOT_FOUND) {
return Status;
......
......@@ -119,4 +119,16 @@ extern
UINTN
gCodecSetupDelay;
//
// Whether to use forced codec.
//
extern BOOLEAN
gUseForcedCodec;
//
// Forced codec number.
//
extern UINTN
gForcedCodec;
#endif // EFI_AUDIODXE_H
......@@ -1726,6 +1726,12 @@ HdaCodecDriverBindingSupported (
goto CLOSE_CODEC;
}
// Check --force-codec.
if (gUseForcedCodec && (gForcedCodec != CodecAddress)) {
Status = EFI_UNSUPPORTED;
goto CLOSE_CODEC;
}
// Codec can be supported.
DEBUG ((DEBUG_INFO, "HDA: Connecting codec 0x%X\n", CodecAddress));
Status = EFI_SUCCESS;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册