diff options
-rw-r--r-- | arch/x86/lib/i8254.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/arch/x86/lib/i8254.c b/arch/x86/lib/i8254.c index d0227954b1..0f97538910 100644 --- a/arch/x86/lib/i8254.c +++ b/arch/x86/lib/i8254.c @@ -51,6 +51,10 @@ int i8254_enable_beep(uint frequency_hz) if (!frequency_hz) return -EINVAL; + /* make sure i8254 is setup correctly before generating beeps */ + outb(PIT_CMD_CTR2 | PIT_CMD_BOTH | PIT_CMD_MODE3, + PIT_BASE + PIT_COMMAND); + i8254_set_beep_freq(frequency_hz); setio_8(SYSCTL_PORTB, PORTB_BEEP_ENABLE); |