-/* $OpenBSD: azalia.c,v 1.174 2010/07/15 03:43:11 jakemsr Exp $ */
+/* $OpenBSD: azalia.c,v 1.175 2010/07/29 01:39:03 jakemsr Exp $ */
/* $NetBSD: azalia.c,v 1.20 2006/05/07 08:31:44 kent Exp $ */
/*-
codec_t *codecs;
int ncodecs; /* number of codecs */
int codecno; /* index of the using codec */
+ int detached; /* nonzero if audio(4) is not attached */
azalia_dma_t corb_dma;
int corb_entries;
err_exit:
printf("%s: initialization failure, detaching\n", XNAME(sc));
azalia_pci_detach(self, 0);
+ sc->detached = 1;
}
int
{
int err;
+ if (az->detached)
+ return 0;
+
/* disable unsolicited responses */
AZ_WRITE_4(az, GCTL, AZ_READ_4(az, GCTL) & ~HDA_GCTL_UNSOL);
pcireg_t v;
int err;
+ if (az->detached)
+ return 0;
+
/* enable back-to-back */
v = pci_conf_read(az->pc, az->tag, PCI_COMMAND_STATUS_REG);
pci_conf_write(az->pc, az->tag, PCI_COMMAND_STATUS_REG,