Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/isaki-audio2]: src/sys Remove dev/auconv.[ch].
details: https://anonhg.NetBSD.org/src/rev/d87ea504caac
branches: isaki-audio2
changeset: 456030:d87ea504caac
user: isaki <isaki%NetBSD.org@localhost>
date: Fri May 03 05:43:46 2019 +0000
description:
Remove dev/auconv.[ch].
Now it is handled in dev/audio/audio.c and dev/audio/linear.c.
Remove dev/mulaw.h.
It already have been just a link to dev/audio/mulaw.h in this
branch.
diffstat:
sys/arch/arm/sunxi/sunxi_codec.h | 3 +-
sys/arch/i386/pnpbios/ess_pnpbios.c | 5 +-
sys/arch/i386/pnpbios/sb_pnpbios.c | 5 +-
sys/arch/i386/pnpbios/ym_pnpbios.c | 5 +-
sys/dev/auconv.c | 477 ------------------------------------
sys/dev/auconv.h | 46 ---
sys/dev/files.audio | 9 +-
sys/dev/hdaudio/hdaudiovar.h | 4 +-
sys/dev/isa/ad1848_isa.c | 5 +-
sys/dev/isa/sb_isa.c | 5 +-
sys/dev/isapnp/ess_isapnp.c | 5 +-
sys/dev/isapnp/gus_isapnp.c | 5 +-
sys/dev/isapnp/mpu_isapnp.c | 5 +-
sys/dev/isapnp/sb_isapnp.c | 5 +-
sys/dev/mulaw.h | 1 -
sys/dev/ofisa/ess_ofisa.c | 5 +-
sys/dev/ofisa/sb_ofisa.c | 5 +-
sys/dev/pci/cs428x.c | 6 +-
sys/dev/usb/umidi.c | 5 +-
sys/dev/usb/umidi_quirks.c | 6 +-
20 files changed, 34 insertions(+), 578 deletions(-)
diffs (truncated from 969 to 300 lines):
diff -r 043e6c92efd6 -r d87ea504caac sys/arch/arm/sunxi/sunxi_codec.h
--- a/sys/arch/arm/sunxi/sunxi_codec.h Fri May 03 05:15:33 2019 +0000
+++ b/sys/arch/arm/sunxi/sunxi_codec.h Fri May 03 05:43:46 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sunxi_codec.h,v 1.4.8.1 2019/04/27 05:30:37 isaki Exp $ */
+/* $NetBSD: sunxi_codec.h,v 1.4.8.2 2019/05/03 05:43:46 isaki Exp $ */
/*-
* Copyright (c) 2014-2017 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -31,7 +31,6 @@
#include <sys/audioio.h>
#include <dev/audio_if.h>
-#include <dev/auconv.h>
#include <dev/fdt/fdtvar.h>
diff -r 043e6c92efd6 -r d87ea504caac sys/arch/i386/pnpbios/ess_pnpbios.c
--- a/sys/arch/i386/pnpbios/ess_pnpbios.c Fri May 03 05:15:33 2019 +0000
+++ b/sys/arch/i386/pnpbios/ess_pnpbios.c Fri May 03 05:43:46 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ess_pnpbios.c,v 1.22 2011/07/01 18:14:15 dyoung Exp $ */
+/* $NetBSD: ess_pnpbios.c,v 1.22.56.1 2019/05/03 05:43:46 isaki Exp $ */
/*-
* Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ess_pnpbios.c,v 1.22 2011/07/01 18:14:15 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ess_pnpbios.c,v 1.22.56.1 2019/05/03 05:43:46 isaki Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -45,7 +45,6 @@
#include <sys/audioio.h>
#include <dev/audio_if.h>
#include <dev/midi_if.h>
-#include <dev/mulaw.h>
#include <dev/isa/isavar.h>
#include <dev/isa/isadmavar.h>
diff -r 043e6c92efd6 -r d87ea504caac sys/arch/i386/pnpbios/sb_pnpbios.c
--- a/sys/arch/i386/pnpbios/sb_pnpbios.c Fri May 03 05:15:33 2019 +0000
+++ b/sys/arch/i386/pnpbios/sb_pnpbios.c Fri May 03 05:43:46 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: sb_pnpbios.c,v 1.17 2016/07/11 11:31:49 msaitoh Exp $ */
+/* $NetBSD: sb_pnpbios.c,v 1.17.20.1 2019/05/03 05:43:46 isaki Exp $ */
/*
* Copyright (c) 1999
* Matthias Drochner. All rights reserved.
@@ -26,7 +26,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sb_pnpbios.c,v 1.17 2016/07/11 11:31:49 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sb_pnpbios.c,v 1.17.20.1 2019/05/03 05:43:46 isaki Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -41,7 +41,6 @@
#include <sys/audioio.h>
#include <dev/audio_if.h>
#include <dev/midi_if.h>
-#include <dev/mulaw.h>
#include <dev/isa/isavar.h>
#include <dev/isa/isadmavar.h>
diff -r 043e6c92efd6 -r d87ea504caac sys/arch/i386/pnpbios/ym_pnpbios.c
--- a/sys/arch/i386/pnpbios/ym_pnpbios.c Fri May 03 05:15:33 2019 +0000
+++ b/sys/arch/i386/pnpbios/ym_pnpbios.c Fri May 03 05:43:46 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ym_pnpbios.c,v 1.18 2016/07/14 10:19:05 msaitoh Exp $ */
+/* $NetBSD: ym_pnpbios.c,v 1.18.20.1 2019/05/03 05:43:46 isaki Exp $ */
/*
* Copyright (c) 1999
* Matthias Drochner. All rights reserved.
@@ -27,7 +27,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ym_pnpbios.c,v 1.18 2016/07/14 10:19:05 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ym_pnpbios.c,v 1.18.20.1 2019/05/03 05:43:46 isaki Exp $");
#include "mpu_ym.h"
@@ -44,7 +44,6 @@
#include <sys/audioio.h>
#include <dev/audio_if.h>
#include <dev/midi_if.h>
-#include <dev/mulaw.h>
#include <dev/isa/isavar.h>
#include <dev/isa/isadmavar.h>
diff -r 043e6c92efd6 -r d87ea504caac sys/dev/auconv.c
--- a/sys/dev/auconv.c Fri May 03 05:15:33 2019 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,477 +0,0 @@
-/* $NetBSD: auconv.c,v 1.37.2.1 2019/04/21 04:28:59 isaki Exp $ */
-
-/*
- * Copyright (c) 1996 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the Computer Systems
- * Engineering Group at Lawrence Berkeley Laboratory.
- * 4. Neither the name of the University nor of the Laboratory may be used
- * to endorse or promote products derived from this software without
- * specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- */
-
-#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: auconv.c,v 1.37.2.1 2019/04/21 04:28:59 isaki Exp $");
-
-#include <sys/types.h>
-#include <sys/audioio.h>
-#include <sys/device.h>
-#include <sys/errno.h>
-#include <sys/malloc.h>
-#include <sys/null.h>
-#include <sys/systm.h>
-#include <dev/audio_if.h>
-#include <dev/auconv.h>
-#include <dev/mulaw.h>
-#include <machine/limits.h>
-#ifndef _KERNEL
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdbool.h>
-#endif
-
-/* #define AUCONV_DEBUG */
-#ifdef AUCONV_DEBUG
-# define DPRINTF(x) printf x
-#else
-# define DPRINTF(x)
-#endif
-
-#ifdef AUCONV_DEBUG
-static void auconv_dump_formats(const struct audio_format *, int);
-#endif
-static void auconv_dump_params(const audio_params_t *);
-static int auconv_exact_match(const struct audio_format *, int, int,
- const struct audio_params *);
-static u_int auconv_normalize_encoding(u_int, u_int);
-static int auconv_is_supported_rate(const struct audio_format *, u_int);
-static int auconv_add_encoding(int, int, int, struct audio_encoding_set **,
- int *);
-
-#ifdef _KERNEL
-#define AUCONV_MALLOC(size) malloc(size, M_DEVBUF, M_NOWAIT)
-#define AUCONV_REALLOC(p, size) realloc(p, size, M_DEVBUF, M_NOWAIT)
-#define AUCONV_FREE(p) free(p, M_DEVBUF)
-#else
-#define AUCONV_MALLOC(size) malloc(size)
-#define AUCONV_REALLOC(p, size) realloc(p, size)
-#define AUCONV_FREE(p) free(p)
-#endif
-
-struct audio_encoding_set {
- int size;
- audio_encoding_t items[1];
-};
-#define ENCODING_SET_SIZE(n) (offsetof(struct audio_encoding_set, items) \
- + sizeof(audio_encoding_t) * (n))
-
-struct conv_table {
- u_int encoding;
- u_int validbits;
- u_int precision;
- stream_filter_factory_t *play_conv;
- stream_filter_factory_t *rec_conv;
-};
-
-#ifdef AUCONV_DEBUG
-static const char *encoding_dbg_names[] = {
- "none", AudioEmulaw, AudioEalaw, "pcm16",
- "pcm8", AudioEadpcm, AudioEslinear_le, AudioEslinear_be,
- AudioEulinear_le, AudioEulinear_be,
- AudioEslinear, AudioEulinear,
- AudioEmpeg_l1_stream, AudioEmpeg_l1_packets,
- AudioEmpeg_l1_system, AudioEmpeg_l2_stream,
- AudioEmpeg_l2_packets, AudioEmpeg_l2_system,
- AudioEac3
-};
-#endif
-
-/**
- * Set appropriate parameters in `param,' and return the index in
- * the hardware capability array `formats.'
- *
- * @param formats [IN] An array of formats which a hardware can support.
- * @param nformats [IN] The number of elements of the array.
- * @param mode [IN] Either AUMODE_PLAY or AUMODE_RECORD.
- * @param param [IN] Requested format. param->sw_code may be set.
- * @param rateconv [IN] true if aurateconv may be used.
- * @param list [OUT] stream_filters required for param.
- * @return The index of selected audio_format entry. -1 if the device
- * can not support the specified param.
- */
-/*
- * XXX AUDIO2
- * It is only for backward compatibility and should be removed.
- */
-int
-auconv_set_converter(const struct audio_format *formats, int nformats,
- int mode, const audio_params_t *param, int rateconv,
- stream_filter_list_t *list)
-{
- int i;
-
- printf("NOTICE: %s is obsoleted in AUDIO2\n", __func__);
-
-#ifdef AUCONV_DEBUG
- DPRINTF(("%s: ENTER rateconv=%d\n", __func__, rateconv));
- auconv_dump_formats(formats, nformats);
-#endif
-
- /* check support by native format */
- i = auconv_exact_match(formats, nformats, mode, param);
- if (i >= 0) {
- DPRINTF(("%s: LEAVE with %d (exact)\n", __func__, i));
- return i;
- }
-
- DPRINTF(("%s: LEAVE with -1 (bottom)\n", __func__));
- return -1;
-}
-
-#ifdef AUCONV_DEBUG
-static void
-auconv_dump_formats(const struct audio_format *formats, int nformats)
-{
- const struct audio_format *f;
- int i, j;
-
- for (i = 0; i < nformats; i++) {
- f = &formats[i];
- printf("[%2d]: mode=", i);
- if (!AUFMT_IS_VALID(f)) {
- printf("INVALID");
- } else if (f->mode == AUMODE_PLAY) {
- printf("PLAY");
- } else if (f->mode == AUMODE_RECORD) {
- printf("RECORD");
- } else if (f->mode == (AUMODE_PLAY | AUMODE_RECORD)) {
- printf("PLAY|RECORD");
- } else {
- printf("0x%x", f->mode);
- }
- printf(" enc=%s", encoding_dbg_names[f->encoding]);
- printf(" %u/%ubit", f->validbits, f->precision);
- printf(" %uch", f->channels);
-
- printf(" channel_mask=");
- if (f->channel_mask == AUFMT_MONAURAL) {
- printf("MONAURAL");
- } else if (f->channel_mask == AUFMT_STEREO) {
- printf("STEREO");
- } else if (f->channel_mask == AUFMT_SURROUND4) {
- printf("SURROUND4");
- } else if (f->channel_mask == AUFMT_DOLBY_5_1) {
- printf("DOLBY5.1");
- } else {
- printf("0x%x", f->channel_mask);
- }
-
- if (f->frequency_type == 0) {
- printf(" %uHz-%uHz", f->frequency[0],
- f->frequency[1]);
- } else {
- printf(" %uHz", f->frequency[0]);
- for (j = 1; j < f->frequency_type; j++)
- printf(",%uHz", f->frequency[j]);
Home |
Main Index |
Thread Index |
Old Index