Home | History | Annotate | Line # | Download | only in xscale
pxa2x0_i2s.h revision 1.1.4.2
      1  1.1.4.2  yamt /*	$NetBSD: pxa2x0_i2s.h,v 1.1.4.2 2006/12/30 20:45:38 yamt Exp $	*/
      2  1.1.4.2  yamt /*	$OpenBSD: pxa2x0_i2s.h,v 1.3 2006/04/04 11:45:40 pascoe Exp $	*/
      3  1.1.4.2  yamt 
      4  1.1.4.2  yamt /*
      5  1.1.4.2  yamt  * Copyright (c) 2005 Uwe Stuehler <uwe (at) bsdx.de>
      6  1.1.4.2  yamt  *
      7  1.1.4.2  yamt  * Permission to use, copy, modify, and distribute this software for any
      8  1.1.4.2  yamt  * purpose with or without fee is hereby granted, provided that the above
      9  1.1.4.2  yamt  * copyright notice and this permission notice appear in all copies.
     10  1.1.4.2  yamt  *
     11  1.1.4.2  yamt  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
     12  1.1.4.2  yamt  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
     13  1.1.4.2  yamt  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
     14  1.1.4.2  yamt  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
     15  1.1.4.2  yamt  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
     16  1.1.4.2  yamt  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
     17  1.1.4.2  yamt  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
     18  1.1.4.2  yamt  */
     19  1.1.4.2  yamt 
     20  1.1.4.2  yamt #ifndef _PXA2X0_I2S_H_
     21  1.1.4.2  yamt #define _PXA2X0_I2S_H_
     22  1.1.4.2  yamt 
     23  1.1.4.2  yamt #include <machine/bus.h>
     24  1.1.4.2  yamt 
     25  1.1.4.2  yamt struct pxa2x0_i2s_dma;
     26  1.1.4.2  yamt struct audio_params;
     27  1.1.4.2  yamt 
     28  1.1.4.2  yamt struct pxa2x0_i2s_softc {
     29  1.1.4.2  yamt 	struct device sc_dev;
     30  1.1.4.2  yamt 
     31  1.1.4.2  yamt 	bus_space_tag_t sc_iot;
     32  1.1.4.2  yamt 	bus_space_handle_t sc_ioh;
     33  1.1.4.2  yamt 	bus_size_t sc_size;
     34  1.1.4.2  yamt 	bus_dma_tag_t sc_dmat;
     35  1.1.4.2  yamt 
     36  1.1.4.2  yamt 	int sc_open;
     37  1.1.4.2  yamt 	uint32_t sc_sadiv;
     38  1.1.4.2  yamt 
     39  1.1.4.2  yamt 	struct pxa2x0_i2s_dma *sc_dmas;
     40  1.1.4.2  yamt 
     41  1.1.4.2  yamt 	/* Dummy DMA segment which points to the I2S SADR */
     42  1.1.4.2  yamt 	bus_dma_segment_t sc_dr;
     43  1.1.4.2  yamt 
     44  1.1.4.2  yamt 	/* PCM Output (Tx) state */
     45  1.1.4.2  yamt 	struct pxa2x0_i2s_dma *sc_txdma;
     46  1.1.4.2  yamt 	void (*sc_txfunc)(void *);
     47  1.1.4.2  yamt 	void *sc_txarg;
     48  1.1.4.2  yamt 
     49  1.1.4.2  yamt 	/* PCM Input (Rx) state */
     50  1.1.4.2  yamt 	struct pxa2x0_i2s_dma *sc_rxdma;
     51  1.1.4.2  yamt 	void (*sc_rxfunc)(void *);
     52  1.1.4.2  yamt 	void *sc_rxarg;
     53  1.1.4.2  yamt };
     54  1.1.4.2  yamt 
     55  1.1.4.2  yamt void	pxa2x0_i2s_init(struct pxa2x0_i2s_softc *sc);
     56  1.1.4.2  yamt int	pxa2x0_i2s_attach_sub(struct pxa2x0_i2s_softc *);
     57  1.1.4.2  yamt int	pxa2x0_i2s_detach_sub(struct pxa2x0_i2s_softc *);
     58  1.1.4.2  yamt void	pxa2x0_i2s_open(struct pxa2x0_i2s_softc *);
     59  1.1.4.2  yamt void	pxa2x0_i2s_close(struct pxa2x0_i2s_softc *);
     60  1.1.4.2  yamt void	pxa2x0_i2s_write(struct pxa2x0_i2s_softc *, u_int32_t);
     61  1.1.4.2  yamt 
     62  1.1.4.2  yamt void	pxa2x0_i2s_setspeed(struct pxa2x0_i2s_softc *, u_int *);
     63  1.1.4.2  yamt 
     64  1.1.4.2  yamt void *	pxa2x0_i2s_allocm(void *, int, size_t, struct malloc_type *, int);
     65  1.1.4.2  yamt void	pxa2x0_i2s_freem(void  *, void *, struct malloc_type *);
     66  1.1.4.2  yamt paddr_t	pxa2x0_i2s_mappage(void *, void *, off_t, int);
     67  1.1.4.2  yamt int	pxa2x0_i2s_round_blocksize(void *, int, int, const struct audio_params *);
     68  1.1.4.2  yamt size_t	pxa2x0_i2s_round_buffersize(void *, int, size_t);
     69  1.1.4.2  yamt int	pxa2x0_i2s_halt_output(void *);
     70  1.1.4.2  yamt int	pxa2x0_i2s_halt_input(void *);
     71  1.1.4.2  yamt int	pxa2x0_i2s_start_output(void *, void *, int, void (*)(void *), void *);
     72  1.1.4.2  yamt int	pxa2x0_i2s_start_input(void *, void *, int, void (*)(void *), void *);
     73  1.1.4.2  yamt 
     74  1.1.4.2  yamt #endif
     75