Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Support devices that the PCI subclass is not PCI...



details:   https://anonhg.NetBSD.org/src/rev/c6eae73c4958
branches:  trunk
changeset: 990464:c6eae73c4958
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Thu Oct 28 09:15:35 2021 +0000

description:
Support devices that the PCI subclass is not PCI_SUBCLASS_MULTIMEDIA_HDAUDIO.

 - Not tested well.
 - If audioX is not attached, add HDAUDIO_ENABLE_DISPLAYPORT and
   HDAUDIO_ENABLE_HDMI to your kernel config.

diffstat:

 sys/dev/pci/hdaudio_pci.c |  26 +++++++++++++++++++-------
 1 files changed, 19 insertions(+), 7 deletions(-)

diffs (55 lines):

diff -r ed68e0d7ac16 -r c6eae73c4958 sys/dev/pci/hdaudio_pci.c
--- a/sys/dev/pci/hdaudio_pci.c Thu Oct 28 07:24:40 2021 +0000
+++ b/sys/dev/pci/hdaudio_pci.c Thu Oct 28 09:15:35 2021 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio_pci.c,v 1.10 2018/09/12 09:49:03 mrg Exp $ */
+/* $NetBSD: hdaudio_pci.c,v 1.11 2021/10/28 09:15:35 msaitoh Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd <support%precedence.co.uk@localhost>
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdaudio_pci.c,v 1.10 2018/09/12 09:49:03 mrg Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio_pci.c,v 1.11 2021/10/28 09:15:35 msaitoh Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -84,6 +84,17 @@
     hdaudio_pci_childdet
 );
 
+/* Some devices' sublcass is not PCI_SUBCLASS_MULTIMEDIA_HDAUDIO. */
+static const struct device_compatible_entry compat_data[] = {
+       { .id = PCI_ID_CODE(PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_2HS_U_HDA) },
+       { .id = PCI_ID_CODE(PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_3HS_U_HDA) },
+       { .id = PCI_ID_CODE(PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_4HS_H_CAVS) },
+       { .id = PCI_ID_CODE(PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_5HS_LP_HDA) },
+       { .id = PCI_ID_CODE(PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_JSL_CAVS) },
+
+       PCI_COMPAT_EOL
+};
+
 /*
  * NetBSD autoconfiguration
  */
@@ -93,12 +104,13 @@
 {
        struct pci_attach_args *pa = opaque;
 
-       if (PCI_CLASS(pa->pa_class) != PCI_CLASS_MULTIMEDIA)
-               return 0;
-       if (PCI_SUBCLASS(pa->pa_class) != PCI_SUBCLASS_MULTIMEDIA_HDAUDIO)
-               return 0;
+       if ((PCI_CLASS(pa->pa_class) == PCI_CLASS_MULTIMEDIA) &&
+           (PCI_SUBCLASS(pa->pa_class) == PCI_SUBCLASS_MULTIMEDIA_HDAUDIO))
+               return 10;
+       if (pci_compatible_match(pa, compat_data) != 0)
+               return 10;
 
-       return 10;
+       return 0;
 }
 
 static void



Home | Main Index | Thread Index | Old Index