Module Name: src Committed By: isaki Date: Sat Apr 27 11:52:54 UTC 2019
Modified Files: src/sys/dev/ic [isaki-audio2]: pl041.c pl041var.h Log Message: Adapt to audio2. To generate a diff of this commit: cvs rdiff -u -r1.5 -r1.5.2.1 src/sys/dev/ic/pl041.c cvs rdiff -u -r1.1 -r1.1.16.1 src/sys/dev/ic/pl041var.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/ic/pl041.c diff -u src/sys/dev/ic/pl041.c:1.5 src/sys/dev/ic/pl041.c:1.5.2.1 --- src/sys/dev/ic/pl041.c:1.5 Mon Sep 3 16:29:31 2018 +++ src/sys/dev/ic/pl041.c Sat Apr 27 11:52:53 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: pl041.c,v 1.5 2018/09/03 16:29:31 riastradh Exp $ */ +/* $NetBSD: pl041.c,v 1.5.2.1 2019/04/27 11:52:53 isaki Exp $ */ /*- * Copyright (c) 2017 Jared McNeill <jmcne...@invisible.ca> @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: pl041.c,v 1.5 2018/09/03 16:29:31 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: pl041.c,v 1.5.2.1 2019/04/27 11:52:53 isaki Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -37,7 +37,6 @@ __KERNEL_RCSID(0, "$NetBSD: pl041.c,v 1. #include <sys/audioio.h> #include <dev/audio_if.h> -#include <dev/auconv.h> #include <dev/ic/ac97var.h> #include <dev/ic/ac97reg.h> @@ -93,8 +92,8 @@ static const struct audio_format aaci_fo .precision = 16, .channels = 2, .channel_mask = AUFMT_STEREO, - .frequency_type = 0, - .frequency = { 48000, 48000 } + .frequency_type = 1, + .frequency = { 48000 } }; static void @@ -122,27 +121,19 @@ aaci_write_data(struct aaci_softc *sc) } static int -aaci_query_encoding(void *priv, struct audio_encoding *enc) +aaci_query_format(void *priv, audio_format_query_t *afp) { - struct aaci_softc * const sc = priv; - return auconv_query_encoding(sc->sc_encodings, enc); + return audio_query_format(&aaci_format, 1, afp); } static int -aaci_set_params(void *priv, int setmode, int usermode, - audio_params_t *play, audio_params_t *rec, - stream_filter_list_t *pfil, stream_filter_list_t *rfil) +aaci_set_format(void *priv, int setmode, + const audio_params_t *play, const audio_params_t *rec, + audio_filter_reg_t *pfil, audio_filter_reg_t *rfil) { - int index; - - if (play && (setmode & AUMODE_PLAY) != 0) { - index = auconv_set_converter(&aaci_format, 1, AUMODE_PLAY, - play, true, pfil); - if (index < 0) - return EINVAL; - } + /* We have only one format so nothing to do here. */ return 0; } @@ -250,8 +241,8 @@ aaci_get_locks(void *priv, kmutex_t **in } static const struct audio_hw_if aaci_hw_if = { - .query_encoding = aaci_query_encoding, - .set_params = aaci_set_params, + .query_format = aaci_query_format, + .set_format = aaci_set_format, .getdev = aaci_getdev, .set_port = aaci_set_port, .get_port = aaci_get_port, @@ -322,13 +313,6 @@ aaci_attach(struct aaci_softc *sc) return; } - error = auconv_create_encodings(&aaci_format, 1, &sc->sc_encodings); - if (error) { - aprint_error_dev(sc->sc_dev, "couldn't create encodings (%d)\n", - error); - return; - } - sc->sc_audiodev = audio_attach_mi(&aaci_hw_if, sc, sc->sc_dev); } Index: src/sys/dev/ic/pl041var.h diff -u src/sys/dev/ic/pl041var.h:1.1 src/sys/dev/ic/pl041var.h:1.1.16.1 --- src/sys/dev/ic/pl041var.h:1.1 Thu Jun 8 10:02:39 2017 +++ src/sys/dev/ic/pl041var.h Sat Apr 27 11:52:53 2019 @@ -1,4 +1,4 @@ -/* $NetBSD: pl041var.h,v 1.1 2017/06/08 10:02:39 jmcneill Exp $ */ +/* $NetBSD: pl041var.h,v 1.1.16.1 2019/04/27 11:52:53 isaki Exp $ */ /*- * Copyright (c) 2017 Jared McNeill <jmcne...@invisible.ca> @@ -50,8 +50,6 @@ struct aaci_softc { uint32_t *sc_pcur; int sc_pblkresid; - - struct audio_encoding_set *sc_encodings; }; void aaci_attach(struct aaci_softc *);