2 /* $OpenBSD: pxa2x0_i2s.h,v 1.3 2006/04/04 11:45:40 pascoe Exp $ */
5 * Copyright (c) 2005 Uwe Stuehler <uwe@bsdx.de>
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.
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.
20 #ifndef _PXA2X0_I2S_H_
21 #define _PXA2X0_I2S_H_
23 #include <machine/bus.h>
25 struct pxa2x0_i2s_dma
;
28 struct pxa2x0_i2s_softc
{
31 bus_space_tag_t sc_iot
;
32 bus_space_handle_t sc_ioh
;
34 bus_dma_tag_t sc_dmat
;
39 struct pxa2x0_i2s_dma
*sc_dmas
;
41 /* Dummy DMA segment which points to the I2S SADR */
42 bus_dma_segment_t sc_dr
;
44 /* PCM Output (Tx) state */
45 struct pxa2x0_i2s_dma
*sc_txdma
;
46 void (*sc_txfunc
)(void *);
49 /* PCM Input (Rx) state */
50 struct pxa2x0_i2s_dma
*sc_rxdma
;
51 void (*sc_rxfunc
)(void *);
55 void pxa2x0_i2s_init(struct pxa2x0_i2s_softc
*sc
);
56 int pxa2x0_i2s_attach_sub(struct pxa2x0_i2s_softc
*);
57 int pxa2x0_i2s_detach_sub(struct pxa2x0_i2s_softc
*);
58 void pxa2x0_i2s_open(struct pxa2x0_i2s_softc
*);
59 void pxa2x0_i2s_close(struct pxa2x0_i2s_softc
*);
60 void pxa2x0_i2s_write(struct pxa2x0_i2s_softc
*, u_int32_t
);
62 void pxa2x0_i2s_setspeed(struct pxa2x0_i2s_softc
*, u_int
*);
64 void * pxa2x0_i2s_allocm(void *, int, size_t, struct malloc_type
*, int);
65 void pxa2x0_i2s_freem(void *, void *, struct malloc_type
*);
66 paddr_t
pxa2x0_i2s_mappage(void *, void *, off_t
, int);
67 int pxa2x0_i2s_round_blocksize(void *, int, int, const struct audio_params
*);
68 size_t pxa2x0_i2s_round_buffersize(void *, int, size_t);
69 int pxa2x0_i2s_halt_output(void *);
70 int pxa2x0_i2s_halt_input(void *);
71 int pxa2x0_i2s_start_output(void *, void *, int, void (*)(void *), void *);
72 int pxa2x0_i2s_start_input(void *, void *, int, void (*)(void *), void *);