diff --git a/system/hwquirks.c b/system/hwquirks.c index 0aef869..a15c09a 100644 --- a/system/hwquirks.c +++ b/system/hwquirks.c @@ -54,6 +54,7 @@ void quirks_init(void) quirk.type = QUIRK_TYPE_NONE; quirk.root_vid = pci_config_read16(0, 0, 0, 0); quirk.root_did = pci_config_read16(0, 0, 0, 2); + quirk.process = NULL; // ------------------------ // -- ASUS TUSL2-C Quirk -- @@ -66,7 +67,7 @@ void quirks_init(void) if (pci_config_read16(0, 0, 0, 0x2E) == 0x8027) { // TUSL2-C quirk.id = QUIRK_TUSL2; quirk.type |= QUIRK_TYPE_SMBUS; - asus_tusl2_configure_mux(); + quirk.process = asus_tusl2_configure_mux; } } } diff --git a/system/hwquirks.h b/system/hwquirks.h index 0982e83..ba1d78b 100644 --- a/system/hwquirks.h +++ b/system/hwquirks.h @@ -10,6 +10,7 @@ #include #include +#include #define QUIRK_TYPE_NONE 0b00000000 #define QUIRK_TYPE_USB 0b00000001 @@ -28,6 +29,7 @@ typedef struct { uint8_t type; uint16_t root_vid; uint16_t root_did; + void (*process)(void); } quirk_t; extern quirk_t quirk; diff --git a/system/smbus.c b/system/smbus.c index b3c3eb6..d0a04d6 100644 --- a/system/smbus.c +++ b/system/smbus.c @@ -12,6 +12,7 @@ #include "smbus.h" #include "smbios.h" #include "jedec_id.h" +#include "hwquirks.h" #define LINE_SPD 13 #define MAX_SPD_SLOT 8 @@ -153,6 +154,10 @@ void print_smbus_startup_info(void) { ram.freq = 0; curspd.isValid = false; + if (quirk.type == QUIRK_TYPE_SMBUS) { + quirk.process(); + } + index = find_smb_controller(); if (index == -1) {