diff options
author | 2016-01-14 21:25:57 +0000 | |
---|---|---|
committer | 2016-01-14 21:25:57 +0000 | |
commit | e6f4df9da7cf33bdf6d62dc24a225736d711e366 (patch) | |
tree | 5cfc5a9283158d784d84e021bfcba5d24c8ddb38 /sys/dev/i2c/ihidev.c | |
parent | When iterating over the report IDs to calculate the maximum size, take (diff) | |
download | wireguard-openbsd-e6f4df9da7cf33bdf6d62dc24a225736d711e366.tar.xz wireguard-openbsd-e6f4df9da7cf33bdf6d62dc24a225736d711e366.zip |
Use I2C_F_POLL flag when acquiring and releasing the i2c bus in the
interrupt handler.
ok jcs@
Diffstat (limited to 'sys/dev/i2c/ihidev.c')
-rw-r--r-- | sys/dev/i2c/ihidev.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/sys/dev/i2c/ihidev.c b/sys/dev/i2c/ihidev.c index 1685aa3228a..11b310a3c6a 100644 --- a/sys/dev/i2c/ihidev.c +++ b/sys/dev/i2c/ihidev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ihidev.c,v 1.5 2016/01/14 21:21:26 kettenis Exp $ */ +/* $OpenBSD: ihidev.c,v 1.6 2016/01/14 21:25:57 kettenis Exp $ */ /* * HID-over-i2c driver * @@ -424,14 +424,17 @@ ihidev_intr(void *arg) u_char *p; u_int rep = 0; - iic_acquire_bus(sc->sc_tag, 0); + /* + * XXX: force I2C_F_POLL for now to avoid dwiic interrupting + * while we are interrupting + */ + + iic_acquire_bus(sc->sc_tag, I2C_F_POLL); - /* XXX: force I2C_F_POLL for now to avoid dwiic interrupting while we - * are interrupting */ res = iic_exec(sc->sc_tag, I2C_OP_READ, sc->sc_addr, NULL, 0, - sc->sc_ibuf, size, I2C_F_POLL); + sc->sc_ibuf, sc->sc_isize, I2C_F_POLL); - iic_release_bus(sc->sc_tag, 0); + iic_release_bus(sc->sc_tag, I2C_F_POLL); DPRINTF(("%s: ihidev_intr: hid input:", sc->sc_dev.dv_xname)); for (i = 0; i < sc->sc_isize; i++) |