CVS commit: [isaki-audio2] src/sys/dev/ic

2019-04-27 Thread Tetsuya Isaki
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 
@@ -27,7 +27,7 @@
  */
 
 #include 
-__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 
 #include 
@@ -37,7 +37,6 @@ __KERNEL_RCSID(0, "$NetBSD: pl041.c,v 1.
 #include 
 
 #include 
-#include 
 
 #include 
 #include 
@@ -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 
@@ -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 *);



CVS commit: [isaki-audio2] src/sys/dev/ic

2019-04-25 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Thu Apr 25 13:24:11 UTC 2019

Modified Files:
src/sys/dev/ic [isaki-audio2]: tms320av110.c

Log Message:
Add missing mutex_exit() in interrupt handler.


To generate a diff of this commit:
cvs rdiff -u -r1.25.2.1 -r1.25.2.2 src/sys/dev/ic/tms320av110.c

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/tms320av110.c
diff -u src/sys/dev/ic/tms320av110.c:1.25.2.1 src/sys/dev/ic/tms320av110.c:1.25.2.2
--- src/sys/dev/ic/tms320av110.c:1.25.2.1	Thu Apr 25 13:20:11 2019
+++ src/sys/dev/ic/tms320av110.c	Thu Apr 25 13:24:11 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: tms320av110.c,v 1.25.2.1 2019/04/25 13:20:11 isaki Exp $	*/
+/*	$NetBSD: tms320av110.c,v 1.25.2.2 2019/04/25 13:24:11 isaki Exp $	*/
 
 /*-
  * Copyright (c) 1997 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
  */
 
 #include 
-__KERNEL_RCSID(0, "$NetBSD: tms320av110.c,v 1.25.2.1 2019/04/25 13:20:11 isaki Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tms320av110.c,v 1.25.2.2 2019/04/25 13:24:11 isaki Exp $");
 
 #include 
 #include 
@@ -166,8 +166,10 @@ tms320av110_intr(void *p)
 	intlist = tav_read_short(sc->sc_iot, sc->sc_ioh, TAV_INTR)
 	/* & tav_read_short(sc->sc_iot, sc->sc_ioh, TAV_INTR_EN)*/;
 
-	if (!intlist)
+	if (!intlist) {
+		mutex_spin_exit(&sc->sc_intr_lock);
 		return 0;
+	}
 
 	/* ack now, so that we don't miss later interrupts */
 	if (sc->sc_intack)



CVS commit: [isaki-audio2] src/sys/dev/ic

2019-04-21 Thread Tetsuya Isaki
Module Name:src
Committed By:   isaki
Date:   Sun Apr 21 07:09:13 UTC 2019

Modified Files:
src/sys/dev/ic [isaki-audio2]: arcofi.c

Log Message:
Oops, add accidentally dropped chunks.


To generate a diff of this commit:
cvs rdiff -u -r1.1.28.2 -r1.1.28.3 src/sys/dev/ic/arcofi.c

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/arcofi.c
diff -u src/sys/dev/ic/arcofi.c:1.1.28.2 src/sys/dev/ic/arcofi.c:1.1.28.3
--- src/sys/dev/ic/arcofi.c:1.1.28.2	Sun Apr 21 06:55:34 2019
+++ src/sys/dev/ic/arcofi.c	Sun Apr 21 07:09:13 2019
@@ -1,4 +1,4 @@
-/*	$NetBSD: arcofi.c,v 1.1.28.2 2019/04/21 06:55:34 isaki Exp $	*/
+/*	$NetBSD: arcofi.c,v 1.1.28.3 2019/04/21 07:09:13 isaki Exp $	*/
 /*	$OpenBSD: arcofi.c,v 1.6 2013/05/15 08:29:24 ratchov Exp $	*/
 
 /*
@@ -195,6 +195,8 @@ static int	arcofi_cr3_to_portmask(uint, 
 static int	arcofi_gain_to_mi(uint);
 static uint	arcofi_mi_to_gain(int);
 static uint	arcofi_portmask_to_cr3(int);
+static int	arcofi_recv_data(struct arcofi_softc *);
+static int	arcofi_xmit_data(struct arcofi_softc *);
 
 static int	arcofi_open(void *, int);
 static void	arcofi_close(void *);
@@ -568,6 +570,9 @@ arcofi_start_output(void *v, void *wbuf,
 	sc->sc_xmit.cb = cb;
 	sc->sc_xmit.cbarg = cbarg;
 
+	/* Fill FIFO */
+	arcofi_xmit_data(sc);
+
 	/* enable output FIFO interrupts */
 	arcofi_write(sc, ARCOFI_FIFO_IR, arcofi_read(sc, ARCOFI_FIFO_IR) |
 	FIFO_IR_ENABLE(FIFO_IR_OUT_HALF_EMPTY));