@@ -7068,6 +7068,7 @@ GetDevices ()
7068
7068
}
7069
7069
if (gSettings.ResetHDA) {
7070
7070
//Slice method from VoodooHDA
7071
+ //PCI_HDA_TCSEL_OFFSET = 0x44
7071
7072
UINT8 Value = 0;
7072
7073
Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0x44, 1, &Value);
7073
7074
@@ -7816,22 +7817,36 @@ SetDevices (LOADER_ENTRY *Entry)
7816
7817
}
7817
7818
7818
7819
// HDA
7819
- else if (gSettings .HDAInjection &&
7820
- (Pci.Hdr .ClassCode [2 ] == PCI_CLASS_MEDIA) &&
7820
+ else if ((Pci.Hdr.ClassCode[2] == PCI_CLASS_MEDIA) &&
7821
7821
((Pci.Hdr.ClassCode[1] == PCI_CLASS_MEDIA_HDA) ||
7822
7822
(Pci.Hdr.ClassCode[1] == PCI_CLASS_MEDIA_AUDIO))) {
7823
7823
// HDMI injection inside
7824
- TmpDirty = setup_hda_devprop (PciIo, &PCIdevice, Entry->OSVersion );
7825
- StringDirty |= TmpDirty;
7826
- }
7824
+ if (gSettings.HDAInjection ) {
7825
+ TmpDirty = setup_hda_devprop (PciIo, &PCIdevice, Entry->OSVersion);
7826
+ StringDirty |= TmpDirty;
7827
+ }
7828
+ if (gSettings.ResetHDA) {
7829
+
7830
+ //PCI_HDA_TCSEL_OFFSET = 0x44
7831
+ UINT8 Value = 0;
7832
+ Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint8, 0x44, 1, &Value);
7833
+
7834
+ if (EFI_ERROR(Status)) {
7835
+ continue;
7836
+ }
7837
+
7838
+ Value &= 0xf8;
7839
+ PciIo->Pci.Write (PciIo, EfiPciIoWidthUint8, 0x44, 1, &Value);
7840
+ }
7841
+ }
7827
7842
7828
7843
//LPC
7829
7844
else if ((Pci.Hdr.ClassCode[2] == PCI_CLASS_BRIDGE) &&
7830
7845
(Pci.Hdr.ClassCode[1] == PCI_CLASS_BRIDGE_ISA))
7831
7846
{
7832
7847
if (gSettings.LpcTune) {
7833
7848
Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint16, GEN_PMCON_1, 1, &PmCon);
7834
- MsgLog (" Initial PmCon value=%hX\n " , PmCon);
7849
+ MsgLog ("Initial PmCon value=%hX\n", PmCon);
7835
7850
7836
7851
if (gSettings.EnableC6) {
7837
7852
PmCon |= 1 << 11;
@@ -7868,7 +7883,7 @@ SetDevices (LOADER_ENTRY *Entry)
7868
7883
PciIo->Pci.Write (PciIo, EfiPciIoWidthUint16, GEN_PMCON_1, 1, &PmCon);
7869
7884
7870
7885
Status = PciIo->Pci.Read (PciIo, EfiPciIoWidthUint16,GEN_PMCON_1, 1, &PmCon);
7871
- MsgLog (" Set PmCon value=%hX\n " , PmCon);
7886
+ MsgLog ("Set PmCon value=%hX\n", PmCon);
7872
7887
7873
7888
}
7874
7889
Rcba = 0;
0 commit comments