Change the way hwquirks are processed. Add a pointer to the needed function on quirk struct, so it can be executed at any point of the code
This commit is contained in:
parent
e154320790
commit
fa563a8cb2
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -10,6 +10,7 @@
|
|||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#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;
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue