From 9476f01c716498b9e98595483b8f5430e9891b38 Mon Sep 17 00:00:00 2001 From: mlarkin Date: Mon, 8 Jan 2018 08:14:00 +0000 Subject: [PATCH] Attach dwiic_pci on Dell Precision 7520. Also restrict ihidev reports to those of 3 bytes or more (as per the hid-over-i2c spec). discussed with jcs, kettenis --- sys/dev/i2c/ihidev.c | 4 ++-- sys/dev/pci/dwiic_pci.c | 4 +++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/sys/dev/i2c/ihidev.c b/sys/dev/i2c/ihidev.c index b0a80e93278..148c1458714 100644 --- a/sys/dev/i2c/ihidev.c +++ b/sys/dev/i2c/ihidev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ihidev.c,v 1.14 2017/11/29 02:48:16 jcs Exp $ */ +/* $OpenBSD: ihidev.c,v 1.15 2018/01/08 08:14:00 mlarkin Exp $ */ /* * HID-over-i2c driver * @@ -604,7 +604,7 @@ ihidev_intr(void *arg) * than or equal to wMaxInputLength */ psize = sc->sc_ibuf[0] | sc->sc_ibuf[1] << 8; - if (!psize || psize > sc->sc_isize) { + if (psize < 3 || psize > sc->sc_isize) { if (sc->sc_poll) { /* * TODO: all fingers are up, should we pass to hid diff --git a/sys/dev/pci/dwiic_pci.c b/sys/dev/pci/dwiic_pci.c index 09439abf680..4af4c2ffcc4 100644 --- a/sys/dev/pci/dwiic_pci.c +++ b/sys/dev/pci/dwiic_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dwiic_pci.c,v 1.1 2017/11/16 18:12:27 jcs Exp $ */ +/* $OpenBSD: dwiic_pci.c,v 1.2 2018/01/08 08:14:00 mlarkin Exp $ */ /* * Synopsys DesignWare I2C controller * PCI attachment @@ -62,6 +62,8 @@ struct cfattach dwiic_pci_ca = { const struct pci_matchid dwiic_pci_ids[] = { { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_100SERIES_LP_I2C_1 }, { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_100SERIES_LP_I2C_2 }, + { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_100SERIES_I2C0 }, + { PCI_VENDOR_INTEL, PCI_PRODUCT_INTEL_100SERIES_I2C1 }, }; int -- 2.20.1