Wed Apr 27 07:47:33 2011 UTC ()
drop 'external' inline here, to avoid C99 vs GNU differences


(plunky)
diff -r1.29 -r1.30 src/sys/dev/ic/ad1848.c

cvs diff -r1.29 -r1.30 src/sys/dev/ic/ad1848.c (expand / switch to unified diff)

--- src/sys/dev/ic/ad1848.c 2008/04/28 20:23:48 1.29
+++ src/sys/dev/ic/ad1848.c 2011/04/27 07:47:33 1.30
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: ad1848.c,v 1.29 2008/04/28 20:23:48 martin Exp $ */ 1/* $NetBSD: ad1848.c,v 1.30 2011/04/27 07:47:33 plunky Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1999 The NetBSD Foundation, Inc. 4 * Copyright (c) 1999 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Ken Hornstein and John Kohl. 8 * by Ken Hornstein and John Kohl.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
@@ -85,27 +85,27 @@ @@ -85,27 +85,27 @@
85 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 85 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
86 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 86 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
87 * SUCH DAMAGE. 87 * SUCH DAMAGE.
88 * 88 *
89 */ 89 */
90/* 90/*
91 * Portions of this code are from the VOXware support for the ad1848 91 * Portions of this code are from the VOXware support for the ad1848
92 * by Hannu Savolainen <hannu@voxware.pp.fi> 92 * by Hannu Savolainen <hannu@voxware.pp.fi>
93 * 93 *
94 * Portions also supplied from the SoundBlaster driver for NetBSD. 94 * Portions also supplied from the SoundBlaster driver for NetBSD.
95 */ 95 */
96 96
97#include <sys/cdefs.h> 97#include <sys/cdefs.h>
98__KERNEL_RCSID(0, "$NetBSD: ad1848.c,v 1.29 2008/04/28 20:23:48 martin Exp $"); 98__KERNEL_RCSID(0, "$NetBSD: ad1848.c,v 1.30 2011/04/27 07:47:33 plunky Exp $");
99 99
100#include <sys/param.h> 100#include <sys/param.h>
101#include <sys/systm.h> 101#include <sys/systm.h>
102#include <sys/errno.h> 102#include <sys/errno.h>
103#include <sys/ioctl.h> 103#include <sys/ioctl.h>
104#include <sys/device.h> 104#include <sys/device.h>
105#include <sys/fcntl.h> 105#include <sys/fcntl.h>
106/*#include <sys/syslog.h>*/ 106/*#include <sys/syslog.h>*/
107/*#include <sys/proc.h>*/ 107/*#include <sys/proc.h>*/
108 108
109#include <sys/cpu.h> 109#include <sys/cpu.h>
110#include <sys/bus.h> 110#include <sys/bus.h>
111 111
@@ -206,64 +206,64 @@ ad1848_from_vol(mixer_ctrl_t *cp, struct @@ -206,64 +206,64 @@ ad1848_from_vol(mixer_ctrl_t *cp, struct
206 if (cp->un.value.num_channels == 1) { 206 if (cp->un.value.num_channels == 1) {
207 cp->un.value.level[AUDIO_MIXER_LEVEL_MONO] = vol->left; 207 cp->un.value.level[AUDIO_MIXER_LEVEL_MONO] = vol->left;
208 return 1; 208 return 1;
209 } 209 }
210 else if (cp->un.value.num_channels == 2) { 210 else if (cp->un.value.num_channels == 2) {
211 cp->un.value.level[AUDIO_MIXER_LEVEL_LEFT] = vol->left; 211 cp->un.value.level[AUDIO_MIXER_LEVEL_LEFT] = vol->left;
212 cp->un.value.level[AUDIO_MIXER_LEVEL_RIGHT] = vol->right; 212 cp->un.value.level[AUDIO_MIXER_LEVEL_RIGHT] = vol->right;
213 return 1; 213 return 1;
214 } 214 }
215 return 0; 215 return 0;
216} 216}
217 217
218 218
219inline int 219int
220ad_read(struct ad1848_softc *sc, int reg) 220ad_read(struct ad1848_softc *sc, int reg)
221{ 221{
222 int x; 222 int x;
223 223
224 ADWRITE(sc, AD1848_IADDR, (reg & 0xff) | sc->MCE_bit); 224 ADWRITE(sc, AD1848_IADDR, (reg & 0xff) | sc->MCE_bit);
225 x = ADREAD(sc, AD1848_IDATA); 225 x = ADREAD(sc, AD1848_IDATA);
226 /* printf("(%02x<-%02x) ", reg|sc->MCE_bit, x); */ 226 /* printf("(%02x<-%02x) ", reg|sc->MCE_bit, x); */
227 return x; 227 return x;
228} 228}
229 229
230inline void 230void
231ad_write(struct ad1848_softc *sc, int reg, int data) 231ad_write(struct ad1848_softc *sc, int reg, int data)
232{ 232{
233 233
234 ADWRITE(sc, AD1848_IADDR, (reg & 0xff) | sc->MCE_bit); 234 ADWRITE(sc, AD1848_IADDR, (reg & 0xff) | sc->MCE_bit);
235 ADWRITE(sc, AD1848_IDATA, data & 0xff); 235 ADWRITE(sc, AD1848_IDATA, data & 0xff);
236 /* printf("(%02x->%02x) ", reg|sc->MCE_bit, data); */ 236 /* printf("(%02x->%02x) ", reg|sc->MCE_bit, data); */
237} 237}
238 238
239/* 239/*
240 * extended registers (mode 3) require an additional level of 240 * extended registers (mode 3) require an additional level of
241 * indirection through CS_XREG (I23). 241 * indirection through CS_XREG (I23).
242 */ 242 */
243 243
244inline int 244int
245ad_xread(struct ad1848_softc *sc, int reg) 245ad_xread(struct ad1848_softc *sc, int reg)
246{ 246{
247 int x; 247 int x;
248 248
249 ADWRITE(sc, AD1848_IADDR, CS_XREG | sc->MCE_bit); 249 ADWRITE(sc, AD1848_IADDR, CS_XREG | sc->MCE_bit);
250 ADWRITE(sc, AD1848_IDATA, (reg | ALT_F3_XRAE) & 0xff); 250 ADWRITE(sc, AD1848_IDATA, (reg | ALT_F3_XRAE) & 0xff);
251 x = ADREAD(sc, AD1848_IDATA); 251 x = ADREAD(sc, AD1848_IDATA);
252 252
253 return x; 253 return x;
254} 254}
255 255
256inline void 256void
257ad_xwrite(struct ad1848_softc *sc, int reg, int val) 257ad_xwrite(struct ad1848_softc *sc, int reg, int val)
258{ 258{
259 259
260 ADWRITE(sc, AD1848_IADDR, CS_XREG | sc->MCE_bit); 260 ADWRITE(sc, AD1848_IADDR, CS_XREG | sc->MCE_bit);
261 ADWRITE(sc, AD1848_IDATA, (reg | ALT_F3_XRAE) & 0xff); 261 ADWRITE(sc, AD1848_IDATA, (reg | ALT_F3_XRAE) & 0xff);
262 ADWRITE(sc, AD1848_IDATA, val & 0xff); 262 ADWRITE(sc, AD1848_IDATA, val & 0xff);
263} 263}
264 264
265static void 265static void
266ad_set_MCE(struct ad1848_softc *sc, int state) 266ad_set_MCE(struct ad1848_softc *sc, int state)
267{ 267{
268 268
269 if (state) 269 if (state)