NO:
W90P710 Programming Guide
VERSION:
2.0
PAGE:
133
The above information is the exclusive intellectual property of Winbond Electronics and shall not be disclosed, distributed or reproduced without permission
from Winbond.
Table No.: 2005-W90P710-11-A
3.
Polling the
AC_R_FINISH
bit of
ACTL_ACCON
register until it was set or time-out
4.
If time-out occurred, the external AC97 codec may not be ready or W90P710 hardware
failure
5.
Clear
ACTL_ACOS0
register
6.
Read
R_INDEX[6:0]
of
ACTL_ACIS1
register. This echo value must be equal to the
value written to
ACTL_ACOS1
. If the echo value was not correct, check the hardware.
7.
Read AC97 register value from
RD[15:0]
of
ACTL_ACIS2
register
A sample code is given below:
static UINT16 ac97_read_register(INT nIdx)
{
volatile
INT nWait;
/* set the R_WB bit and write register index */
writew(REG_ACTL_ACOS1, 0x80 | nIdx);
/* set the valid frame bit and valid slots */
writew(REG_ACTL_ACOS0,
0x11);
Delay(100);
/* polling the AC_R_FINISH */
for (nWait = 0; nWait < 0x10000; nWait++)
if (readw(REG_ACTL_ACCON) & AC_R_FINISH)
break;
if (nWait == 0x10000)
_error_msg("ac97_read_register
time
out!\n");
writew(REG_ACTL_ACOS0,
0);
if (readw(REG_ACTL_ACIS1) >> 2 != nIdx)
_debug_msg("ac97_read_register - R_INDEX of REG_ACTL_ACIS1 not match!,
0x%x\n", readw(REG_ACTL_ACIS1));
Delay(100);
return (readw(REG_ACTL_ACIS2) & 0xFFFF);