Fix VIA AC97 warning
This commit is contained in:
@@ -176,7 +176,8 @@ ac97_via_update_irqs(ac97_via_t *dev)
|
|||||||
|
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ac97_via_update_codec(ac97_via_t *dev) {
|
ac97_via_update_codec(ac97_via_t *dev)
|
||||||
|
{
|
||||||
/* Get primary audio codec. */
|
/* Get primary audio codec. */
|
||||||
ac97_codec_t *codec = dev->codec[0][0];
|
ac97_codec_t *codec = dev->codec[0][0];
|
||||||
|
|
||||||
@@ -378,16 +379,16 @@ ac97_via_sgd_write(uint16_t addr, uint8_t val, void *priv)
|
|||||||
if (val & 1) { /* return 0x00 on unaligned reads */
|
if (val & 1) { /* return 0x00 on unaligned reads */
|
||||||
dev->sgd_regs[0x80] = dev->sgd_regs[0x81] = 0x00;
|
dev->sgd_regs[0x80] = dev->sgd_regs[0x81] = 0x00;
|
||||||
} else {
|
} else {
|
||||||
dev->sgd_regs[0x80] = dev->codec_shadow[modem].regs_codec[i][val] = ac97_codec_read(codec, val);
|
dev->sgd_regs[0x80] = dev->codec_shadow[modem].regs_codec[i][(val & 0x7f)] = ac97_codec_read(codec, val);
|
||||||
dev->sgd_regs[0x81] = dev->codec_shadow[modem].regs_codec[i][val | 1] = ac97_codec_read(codec, val | 1);
|
dev->sgd_regs[0x81] = dev->codec_shadow[modem].regs_codec[i][(val & 0x7f) | 1] = ac97_codec_read(codec, val | 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Flag data/status/index for this codec as valid. */
|
/* Flag data/status/index for this codec as valid. */
|
||||||
if (val & 0x80)
|
if (val & 0x80)
|
||||||
dev->sgd_regs[0x83] |= 0x02 << (i << 1);
|
dev->sgd_regs[0x83] |= 0x02 << (i << 1);
|
||||||
} else if (!(val & 1)) { /* do nothing on unaligned writes */
|
} else if (!(val & 1)) { /* do nothing on unaligned writes */
|
||||||
ac97_codec_write(codec, val, dev->codec_shadow[modem].regs_codec[i][val] = dev->sgd_regs[0x80]);
|
ac97_codec_write(codec, val, dev->codec_shadow[modem].regs_codec[i][(val & 0x7f)] = dev->sgd_regs[0x80]);
|
||||||
ac97_codec_write(codec, val | 1, dev->codec_shadow[modem].regs_codec[i][val | 1] = dev->sgd_regs[0x81]);
|
ac97_codec_write(codec, val | 1, dev->codec_shadow[modem].regs_codec[i][(val & 0x7f) | 1] = dev->sgd_regs[0x81]);
|
||||||
|
|
||||||
/* Update primary audio codec state if that codec was written to. */
|
/* Update primary audio codec state if that codec was written to. */
|
||||||
if (!modem && !i)
|
if (!modem && !i)
|
||||||
|
Reference in New Issue
Block a user