Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/isaki-audio2]: src/sys/dev/pci Remove encoding conversions on recording.
details: https://anonhg.NetBSD.org/src/rev/544cce70acb2
branches: isaki-audio2
changeset: 456047:544cce70acb2
user: isaki <isaki%NetBSD.org@localhost>
date: Sun May 05 05:59:40 2019 +0000
description:
Remove encoding conversions on recording.
These are handled in the upper layer now.
diffstat:
sys/dev/pci/cs4280.c | 68 +++---------------------------------------------
sys/dev/pci/cs4280reg.h | 10 +------
sys/dev/pci/cs428x.h | 3 +-
3 files changed, 7 insertions(+), 74 deletions(-)
diffs (144 lines):
diff -r 59aa4515f1eb -r 544cce70acb2 sys/dev/pci/cs4280.c
--- a/sys/dev/pci/cs4280.c Sun May 05 03:11:28 2019 +0000
+++ b/sys/dev/pci/cs4280.c Sun May 05 05:59:40 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cs4280.c,v 1.71.2.2 2019/05/04 07:20:10 isaki Exp $ */
+/* $NetBSD: cs4280.c,v 1.71.2.3 2019/05/05 05:59:40 isaki Exp $ */
/*
* Copyright (c) 1999, 2000 Tatoku Ogaito. All rights reserved.
@@ -52,7 +52,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cs4280.c,v 1.71.2.2 2019/05/04 07:20:10 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cs4280.c,v 1.71.2.3 2019/05/05 05:59:40 isaki Exp $");
#include "midi.h"
@@ -450,9 +450,6 @@
}
/* Capture Interrupt */
if (intr & HISR_CINT) {
- int i;
- int16_t rdata;
-
handled = 1;
mem = BA1READ4(sc, CS4280_CIE);
BA1WRITE4(sc, CS4280_CIE, (mem & ~CIE_CI_MASK) | CIE_CI_DISABLE);
@@ -463,53 +460,9 @@
if ((sc->sc_ri&1) == 0)
empty_dma += sc->hw_blocksize;
- /*
- * XXX
- * I think this audio data conversion should be
- * happend in upper layer, but I put this here
- * since there is no conversion function available.
- */
- switch(sc->sc_rparam) {
- case CF_16BIT_STEREO:
- /* just copy it */
- memcpy(sc->sc_rn, empty_dma, sc->hw_blocksize);
- sc->sc_rn += sc->hw_blocksize;
- break;
- case CF_16BIT_MONO:
- for (i = 0; i < 512; i++) {
- rdata = *((int16_t *)empty_dma)>>1;
- empty_dma += 2;
- rdata += *((int16_t *)empty_dma)>>1;
- empty_dma += 2;
- *((int16_t *)sc->sc_rn) = rdata;
- sc->sc_rn += 2;
- }
- break;
- case CF_8BIT_STEREO:
- for (i = 0; i < 512; i++) {
- rdata = *((int16_t*)empty_dma);
- empty_dma += 2;
- *sc->sc_rn++ = rdata >> 8;
- rdata = *((int16_t*)empty_dma);
- empty_dma += 2;
- *sc->sc_rn++ = rdata >> 8;
- }
- break;
- case CF_8BIT_MONO:
- for (i = 0; i < 512; i++) {
- rdata = *((int16_t*)empty_dma) >>1;
- empty_dma += 2;
- rdata += *((int16_t*)empty_dma) >>1;
- empty_dma += 2;
- *sc->sc_rn++ = rdata >>8;
- }
- break;
- default:
- /* Should not reach here */
- aprint_error_dev(sc->sc_dev,
- "unknown sc->sc_rparam: %d\n",
- sc->sc_rparam);
- }
+ /* just copy it */
+ memcpy(sc->sc_rn, empty_dma, sc->hw_blocksize);
+ sc->sc_rn += sc->hw_blocksize;
if (sc->sc_rn >= sc->sc_re)
sc->sc_rn = sc->sc_rs;
}
@@ -752,17 +705,6 @@
/* initiate capture DMA */
BA1WRITE4(sc, CS4280_CBA, DMAADDR(p));
- /* setup format information for internal converter */
- sc->sc_rparam = 0;
- if (param->precision == 8) {
- sc->sc_rparam += CF_8BIT;
- sc->sc_rcount <<= 1;
- }
- if (param->channels == 1) {
- sc->sc_rparam += CF_MONO;
- sc->sc_rcount <<= 1;
- }
-
/* set CIE */
cie = BA1READ4(sc, CS4280_CIE) & ~CIE_CI_MASK;
BA1WRITE4(sc, CS4280_CIE, cie | CIE_CI_ENABLE);
diff -r 59aa4515f1eb -r 544cce70acb2 sys/dev/pci/cs4280reg.h
--- a/sys/dev/pci/cs4280reg.h Sun May 05 03:11:28 2019 +0000
+++ b/sys/dev/pci/cs4280reg.h Sun May 05 05:59:40 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cs4280reg.h,v 1.7 2006/04/15 21:20:47 jmcneill Exp $ */
+/* $NetBSD: cs4280reg.h,v 1.7.156.1 2019/05/05 05:59:40 isaki Exp $ */
/*
* Copyright (c) 1999, 2000 Tatoku Ogaito. All rights reserved.
@@ -217,14 +217,6 @@
#define FRMT_FTV 0x00000adf
-#define CF_MONO 0x01
-#define CF_8BIT 0x02
-
-#define CF_16BIT_STEREO 0x00
-#define CF_16BIT_MONO 0x01
-#define CF_8BIT_STEREO 0x02
-#define CF_8BIT_MONO 0x03
-
#define MIDI_BUSY_WAIT 100
#define MIDI_BUSY_DELAY 100 /* Delay when UART is busy */
diff -r 59aa4515f1eb -r 544cce70acb2 sys/dev/pci/cs428x.h
--- a/sys/dev/pci/cs428x.h Sun May 05 03:11:28 2019 +0000
+++ b/sys/dev/pci/cs428x.h Sun May 05 05:59:40 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cs428x.h,v 1.16.42.1 2019/04/21 07:49:16 isaki Exp $ */
+/* $NetBSD: cs428x.h,v 1.16.42.2 2019/05/05 05:59:40 isaki Exp $ */
/*
* Copyright (c) 2000 Tatoku Ogaito. All rights reserved.
@@ -118,7 +118,6 @@
int sc_ri;
struct cs428x_dma *sc_rdma;
char *sc_rbuf;
- int sc_rparam; /* record format */
int (*halt_input)(void *);
char sc_rrun; /* recording status */
int sc_rrate; /* recording sample rate */
Home |
Main Index |
Thread Index |
Old Index