diff options
author | Patrick Wildt <patrick@cvs.openbsd.org> | 2022-11-10 12:16:07 +0000 |
---|---|---|
committer | Patrick Wildt <patrick@cvs.openbsd.org> | 2022-11-10 12:16:07 +0000 |
commit | a103be891afba5e2cd438c0f37bb03afda8997fb (patch) | |
tree | 04f330414e80b2d42f304428c333f08a9546d999 /sys/dev | |
parent | 33c4e6a808c833edd9e40e6c9d95c2ed86e8886c (diff) |
Remove hack that uses a timeout to fake interrupts now that qcpdc(4) allows
us to properly establish interrupts.
The fixed IPL_BIO should probably be replaced by the highest IPL requested
by our children.
ok kettenis@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/fdt/qcspmi.c | 30 |
1 files changed, 9 insertions, 21 deletions
diff --git a/sys/dev/fdt/qcspmi.c b/sys/dev/fdt/qcspmi.c index a837b6fdde8..697dcc69657 100644 --- a/sys/dev/fdt/qcspmi.c +++ b/sys/dev/fdt/qcspmi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: qcspmi.c,v 1.1 2022/11/08 19:34:54 patrick Exp $ */ +/* $OpenBSD: qcspmi.c,v 1.2 2022/11/10 12:16:06 patrick Exp $ */ /* * Copyright (c) 2022 Patrick Wildt <patrick@blueri.se> * @@ -18,7 +18,6 @@ #include <sys/param.h> #include <sys/malloc.h> #include <sys/systm.h> -#include <sys/timeout.h> #include <machine/bus.h> #include <machine/fdt.h> @@ -139,6 +138,7 @@ struct qcspmi_softc { bus_space_tag_t sc_iot; bus_space_handle_t sc_ioh[QCSPMI_REG_MAX]; + void *sc_ih; int sc_ee; @@ -149,8 +149,6 @@ struct qcspmi_softc { struct interrupt_controller sc_ic; TAILQ_HEAD(,qcspmi_intrhand) sc_intrq; - - struct timeout sc_tick; }; int qcspmi_match(struct device *, void *, void *); @@ -170,8 +168,6 @@ void qcspmi_intr_barrier(void *); int qcspmi_pin_intr(struct qcspmi_softc *, int); int qcspmi_intr(void *); -void qcspmi_tick(void *); - const struct cfattach qcspmi_ca = { sizeof(struct qcspmi_softc), qcspmi_match, qcspmi_attach }; @@ -232,6 +228,13 @@ qcspmi_attach(struct device *parent, struct device *self, void *aux) TAILQ_INIT(&sc->sc_intrq); + sc->sc_ih = fdt_intr_establish(sc->sc_node, IPL_BIO, qcspmi_intr, + sc, sc->sc_dev.dv_xname); + if (sc->sc_ih == NULL) { + printf(": can't establish interrupt\n"); + return; + } + printf("\n"); for (i = 0; i < SPMI_MAX_PERIPH; i++) { @@ -290,10 +293,6 @@ qcspmi_attach(struct device *parent, struct device *self, void *aux) sa.sa_node = node; config_found(self, &sa, qcspmi_print); } - - /* TODO: implement interrupts */ - timeout_set(&sc->sc_tick, qcspmi_tick, sc); - timeout_add_sec(&sc->sc_tick, 1); } int @@ -557,12 +556,10 @@ qcspmi_intr_disable(void *cookie) void qcspmi_intr_barrier(void *cookie) { -#if 0 struct qcspmi_intrhand *ih = cookie; struct qcspmi_softc *sc = ih->ih_sc; intr_barrier(sc->sc_ih); -#endif } int @@ -604,12 +601,3 @@ qcspmi_intr(void *arg) return handled; } - -void -qcspmi_tick(void *arg) -{ - struct qcspmi_softc *sc = arg; - - qcspmi_intr(arg); - timeout_add_sec(&sc->sc_tick, 1); -} |