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