diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2016-01-14 21:25:58 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2016-01-14 21:25:58 +0000 |
commit | 8df8c272b146b0f273201121a6e9120a9b827faf (patch) | |
tree | 8be73cf78bbd3d87ce9060f49ce28478e56d1140 /sys/dev | |
parent | 6907d0e322a04bbd8343b995c270278601913d37 (diff) |
Use I2C_F_POLL flag when acquiring and releasing the i2c bus in the
interrupt handler.
ok jcs@
Diffstat (limited to 'sys/dev')
-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++) |