Annotation of sys/arch/macppc/dev/i2svar.h, Revision 1.1.1.1
1.1 nbrk 1: /* $OpenBSD: i2svar.h,v 1.3 2005/11/19 01:07:00 kettenis Exp $ */
2: /* $Id: i2svar.h,v 1.3 2005/11/19 01:07:00 kettenis Exp $ */
3:
4: /*-
5: * Copyright (c) 2001,2003 Tsubai Masanari. All rights reserved.
6: *
7: * Redistribution and use in source and binary forms, with or without
8: * modification, are permitted provided that the following conditions
9: * are met:
10: * 1. Redistributions of source code must retain the above copyright
11: * notice, this list of conditions and the following disclaimer.
12: * 2. Redistributions in binary form must reproduce the above copyright
13: * notice, this list of conditions and the following disclaimer in the
14: * documentation and/or other materials provided with the distribution.
15: * 3. The name of the author may not be used to endorse or promote products
16: * derived from this software without specific prior written permission.
17: *
18: * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19: * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20: * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21: * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22: * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23: * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24: * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25: * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26: * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
27: * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28: */
29:
30: #if !defined(I2S_H_INCLUDE)
31: #define I2S_H_INCLUDE
32:
33: #define I2S_DMALIST_MAX 32
34: #define I2S_DMASEG_MAX NBPG
35:
36: struct i2s_dma {
37: bus_dmamap_t map;
38: caddr_t addr;
39: bus_dma_segment_t segs[I2S_DMALIST_MAX];
40: int nsegs;
41: size_t size;
42: struct i2s_dma *next;
43: };
44:
45: struct i2s_softc {
46: struct device sc_dev;
47: int sc_flags;
48: int sc_node;
49: u_int sc_baseaddr;
50:
51: void (*sc_ointr)(void *); /* dma completion intr handler */
52: void *sc_oarg; /* arg for sc_ointr() */
53: int sc_opages; /* # of output pages */
54:
55: void (*sc_iintr)(void *); /* dma completion intr handler */
56: void *sc_iarg; /* arg for sc_iintr() */
57:
58: u_int sc_record_source; /* recording source mask */
59: u_int sc_output_mask; /* output source mask */
60:
61: void (*sc_setvolume)(struct i2s_softc *, int, int);
62: void (*sc_setbass)(struct i2s_softc *, int);
63: void (*sc_settreble)(struct i2s_softc *, int);
64:
65: u_char *sc_reg;
66: void *sc_i2c;
67:
68: u_int sc_rate;
69: u_int sc_vol_l;
70: u_int sc_vol_r;
71: u_int sc_bass;
72: u_int sc_treble;
73:
74: bus_dma_tag_t sc_dmat;
75: dbdma_regmap_t *sc_odma;
76: dbdma_regmap_t *sc_idma;
77: struct dbdma_command *sc_odmacmd, *sc_odmap;
78: struct dbdma_command *sc_idmacmd, *sc_idmap;
79: dbdma_t sc_odbdma, sc_idbdma;
80:
81: struct i2s_dma *sc_dmas;
82: };
83:
84: void i2s_attach(struct device *, struct i2s_softc *, struct confargs *);
85: int i2s_intr(void *);
86: int i2s_open(void *, int);
87: void i2s_close(void *);
88: int i2s_query_encoding(void *, struct audio_encoding *);
89: int i2s_set_params(void *, int, int, struct audio_params *, struct audio_params *);
90: int i2s_round_blocksize(void *, int);
91: int i2s_halt_output(void *);
92: int i2s_halt_input(void *);
93: int i2s_set_port(void *, mixer_ctrl_t *);
94: int i2s_get_port(void *, mixer_ctrl_t *);
95: int i2s_query_devinfo(void *, mixer_devinfo_t *);
96: size_t i2s_round_buffersize(void *, int, size_t);
97: paddr_t i2s_mappage(void *, void *, off_t, int);
98: int i2s_get_props(void *);
99: int i2s_trigger_output(void *, void *, void *, int, void (*)(void *),
100: void *, struct audio_params *);
101: int i2s_trigger_input(void *, void *, void *, int, void (*)(void *),
102: void *, struct audio_params *);
103: int i2s_set_rate(struct i2s_softc *, int);
104: void i2s_gpio_init(struct i2s_softc *, int, struct device *);
105: void *i2s_allocm(void *, int, size_t, int, int);
106: int deq_reset(struct i2s_softc *);
107:
108: #endif
CVSweb