-/* $OpenBSD: acpidev.h,v 1.30 2010/07/27 01:21:19 jordan Exp $ */
+/* $OpenBSD: acpidev.h,v 1.31 2010/08/03 16:55:06 marco Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
struct acpiec_softc {
struct device sc_dev;
+ int sc_ecbusy;
+
/* command/status register */
bus_space_tag_t sc_cmd_bt;
bus_space_handle_t sc_cmd_bh;
-/* $OpenBSD: acpiec.c,v 1.41 2010/08/02 17:13:57 deraadt Exp $ */
+/* $OpenBSD: acpiec.c,v 1.42 2010/08/03 16:55:06 marco Exp $ */
/*
* Copyright (c) 2006 Can Erkin Acar <canacar@openbsd.org>
*
* transaction does not get interrupted.
*/
dnprintf(20, "%s: read %d, %d\n", DEVNAME(sc), (int)addr, len);
+ sc->sc_ecbusy = 1;
acpiec_burst_enable(sc);
for (reg = 0; reg < len; reg++)
buffer[reg] = acpiec_read_1(sc, addr + reg);
acpiec_burst_disable(sc);
+ sc->sc_ecbusy = 0;
+ if (sc->sc_gotsci)
+ acpiec_sci_event(sc);
}
void
* transaction does not get interrupted.
*/
dnprintf(20, "%s: write %d, %d\n", DEVNAME(sc), (int)addr, len);
+ sc->sc_ecbusy = 1;
acpiec_burst_enable(sc);
for (reg = 0; reg < len; reg++)
acpiec_write_1(sc, addr + reg, buffer[reg]);
acpiec_burst_disable(sc);
+ sc->sc_ecbusy = 0;
+ if (sc->sc_gotsci)
+ acpiec_sci_event(sc);
}
int
dnprintf(10, "ACPIEC: got gpe\n");
do {
- if (sc->sc_gotsci)
+ if (sc->sc_gotsci && !sc->sc_ecbusy)
acpiec_sci_event(sc);
stat = acpiec_status(sc);