From: mpi Date: Wed, 3 Jun 2015 08:30:27 +0000 (+0000) Subject: Check for the correct bit in the interrupts property of the device-tree X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=a74f2f29ca7bf7d096c77a1190ad39685111fcf9;p=openbsd Check for the correct bit in the interrupts property of the device-tree to determin if interrupts should be established as edge/level triggered. Fix audio interrupts on U4 systems. On such systems the "interrupts" fields in the device-tree has more bits set and cannot be compared to 0. --- diff --git a/sys/arch/macppc/dev/i2s.c b/sys/arch/macppc/dev/i2s.c index 37e6d897bcc..0dd32fec96e 100644 --- a/sys/arch/macppc/dev/i2s.c +++ b/sys/arch/macppc/dev/i2s.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i2s.c,v 1.27 2015/05/11 06:46:21 ratchov Exp $ */ +/* $OpenBSD: i2s.c,v 1.28 2015/06/03 08:30:27 mpi Exp $ */ /* $NetBSD: i2s.c,v 1.1 2003/12/27 02:19:34 grant Exp $ */ /*- @@ -115,9 +115,9 @@ i2s_attach(struct device *parent, struct i2s_softc *sc, struct confargs *ca) cirq = intr[0]; oirq = intr[2]; iirq = intr[4]; - cirq_type = intr[1] ? IST_LEVEL : IST_EDGE; - oirq_type = intr[3] ? IST_LEVEL : IST_EDGE; - iirq_type = intr[5] ? IST_LEVEL : IST_EDGE; + cirq_type = (intr[1] & 1) ? IST_LEVEL : IST_EDGE; + oirq_type = (intr[3] & 1) ? IST_LEVEL : IST_EDGE; + iirq_type = (intr[5] & 1) ? IST_LEVEL : IST_EDGE; /* intr_establish(cirq, cirq_type, IPL_AUDIO, i2s_intr, sc); */ mac_intr_establish(parent, oirq, oirq_type, IPL_AUDIO | IPL_MPSAFE,