| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: repulse.c,v 1.23 2019/06/08 08:02:36 isaki Exp $ */ | | 1 | /* $NetBSD: repulse.c,v 1.24 2022/02/12 23:30:30 andvar Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2001 The NetBSD Foundation, Inc. | | 4 | * Copyright (c) 2001 The NetBSD Foundation, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * This code is derived from software contributed to The NetBSD Foundation | | 7 | * This code is derived from software contributed to The NetBSD Foundation |
8 | * by Ignatios Souvatzis. | | 8 | * by Ignatios Souvatzis. |
9 | * | | 9 | * |
10 | * Redistribution and use in source and binary forms, with or without | | 10 | * Redistribution and use in source and binary forms, with or without |
11 | * modification, are permitted provided that the following conditions | | 11 | * modification, are permitted provided that the following conditions |
12 | * are met: | | 12 | * are met: |
13 | * 1. Redistributions of source code must retain the above copyright | | 13 | * 1. Redistributions of source code must retain the above copyright |
14 | * notice, this list of conditions and the following disclaimer. | | 14 | * notice, this list of conditions and the following disclaimer. |
| @@ -20,27 +20,27 @@ | | | @@ -20,27 +20,27 @@ |
20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 20 | * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS | | 22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS |
23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 23 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
29 | * POSSIBILITY OF SUCH DAMAGE. | | 29 | * POSSIBILITY OF SUCH DAMAGE. |
30 | */ | | 30 | */ |
31 | | | 31 | |
32 | #include <sys/cdefs.h> | | 32 | #include <sys/cdefs.h> |
33 | __KERNEL_RCSID(0, "$NetBSD: repulse.c,v 1.23 2019/06/08 08:02:36 isaki Exp $"); | | 33 | __KERNEL_RCSID(0, "$NetBSD: repulse.c,v 1.24 2022/02/12 23:30:30 andvar Exp $"); |
34 | | | 34 | |
35 | #include <sys/types.h> | | 35 | #include <sys/types.h> |
36 | #include <sys/param.h> | | 36 | #include <sys/param.h> |
37 | #include <sys/systm.h> | | 37 | #include <sys/systm.h> |
38 | #include <sys/kernel.h> | | 38 | #include <sys/kernel.h> |
39 | #include <sys/device.h> | | 39 | #include <sys/device.h> |
40 | #include <sys/fcntl.h> /* FREAD */ | | 40 | #include <sys/fcntl.h> /* FREAD */ |
41 | #include <sys/bus.h> | | 41 | #include <sys/bus.h> |
42 | | | 42 | |
43 | #include <sys/audioio.h> | | 43 | #include <sys/audioio.h> |
44 | #include <dev/audio/audio_if.h> | | 44 | #include <dev/audio/audio_if.h> |
45 | | | 45 | |
46 | #include <dev/ic/ac97reg.h> | | 46 | #include <dev/ic/ac97reg.h> |
| @@ -300,27 +300,27 @@ repulse_attach(device_t parent, device_t | | | @@ -300,27 +300,27 @@ repulse_attach(device_t parent, device_t |
300 | | | 300 | |
301 | mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE); | | 301 | mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE); |
302 | mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED); | | 302 | mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED); |
303 | | | 303 | |
304 | if (ac97_attach(&sc->sc_achost, self, &sc->sc_lock)) { | | 304 | if (ac97_attach(&sc->sc_achost, self, &sc->sc_lock)) { |
305 | printf("%s: error attaching codec\n", device_xname(self)); | | 305 | printf("%s: error attaching codec\n", device_xname(self)); |
306 | return; | | 306 | return; |
307 | } | | 307 | } |
308 | | | 308 | |
309 | #ifdef DIAGNOSTIC | | 309 | #ifdef DIAGNOSTIC |
310 | /* | | 310 | /* |
311 | * Print a warning if the codec doesn't support hardware variable | | 311 | * Print a warning if the codec doesn't support hardware variable |
312 | * rate audio. As the initial incarnations of the Repulse board | | 312 | * rate audio. As the initial incarnations of the Repulse board |
313 | * are AC'97 2.1, it is epxected that we'll always have VRA. | | 313 | * are AC'97 2.1, it is expected that we'll always have VRA. |
314 | */ | | 314 | */ |
315 | /* | | 315 | /* |
316 | * XXX this should be a panic(). OTOH, audio codec speed is not | | 316 | * XXX this should be a panic(). OTOH, audio codec speed is not |
317 | * important enough to do this. | | 317 | * important enough to do this. |
318 | */ | | 318 | */ |
319 | a = sc->sc_codec_if->vtbl->get_extcaps(sc->sc_codec_if); | | 319 | a = sc->sc_codec_if->vtbl->get_extcaps(sc->sc_codec_if); |
320 | if (!(a & AC97_EXT_AUDIO_VRA)) { | | 320 | if (!(a & AC97_EXT_AUDIO_VRA)) { |
321 | printf("%s: warning: codec doesn't support " | | 321 | printf("%s: warning: codec doesn't support " |
322 | "hardware AC'97 2.0 Variable Rate Audio\n", | | 322 | "hardware AC'97 2.0 Variable Rate Audio\n", |
323 | device_xname(self)); | | 323 | device_xname(self)); |
324 | } | | 324 | } |
325 | #endif | | 325 | #endif |
326 | | | 326 | |