-/* $OpenBSD: acpidev.h,v 1.42 2017/09/06 13:01:48 jcs Exp $ */
+/* $OpenBSD: acpidev.h,v 1.43 2018/01/17 07:40:29 bentley Exp $ */
/*
* Copyright (c) 2005 Marco Peereboom <marco@openbsd.org>
* Copyright (c) 2005 Thorsten Lockert <tholo@sigmasoft.com>
struct acpiec_event sc_events[ACPIEC_MAX_EVENTS];
int sc_gotsci;
int sc_glk;
+ int sc_cantburst;
};
void acpibtn_disable_psw(void);
-/* $OpenBSD: acpiec.c,v 1.56 2017/03/11 21:46:32 jcs Exp $ */
+/* $OpenBSD: acpiec.c,v 1.57 2018/01/17 07:40:29 bentley Exp $ */
/*
* Copyright (c) 2006 Can Erkin Acar <canacar@openbsd.org>
*
int acpiec_reg(struct acpiec_softc *);
+extern char *hw_vendor, *hw_prod;
+
struct cfattach acpiec_ca = {
sizeof(struct acpiec_softc), acpiec_match, acpiec_attach
};
void
acpiec_burst_enable(struct acpiec_softc *sc)
{
+ if (sc->sc_cantburst)
+ return;
+
acpiec_write_cmd(sc, EC_CMD_BE);
acpiec_read_data(sc);
}
void
acpiec_burst_disable(struct acpiec_softc *sc)
{
+ if (sc->sc_cantburst)
+ return;
+
if ((acpiec_status(sc) & EC_STAT_BURST) == EC_STAT_BURST)
acpiec_write_cmd(sc, EC_CMD_BD);
}
sc->sc_acpi = (struct acpi_softc *)parent;
sc->sc_devnode = aa->aaa_node;
+ sc->sc_cantburst = 0;
if (aml_evalinteger(sc->sc_acpi, sc->sc_devnode, "_STA", 0, NULL, &st))
st = STA_PRESENT | STA_ENABLED | STA_DEV_OK;
return;
}
+ /*
+ * Some Chromebooks using the Google EC do not support burst mode and
+ * cause us to spin forever waiting for the acknowledgment. Don't use
+ * burst mode at all on these machines.
+ */
+ if (hw_vendor != NULL && hw_prod != NULL &&
+ strcmp(hw_vendor, "GOOGLE") == 0 &&
+ strcmp(hw_prod, "Samus") == 0)
+ sc->sc_cantburst = 1;
+
acpiec_get_events(sc);
dnprintf(10, "%s: GPE: %d\n", DEVNAME(sc), sc->sc_gpe);