1 /* $NetBSD: tms320av110var.h,v 1.9 2007/10/19 12:00:03 ad Exp $ */
4 * Copyright (c) 1997 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Ignatios Souvatzis.
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
33 * Machine independent definitions, declarations and data structures for
34 * access to the TMS320AV110 data sheet.
36 * Currently, only minimum support for audio output. For audio/video
37 * synchronization, more is needed.
40 #ifndef _TMS320AV110_VAR_H_
41 #define _TMS320AV110_VAR_H_
50 bus_space_tag_t sc_iot
;
51 bus_space_handle_t sc_ioh
;
53 /* above audio callback function */
54 void (*sc_intr
)(void *);
58 /* below audio interrupt acknowledge function. Ignored if NULL */
59 void (*sc_intack
)(struct tav_softc
*);
61 /* initialization from below */
63 uint8_t sc_pcm_div
; /* passed in */
64 uint8_t sc_pcm_ord
; /* passed in */
65 uint8_t sc_pcm_18
; /* passed in */
66 uint8_t sc_dif
; /* passed in */
71 void tms320av110_attach_mi(struct tav_softc
*);
72 int tms320av110_intr(void *);
74 static void tav_write_short(bus_space_tag_t
, bus_space_handle_t
,
75 bus_size_t
, uint16_t);
77 /* access functions/macros: */
78 /* XXX shouldn't these be in the reg.h file? */
80 #define tav_read_byte(ioh, iot, off) bus_space_read_1(ioh, iot, off)
82 #define tav_read_short(ioh, iot, off) ( \
83 bus_space_read_1((ioh), (iot), (off)) | \
84 bus_space_read_1((ioh), (iot), (off)+1) << 8)
86 #define tav_read_long(ioh, iot, off) ( \
87 bus_space_read_1((ioh), (iot), (off)) | \
88 bus_space_read_1((ioh), (iot), (off)+1) << 8 | \
89 bus_space_read_1((ioh), (iot), (off)+2) << 16 | \
90 bus_space_read_1((ioh), (iot), (off)+3))
92 #define tav_read_time(ioh, iot, off) ( \
93 bus_space_read_1((ioh), (iot), (off)) | \
94 bus_space_read_1((ioh), (iot), (off)+1) << 8 | \
95 bus_space_read_1((ioh), (iot), (off)+2) << 16 | \
96 bus_space_read_1((ioh), (iot), (off)+3) << 24 | \
97 bus_space_read_1((ioh), (iot), (off)+4) << 32)
99 #define tav_write_byte(ioh, iot, off, v) bus_space_write_1(ioh, iot, off, v)
102 tav_write_short(bus_space_tag_t iot
, bus_space_handle_t ioh
,
103 bus_size_t off
, uint16_t val
)
106 bus_space_write_1(iot
, ioh
, off
+1, (val
)>>8);
107 bus_space_write_1(iot
, ioh
, off
, (uint8_t)val
);
110 #endif /* _TMS320AV110_VAR_H_ */