diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-07-17 22:30:59 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2015-07-17 22:30:59 +0000 |
commit | 507d05fedfe428a1623a1d0bf76f4f1ce45dbc87 (patch) | |
tree | 7347c259e0ede0bc50fb64ffd05e158a29e98155 /sys | |
parent | 0d5f6e396a74653054498e7bff900909cd87b500 (diff) |
Make sound cards work on older PowerMacs.
On such machines the device-tree contains absolute addresses for the
various sound buttons and the hardware was not properly initiliazed.
Problem reported and fix tested by Fabian Frédérick.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/macppc/dev/i2s.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/arch/macppc/dev/i2s.c b/sys/arch/macppc/dev/i2s.c index 0dd32fec96e..5af23bb23a5 100644 --- a/sys/arch/macppc/dev/i2s.c +++ b/sys/arch/macppc/dev/i2s.c @@ -1,4 +1,4 @@ -/* $OpenBSD: i2s.c,v 1.28 2015/06/03 08:30:27 mpi Exp $ */ +/* $OpenBSD: i2s.c,v 1.29 2015/07/17 22:30:58 mpi Exp $ */ /* $NetBSD: i2s.c,v 1.1 2003/12/27 02:19:34 grant Exp $ */ /*- @@ -978,7 +978,11 @@ i2s_gpio_init(struct i2s_softc *sc, int node, struct device *parent) bzero(audio_gpio, sizeof audio_gpio); OF_getprop(gpio, "name", name, sizeof name); OF_getprop(gpio, "audio-gpio", audio_gpio, sizeof audio_gpio); - OF_getprop(gpio, "reg", ®, sizeof(reg)); + if (OF_getprop(gpio, "reg", ®, sizeof(reg)) == -1) + OF_getprop(gpio, "AAPL,address", ®, sizeof(reg)); + + if (reg > sc->sc_baseaddr) + reg = (reg - sc->sc_baseaddr); /* gpio5 */ if (sc->sc_hp == 0 && strcmp(audio_gpio, "headphone-mute") == 0) |