1 /* $NetBSD: arcofivar.h,v 1.2 2019/05/08 13:40:18 isaki Exp $ */ 2 /* $OpenBSD: arcofivar.h,v 1.2 2011/12/25 00:07:27 miod Exp $ */ 3 4 /* 5 * Copyright (c) 2011 Miodrag Vallat. 6 * 7 * Permission to use, copy, modify, and distribute this software for any 8 * purpose with or without fee is hereby granted, provided that the above 9 * copyright notice and this permission notice appear in all copies. 10 * 11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 */ 19 20 #define ARCOFI_NREGS 6 21 22 struct arcofi_softc { 23 device_t sc_dev; 24 bus_addr_t sc_reg[ARCOFI_NREGS]; 25 bus_space_tag_t sc_iot; 26 bus_space_handle_t sc_ioh; 27 28 struct audio_device sc_audio_device; 29 30 int sc_mode; 31 32 struct { 33 uint8_t cr3, cr4; 34 uint gr_idx, gx_idx; 35 int output_mute; 36 } sc_active, 37 sc_shadow; 38 39 struct { 40 uint8_t *buf; 41 uint8_t *past; 42 void (*cb)(void *); 43 void *cbarg; 44 } sc_recv, 45 sc_xmit; 46 kmutex_t sc_lock; 47 kmutex_t sc_intr_lock; 48 }; 49 50 void arcofi_attach(struct arcofi_softc *, const char *); 51 int arcofi_hwintr(void *); 52