9front - general discussion about 9front
 help / color / mirror / Atom feed
From: kemal <kemalinanc8@gmail.com>
To: 9front@9front.org
Subject: Re: [9front] audiohda add cannon lake
Date: Thu, 27 Jul 2023 21:33:48 +0300	[thread overview]
Message-ID: <CABO6shfaxy8xtmOir4-RB_nDBDA4uBJMuHDb37Z04Qd-0mmwcA@mail.gmail.com> (raw)
In-Reply-To: <CAG3JMtYowbO9oYqVv3Ku9H6Xr4Tsw3mYcW0MRs=fbyJEvkE9Vw@mail.gmail.com>

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

2023-07-27 6:11 GMT+03:00, Thaddeus Woskowiak <tswoskowiak@gmail.com>:
> I have a Lenovo ThinkCentre M720 Tiny with an Intel Core i5-8500T and
> B360 chipset. It has issues but this quick patch gets audio working:
> http://okturing.com/src/16483/body
>
> -taw
>

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: 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;
 }
 

  reply	other threads:[~2023-07-27 18:35 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27  3:11 Thaddeus Woskowiak
2023-07-27 18:33 ` kemal [this message]
2023-08-18 13:05   ` kemal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABO6shfaxy8xtmOir4-RB_nDBDA4uBJMuHDb37Z04Qd-0mmwcA@mail.gmail.com \
    --to=kemalinanc8@gmail.com \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).