| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: bcm2835_vcaudio.c,v 1.16 2021/01/23 12:53:46 nia Exp $ */ | | 1 | /* $NetBSD: bcm2835_vcaudio.c,v 1.17 2021/01/27 12:06:10 nia Exp $ */ |
2 | | | 2 | |
3 | /*- | | 3 | /*- |
4 | * Copyright (c) 2013 Jared D. McNeill <jmcneill@invisible.ca> | | 4 | * Copyright (c) 2013 Jared D. McNeill <jmcneill@invisible.ca> |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Redistribution and use in source and binary forms, with or without | | 7 | * Redistribution and use in source and binary forms, with or without |
8 | * modification, are permitted provided that the following conditions | | 8 | * modification, are permitted provided that the following conditions |
9 | * are met: | | 9 | * are met: |
10 | * 1. Redistributions of source code must retain the above copyright | | 10 | * 1. Redistributions of source code must retain the above copyright |
11 | * notice, this list of conditions and the following disclaimer. | | 11 | * notice, this list of conditions and the following disclaimer. |
12 | * 2. Redistributions in binary form must reproduce the above copyright | | 12 | * 2. Redistributions in binary form must reproduce the above copyright |
13 | * notice, this list of conditions and the following disclaimer in the | | 13 | * notice, this list of conditions and the following disclaimer in the |
14 | * documentation and/or other materials provided with the distribution. | | 14 | * documentation and/or other materials provided with the distribution. |
| @@ -21,27 +21,27 @@ | | | @@ -21,27 +21,27 @@ |
21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 21 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 22 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 23 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 24 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 25 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
26 | * POSSIBILITY OF SUCH DAMAGE. | | 26 | * POSSIBILITY OF SUCH DAMAGE. |
27 | */ | | 27 | */ |
28 | | | 28 | |
29 | /* | | 29 | /* |
30 | * VideoCore audio interface | | 30 | * VideoCore audio interface |
31 | */ | | 31 | */ |
32 | | | 32 | |
33 | #include <sys/cdefs.h> | | 33 | #include <sys/cdefs.h> |
34 | __KERNEL_RCSID(0, "$NetBSD: bcm2835_vcaudio.c,v 1.16 2021/01/23 12:53:46 nia Exp $"); | | 34 | __KERNEL_RCSID(0, "$NetBSD: bcm2835_vcaudio.c,v 1.17 2021/01/27 12:06:10 nia Exp $"); |
35 | | | 35 | |
36 | #include <sys/param.h> | | 36 | #include <sys/param.h> |
37 | #include <sys/types.h> | | 37 | #include <sys/types.h> |
38 | #include <sys/systm.h> | | 38 | #include <sys/systm.h> |
39 | #include <sys/device.h> | | 39 | #include <sys/device.h> |
40 | #include <sys/conf.h> | | 40 | #include <sys/conf.h> |
41 | #include <sys/bus.h> | | 41 | #include <sys/bus.h> |
42 | #include <sys/kmem.h> | | 42 | #include <sys/kmem.h> |
43 | | | 43 | |
44 | #include <sys/audioio.h> | | 44 | #include <sys/audioio.h> |
45 | #include <dev/audio/audio_if.h> | | 45 | #include <dev/audio/audio_if.h> |
46 | | | 46 | |
47 | #include <interface/compat/vchi_bsd.h> | | 47 | #include <interface/compat/vchi_bsd.h> |
| @@ -260,27 +260,27 @@ vcaudio_childdet(device_t self, device_t | | | @@ -260,27 +260,27 @@ vcaudio_childdet(device_t self, device_t |
260 | | | 260 | |
261 | static int | | 261 | static int |
262 | vcaudio_init(struct vcaudio_softc *sc) | | 262 | vcaudio_init(struct vcaudio_softc *sc) |
263 | { | | 263 | { |
264 | VC_AUDIO_MSG_T msg; | | 264 | VC_AUDIO_MSG_T msg; |
265 | int error; | | 265 | int error; |
266 | | | 266 | |
267 | sc->sc_swvol = 255; | | 267 | sc->sc_swvol = 255; |
268 | sc->sc_hwvol[VCAUDIO_DEST_AUTO] = 255; | | 268 | sc->sc_hwvol[VCAUDIO_DEST_AUTO] = 255; |
269 | sc->sc_hwvol[VCAUDIO_DEST_HP] = 255; | | 269 | sc->sc_hwvol[VCAUDIO_DEST_HP] = 255; |
270 | sc->sc_hwvol[VCAUDIO_DEST_HDMI] = 255; | | 270 | sc->sc_hwvol[VCAUDIO_DEST_HDMI] = 255; |
271 | sc->sc_dest = VCAUDIO_DEST_AUTO; | | 271 | sc->sc_dest = VCAUDIO_DEST_AUTO; |
272 | | | 272 | |
273 | sc->sc_format.mode = AUMODE_PLAY|AUMODE_RECORD; | | 273 | sc->sc_format.mode = AUMODE_PLAY; |
274 | sc->sc_format.encoding = AUDIO_ENCODING_SLINEAR_LE; | | 274 | sc->sc_format.encoding = AUDIO_ENCODING_SLINEAR_LE; |
275 | sc->sc_format.validbits = 16; | | 275 | sc->sc_format.validbits = 16; |
276 | sc->sc_format.precision = 16; | | 276 | sc->sc_format.precision = 16; |
277 | sc->sc_format.channels = 2; | | 277 | sc->sc_format.channels = 2; |
278 | sc->sc_format.channel_mask = AUFMT_STEREO; | | 278 | sc->sc_format.channel_mask = AUFMT_STEREO; |
279 | sc->sc_format.frequency_type = 0; | | 279 | sc->sc_format.frequency_type = 0; |
280 | sc->sc_format.frequency[0] = 48000; | | 280 | sc->sc_format.frequency[0] = 48000; |
281 | sc->sc_format.frequency[1] = 48000; | | 281 | sc->sc_format.frequency[1] = 48000; |
282 | | | 282 | |
283 | error = vchi_initialise(&sc->sc_instance); | | 283 | error = vchi_initialise(&sc->sc_instance); |
284 | if (error) { | | 284 | if (error) { |
285 | aprint_error_dev(sc->sc_dev, | | 285 | aprint_error_dev(sc->sc_dev, |
286 | "couldn't init vchi instance (%d)\n", error); | | 286 | "couldn't init vchi instance (%d)\n", error); |