summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorJoshua Stein <jcs@cvs.openbsd.org>2016-09-01 09:39:55 +0000
committerJoshua Stein <jcs@cvs.openbsd.org>2016-09-01 09:39:55 +0000
commit77202025ddeec8906404f580766c68a06f950256 (patch)
tree9774f36e12e17152b386b4b4db2574b1cfc9fb11 /sys/dev
parentd69bf0fecaed5c1c7f4e6b86ff27336103373d97 (diff)
- disable controller when we're done using it
- read CLR_INTR register when disabling interrupts
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/acpi/dwiic.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/acpi/dwiic.c b/sys/dev/acpi/dwiic.c
index 24a455fbe4e..7d796192c4e 100644
--- a/sys/dev/acpi/dwiic.c
+++ b/sys/dev/acpi/dwiic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dwiic.c,v 1.17 2016/09/01 09:38:25 jcs Exp $ */
+/* $OpenBSD: dwiic.c,v 1.18 2016/09/01 09:39:54 jcs Exp $ */
/*
* Synopsys DesignWare I2C controller
*
@@ -814,6 +814,7 @@ dwiic_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr, const void *cmdbuf,
/* disable interrupts */
dwiic_write(sc, DW_IC_INTR_MASK, 0);
+ dwiic_read(sc, DW_IC_CLR_INTR);
/* enable controller */
dwiic_enable(sc, 1);
@@ -928,6 +929,10 @@ dwiic_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr, const void *cmdbuf,
(int)(len - 1 - readpos));
sc->sc_i2c_xfer.error = 1;
sc->sc_busy = 0;
+
+ /* disable controller */
+ dwiic_enable(sc, 0);
+
return (1);
}
@@ -954,6 +959,9 @@ dwiic_i2c_exec(void *cookie, i2c_op_t op, i2c_addr_t addr, const void *cmdbuf,
}
}
+ /* disable controller */
+ dwiic_enable(sc, 0);
+
sc->sc_busy = 0;
return 0;