Deleted Added
full compact
emu10k1.c (111556) emu10k1.c (113653)
1/*
2 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 18 unchanged lines hidden (view full) ---

27#include <dev/sound/pcm/sound.h>
28#include <dev/sound/pcm/ac97.h>
29#include <gnu/dev/sound/pci/emu10k1.h>
30
31#include <pci/pcireg.h>
32#include <pci/pcivar.h>
33#include <sys/queue.h>
34
1/*
2 * Copyright (c) 1999 Cameron Grant <gandalf@vilnya.demon.co.uk>
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 18 unchanged lines hidden (view full) ---

27#include <dev/sound/pcm/sound.h>
28#include <dev/sound/pcm/ac97.h>
29#include <gnu/dev/sound/pci/emu10k1.h>
30
31#include <pci/pcireg.h>
32#include <pci/pcivar.h>
33#include <sys/queue.h>
34
35SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/emu10k1.c 111556 2003-02-26 16:11:18Z cognet $");
35SND_DECLARE_FILE("$FreeBSD: head/sys/dev/sound/pci/emu10k1.c 113653 2003-04-18 04:13:38Z obrien $");
36
37/* -------------------------------------------------------------------- */
38
39#define EMU10K1_PCI_ID 0x00021102
40#define EMU10K2_PCI_ID 0x00041102
41#define EMU_DEFAULT_BUFSZ 4096
42#define EMU_CHANS 4
43#undef EMUDEBUG

--- 1194 unchanged lines hidden (view full) ---

1238
1239/* Probe and attach the card */
1240static int
1241emu_init(struct sc_info *sc)
1242{
1243 u_int32_t spcs, ch, tmp, i;
1244
1245 /* disable audio and lock cache */
36
37/* -------------------------------------------------------------------- */
38
39#define EMU10K1_PCI_ID 0x00021102
40#define EMU10K2_PCI_ID 0x00041102
41#define EMU_DEFAULT_BUFSZ 4096
42#define EMU_CHANS 4
43#undef EMUDEBUG

--- 1194 unchanged lines hidden (view full) ---

1238
1239/* Probe and attach the card */
1240static int
1241emu_init(struct sc_info *sc)
1242{
1243 u_int32_t spcs, ch, tmp, i;
1244
1245 /* disable audio and lock cache */
1246 emu_wr(sc, HCFG, HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE | HCFG_MUTEBUTTONENABLE, 4);
1246 emu_wr(sc, HCFG, HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE, 4);
1247
1248 /* reset recording buffers */
1249 emu_wrptr(sc, 0, MICBS, ADCBS_BUFSIZE_NONE);
1250 emu_wrptr(sc, 0, MICBA, 0);
1251 emu_wrptr(sc, 0, FXBS, ADCBS_BUFSIZE_NONE);
1252 emu_wrptr(sc, 0, FXBA, 0);
1253 emu_wrptr(sc, 0, ADCBS, ADCBS_BUFSIZE_NONE);
1254 emu_wrptr(sc, 0, ADCBA, 0);

--- 105 unchanged lines hidden (view full) ---

1360 /*
1361 * Hokay, now enable the AUD bit
1362 * Enable Audio = 1
1363 * Mute Disable Audio = 0
1364 * Lock Tank Memory = 1
1365 * Lock Sound Memory = 0
1366 * Auto Mute = 1
1367 */
1247
1248 /* reset recording buffers */
1249 emu_wrptr(sc, 0, MICBS, ADCBS_BUFSIZE_NONE);
1250 emu_wrptr(sc, 0, MICBA, 0);
1251 emu_wrptr(sc, 0, FXBS, ADCBS_BUFSIZE_NONE);
1252 emu_wrptr(sc, 0, FXBA, 0);
1253 emu_wrptr(sc, 0, ADCBS, ADCBS_BUFSIZE_NONE);
1254 emu_wrptr(sc, 0, ADCBA, 0);

--- 105 unchanged lines hidden (view full) ---

1360 /*
1361 * Hokay, now enable the AUD bit
1362 * Enable Audio = 1
1363 * Mute Disable Audio = 0
1364 * Lock Tank Memory = 1
1365 * Lock Sound Memory = 0
1366 * Auto Mute = 1
1367 */
1368 tmp = HCFG_AUDIOENABLE | HCFG_LOCKTANKCACHE | HCFG_AUTOMUTE;
1368 tmp = HCFG_AUDIOENABLE | HCFG_LOCKTANKCACHE_MASK | HCFG_AUTOMUTE;
1369 if (sc->rev >= 6)
1370 tmp |= HCFG_JOYENABLE;
1371 emu_wr(sc, HCFG, tmp, 4);
1372
1373 /* TOSLink detection */
1374 sc->tos_link = 0;
1375 tmp = emu_rd(sc, HCFG, 4);
1376 if (tmp & (HCFG_GPINPUT0 | HCFG_GPINPUT1)) {

--- 19 unchanged lines hidden (view full) ---

1396 for (ch = 0; ch < NUM_G; ch++) {
1397 emu_wrptr(sc, ch, VTFT, 0);
1398 emu_wrptr(sc, ch, CVCF, 0);
1399 emu_wrptr(sc, ch, PTRX, 0);
1400 emu_wrptr(sc, ch, CPF, 0);
1401 }
1402
1403 /* disable audio and lock cache */
1369 if (sc->rev >= 6)
1370 tmp |= HCFG_JOYENABLE;
1371 emu_wr(sc, HCFG, tmp, 4);
1372
1373 /* TOSLink detection */
1374 sc->tos_link = 0;
1375 tmp = emu_rd(sc, HCFG, 4);
1376 if (tmp & (HCFG_GPINPUT0 | HCFG_GPINPUT1)) {

--- 19 unchanged lines hidden (view full) ---

1396 for (ch = 0; ch < NUM_G; ch++) {
1397 emu_wrptr(sc, ch, VTFT, 0);
1398 emu_wrptr(sc, ch, CVCF, 0);
1399 emu_wrptr(sc, ch, PTRX, 0);
1400 emu_wrptr(sc, ch, CPF, 0);
1401 }
1402
1403 /* disable audio and lock cache */
1404 emu_wr(sc, HCFG, HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE | HCFG_MUTEBUTTONENABLE, 4);
1404 emu_wr(sc, HCFG, HCFG_LOCKSOUNDCACHE | HCFG_LOCKTANKCACHE_MASK | HCFG_MUTEBUTTONENABLE, 4);
1405
1406 emu_wrptr(sc, 0, PTB, 0);
1407 /* reset recording buffers */
1408 emu_wrptr(sc, 0, MICBS, ADCBS_BUFSIZE_NONE);
1409 emu_wrptr(sc, 0, MICBA, 0);
1410 emu_wrptr(sc, 0, FXBS, ADCBS_BUFSIZE_NONE);
1411 emu_wrptr(sc, 0, FXBA, 0);
1412 emu_wrptr(sc, 0, FXWC, 0);

--- 222 unchanged lines hidden ---
1405
1406 emu_wrptr(sc, 0, PTB, 0);
1407 /* reset recording buffers */
1408 emu_wrptr(sc, 0, MICBS, ADCBS_BUFSIZE_NONE);
1409 emu_wrptr(sc, 0, MICBA, 0);
1410 emu_wrptr(sc, 0, FXBS, ADCBS_BUFSIZE_NONE);
1411 emu_wrptr(sc, 0, FXBA, 0);
1412 emu_wrptr(sc, 0, FXWC, 0);

--- 222 unchanged lines hidden ---