Home | History | Annotate | Line # | Download | only in ic
arcofivar.h revision 1.1
      1 /*	$NetBSD: arcofivar.h,v 1.1 2014/08/24 08:17:44 tsutsui 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 	void			*sc_sih;
     30 
     31 	int			sc_open;
     32 	int			sc_mode;
     33 
     34 	struct {
     35 		uint8_t	cr3, cr4;
     36 		uint	gr_idx, gx_idx;
     37 		int	output_mute;
     38 	}			sc_active,
     39 				sc_shadow;
     40 
     41 	struct {
     42 		uint8_t	*buf;
     43 		uint8_t	*past;
     44 		void	(*cb)(void *);
     45 		void	*cbarg;
     46 	}			sc_recv,
     47 				sc_xmit;
     48 	kmutex_t		sc_lock;
     49 	kmutex_t		sc_intr_lock;
     50 	kcondvar_t		sc_cv;
     51 	struct audio_encoding_set *sc_encodings;
     52 };
     53 
     54 void	arcofi_attach(struct arcofi_softc *, const char *);
     55 int	arcofi_hwintr(void *);
     56 void	arcofi_swintr(void *);
     57