1 /* $NetBSD: cs4231_sbus.c,v 1.46 2009/09/17 16:28:12 tsutsui Exp $ */
4 * Copyright (c) 1998, 1999, 2002, 2007 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
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.
32 #include <sys/cdefs.h>
33 __KERNEL_RCSID(0, "$NetBSD: cs4231_sbus.c,v 1.46 2009/09/17 16:28:12 tsutsui Exp $");
38 #include <sys/param.h>
39 #include <sys/systm.h>
40 #include <sys/errno.h>
41 #include <sys/device.h>
42 #include <sys/malloc.h>
46 #include <dev/sbus/sbusvar.h>
48 #include <sys/audioio.h>
49 #include <dev/audio_if.h>
51 #include <dev/ic/ad1848reg.h>
52 #include <dev/ic/cs4231reg.h>
53 #include <dev/ic/ad1848var.h>
54 #include <dev/ic/cs4231var.h>
56 #include <dev/ic/apcdmareg.h>
59 int cs4231_sbus_debug
= 0;
60 #define DPRINTF(x) if (cs4231_sbus_debug) printf x
65 /* where APC DMA registers are located */
66 #define CS4231_APCDMA_OFFSET 16
68 /* interrupt enable bits except those specific for playback/capture */
69 #define APC_ENABLE (APC_EI | APC_IE | APC_EIE)
71 struct cs4231_sbus_softc
{
72 struct cs4231_softc sc_cs4231
;
76 bus_space_tag_t sc_bt
; /* DMA controller tag */
77 bus_space_handle_t sc_bh
; /* DMA controller registers */
81 static int cs4231_sbus_match(device_t
, cfdata_t
, void *);
82 static void cs4231_sbus_attach(device_t
, device_t
, void *);
83 static int cs4231_sbus_pint(void *);
84 static int cs4231_sbus_rint(void *);
86 CFATTACH_DECL(audiocs_sbus
, sizeof(struct cs4231_sbus_softc
),
87 cs4231_sbus_match
, cs4231_sbus_attach
, NULL
, NULL
);
89 /* audio_hw_if methods specific to apc DMA */
90 static int cs4231_sbus_trigger_output(void *, void *, void *, int,
91 void (*)(void *), void *,
92 const audio_params_t
*);
93 static int cs4231_sbus_trigger_input(void *, void *, void *, int,
94 void (*)(void *), void *,
95 const audio_params_t
*);
96 static int cs4231_sbus_halt_output(void *);
97 static int cs4231_sbus_halt_input(void *);
99 const struct audio_hw_if audiocs_sbus_hw_if
= {
103 ad1848_query_encoding
,
105 NULL
, /* round_blocksize */
106 ad1848_commit_settings
,
107 NULL
, /* init_output */
108 NULL
, /* init_input */
109 NULL
, /* start_output */
110 NULL
, /* start_input */
111 cs4231_sbus_halt_output
,
112 cs4231_sbus_halt_input
,
113 NULL
, /* speaker_ctl */
118 cs4231_query_devinfo
,
121 NULL
, /* round_buffersize */
124 cs4231_sbus_trigger_output
,
125 cs4231_sbus_trigger_input
,
126 NULL
, /* dev_ioctl */
127 NULL
, /* powerstate */
132 static void cs4231_sbus_regdump(char *, struct cs4231_sbus_softc
*);
135 static int cs4231_sbus_intr(void *);
140 cs4231_sbus_match(device_t parent
, cfdata_t cf
, void *aux
)
142 struct sbus_attach_args
*sa
;
145 return strcmp(sa
->sa_name
, AUDIOCS_PROM_NAME
) == 0;
150 cs4231_sbus_attach(device_t parent
, device_t self
, void *aux
)
152 struct cs4231_sbus_softc
*sbsc
;
153 struct cs4231_softc
*sc
;
154 struct sbus_attach_args
*sa
;
155 bus_space_handle_t bh
;
157 sbsc
= device_private(self
);
158 sc
= &sbsc
->sc_cs4231
;
160 sbsc
->sc_bt
= sc
->sc_bustag
= sa
->sa_bustag
;
161 sc
->sc_dmatag
= sa
->sa_dmatag
;
163 sbsc
->sc_pint
= sparc_softintr_establish(IPL_VM
,
164 (void *)cs4231_sbus_pint
, sc
);
165 sbsc
->sc_rint
= sparc_softintr_establish(IPL_VM
,
166 (void *)cs4231_sbus_rint
, sc
);
169 * Map my registers in, if they aren't already in virtual
172 if (sa
->sa_npromvaddrs
) {
173 sbus_promaddr_to_handle(sa
->sa_bustag
,
174 sa
->sa_promvaddrs
[0], &bh
);
176 if (sbus_bus_map(sa
->sa_bustag
, sa
->sa_slot
,
177 sa
->sa_offset
, sa
->sa_size
, 0, &bh
) != 0) {
178 aprint_error("%s @ sbus: cannot map registers\n",
184 bus_space_subregion(sa
->sa_bustag
, bh
, CS4231_APCDMA_OFFSET
,
185 APC_DMA_SIZE
, &sbsc
->sc_bh
);
187 cs4231_common_attach(sc
, bh
);
190 /* Establish interrupt channel */
192 bus_intr_establish(sa
->sa_bustag
,
193 sa
->sa_pri
, IPL_SCHED
,
194 cs4231_sbus_intr
, sbsc
);
196 audio_attach_mi(&audiocs_sbus_hw_if
, sbsc
, self
);
202 cs4231_sbus_regdump(char *label
, struct cs4231_sbus_softc
*sc
)
206 printf("cs4231regdump(%s): regs:", label
);
207 printf("dmapva: 0x%x; ",
208 bus_space_read_4(sc
->sc_bh
, sc
->sc_bh
, APC_DMA_PVA
));
209 printf("dmapc: 0x%x; ",
210 bus_space_read_4(sc
->sc_bh
, sc
->sc_bh
, APC_DMA_PC
));
211 printf("dmapnva: 0x%x; ",
212 bus_space_read_4(sc
->sc_bh
, sc
->sc_bh
, APC_DMA_PNVA
));
213 printf("dmapnc: 0x%x\n",
214 bus_space_read_4(sc
->sc_bh
, sc
->sc_bh
, APC_DMA_PNC
));
215 printf("dmacva: 0x%x; ",
216 bus_space_read_4(sc
->sc_bh
, sc
->sc_bh
, APC_DMA_CVA
));
217 printf("dmacc: 0x%x; ",
218 bus_space_read_4(sc
->sc_bh
, sc
->sc_bh
, APC_DMA_CC
));
219 printf("dmacnva: 0x%x; ",
220 bus_space_read_4(sc
->sc_bh
, sc
->sc_bh
, APC_DMA_CNVA
));
221 printf("dmacnc: 0x%x\n",
222 bus_space_read_4(sc
->sc_bh
, sc
->sc_bh
, APC_DMA_CNC
));
224 snprintb(bits
, sizeof(bits
), APC_BITS
,
225 bus_space_read_4(sc
->sc_bh
, sc
->sc_bh
, APC_DMA_CSR
));
226 printf("apc_dmacsr=%s\n", bits
);
228 ad1848_dump_regs(&sc
->sc_cs4231
.sc_ad1848
);
230 #endif /* AUDIO_DEBUG */
234 cs4231_sbus_trigger_output(void *addr
, void *start
, void *end
, int blksize
,
235 void (*intr
)(void *), void *arg
,
236 const audio_params_t
*param
)
238 struct cs4231_sbus_softc
*sbsc
;
239 struct cs4231_softc
*sc
;
240 struct cs_transfer
*t
;
250 sc
= &sbsc
->sc_cs4231
;
251 t
= &sc
->sc_playback
;
252 ret
= cs4231_transfer_init(sc
, t
, &dmaaddr
, &dmasize
,
253 start
, end
, blksize
, intr
, arg
);
257 DPRINTF(("trigger_output: was: %x %d, %x %d\n",
258 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_PVA
),
259 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_PC
),
260 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_PNVA
),
261 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_PNC
)));
263 /* load first block */
264 bus_space_write_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_PNVA
, dmaaddr
);
265 bus_space_write_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_PNC
, dmasize
);
267 DPRINTF(("trigger_output: 1st: %x %d, %x %d\n",
268 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_PVA
),
269 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_PC
),
270 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_PNVA
),
271 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_PNC
)));
273 csr
= bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CSR
);
275 snprintb(bits
, sizeof(bits
), APC_BITS
, csr
);
277 DPRINTF(("trigger_output: csr=%s\n", bits
));
278 if ((csr
& PDMA_GO
) == 0 || (csr
& APC_PPAUSE
) != 0) {
281 csr
&= ~(APC_PPAUSE
| APC_PMIE
| APC_INTR_MASK
);
282 bus_space_write_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CSR
, csr
);
284 csr
= bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CSR
);
285 csr
&= ~APC_INTR_MASK
;
286 csr
|= APC_ENABLE
| APC_PIE
| APC_PMIE
| PDMA_GO
;
287 bus_space_write_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CSR
, csr
);
289 ad_write(&sc
->sc_ad1848
, SP_LOWER_BASE_COUNT
, 0xff);
290 ad_write(&sc
->sc_ad1848
, SP_UPPER_BASE_COUNT
, 0xff);
292 cfg
= ad_read(&sc
->sc_ad1848
, SP_INTERFACE_CONFIG
);
293 ad_write(&sc
->sc_ad1848
, SP_INTERFACE_CONFIG
,
294 (cfg
| PLAYBACK_ENABLE
));
297 snprintb(bits
, sizeof(bits
), APC_BITS
, csr
);
299 DPRINTF(("trigger_output: already: csr=%s\n", bits
));
303 /* load next block if we can */
304 csr
= bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CSR
);
306 cs4231_transfer_advance(t
, &dmaaddr
, &dmasize
);
307 bus_space_write_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_PNVA
, dmaaddr
);
308 bus_space_write_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_PNC
, dmasize
);
310 DPRINTF(("trigger_output: 2nd: %x %d, %x %d\n",
311 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_PVA
),
312 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_PC
),
313 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_PNVA
),
314 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_PNC
)));
322 cs4231_sbus_halt_output(void *addr
)
324 struct cs4231_sbus_softc
*sbsc
;
325 struct cs4231_softc
*sc
;
333 sc
= &sbsc
->sc_cs4231
;
334 sc
->sc_playback
.t_active
= 0;
336 csr
= bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CSR
);
338 snprintb(bits
, sizeof(bits
), APC_BITS
, csr
);
340 DPRINTF(("halt_output: csr=%s\n", bits
));
342 csr
&= ~APC_INTR_MASK
; /* do not clear interrupts accidentally */
343 csr
|= APC_PPAUSE
; /* pause playback (let current complete) */
344 bus_space_write_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CSR
, csr
);
346 /* let the curernt transfer complete */
349 csr
= bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
,
352 snprintb(bits
, sizeof(bits
), APC_BITS
, csr
);
354 DPRINTF(("halt_output: csr=%s\n", bits
));
355 } while ((csr
& APC_PM
) == 0);
357 cfg
= ad_read(&sc
->sc_ad1848
, SP_INTERFACE_CONFIG
);
358 ad_write(&sc
->sc_ad1848
, SP_INTERFACE_CONFIG
,(cfg
& ~PLAYBACK_ENABLE
));
364 /* NB: we don't enable APC_CMIE and won't use APC_CM */
366 cs4231_sbus_trigger_input(void *addr
, void *start
, void *end
, int blksize
,
367 void (*intr
)(void *), void *arg
,
368 const audio_params_t
*param
)
370 struct cs4231_sbus_softc
*sbsc
;
371 struct cs4231_softc
*sc
;
372 struct cs_transfer
*t
;
382 sc
= &sbsc
->sc_cs4231
;
384 ret
= cs4231_transfer_init(sc
, t
, &dmaaddr
, &dmasize
,
385 start
, end
, blksize
, intr
, arg
);
389 csr
= bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CSR
);
391 snprintb(bits
, sizeof(bits
), APC_BITS
, csr
);
393 DPRINTF(("trigger_input: csr=%s\n", bits
));
394 DPRINTF(("trigger_input: was: %x %d, %x %d\n",
395 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CVA
),
396 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CC
),
397 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CNVA
),
398 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CNC
)));
400 /* supply first block */
401 bus_space_write_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CNVA
, dmaaddr
);
402 bus_space_write_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CNC
, dmasize
);
404 DPRINTF(("trigger_input: 1st: %x %d, %x %d\n",
405 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CVA
),
406 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CC
),
407 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CNVA
),
408 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CNC
)));
410 csr
= bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CSR
);
411 if ((csr
& CDMA_GO
) == 0 || (csr
& APC_CPAUSE
) != 0) {
414 csr
&= ~(APC_CPAUSE
| APC_CMIE
| APC_INTR_MASK
);
415 bus_space_write_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CSR
, csr
);
417 csr
= bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CSR
);
418 csr
&= ~APC_INTR_MASK
;
419 csr
|= APC_ENABLE
| APC_CIE
| CDMA_GO
;
420 bus_space_write_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CSR
, csr
);
422 ad_write(&sc
->sc_ad1848
, CS_LOWER_REC_CNT
, 0xff);
423 ad_write(&sc
->sc_ad1848
, CS_UPPER_REC_CNT
, 0xff);
425 cfg
= ad_read(&sc
->sc_ad1848
, SP_INTERFACE_CONFIG
);
426 ad_write(&sc
->sc_ad1848
, SP_INTERFACE_CONFIG
,
427 (cfg
| CAPTURE_ENABLE
));
430 snprintb(bits
, sizeof(bits
), APC_BITS
, csr
);
432 DPRINTF(("trigger_input: already: csr=%s\n", bits
));
435 /* supply next block if we can */
436 csr
= bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CSR
);
438 cs4231_transfer_advance(t
, &dmaaddr
, &dmasize
);
439 bus_space_write_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CNVA
, dmaaddr
);
440 bus_space_write_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CNC
, dmasize
);
441 DPRINTF(("trigger_input: 2nd: %x %d, %x %d\n",
442 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CVA
),
443 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CC
),
444 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CNVA
),
445 bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CNC
)));
453 cs4231_sbus_halt_input(void *addr
)
455 struct cs4231_sbus_softc
*sbsc
;
456 struct cs4231_softc
*sc
;
464 sc
= &sbsc
->sc_cs4231
;
465 sc
->sc_capture
.t_active
= 0;
467 csr
= bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CSR
);
469 snprintb(bits
, sizeof(bits
), APC_BITS
, csr
);
471 DPRINTF(("halt_input: csr=%s\n", bits
));
474 csr
&= ~APC_INTR_MASK
; /* do not clear interrupts accidentally */
476 bus_space_write_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CSR
, csr
);
478 /* let the curernt transfer complete */
481 csr
= bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
,
484 snprintb(bits
, sizeof(bits
), APC_BITS
, csr
);
486 DPRINTF(("halt_input: csr=%s\n", bits
));
489 } while ((csr
& APC_CM
) == 0);
491 cfg
= ad_read(&sc
->sc_ad1848
, SP_INTERFACE_CONFIG
);
492 ad_write(&sc
->sc_ad1848
, SP_INTERFACE_CONFIG
, (cfg
& ~CAPTURE_ENABLE
));
499 cs4231_sbus_intr(void *arg
)
501 struct cs4231_sbus_softc
*sbsc
;
502 struct cs4231_softc
*sc
;
508 #if defined(AUDIO_DEBUG) || defined(DIAGNOSTIC)
513 sc
= &sbsc
->sc_cs4231
;
514 csr
= bus_space_read_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CSR
);
515 if ((csr
& APC_INTR_MASK
) == 0) /* any interrupt pedning? */
518 /* write back DMA status to clear interrupt */
519 bus_space_write_4(sbsc
->sc_bt
, sbsc
->sc_bh
, APC_DMA_CSR
, csr
);
520 ++sc
->sc_intrcnt
.ev_count
;
524 if (cs4231_sbus_debug
> 1)
525 cs4231_sbus_regdump("audiointr", sbsc
);
528 status
= ADREAD(&sc
->sc_ad1848
, AD1848_STATUS
);
530 snprintb(bits
, sizeof(bits
), AD_R2_BITS
, status
);
532 DPRINTF(("%s: status: %s\n", device_xname(&sc
->sc_ad1848
.sc_dev
),
534 if (status
& INTERRUPT_STATUS
) {
538 reason
= ad_read(&sc
->sc_ad1848
, CS_IRQ_STATUS
);
539 snprintb(bits
, sizeof(bits
), CS_I24_BITS
, reason
);
540 DPRINTF(("%s: i24: %s\n", device_xname(&sc
->sc_ad1848
.sc_dev
),
543 /* clear ad1848 interrupt */
544 ADWRITE(&sc
->sc_ad1848
, AD1848_STATUS
, 0);
548 if (csr
& APC_CD
) { /* can supply new block */
549 struct cs_transfer
*t
= &sc
->sc_capture
;
551 cs4231_transfer_advance(t
, &dmaaddr
, &dmasize
);
552 bus_space_write_4(sbsc
->sc_bt
, sbsc
->sc_bh
,
553 APC_DMA_CNVA
, dmaaddr
);
554 bus_space_write_4(sbsc
->sc_bt
, sbsc
->sc_bh
,
555 APC_DMA_CNC
, dmasize
);
557 if (t
->t_intr
!= NULL
)
558 sparc_softintr_schedule(sbsc
->sc_rint
);
559 ++t
->t_intrcnt
.ev_count
;
565 if (!sc
->sc_playback
.t_active
)
566 served
= 1; /* draining in halt_output() */
570 if (csr
& APC_PD
) { /* can load new block */
571 struct cs_transfer
*t
= &sc
->sc_playback
;
574 cs4231_transfer_advance(t
, &dmaaddr
, &dmasize
);
575 bus_space_write_4(sbsc
->sc_bt
, sbsc
->sc_bh
,
576 APC_DMA_PNVA
, dmaaddr
);
577 bus_space_write_4(sbsc
->sc_bt
, sbsc
->sc_bh
,
578 APC_DMA_PNC
, dmasize
);
581 if (t
->t_intr
!= NULL
)
582 sparc_softintr_schedule(sbsc
->sc_pint
);
583 ++t
->t_intrcnt
.ev_count
;
588 /* got an interrupt we don't know how to handle */
591 snprintb(bits
, sizeof(bits
), APC_BITS
, csr
);
592 printf("%s: unhandled csr=%s\n",
593 device_xname(&sc
->sc_ad1848
.sc_dev
), bits
);
602 cs4231_sbus_pint(void *cookie
)
604 struct cs4231_softc
*sc
= cookie
;
605 struct cs_transfer
*t
;
607 KERNEL_LOCK(1, NULL
);
608 t
= &sc
->sc_playback
;
609 if (t
->t_intr
!= NULL
)
610 (*t
->t_intr
)(t
->t_arg
);
611 KERNEL_UNLOCK_ONE(NULL
);
616 cs4231_sbus_rint(void *cookie
)
618 struct cs4231_softc
*sc
= cookie
;
619 struct cs_transfer
*t
;
621 KERNEL_LOCK(1, NULL
);
623 if (t
->t_intr
!= NULL
)
624 (*t
->t_intr
)(t
->t_arg
);
625 KERNEL_UNLOCK_ONE(NULL
);
629 #endif /* NAUDIO > 0 */