* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* $FreeBSD: src/lib/libc_r/test/join_leak_d.c,v 1.1.2.1 2001/06/22 21:44:27 jasone Exp $
- * $DragonFly: src/lib/libc_r/test/join_leak_d.c,v 1.2 2003/06/17 04:26:48 dillon Exp $
*
* Test for leaked joined threads.
*/
fprintf(stderr, "Heap growth exceeded maximum (%u > %u)\n",
growth, MAXGROWTH);
}
-#if (0)
+#if 0
else {
fprintf(stderr, "Heap growth acceptable (%u <= %u)\n",
growth, MAXGROWTH);
// 16 term solution that performs less well than 17 term one
// in my environment (PPro/PII)
-#if(0)
+#if 0
#define sb3(a,b,c,d,e,f,g,h) \
{ t1 = a ^ b; \
u_int32_t data;
int i;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_rdi2c(sc, 0x%02x, 0x%02x)\n", dev, addr);
#endif
for (i = 0; i < ENVY24_TIMEOUT; i++) {
}
data = envy24_rdcs(sc, ENVY24_CCS_I2CDATA, 1);
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_rdi2c(): return 0x%x\n", data);
#endif
return (int)data;
u_int32_t tmp;
int i;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_rdi2c(sc, 0x%02x, 0x%02x)\n", dev, addr);
#endif
for (i = 0; i < ENVY24_TIMEOUT; i++) {
{
u_int32_t data;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_rdrom(sc, 0x%02x)\n", addr);
#endif
data = envy24_rdcs(sc, ENVY24_CCS_I2CSTAT, 1);
if ((data & ENVY24_CCS_I2CSTAT_ROM) == 0) {
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_rdrom(): E2PROM not presented\n");
#endif
return -1;
int size;
int i;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_rom2cfg(sc)\n");
#endif
size = envy24_rdrom(sc, ENVY24_E2PROM_SIZE);
if (size < ENVY24_E2PROM_GPIODIR + 1) {
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_rom2cfg(): ENVY24_E2PROM_SIZE-->%d\n", size);
#endif
return NULL;
u_int32_t data;
int i;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_coldcd()\n");
#endif
envy24_wrmt(sc, ENVY24_MT_AC97CMD, ENVY24_MT_AC97CMD_CLD, 1);
u_int32_t data;
int i;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_slavecd()\n");
#endif
envy24_wrmt(sc, ENVY24_MT_AC97CMD,
u_int32_t data;
int i;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_rdcd(obj, sc, 0x%02x)\n", regno);
#endif
envy24_wrmt(sc, ENVY24_MT_AC97IDX, (u_int32_t)regno, 1);
}
data = envy24_rdmt(sc, ENVY24_MT_AC97DLO, 2);
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_rdcd(): return 0x%x\n", data);
#endif
return (int)data;
u_int32_t cmd;
int i;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_wrcd(obj, sc, 0x%02x, 0x%04x)\n", regno, data);
#endif
envy24_wrmt(sc, ENVY24_MT_AC97IDX, (u_int32_t)regno, 1);
static void
envy24_gpiowr(struct sc_info *sc, u_int32_t data)
{
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_gpiowr(sc, 0x%02x)\n", data & 0xff);
return;
#endif
{
u_int32_t data = 0;
struct envy24_delta_ak4524_codec *ptr = codec;
-#if(0)
+#if 0
device_printf(ptr->parent->dev, "--> %d, %d\n", scl, sda);
#endif
data = envy24_gpiord(ptr->parent);
u_int32_t data = 0;
struct envy24_delta_ak4524_codec *ptr = codec;
-#if(0)
+#if 0
device_printf(ptr->parent->dev, "--> %d, %d, %d\n", cs, cclk, cdti);
#endif
data = envy24_gpiord(ptr->parent);
struct sc_info *sc = info;
struct envy24_delta_ak4524_codec *buff = NULL;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_delta_ak4524_create(dev, sc, %d, %d)\n", dir, num);
#endif
struct envy24_delta_ak4524_codec *ptr = codec;
if (ptr == NULL)
return;
-#if(0)
+#if 0
device_printf(ptr->parent->dev, "envy24_delta_ak4524_destroy()\n");
#endif
struct envy24_delta_ak4524_codec *ptr = codec;
if (ptr == NULL)
return;
-#if(0)
+#if 0
device_printf(ptr->parent->dev, "envy24_delta_ak4524_init()\n");
#endif
struct envy24_delta_ak4524_codec *ptr = codec;
if (ptr == NULL)
return;
-#if(0)
+#if 0
device_printf(ptr->parent->dev, "envy24_delta_ak4524_reinit()\n");
#endif
struct envy24_delta_ak4524_codec *ptr = codec;
if (ptr == NULL)
return;
-#if(0)
+#if 0
device_printf(ptr->parent->dev, "envy24_delta_ak4524_set()\n");
#endif
u_int32_t code;
int i = 0;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_setspeed(sc, %d)\n", speed);
#endif
if (speed == 0) {
}
code = envy24_speedtab[i].code;
}
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_setspeed(): speed %d/code 0x%04x\n", envy24_speedtab[i].speed, code);
#endif
if (code < 0x10) {
else
speed = 0;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_setspeed(): return %d\n", speed);
#endif
return speed;
static void
envy24_setvolume(struct sc_info *sc, unsigned ch)
{
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_setvolume(sc, %d)\n", ch);
#endif
if (sc->cfg->subvendor==0x153b && sc->cfg->subdevice==0x1138 ) {
{
u_int32_t vol;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_mutevolume(sc, %d)\n", ch);
#endif
vol = ENVY24_VOL_MUTE << 8 | ENVY24_VOL_MUTE;
int unit, regno;
u_int32_t ptr, rtn;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_gethwptr(sc, %d)\n", dir);
#endif
if (dir == PCMDIR_PLAY) {
rtn -= (ptr + 1);
rtn /= unit;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_gethwptr(): return %d\n", rtn);
#endif
return rtn;
u_int32_t ptr, size, cnt;
u_int16_t blk;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_updintr(sc, %d)\n", dir);
#endif
if (dir == PCMDIR_PLAY) {
cnt = blk - 1;
*/
cnt = blk - 1;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_updintr():ptr = %d, blk = %d, cnt = %d\n", ptr, blk, cnt);
#endif
envy24_wrmt(sc, regintr, cnt, 2);
intr = envy24_rdmt(sc, ENVY24_MT_INT, 1);
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_updintr():intr = 0x%02x, mask = 0x%02x\n", intr, mask);
#endif
envy24_wrmt(sc, ENVY24_MT_INT, intr & mask, 1);
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_updintr():INT-->0x%02x\n",
envy24_rdmt(sc, ENVY24_MT_INT, 1));
#endif
{
u_int32_t mask, intr;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_maskintr(sc, %d)\n", dir);
#endif
if (dir == PCMDIR_PLAY)
{
u_int32_t mask, stat, intr, rtn;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_checkintr(sc, %d)\n", dir);
#endif
intr = envy24_rdmt(sc, ENVY24_MT_INT, 1);
{
u_int32_t stat, sw;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_start(sc, %d)\n", dir);
#endif
if (dir == PCMDIR_PLAY)
stat = envy24_rdmt(sc, ENVY24_MT_PCTL, 1);
envy24_wrmt(sc, ENVY24_MT_PCTL, stat | sw, 1);
-#if(0)
+#if 0
DELAY(100);
device_printf(sc->dev, "PADDR:0x%08x\n", envy24_rdmt(sc, ENVY24_MT_PADDR, 4));
device_printf(sc->dev, "PCNT:%ld\n", envy24_rdmt(sc, ENVY24_MT_PCNT, 2));
{
u_int32_t stat, sw;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_stop(sc, %d)\n", dir);
#endif
if (dir == PCMDIR_PLAY)
u_int32_t reg, mask;
u_int32_t left, right;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_route(sc, %d, %d, %d, %d)\n",
dac, class, adc, rev);
#endif
reg = class | class << 2 |
((adc << 1 | left) | left << 3) << 8 |
((adc << 1 | right) | right << 3) << 12;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_route(): MT_SPDOUT-->0x%04x\n", reg);
#endif
envy24_wrmt(sc, ENVY24_MT_SPDOUT, reg, 2);
mask = ~(0x0303 << dac * 2);
reg = envy24_rdmt(sc, ENVY24_MT_PSDOUT, 2);
reg = (reg & mask) | ((class | class << 8) << dac * 2);
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_route(): MT_PSDOUT-->0x%04x\n", reg);
#endif
envy24_wrmt(sc, ENVY24_MT_PSDOUT, reg, 2);
reg = (reg & mask) |
(((adc << 1 | left) | left << 3) |
((adc << 1 | right) | right << 3) << 4) << dac * 8;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_route(): MT_RECORD-->0x%08x\n", reg);
#endif
envy24_wrmt(sc, ENVY24_MT_RECORD, reg, 4);
int src, dst, ssize, dsize, slot;
int i;
-#if(0)
+#if 0
device_printf(ch->parent->dev, "envy24_p16sl()\n");
#endif
length = sndbuf_getready(ch->buffer) / 4;
ssize = ch->size / 2;
dsize = ch->size / 4;
slot = ch->num * 2;
-#if(0)
+#if 0
device_printf(ch->parent->dev, "envy24_p16sl():%lu-->%lu(%lu)\n", src, dst, length);
#endif
for (i = 0; i < length; i++) {
dmabuf[dst * ENVY24_PLAY_CHNUM + slot].buffer = (u_int32_t)data[src] << 16;
dmabuf[dst * ENVY24_PLAY_CHNUM + slot + 1].buffer = (u_int32_t)data[src + 1] << 16;
-#if(0)
+#if 0
if (i < 16) {
printf("%08x", dmabuf[dst * ENVY24_PLAY_CHNUM + slot]);
printf("%08x", dmabuf[dst * ENVY24_PLAY_CHNUM + slot + 1]);
src += 2;
src %= ssize;
}
-#if(0)
+#if 0
printf("\n");
#endif
struct sc_chinfo *ch;
unsigned num;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24chan_init(obj, devinfo, b, c, %d)\n", dir);
#endif
snd_mtxlock(sc->lock);
struct sc_chinfo *ch = data;
struct sc_info *sc = ch->parent;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24chan_free()\n");
#endif
snd_mtxlock(sc->lock);
/* unsigned int bcnt, bsize; */
int i;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24chan_setformat(obj, data, 0x%08x)\n", format);
#endif
snd_mtxlock(sc->lock);
#endif
snd_mtxunlock(sc->lock);
-#if(0)
+#if 0
device_printf(sc->dev, "envy24chan_setformat(): return 0x%08x\n", 0);
#endif
return 0;
u_int32_t val, prev;
int i;
-#if(0)
+#if 0
device_printf(ch->parent->dev, "envy24chan_setspeed(obj, data, %d)\n", speed);
#endif
prev = 0x7fffffff;
}
ch->speed = prev;
-#if(0)
+#if 0
device_printf(ch->parent->dev, "envy24chan_setspeed(): return %d\n", ch->speed);
#endif
return ch->speed;
u_int32_t size, prev;
unsigned int bcnt, bsize;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24chan_setblocksize(obj, data, %d)\n", blocksize);
#endif
prev = 0x7fffffff;
sndbuf_resize(ch->buffer, bcnt, bsize);
/* snd_mtxunlock(sc->lock); */
-#if(0)
+#if 0
device_printf(sc->dev, "envy24chan_setblocksize(): return %d\n", prev);
#endif
return prev;
slot = 1;
switch (go) {
case PCMTRIG_START:
-#if(0)
+#if 0
device_printf(sc->dev, "envy24chan_trigger(): start\n");
#endif
/* check or set channel speed */
ch->run = 1;
break;
case PCMTRIG_EMLDMAWR:
-#if(0)
+#if 0
device_printf(sc->dev, "envy24chan_trigger(): emldmawr\n");
#endif
if (ch->run != 1)
ch->emldma(ch);
break;
case PCMTRIG_EMLDMARD:
-#if(0)
+#if 0
device_printf(sc->dev, "envy24chan_trigger(): emldmard\n");
#endif
if (ch->run != 1)
break;
case PCMTRIG_ABORT:
if (ch->run) {
-#if(0)
+#if 0
device_printf(sc->dev, "envy24chan_trigger(): abort\n");
#endif
ch->run = 0;
u_int32_t ptr;
int rtn;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24chan_getptr()\n");
#endif
snd_mtxlock(sc->lock);
rtn = ptr * ch->unit;
snd_mtxunlock(sc->lock);
-#if(0)
+#if 0
device_printf(sc->dev, "envy24chan_getptr(): return %d\n",
rtn);
#endif
struct sc_info *sc = ch->parent;
struct pcmchan_caps *rtn;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24chan_getcaps()\n");
#endif
snd_mtxlock(sc->lock);
{
struct sc_info *sc = mix_getdevinfo(m);
-#if(0)
+#if 0
device_printf(sc->dev, "envy24mixer_init()\n");
#endif
if (sc == NULL)
if (sc == NULL)
return -1;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24mixer_reinit()\n");
#endif
if (sc == NULL)
return -1;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24mixer_uninit()\n");
#endif
if (dev != 0 && ch == -1)
return -1;
hwch = envy24_chanmap[ch];
-#if(0)
+#if 0
device_printf(sc->dev, "envy24mixer_set(m, %d, %d, %d)\n",
dev, left, right);
#endif
{
struct sc_info *sc = mix_getdevinfo(m);
int ch = envy24_mixmap[src];
-#if(0)
+#if 0
device_printf(sc->dev, "envy24mixer_setrecsrc(m, %d)\n", src);
#endif
u_int32_t ptr, dsize, feed;
int i;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_intr()\n");
#endif
snd_mtxlock(sc->lock);
if (envy24_checkintr(sc, PCMDIR_PLAY)) {
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_intr(): play\n");
#endif
dsize = sc->psize / 4;
ptr = dsize - envy24_rdmt(sc, ENVY24_MT_PCNT, 2) - 1;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_intr(): ptr = %d-->", ptr);
#endif
ptr -= ptr % sc->blk[0];
feed = (ptr + dsize - sc->intr[0]) % dsize;
-#if(0)
+#if 0
printf("%d intr = %d feed = %d\n", ptr, sc->intr[0], feed);
#endif
for (i = ENVY24_CHAN_PLAY_DAC1; i <= ENVY24_CHAN_PLAY_SPDIF; i++) {
ch = &sc->chan[i];
-#if(0)
+#if 0
if (ch->run)
device_printf(sc->dev, "envy24_intr(): chan[%d].blk = %d\n", i, ch->blk);
#endif
envy24_updintr(sc, PCMDIR_PLAY);
}
if (envy24_checkintr(sc, PCMDIR_REC)) {
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_intr(): rec\n");
#endif
dsize = sc->rsize / 4;
u_int16_t sv, sd;
int i;
-#if(0)
+#if 0
printf("envy24_pci_probe()\n");
#endif
if (pci_get_device(dev) == PCID_ENVY24 &&
}
}
device_set_desc(dev, cfg_table[i].name);
-#if(0)
+#if 0
printf("envy24_pci_probe(): return 0\n");
#endif
return 0;
}
else {
-#if(0)
+#if 0
printf("envy24_pci_probe(): return ENXIO\n");
#endif
return ENXIO;
{
/* struct sc_info *sc = (struct sc_info *)arg; */
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_dmapsetmap()\n");
if (bootverbose) {
printf("envy24(play): setmap %lx, %lx; ",
{
/* struct sc_info *sc = (struct sc_info *)arg; */
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_dmarsetmap()\n");
if (bootverbose) {
printf("envy24(record): setmap %lx, %lx; ",
static void
envy24_dmafree(struct sc_info *sc)
{
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_dmafree():");
if (sc->rmap) printf(" sc->rmap(0x%08x)", (u_int32_t)sc->rmap);
else printf(" sc->rmap(null)");
if (sc->pbuf) printf(" sc->pbuf(0x%08x)\n", (u_int32_t)sc->pbuf);
else printf(" sc->pbuf(null)\n");
#endif
-#if(0)
+#if 0
if (sc->rmap)
bus_dmamap_unload(sc->dmat, sc->rmap);
if (sc->pmap)
{
u_int32_t addr;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_dmainit()\n");
#endif
/* init values */
sc->blk[0] = sc->blk[1] = 0;
/* allocate DMA buffer */
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_dmainit(): bus_dmamem_alloc(): sc->pbuf\n");
#endif
if (bus_dmamem_alloc(sc->dmat, (void **)&sc->pbuf, BUS_DMA_NOWAIT, &sc->pmap))
goto bad;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_dmainit(): bus_dmamem_alloc(): sc->rbuf\n");
#endif
if (bus_dmamem_alloc(sc->dmat, (void **)&sc->rbuf, BUS_DMA_NOWAIT, &sc->rmap))
goto bad;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_dmainit(): bus_dmamem_load(): sc->pmap\n");
#endif
if (bus_dmamap_load(sc->dmat, sc->pmap, sc->pbuf, sc->psize, envy24_dmapsetmap, sc, 0))
goto bad;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_dmainit(): bus_dmamem_load(): sc->rmap\n");
#endif
if (bus_dmamap_load(sc->dmat, sc->rmap, sc->rbuf, sc->rsize, envy24_dmarsetmap, sc, 0))
/* set values to register */
addr = vtophys(sc->pbuf);
-#if(0)
+#if 0
device_printf(sc->dev, "pbuf(0x%08x)\n", addr);
#endif
envy24_wrmt(sc, ENVY24_MT_PADDR, addr, 4);
-#if(0)
+#if 0
device_printf(sc->dev, "PADDR-->(0x%08x)\n", envy24_rdmt(sc, ENVY24_MT_PADDR, 4));
device_printf(sc->dev, "psize(%ld)\n", sc->psize / 4 - 1);
#endif
envy24_wrmt(sc, ENVY24_MT_PCNT, sc->psize / 4 - 1, 2);
-#if(0)
+#if 0
device_printf(sc->dev, "PCNT-->(%ld)\n", envy24_rdmt(sc, ENVY24_MT_PCNT, 2));
#endif
addr = vtophys(sc->rbuf);
envy24_init(struct sc_info *sc)
{
u_int32_t data;
-#if(0)
+#if 0
int rtn;
#endif
int i;
u_int32_t sv, sd;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_init()\n");
#endif
sv = pci_get_subvendor(sc->dev);
sd = pci_get_subdevice(sc->dev);
if (sv == cfg_table[i].subvendor && sd == cfg_table[i].subdevice) {
-#if(0)
+#if 0
device_printf(sc->dev, "Set configuration from table\n");
#endif
sc->cfg = &cfg_table[i];
}
/* initialize DMA buffer */
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_init(): initialize DMA buffer\n");
#endif
if (envy24_dmainit(sc))
data = envy24_rdcs(sc, ENVY24_CCS_IMASK, 1);
envy24_wrcs(sc, ENVY24_CCS_IMASK, data & ~ENVY24_CCS_IMASK_PMT, 1);
data = envy24_rdcs(sc, ENVY24_CCS_IMASK, 1);
-#if(0)
+#if 0
device_printf(sc->dev, "envy24_init(): CCS_IMASK-->0x%02x\n", data);
#endif
sc->dsh = rman_get_bushandle(sc->ds);
sc->mtt = rman_get_bustag(sc->mt);
sc->mth = rman_get_bushandle(sc->mt);
-#if(0)
+#if 0
device_printf(sc->dev,
"IO port register values\nCCS: 0x%lx\nDDMA: 0x%lx\nDS: 0x%lx\nMT: 0x%lx\n",
pci_read_config(sc->dev, PCIR_CCS, 4),
int err = 0;
int i;
-#if(0)
+#if 0
device_printf(dev, "envy24_pci_attach()\n");
#endif
/* get sc_info data area */
int r;
int i;
-#if(0)
+#if 0
device_printf(dev, "envy24_pci_detach()\n");
#endif
sc = pcm_getdevinfo(dev);
u_int32_t data;
int i;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_rdi2c(sc, 0x%02x, 0x%02x)\n", dev, addr);
#endif
for (i = 0; i < ENVY24HT_TIMEOUT; i++) {
}
data = envy24ht_rdcs(sc, ENVY24HT_CCS_I2CDATA, 1);
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_rdi2c(): return 0x%x\n", data);
#endif
return (int)data;
u_int32_t tmp;
int i;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_rdi2c(sc, 0x%02x, 0x%02x)\n", dev, addr);
#endif
for (i = 0; i < ENVY24HT_TIMEOUT; i++) {
{
u_int32_t data;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_rdrom(sc, 0x%02x)\n", addr);
#endif
data = envy24ht_rdcs(sc, ENVY24HT_CCS_I2CSTAT, 1);
if ((data & ENVY24HT_CCS_I2CSTAT_ROM) == 0) {
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_rdrom(): E2PROM not presented\n");
#endif
return -1;
int size;
int i;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_rom2cfg(sc)\n");
#endif
size = envy24ht_rdrom(sc, ENVY24HT_E2PROM_SIZE);
if ((size < ENVY24HT_E2PROM_GPIOSTATE + 3) || (size == 0x78)) {
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_rom2cfg(): ENVY24HT_E2PROM_SIZE-->%d\n", size);
#endif
buff = kmalloc(sizeof(*buff), M_ENVY24HT, M_WAITOK);
u_int32_t data;
int i;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_coldcd()\n");
#endif
envy24ht_wrmt(sc, ENVY24HT_MT_AC97CMD, ENVY24HT_MT_AC97CMD_CLD, 1);
u_int32_t data;
int i;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_slavecd()\n");
#endif
envy24ht_wrmt(sc, ENVY24HT_MT_AC97CMD,
u_int32_t data;
int i;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_rdcd(obj, sc, 0x%02x)\n", regno);
#endif
envy24ht_wrmt(sc, ENVY24HT_MT_AC97IDX, (u_int32_t)regno, 1);
}
data = envy24ht_rdmt(sc, ENVY24HT_MT_AC97DLO, 2);
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_rdcd(): return 0x%x\n", data);
#endif
return (int)data;
u_int32_t cmd;
int i;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_wrcd(obj, sc, 0x%02x, 0x%04x)\n", regno, data);
#endif
envy24ht_wrmt(sc, ENVY24HT_MT_AC97IDX, (u_int32_t)regno, 1);
static void
envy24ht_gpiowr(struct sc_info *sc, u_int32_t data)
{
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_gpiowr(sc, 0x%02x)\n", data & 0x7FFFFF);
return;
#endif
u_int32_t data = 0;
struct envy24ht_spi_codec *ptr = codec;
-#if(0)
+#if 0
device_printf(ptr->parent->dev, "--> %d, %d, %d\n", cs, cclk, cdti);
#endif
data = envy24ht_gpiord(ptr->parent);
struct sc_info *sc = info;
struct envy24ht_spi_codec *buff = NULL;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_spi_create(dev, sc, %d, %d)\n", dir, num);
#endif
struct envy24ht_spi_codec *ptr = codec;
if (ptr == NULL)
return;
-#if(0)
+#if 0
device_printf(ptr->parent->dev, "envy24ht_spi_destroy()\n");
#endif
struct envy24ht_spi_codec *ptr = codec;
if (ptr == NULL)
return;
-#if(0)
+#if 0
device_printf(ptr->parent->dev, "envy24ht_spicds_init()\n");
#endif
ptr->cs = ptr->parent->cfg->cs;
struct envy24ht_spi_codec *ptr = codec;
if (ptr == NULL)
return;
-#if(0)
+#if 0
device_printf(ptr->parent->dev, "envy24ht_spi_reinit()\n");
#endif
struct envy24ht_spi_codec *ptr = codec;
if (ptr == NULL)
return;
-#if(0)
+#if 0
device_printf(ptr->parent->dev, "envy24ht_spi_set()\n");
#endif
u_int32_t code, i2sfmt;
int i = 0;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_setspeed(sc, %d)\n", speed);
if (speed == 0) {
code = ENVY24HT_MT_RATE_SPDIF; /* external master clock */
else
speed = 0;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_setspeed(): return %d\n", speed);
#endif
return speed;
static void
envy24ht_setvolume(struct sc_info *sc, unsigned ch)
{
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_setvolume(sc, %d)\n", ch);
envy24ht_wrmt(sc, ENVY24HT_MT_VOLIDX, ch * 2, 1);
envy24ht_wrmt(sc, ENVY24HT_MT_VOLUME, 0x7f00 | sc->left[ch], 2);
int unit, regno;
u_int32_t ptr, rtn;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_gethwptr(sc, %d)\n", dir);
#endif
if (dir == PCMDIR_PLAY) {
rtn -= (ptr + 1);
rtn /= unit;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_gethwptr(): return %d\n", rtn);
#endif
return rtn;
u_int32_t ptr, size, cnt;
u_int16_t blk;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_updintr(sc, %d)\n", dir);
#endif
if (dir == PCMDIR_PLAY) {
cnt = blk - 1;
*/
cnt = blk - 1;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_updintr():ptr = %d, blk = %d, cnt = %d\n", ptr, blk, cnt);
#endif
envy24ht_wrmt(sc, regintr, cnt, 2);
intr = envy24ht_rdmt(sc, ENVY24HT_MT_INT_MASK, 1);
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_updintr():intr = 0x%02x, mask = 0x%02x\n", intr, mask);
#endif
envy24ht_wrmt(sc, ENVY24HT_MT_INT_MASK, intr & mask, 1);
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_updintr():INT-->0x%02x\n",
envy24ht_rdmt(sc, ENVY24HT_MT_INT_MASK, 1));
#endif
{
u_int32_t mask, intr;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_maskintr(sc, %d)\n", dir);
#endif
if (dir == PCMDIR_PLAY)
{
u_int32_t mask, stat, intr, rtn;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_checkintr(sc, %d)\n", dir);
#endif
intr = envy24ht_rdmt(sc, ENVY24HT_MT_INT_STAT, 1);
{
u_int32_t stat, sw;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_start(sc, %d)\n", dir);
#endif
if (dir == PCMDIR_PLAY)
stat = envy24ht_rdmt(sc, ENVY24HT_MT_PCTL, 1);
envy24ht_wrmt(sc, ENVY24HT_MT_PCTL, stat | sw, 1);
-#if(0)
+#if 0
DELAY(100);
device_printf(sc->dev, "PADDR:0x%08x\n", envy24ht_rdmt(sc, ENVY24HT_MT_PADDR, 4));
device_printf(sc->dev, "PCNT:%ld\n", envy24ht_rdmt(sc, ENVY24HT_MT_PCNT, 2));
{
u_int32_t stat, sw;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_stop(sc, %d)\n", dir);
#endif
if (dir == PCMDIR_PLAY)
int src, dst, ssize, dsize, slot;
int i;
-#if(0)
+#if 0
device_printf(ch->parent->dev, "envy24ht_p16sl()\n");
#endif
length = sndbuf_getready(ch->buffer) / 4;
ssize = ch->size / 2;
dsize = ch->size / 4;
slot = ch->num * 2;
-#if(0)
+#if 0
device_printf(ch->parent->dev, "envy24ht_p16sl():%lu-->%lu(%lu)\n", src, dst, length);
#endif
for (i = 0; i < length; i++) {
dmabuf[dst * ENVY24HT_PLAY_CHNUM + slot].buffer = (u_int32_t)data[src] << 16;
dmabuf[dst * ENVY24HT_PLAY_CHNUM + slot + 1].buffer = (u_int32_t)data[src + 1] << 16;
-#if(0)
+#if 0
if (i < 16) {
kprintf("%08x", dmabuf[dst * ENVY24HT_PLAY_CHNUM + slot]);
kprintf("%08x", dmabuf[dst * ENVY24HT_PLAY_CHNUM + slot + 1]);
src += 2;
src %= ssize;
}
-#if(0)
+#if 0
kprintf("\n");
#endif
struct sc_chinfo *ch;
unsigned num;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24htchan_init(obj, devinfo, b, c, %d)\n", dir);
#endif
snd_mtxlock(sc->lock);
struct sc_chinfo *ch = data;
struct sc_info *sc = ch->parent;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24htchan_free()\n");
#endif
snd_mtxlock(sc->lock);
/* unsigned int bcnt, bsize; */
int i;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24htchan_setformat(obj, data, 0x%08x)\n", format);
#endif
snd_mtxlock(sc->lock);
#endif
snd_mtxunlock(sc->lock);
-#if(0)
+#if 0
device_printf(sc->dev, "envy24htchan_setformat(): return 0x%08x\n", 0);
#endif
return 0;
u_int32_t val, prev;
int i;
-#if(0)
+#if 0
device_printf(ch->parent->dev, "envy24htchan_setspeed(obj, data, %d)\n", speed);
#endif
prev = 0x7fffffff;
}
ch->speed = prev;
-#if(0)
+#if 0
device_printf(ch->parent->dev, "envy24htchan_setspeed(): return %d\n", ch->speed);
#endif
return ch->speed;
u_int32_t size, prev;
unsigned int bcnt, bsize;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24htchan_setblocksize(obj, data, %d)\n", blocksize);
#endif
prev = 0x7fffffff;
sndbuf_resize(ch->buffer, bcnt, bsize);
/* snd_mtxunlock(sc->lock); */
-#if(0)
+#if 0
device_printf(sc->dev, "envy24htchan_setblocksize(): return %d\n", prev);
#endif
return prev;
slot = 1;
switch (go) {
case PCMTRIG_START:
-#if(0)
+#if 0
device_printf(sc->dev, "envy24htchan_trigger(): start\n");
#endif
/* check or set channel speed */
ch->run = 1;
break;
case PCMTRIG_EMLDMAWR:
-#if(0)
+#if 0
device_printf(sc->dev, "envy24htchan_trigger(): emldmawr\n");
#endif
if (ch->run != 1)
ch->emldma(ch);
break;
case PCMTRIG_EMLDMARD:
-#if(0)
+#if 0
device_printf(sc->dev, "envy24htchan_trigger(): emldmard\n");
#endif
if (ch->run != 1)
break;
case PCMTRIG_ABORT:
if (ch->run) {
-#if(0)
+#if 0
device_printf(sc->dev, "envy24htchan_trigger(): abort\n");
#endif
ch->run = 0;
u_int32_t ptr;
int rtn;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24htchan_getptr()\n");
#endif
snd_mtxlock(sc->lock);
rtn = ptr * ch->unit;
snd_mtxunlock(sc->lock);
-#if(0)
+#if 0
device_printf(sc->dev, "envy24htchan_getptr(): return %d\n",
rtn);
#endif
struct sc_info *sc = ch->parent;
struct pcmchan_caps *rtn;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24htchan_getcaps()\n");
#endif
snd_mtxlock(sc->lock);
{
struct sc_info *sc = mix_getdevinfo(m);
-#if(0)
+#if 0
device_printf(sc->dev, "envy24htmixer_init()\n");
#endif
if (sc == NULL)
if (sc == NULL)
return -1;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24htmixer_reinit()\n");
#endif
if (sc == NULL)
return -1;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24htmixer_uninit()\n");
#endif
if (dev != 0 && ch == -1)
return -1;
hwch = envy24ht_chanmap[ch];
-#if(0)
+#if 0
device_printf(sc->dev, "envy24htmixer_set(m, %d, %d, %d)\n",
dev, left, right);
#endif
{
struct sc_info *sc = mix_getdevinfo(m);
int ch = envy24ht_mixmap[src];
-#if(0)
+#if 0
device_printf(sc->dev, "envy24htmixer_setrecsrc(m, %d)\n", src);
#endif
u_int32_t ptr, dsize, feed;
int i;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_intr()\n");
#endif
snd_mtxlock(sc->lock);
if (envy24ht_checkintr(sc, PCMDIR_PLAY)) {
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_intr(): play\n");
#endif
dsize = sc->psize / 4;
ptr = dsize - envy24ht_rdmt(sc, ENVY24HT_MT_PCNT, 2) - 1;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_intr(): ptr = %d-->", ptr);
#endif
ptr -= ptr % sc->blk[0];
feed = (ptr + dsize - sc->intr[0]) % dsize;
-#if(0)
+#if 0
kprintf("%d intr = %d feed = %d\n", ptr, sc->intr[0], feed);
#endif
for (i = ENVY24HT_CHAN_PLAY_DAC1; i <= ENVY24HT_CHAN_PLAY_SPDIF; i++) {
ch = &sc->chan[i];
-#if(0)
+#if 0
if (ch->run)
device_printf(sc->dev, "envy24ht_intr(): chan[%d].blk = %d\n", i, ch->blk);
#endif
envy24ht_updintr(sc, PCMDIR_PLAY);
}
if (envy24ht_checkintr(sc, PCMDIR_REC)) {
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_intr(): rec\n");
#endif
dsize = sc->rsize / 4;
u_int16_t sv, sd;
int i;
-#if(0)
+#if 0
kprintf("envy24ht_pci_probe()\n");
#endif
if (pci_get_device(dev) == PCID_ENVY24HT &&
}
}
device_set_desc(dev, cfg_table[i].name);
-#if(0)
+#if 0
kprintf("envy24ht_pci_probe(): return 0\n");
#endif
return 0;
}
else {
-#if(0)
+#if 0
kprintf("envy24ht_pci_probe(): return ENXIO\n");
#endif
return ENXIO;
{
/* struct sc_info *sc = (struct sc_info *)arg; */
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_dmapsetmap()\n");
if (bootverbose) {
kprintf("envy24ht(play): setmap %lx, %lx; ",
{
/* struct sc_info *sc = (struct sc_info *)arg; */
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_dmarsetmap()\n");
if (bootverbose) {
kprintf("envy24ht(record): setmap %lx, %lx; ",
static void
envy24ht_dmafree(struct sc_info *sc)
{
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_dmafree():");
if (sc->rmap) kprintf(" sc->rmap(0x%08x)", (u_int32_t)sc->rmap);
else kprintf(" sc->rmap(null)");
if (sc->pbuf) kprintf(" sc->pbuf(0x%08x)\n", (u_int32_t)sc->pbuf);
else kprintf(" sc->pbuf(null)\n");
#endif
-#if(0)
+#if 0
if (sc->rmap)
bus_dmamap_unload(sc->dmat, sc->rmap);
if (sc->pmap)
{
u_int32_t addr;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_dmainit()\n");
#endif
/* init values */
sc->blk[0] = sc->blk[1] = 0;
/* allocate DMA buffer */
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_dmainit(): bus_dmamem_alloc(): sc->pbuf\n");
#endif
if (bus_dmamem_alloc(sc->dmat, (void **)&sc->pbuf, BUS_DMA_NOWAIT, &sc->pmap))
goto bad;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_dmainit(): bus_dmamem_alloc(): sc->rbuf\n");
#endif
if (bus_dmamem_alloc(sc->dmat, (void **)&sc->rbuf, BUS_DMA_NOWAIT, &sc->rmap))
goto bad;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_dmainit(): bus_dmamem_load(): sc->pmap\n");
#endif
if (bus_dmamap_load(sc->dmat, sc->pmap, sc->pbuf, sc->psize, envy24ht_dmapsetmap, sc, 0))
goto bad;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_dmainit(): bus_dmamem_load(): sc->rmap\n");
#endif
if (bus_dmamap_load(sc->dmat, sc->rmap, sc->rbuf, sc->rsize, envy24ht_dmarsetmap, sc, 0))
/* set values to register */
addr = vtophys(sc->pbuf);
-#if(0)
+#if 0
device_printf(sc->dev, "pbuf(0x%08x)\n", addr);
#endif
envy24ht_wrmt(sc, ENVY24HT_MT_PADDR, addr, 4);
-#if(0)
+#if 0
device_printf(sc->dev, "PADDR-->(0x%08x)\n", envy24ht_rdmt(sc, ENVY24HT_MT_PADDR, 4));
device_printf(sc->dev, "psize(%ld)\n", sc->psize / 4 - 1);
#endif
envy24ht_wrmt(sc, ENVY24HT_MT_PCNT, sc->psize / 4 - 1, 2);
-#if(0)
+#if 0
device_printf(sc->dev, "PCNT-->(%ld)\n", envy24ht_rdmt(sc, ENVY24HT_MT_PCNT, 2));
#endif
addr = vtophys(sc->rbuf);
envy24ht_init(struct sc_info *sc)
{
u_int32_t data;
-#if(0)
+#if 0
int rtn;
#endif
int i;
u_int32_t sv, sd;
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_init()\n");
#endif
sv = pci_get_subvendor(sc->dev);
sd = pci_get_subdevice(sc->dev);
if (sv == cfg_table[i].subvendor && sd == cfg_table[i].subdevice) {
-#if(0)
+#if 0
device_printf(sc->dev, "Set configuration from table\n");
#endif
sc->cfg = &cfg_table[i];
}
/* initialize DMA buffer */
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_init(): initialize DMA buffer\n");
#endif
if (envy24ht_dmainit(sc))
data = envy24ht_rdcs(sc, ENVY24HT_CCS_IMASK, 1);
envy24ht_wrcs(sc, ENVY24HT_CCS_IMASK, data & ~ENVY24HT_CCS_IMASK_PMT, 1);
data = envy24ht_rdcs(sc, ENVY24HT_CCS_IMASK, 1);
-#if(0)
+#if 0
device_printf(sc->dev, "envy24ht_init(): CCS_IMASK-->0x%02x\n", data);
#endif
sc->csh = rman_get_bushandle(sc->cs);
sc->mtt = rman_get_bustag(sc->mt);
sc->mth = rman_get_bushandle(sc->mt);
-#if(0)
+#if 0
device_printf(sc->dev,
"IO port register values\nCCS: 0x%lx\nMT: 0x%lx\n",
pci_read_config(sc->dev, PCIR_CCS, 4),
int err = 0;
int i;
-#if(0)
+#if 0
device_printf(dev, "envy24ht_pci_attach()\n");
#endif
/* get sc_info data area */
int r;
int i;
-#if(0)
+#if 0
device_printf(dev, "envy24ht_pci_detach()\n");
#endif
sc = pcm_getdevinfo(dev);
* SUCH DAMAGE.
*
* $FreeBSD: src/sys/dev/sound/pci/spicds.c,v 1.5.2.2 2007/06/11 19:33:27 ariff Exp $
- * $DragonFly: src/sys/dev/sound/pci/spicds.c,v 1.3 2007/06/27 13:26:18 hasso Exp $
*/
#include <dev/sound/pcm/sound.h>
{
int mask;
-#if(0)
+#if 0
device_printf(codec->dev, "spicds_wrcd(codec, 0x%02x, 0x%02x)\n", reg, val);
#endif
/* start */
{
struct spicds_info *codec;
-#if(0)
+#if 0
device_printf(dev, "spicds_create(dev, devinfo, %d, ctrl)\n", num);
#endif
codec = kmalloc(sizeof *codec, M_SPICDS, M_WAITOK);
void
spicds_init(struct spicds_info *codec)
{
-#if(0)
+#if 0
device_printf(codec->dev, "spicds_init(codec)\n");
#endif
snd_mtxlock(codec->lock);
void
spicds_set(struct spicds_info *codec, int dir, unsigned int left, unsigned int right)
{
-#if(0)
+#if 0
device_printf(codec->dev, "spicds_set(codec, %d, %d, %d)\n", dir, left, right);
#endif
snd_mtxlock(codec->lock);
right = right * 127 / 100;
}
if (dir == PCMDIR_REC && codec->type == SPICDS_TYPE_AK4524) {
-#if(0)
+#if 0
device_printf(codec->dev, "spicds_set(): AK4524(REC) %d/%d\n", left, right);
#endif
spicds_wrcd(codec, AK4524_LIPGA, left);
spicds_wrcd(codec, AK4524_RIPGA, right);
}
if (dir == PCMDIR_PLAY && codec->type == SPICDS_TYPE_AK4524) {
-#if(0)
+#if 0
device_printf(codec->dev, "spicds_set(): AK4524(PLAY) %d/%d\n", left, right);
#endif
spicds_wrcd(codec, AK4524_LOATT, left);
spicds_wrcd(codec, AK4524_ROATT, right);
}
if (dir == PCMDIR_PLAY && codec->type == SPICDS_TYPE_AK4528) {
-#if(0)
+#if 0
device_printf(codec->dev, "spicds_set(): AK4528(PLAY) %d/%d\n", left, right);
#endif
spicds_wrcd(codec, AK4528_LOATT, left);
spicds_wrcd(codec, AK4528_ROATT, right);
}
if (dir == PCMDIR_PLAY && codec->type == SPICDS_TYPE_WM8770) {
-#if(0)
+#if 0
device_printf(codec->dev, "spicds_set(): WM8770(PLAY) %d/%d\n", left, right);
#endif
spicds_wrcd(codec, WM8770_AOATT_L1, left | WM8770_AOATT_UPDATE);
spicds_wrcd(codec, WM8770_AOATT_R1, right | WM8770_AOATT_UPDATE);
}
if (dir == PCMDIR_PLAY && codec->type == SPICDS_TYPE_AK4358) {
-#if(0)
+#if 0
device_printf(codec->dev, "spicds_set(): AK4358(PLAY) %d/%d\n", left, right);
#endif
spicds_wrcd(codec, AK4358_LO1ATT, left | AK4358_OATT_ENABLE);
spicds_wrcd(codec, AK4358_RO1ATT, right | AK4358_OATT_ENABLE);
}
if (dir == PCMDIR_PLAY && codec->type == SPICDS_TYPE_AK4381) {
-#if(0)
+#if 0
device_printf(codec->dev, "spicds_set(): AK4381(PLAY) %d/%d\n", left, right);
#endif
spicds_wrcd(codec, AK4381_LOATT, left);
}
if (dir == PCMDIR_PLAY && codec->type == SPICDS_TYPE_AK4396) {
-#if(0)
+#if 0
device_printf(codec->dev, "spicds_set(): AK4396(PLAY) %d/%d\n", left, right);
#endif
spicds_wrcd(codec, AK4396_LOATT, left);