Lines Matching +full:pcm +full:- +full:clock +full:- +full:mode
1 /*-
2 * SPDX-License-Identifier: BSD-2-Clause
9 * Copyright (c) 1996-1998 Crystal Semiconductor Corp.
47 #include <dev/sound/pcm/sound.h>
66 device_t pcm; /* pcm device */
67 driver_intr_t* pcmintr; /* pcm intr */
68 void *pcmintr_arg; /* pcm intr arg */
192 subcard = card->cards;
211 device_set_desc(dev, card->name);
229 scp->dev = dev;
234 resp = &scp->res;
235 scp->card = csa_findsubcard(dev);
236 scp->binfo.card = scp->card;
237 printf("csa: card is %s\n", scp->card->name);
238 resp->io_rid = PCIR_BAR(0);
239 resp->io = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
240 &resp->io_rid, RF_ACTIVE);
241 if (resp->io == NULL)
243 resp->mem_rid = PCIR_BAR(1);
244 resp->mem = bus_alloc_resource_any(dev, SYS_RES_MEMORY,
245 &resp->mem_rid, RF_ACTIVE);
246 if (resp->mem == NULL)
248 resp->irq_rid = 0;
249 resp->irq = bus_alloc_resource_any(dev, SYS_RES_IRQ,
250 &resp->irq_rid, RF_ACTIVE | RF_SHAREABLE);
251 if (resp->irq == NULL)
255 if (snd_setup_intr(dev, resp->irq, 0, csa_intr, scp, &scp->ih))
275 /* PCM Audio */
277 func->varinfo = &scp->binfo;
278 func->func = SCF_PCM;
279 scp->pcm = device_add_child(dev, "pcm", DEVICE_UNIT_ANY);
280 device_set_ivars(scp->pcm, func);
284 func->varinfo = &scp->binfo;
285 func->func = SCF_MIDI;
286 scp->midi = device_add_child(dev, "midi", DEVICE_UNIT_ANY);
287 device_set_ivars(scp->midi, func);
294 bus_teardown_intr(dev, resp->irq, scp->ih);
296 bus_release_resource(dev, SYS_RES_IRQ, resp->irq_rid, resp->irq);
298 bus_release_resource(dev, SYS_RES_MEMORY, resp->mem_rid, resp->mem);
300 bus_release_resource(dev, SYS_RES_MEMORY, resp->io_rid, resp->io);
318 resp = &scp->res;
324 bus_teardown_intr(dev, resp->irq, scp->ih);
325 bus_release_resource(dev, SYS_RES_IRQ, resp->irq_rid, resp->irq);
326 bus_release_resource(dev, SYS_RES_MEMORY, resp->mem_rid, resp->mem);
327 bus_release_resource(dev, SYS_RES_MEMORY, resp->io_rid, resp->io);
339 resp = &scp->res;
364 resp = &scp->res;
369 res = resp->irq;
374 res = resp->io;
377 res = resp->mem;
416 printf("ata-csa.c: we cannot use a filter here\n");
420 resp = &scp->res;
427 if (func == NULL || irq != resp->irq)
430 switch (func->func) {
432 scp->pcmintr = intr;
433 scp->pcmintr_arg = arg;
437 scp->midiintr = intr;
438 scp->midiintr_arg = arg;
460 resp = &scp->res;
467 if (func == NULL || irq != resp->irq || cookie != scp)
470 switch (func->func) {
472 scp->pcmintr = NULL;
473 scp->pcmintr_arg = NULL;
477 scp->midiintr = NULL;
478 scp->midiintr_arg = NULL;
496 resp = &scp->res;
510 scp->binfo.hisr = hisr;
513 if ((hisr & (HISR_VC0 | HISR_VC1)) != 0 && scp->pcmintr != NULL) {
514 scp->pcmintr(scp->pcmintr_arg);
517 if ((hisr & HISR_MIDI) != 0 && scp->midiintr != NULL) {
518 scp->midiintr(scp->midiintr_arg);
533 resp = &scp->res;
536 * First, blast the clock control register to zero so that the PLL starts
544 * If we are in AC97 mode, then we must set the part to a host controlled
545 * AC-link. Otherwise, we won't be able to bring up the link.
567 * as we start receiving bit clock, we'll start producing the SYNC
574 * generating bit clock (so we don't try to start the PLL without an
575 * input clock).
581 * the clock control circuit gets its clock from the correct place.
587 * Write the selected clock control setup to the hardware. Do not turn on
664 * the codec is pumping ADC data across the AC-link.
707 * Turn off the Processor by turning off the software clock enable flag in
708 * the clock control register.
870 * set DCV - will clear when process completed
871 * set CRW - Read command
872 * set VFRM - valid frame enabled
873 * set ESYN - ASYNC generation enabled
874 * set RSTN - ARST# inactive, AC97 codec not reset
880 csa_writeio(resp, BA0_ACCAD, offset - BA0_AC97_RESET);
921 * VSTS - Valid Status
958 * set DCV - will clear when process completed
959 * set VFRM - valid frame enabled
960 * set ESYN - ASYNC generation enabled
961 * set RSTN - ARST# inactive, AC97 codec not reset
967 csa_writeio(resp, BA0_ACCAD, offset - BA0_AC97_RESET);
1005 return bus_space_read_4(rman_get_bustag(resp->io), rman_get_bushandle(resp->io), offset) & 0xffffffff;
1017 bus_space_write_4(rman_get_bustag(resp->io), rman_get_bushandle(resp->io), offset, data);
1025 return bus_space_read_4(rman_get_bustag(resp->mem), rman_get_bushandle(resp->mem), offset);
1031 bus_space_write_4(rman_get_bustag(resp->mem), rman_get_bushandle(resp->mem), offset, data);