-/* $OpenBSD: qciic.c,v 1.3 2022/09/10 13:05:41 kettenis Exp $ */
+/* $OpenBSD: qciic.c,v 1.4 2022/09/11 18:07:26 kettenis Exp $ */
/*
* Copyright (c) 2022 Mark Kettenis <kettenis@openbsd.org>
*
bus_space_tag_t sc_iot;
bus_space_handle_t sc_ioh;
+ struct acpi_softc *sc_acpi;
struct aml_node *sc_node;
struct device *sc_iic;
struct acpi_attach_args *aaa = aux;
struct i2cbus_attach_args iba;
+ sc->sc_acpi = (struct acpi_softc *)parent;
sc->sc_node = aaa->aaa_node;
printf(" %s", aaa->aaa_node->name);
sc->sc_ic.ic_intr_disestablish = qciic_i2c_intr_disestablish;
sc->sc_ic.ic_intr_string = qciic_i2c_intr_string;
+#ifndef SMALL_KERNEL
+ /*
+ * XXX Registering the I2C9 node with ACPI leads to AML
+ * executing I2C transaction that fail and spin with the
+ * kernel lock held until they fail.
+ */
+ if (strcmp(aaa->aaa_dev, "QCOM0610") != 0) {
+ sc->sc_node->i2c = &sc->sc_ic;
+ acpi_register_gsb(sc->sc_acpi, sc->sc_node);
+ }
+#endif
+
memset(&iba, 0, sizeof(iba));
iba.iba_name = "iic";
iba.iba_tag = &sc->sc_ic;