9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] audiohda: detect hda devices using pci class id
@ 2023-09-17 13:16 kemal
  2023-09-17 18:26 ` ori
  0 siblings, 1 reply; 2+ messages in thread
From: kemal @ 2023-09-17 13:16 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 342 bytes --]

ping:

pci id assignment specification assigns the class 04:03 as HDA
https://pcisig.com/sites/default/files/files/PCI_Code-ID_r_1_11__v24_Jan_2019.pdf
checking the class id would allow the driver to attach any generic HDA device
i prepared a patch to do this, i kept the pci lookup table in case there is
some device with a broken pci class

[-- Attachment #2: audiohda.patch --]
[-- Type: application/octet-stream, Size: 729 bytes --]

From: kemal <kemalinanc8@gmail.com>
Date: Thu, 27 Jul 2023 18:25:14 +0000
Subject: [PATCH] audiohda: detect hda devices using pci class id

---
diff 281c087865941281cbe656b5d7b44c15cfa68dfc 693b8be8be4be656b3108a2fc8eebb8fba94b1d2
--- a/sys/src/9/pc/audiohda.c
+++ b/sys/src/9/pc/audiohda.c
@@ -1758,7 +1758,9 @@
 static Pcidev*
 hdamatch(Pcidev *p)
 {
-	while(p = pcimatch(p, 0, 0))
+	while(p = pcimatch(p, 0, 0)){
+		if(p->ccrb == 0x04 && p->ccru == 0x03)
+			return p;
 		switch((p->vid << 16) | p->did){
 		case (0x8086 << 16) | 0x2668:	/* Intel ICH6 (untested) */
 		case (0x8086 << 16) | 0x27d8:	/* Intel ICH7 */
@@ -1812,6 +1814,7 @@
 		case (0x15ad << 16) | 0x1977:	/* Vmware */
 			return p;
 		}
+	}
 	return nil;
 }
 

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [9front] audiohda: detect hda devices using pci class id
  2023-09-17 13:16 [9front] audiohda: detect hda devices using pci class id kemal
@ 2023-09-17 18:26 ` ori
  0 siblings, 0 replies; 2+ messages in thread
From: ori @ 2023-09-17 18:26 UTC (permalink / raw)
  To: 9front

Quoth kemal <kemalinanc8@gmail.com>:
> /mail/fs/9Front/3232/2/body.patch

lgtm, committed.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-17 18:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-17 13:16 [9front] audiohda: detect hda devices using pci class id kemal
2023-09-17 18:26 ` ori

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).