Skip to content

Commit

Permalink
audio: Avoid invalid writes to NABM PICB and NABM PIV
Browse files Browse the repository at this point in the history
  • Loading branch information
JayFoxRox authored and thrimbor committed Feb 7, 2020
1 parent a12c8b8 commit c48966b
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/hal/audio.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,16 +155,18 @@ void XAudioInit(int sampleSizeInBits, int numChannels, XAudioCallback callback,
void XAudioPlay()
{
volatile AC97_DEVICE *pac97device = &ac97Device;
pac97device->mmio[0x118>>2] = (unsigned int)0x1d000000; // PCM out - run, allow interrupts
pac97device->mmio[0x178>>2] = (unsigned int)0x1d000000; // PCM out - run, allow interrupts
volatile unsigned char *pb = (unsigned char *)pac97device->mmio;
pb[0x11B] = 0x1d; // PCM out - run, allow interrupts
pb[0x17B] = 0x1d; // PCM out - run, allow interrupts
}

// tell the chip it is paused.
void XAudioPause()
{
volatile AC97_DEVICE *pac97device = &ac97Device;
pac97device->mmio[0x118>>2] = (unsigned int)0x1c000000; // PCM out - PAUSE, allow interrupts
pac97device->mmio[0x178>>2] = (unsigned int)0x1c000000; // PCM out - PAUSE, allow interrupts
volatile unsigned char *pb = (unsigned char *)pac97device->mmio;
pb[0x11B] = 0x1c; // PCM out - PAUSE, allow interrupts
pb[0x17B] = 0x1c; // PCM out - PAUSE, allow interrupts
}

// This is the function you should call when you want to give the
Expand Down

0 comments on commit c48966b

Please sign in to comment.