2022-05-20 06:23:25 -05:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
// Copyright (C) 2004-2022 Sam Demeulemeester
|
|
|
|
#ifndef _QUIRK_H_
|
|
|
|
#define _QUIRK_H_
|
|
|
|
/**
|
|
|
|
*
|
|
|
|
* Provides support for hardware quirks
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
2022-06-05 07:36:56 -05:00
|
|
|
#include <stddef.h>
|
2022-05-20 06:23:25 -05:00
|
|
|
|
2022-06-06 12:56:04 -05:00
|
|
|
#define QUIRK_TYPE_NONE (1 << 0)
|
|
|
|
#define QUIRK_TYPE_USB (1 << 1)
|
|
|
|
#define QUIRK_TYPE_SMP (1 << 2)
|
|
|
|
#define QUIRK_TYPE_SMBIOS (1 << 3)
|
|
|
|
#define QUIRK_TYPE_SMBUS (1 << 4)
|
|
|
|
#define QUIRK_TYPE_TIMER (1 << 5)
|
|
|
|
#define QUIRK_TYPE_MEM_SIZE (1 << 6)
|
2022-05-20 06:23:25 -05:00
|
|
|
|
|
|
|
typedef enum {
|
|
|
|
QUIRK_NONE,
|
2022-06-06 12:56:04 -05:00
|
|
|
QUIRK_TUSL2,
|
|
|
|
QUIRK_ALI_ALADDIN_V
|
2022-05-20 06:23:25 -05:00
|
|
|
} quirk_id_t;
|
|
|
|
|
|
|
|
typedef struct {
|
|
|
|
quirk_id_t id;
|
|
|
|
uint8_t type;
|
|
|
|
uint16_t root_vid;
|
|
|
|
uint16_t root_did;
|
2022-06-05 07:36:56 -05:00
|
|
|
void (*process)(void);
|
2022-05-20 06:23:25 -05:00
|
|
|
} quirk_t;
|
|
|
|
|
|
|
|
extern quirk_t quirk;
|
|
|
|
|
|
|
|
void quirks_init(void);
|
|
|
|
|
|
|
|
#endif /* _QUIRK_H_ */
|