The diff below makes the dwiic(4) driver's match function behave like
the other acpi attach functions by matching on the _HID.  This way it
will continue to atach with the diff I sent out earlier today.

I deliberately did not use the #define's from acpireg.h here.  I
intend to remove those.  Just listing the strings in the driver makes
it easier to check to what IDs the driver attaches.

ok?


Index: dwiic.c
===================================================================
RCS file: /cvs/src/sys/dev/acpi/dwiic.c,v
retrieving revision 1.9
diff -u -p -r1.9 dwiic.c
--- dwiic.c     22 Jan 2016 22:57:23 -0000      1.9
+++ dwiic.c     28 Mar 2016 18:34:32 -0000
@@ -196,6 +196,15 @@ struct cfdriver dwiic_cd = {
        NULL, "dwiic", DV_DULL
 };
 
+const char *dwiic_hids[] = {
+       "INT33C2",
+       "INT33C3",
+       "INT3432",
+       "INT3433",
+       "80860F41",
+       NULL
+};
+
 int
 dwiic_match(struct device *parent, void *match, void *aux)
 {
@@ -203,9 +212,7 @@ dwiic_match(struct device *parent, void 
        struct cfdata *cf = match;
        int64_t sta;
 
-       if (aaa->aaa_name == NULL ||
-           strcmp(aaa->aaa_name, cf->cf_driver->cd_name) != 0 ||
-           aaa->aaa_table != NULL)
+       if (!acpi_matchhids(aaa, dwiic_hids, cf->cf_driver->cd_name))
                return 0;
 
        if (aml_evalinteger((struct acpi_softc *)parent, aaa->aaa_node,

Reply via email to