mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 04:07:45 +00:00
Kernel: Read and report AC'97 codec revision
This might help with debugging on bare metal. Since the minimum version that can be specified is revision 2.1, and we do not use any feature from revision 2.2 or newer, this is merely future-proofing ourselves for new features yet to be built. Additionally, removing the `VERIFY()` ensures we will not crash on cards that only support earlier revisions.
This commit is contained in:
parent
9a46573ffc
commit
694ff12272
2 changed files with 7 additions and 1 deletions
|
@ -87,8 +87,12 @@ UNMAP_AFTER_INIT ErrorOr<void> AC97::initialize()
|
|||
// Reset mixer
|
||||
m_io_mixer_base.offset(NativeAudioMixerRegister::Reset).out<u16>(1);
|
||||
|
||||
// Read out AC'97 codec revision
|
||||
auto extended_audio_id = m_io_mixer_base.offset(NativeAudioMixerRegister::ExtendedAudioID).in<u16>();
|
||||
VERIFY((extended_audio_id & ExtendedAudioMask::Revision) >> 10 == AC97Revision::Revision23);
|
||||
m_codec_revision = static_cast<AC97Revision>(((extended_audio_id & ExtendedAudioMask::Revision) >> 10) & 0b11);
|
||||
dbgln_if(AC97_DEBUG, "AC97 @ {}: codec revision {:#02b}", pci_address(), to_underlying(m_codec_revision));
|
||||
if (m_codec_revision == AC97Revision::Reserved)
|
||||
return ENOTSUP;
|
||||
|
||||
// Enable variable and double rate PCM audio if supported
|
||||
auto extended_audio_status_control_register = m_io_mixer_base.offset(NativeAudioMixerRegister::ExtendedAudioStatusControl);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue