1 1.3 nat /* $NetBSD: ascaudiovar.h,v 1.3 2025/05/14 07:15:03 nat Exp $ */ 2 1.1 nat 3 1.1 nat /*- 4 1.1 nat * Copyright (c) 2017, 2023 Nathanial Sloss <nathanialsloss (at) yahoo.com.au> 5 1.1 nat * All rights reserved. 6 1.1 nat * 7 1.1 nat * Redistribution and use in source and binary forms, with or without 8 1.1 nat * modification, are permitted provided that the following conditions 9 1.1 nat * are met: 10 1.1 nat * 1. Redistributions of source code must retain the above copyright 11 1.1 nat * notice, this list of conditions and the following disclaimer. 12 1.1 nat * 2. Redistributions in binary form must reproduce the above copyright 13 1.1 nat * notice, this list of conditions and the following disclaimer in the 14 1.1 nat * documentation and/or other materials provided with the distribution. 15 1.1 nat * 16 1.1 nat * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 17 1.1 nat * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 18 1.1 nat * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 19 1.1 nat * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 20 1.1 nat * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 1.1 nat * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 1.1 nat * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 1.1 nat * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 1.1 nat * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 1.1 nat * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 1.1 nat * POSSIBILITY OF SUCH DAMAGE. 27 1.1 nat */ 28 1.1 nat 29 1.1 nat #ifndef _SYS_ARCH_MAC68K_OBIO_ASCAUDIOVAR_H 30 1.1 nat #define _SYS_ARCH_MAC68K_OBIO_ASCAUDIOVAR_H 31 1.1 nat 32 1.1 nat #define ASCAUDIOUNIT(d) ((d) & 0x7) 33 1.1 nat 34 1.1 nat typedef struct ascaudio_softc { 35 1.1 nat device_t sc_dev; 36 1.1 nat bus_space_tag_t sc_tag; 37 1.1 nat bus_space_handle_t sc_handle; 38 1.1 nat int sc_open; 39 1.1 nat 40 1.1 nat device_t sc_audiodev; 41 1.1 nat struct audio_encoding_set *sc_encodings; 42 1.1 nat void *sc_intr; 43 1.1 nat void (*sc_pintr)(void *); 44 1.1 nat void *sc_pintrarg; 45 1.1 nat void (*sc_rintr)(void *); 46 1.1 nat void *sc_rintrarg; 47 1.1 nat 48 1.1 nat kmutex_t sc_lock; 49 1.1 nat kmutex_t sc_intr_lock; 50 1.1 nat 51 1.1 nat callout_t sc_pcallout; 52 1.1 nat callout_t sc_rcallout; 53 1.1 nat 54 1.1 nat uint8_t *sc_playbuf; 55 1.1 nat uint8_t *sc_wptr; 56 1.1 nat uint8_t *sc_putptr; 57 1.1 nat int sc_avail; 58 1.1 nat 59 1.1 nat uint8_t *sc_recbuf; 60 1.1 nat uint8_t *sc_rptr; 61 1.1 nat uint8_t *sc_getptr; 62 1.1 nat int sc_recavail; 63 1.1 nat 64 1.1 nat uint8_t sc_vol; 65 1.2 nat uint8_t sc_recvol; 66 1.1 nat uint8_t sc_ver; 67 1.1 nat int sc_options; /* options for this instance. */ 68 1.1 nat uint8_t sc_speakers; 69 1.1 nat uint sc_rate; 70 1.3 nat int sc_recfreq; 71 1.1 nat bool sc_slowcpu; 72 1.1 nat } ascaudio_softc_t; 73 1.1 nat 74 1.1 nat #define LOWQUALITY 0x1 75 1.1 nat #define HIGHQUALITY 0x2 76 1.1 nat #define ASCAUDIO_OPTIONS_MASK (LOWQUALITY|HIGHQUALITY) 77 1.1 nat #define ASCAUDIO_OPTIONS_BITS "\10\2HIGHQUALITY\1LOWQUALITY" 78 1.1 nat 79 1.1 nat #endif /* !_SYS_ARCH_MAC68K_OBIO_ASCAUDIOVAR_H */ 80