summaryrefslogtreecommitdiff
path: root/sys/dev/i2c/iatp.c
diff options
context:
space:
mode:
authorJoshua Stein <jcs@cvs.openbsd.org>2018-06-22 15:58:27 +0000
committerJoshua Stein <jcs@cvs.openbsd.org>2018-06-22 15:58:27 +0000
commit9013445558ca6a1f486610d882aaa9c805685b88 (patch)
treea477189f47decb5be2855ab28002a64859c1aae9 /sys/dev/i2c/iatp.c
parent4659f1a518bb27b99e22d692ffce48751b281109 (diff)
set I2C_F_POLL when acquiring the iic bus in an interrupt handler
found by witness, reported and tested by bentley
Diffstat (limited to 'sys/dev/i2c/iatp.c')
-rw-r--r--sys/dev/i2c/iatp.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/i2c/iatp.c b/sys/dev/i2c/iatp.c
index 54e9ca75295..189b547e189 100644
--- a/sys/dev/i2c/iatp.c
+++ b/sys/dev/i2c/iatp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: iatp.c,v 1.4 2017/10/28 14:44:46 bru Exp $ */
+/* $OpenBSD: iatp.c,v 1.5 2018/06/22 15:58:26 jcs Exp $ */
/*
* Atmel maXTouch i2c touchscreen/touchpad driver
* Copyright (c) 2016 joshua stein <jcs@openbsd.org>
@@ -682,12 +682,12 @@ iatp_read_reg(struct iatp_softc *sc, uint16_t reg, size_t len, void *val)
uint8_t cmd[2] = { reg & 0xff, (reg >> 8) & 0xff };
int ret;
- iic_acquire_bus(sc->sc_tag, 0);
+ iic_acquire_bus(sc->sc_tag, I2C_F_POLL);
ret = iic_exec(sc->sc_tag, I2C_OP_READ_WITH_STOP, sc->sc_addr, &cmd,
sizeof(cmd), val, len, I2C_F_POLL);
- iic_release_bus(sc->sc_tag, 0);
+ iic_release_bus(sc->sc_tag, I2C_F_POLL);
return ret;
}