Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/dev/i2c/ihidev.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/dev/i2c/ihidev.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.1 retrieving revision 1.1.2.4 diff -u -p -r1.1 -r1.1.2.4 --- src/sys/dev/i2c/ihidev.c 2017/12/10 17:05:54 1.1 +++ src/sys/dev/i2c/ihidev.c 2018/11/26 01:52:31 1.1.2.4 @@ -1,4 +1,4 @@ -/* $NetBSD: ihidev.c,v 1.1 2017/12/10 17:05:54 bouyer Exp $ */ +/* $NetBSD: ihidev.c,v 1.1.2.4 2018/11/26 01:52:31 pgoyette Exp $ */ /* $OpenBSD ihidev.c,v 1.13 2017/04/08 02:57:23 deraadt Exp $ */ /*- @@ -54,7 +54,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ihidev.c,v 1.1 2017/12/10 17:05:54 bouyer Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ihidev.c,v 1.1.2.4 2018/11/26 01:52:31 pgoyette Exp $"); #include #include @@ -112,7 +112,7 @@ CFATTACH_DECL_NEW(ihidev, sizeof(struct static bool ihidev_suspend(device_t, const pmf_qual_t *); static bool ihidev_resume(device_t, const pmf_qual_t *); static int ihidev_hid_command(struct ihidev_softc *, int, void *, bool); -static unsigned int ihidev_intr(void *); +static int ihidev_intr(void *); static int ihidev_reset(struct ihidev_softc *, bool); static int ihidev_hid_desc_parse(struct ihidev_softc *); @@ -120,20 +120,20 @@ static int ihidev_maxrepid(void *, int); static int ihidev_print(void *, const char *); static int ihidev_submatch(device_t, cfdata_t, const int *, void *); -static const char *ihidev_compats[] = { - "hid-over-i2c", - NULL +static const struct device_compatible_entry compat_data[] = { + { "hid-over-i2c", 0 }, + { NULL, 0 } }; static int ihidev_match(device_t parent, cfdata_t match, void *aux) { struct i2c_attach_args * const ia = aux; + int match_result; + + if (iic_use_direct_match(ia, match, compat_data, &match_result)) + return I2C_MATCH_DIRECT_COMPATIBLE; - if (ia->ia_ncompat > 0) { - if (iic_compat_match(ia, ihidev_compats)) - return 1; - } return 0; } @@ -208,7 +208,8 @@ ihidev_attach(device_t parent, device_t { char buf[100]; - sc->sc_ih = acpi_intr_establish(self, sc->sc_phandle, ihidev_intr, sc); + sc->sc_ih = acpi_intr_establish(self, sc->sc_phandle, IPL_TTY, + false, ihidev_intr, sc, device_xname(self)); if (sc->sc_ih == NULL) aprint_error_dev(self, "can't establish interrupt\n"); aprint_normal_dev(self, "interrupting at %s\n", @@ -263,7 +264,7 @@ ihidev_detach(device_t self, int flags) mutex_enter(&sc->sc_intr_lock); #if NACPICA > 0 if (sc->sc_ih != NULL) - acpi_intr_disestablish(sc->sc_ih, ihidev_intr); + acpi_intr_disestablish(sc->sc_ih); #endif if (ihidev_hid_command(sc, I2C_HID_CMD_SET_POWER, &I2C_HID_POWER_OFF, true)) @@ -650,7 +651,7 @@ ihidev_hid_desc_parse(struct ihidev_soft return (0); } -static unsigned int +static int ihidev_intr(void *arg) { struct ihidev_softc *sc = arg; @@ -724,7 +725,7 @@ ihidev_maxrepid(void *buf, int len) maxid = -1; h.report_ID = 0; for (d = hid_start_parse(buf, len, hid_none); hid_get_item(d, &h); ) - if (h.report_ID > maxid) + if ((int)h.report_ID > maxid) maxid = h.report_ID; hid_end_parse(d);