AC97: Add TR28023/CT1297 codec

# Conflicts:
#	src/include/86box/snd_ac97.h
This commit is contained in:
RichardG867
2023-05-03 21:27:21 -03:00
parent 25c80854b1
commit d8229b6567
3 changed files with 32 additions and 2 deletions

View File

@@ -100,7 +100,8 @@ enum {
AC97_CODEC_WM9701A = 4,
AC97_CODEC_STAC9708 = 5,
AC97_CODEC_STAC9721 = 6,
AC97_CODEC_AK4540 = 7
AC97_CODEC_AK4540 = 7,
AC97_CODEC_TR28023 = 8
};
typedef struct ac97_vendor_reg_t {
@@ -152,8 +153,10 @@ extern const device_t ak4540_device;
extern const device_t alc100_device;
extern const device_t cs4297_device;
extern const device_t cs4297a_device;
#define ct1297_device tr28023_device
extern const device_t stac9708_device;
extern const device_t stac9721_device;
extern const device_t tr28023_device;
extern const device_t wm9701a_device;
extern const device_t ac97_via_device;

View File

@@ -29,7 +29,8 @@
static const struct {
const uint32_t vendor_id, min_rate, max_rate, misc_flags; /* definitions for misc_flags in snd_ac97.h */
const uint16_t reset_flags, extid_flags, /* definitions in snd_ac97.h */
powerdown_mask; /* bits [7:0] => register 26 bits [15:8]; bits [11:8] => register 2A bits [14:11] */
powerdown_mask; /* bits [7:0] => register 26 bits [15:8]; bits [11:8] => register 2A bits [14:11]
when using the probing tool, always |0x030 as it doesn't touch full powerdowns */
const ac97_vendor_reg_t *vendor_regs; /* bits [11:8] of index are the page number if applicable (registers [60:6F]) */
const device_t *device;
} ac97_codecs[] = {
@@ -95,6 +96,14 @@ static const struct {
.vendor_regs = (const ac97_vendor_reg_t []) {{0x6c, 0x0000, 0x0000}, {0x6e, 0x0000, 0x0003}, {0x70, 0x0000, 0xffff}, {0x72, 0x0000, 0x0006}, {0x74, 0x0000, 0x0003}, {0x76, 0x0000, 0xffff}, {0x78, 0x0000, 0x3802}, {0}},
.device = &stac9721_device
},
[AC97_CODEC_TR28023] = {
.vendor_id = AC97_VENDOR_ID('T', 'R', 'A', 0x03),
.misc_flags = AC97_MASTER_6B | AC97_MONOOUT | AC97_MONOOUT_6B | AC97_PCBEEP | AC97_PHONE | AC97_POP | AC97_MS | AC97_LPBK,
.reset_flags = 0,
.extid_flags = 0,
.powerdown_mask = 0x03f,
.device = &tr28023_device
},
[AC97_CODEC_WM9701A] = {
.vendor_id = AC97_VENDOR_ID('W', 'M', 'L', 0x00),
.misc_flags = AC97_AUXOUT | AC97_MONOOUT | AC97_PCBEEP | AC97_PHONE | AC97_VIDEO | AC97_AUXIN | AC97_MS | AC97_LPBK,
@@ -747,6 +756,20 @@ const device_t stac9721_device = {
.config = NULL
};
const device_t tr28023_device = {
.name = "TriTech TR28023 / Creative CT1297",
.internal_name = "tr28023",
.flags = DEVICE_AC97,
.local = AC97_CODEC_TR28023,
.init = ac97_codec_init,
.close = ac97_codec_close,
.reset = ac97_codec_reset,
{ .available = NULL },
.speed_changed = NULL,
.force_redraw = NULL,
.config = NULL
};
const device_t wm9701a_device = {
.name = "Wolfson WM9701A",
.internal_name = "wm9701a",

View File

@@ -2078,6 +2078,10 @@ static const device_config_t es1371_config[] = {
{
.description = "SigmaTel STAC9721",
.value = AC97_CODEC_STAC9721
},
{
.description = "TriTech TR28023 / Creative CT1297",
.value = AC97_CODEC_TR28023
}
},
.default_int = AC97_CODEC_CS4297A