Kernel: HDAudio only probe codecs in STATESTS
This removes unnecessary probing that lead to timeouts. Also cap codec address at 14 instead of 15. My test laptop was duplicating codec 0 at address 15 leading to duplicate devices.
This commit is contained in:
parent
c563efcd1c
commit
f89d690716
|
|
@ -11,6 +11,7 @@ namespace Kernel::HDAudio
|
|||
VMIN = 0x02,
|
||||
VMAJ = 0x03,
|
||||
GCTL = 0x08,
|
||||
STATESTS = 0x0E,
|
||||
|
||||
INTCTL = 0x20,
|
||||
INTSTS = 0x24,
|
||||
|
|
|
|||
|
|
@ -65,8 +65,12 @@ namespace Kernel
|
|||
m_pci_device.enable_interrupt(0, *this);
|
||||
m_bar0->write32(Regs::INTCTL, UINT32_MAX);
|
||||
|
||||
for (uint8_t codec_id = 0; codec_id < 0x10; codec_id++)
|
||||
const uint16_t state_sts = m_bar0->read16(Regs::STATESTS);
|
||||
for (uint8_t codec_id = 0; codec_id < 15; codec_id++)
|
||||
{
|
||||
if (!(state_sts & (1 << codec_id)))
|
||||
continue;
|
||||
|
||||
auto codec_or_error = initialize_codec(codec_id);
|
||||
if (codec_or_error.is_error())
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in New Issue