Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-9]: src/sys Pull up following revision(s) (requested by jmcneill ...
details: https://anonhg.NetBSD.org/src/rev/d112eb12c3b1
branches: netbsd-9
changeset: 843522:d112eb12c3b1
user: martin <martin%NetBSD.org@localhost>
date: Mon Nov 18 19:33:10 2019 +0000
description:
Pull up following revision(s) (requested by jmcneill in ticket #438):
sys/dev/fdt/spdif_tx.c: revision 1.1
sys/arch/evbarm/conf/GENERIC64: revision 1.114
sys/dev/fdt/files.fdt: revision 1.48
Add driver for dummy spdif transmitter bindings.
Add spdiftx
diffstat:
sys/arch/evbarm/conf/GENERIC64 | 3 +-
sys/dev/fdt/files.fdt | 6 +-
sys/dev/fdt/spdif_tx.c | 114 +++++++++++++++++++++++++++++++++++++++++
3 files changed, 121 insertions(+), 2 deletions(-)
diffs (156 lines):
diff -r bf484051020e -r d112eb12c3b1 sys/arch/evbarm/conf/GENERIC64
--- a/sys/arch/evbarm/conf/GENERIC64 Mon Nov 18 19:31:00 2019 +0000
+++ b/sys/arch/evbarm/conf/GENERIC64 Mon Nov 18 19:33:10 2019 +0000
@@ -1,5 +1,5 @@
#
-# $NetBSD: GENERIC64,v 1.103.2.3 2019/11/16 16:48:25 martin Exp $
+# $NetBSD: GENERIC64,v 1.103.2.4 2019/11/18 19:33:10 martin Exp $
#
# GENERIC ARM (aarch64) kernel
#
@@ -412,6 +412,7 @@
options HDAUDIO_ENABLE_HDMI
options HDAUDIO_ENABLE_DISPLAYPORT
ausoc* at fdt? # Simple SoC audio card
+spdiftx* at fdt? # SPDIF transmitter
rki2s* at fdt? # Rockchip I2S/PCM
sunxicodec* at fdt? # Allwinner audio codec
sun8icodec* at fdt? # Allwinner audio codec (sun8i/sun50i)
diff -r bf484051020e -r d112eb12c3b1 sys/dev/fdt/files.fdt
--- a/sys/dev/fdt/files.fdt Mon Nov 18 19:31:00 2019 +0000
+++ b/sys/dev/fdt/files.fdt Mon Nov 18 19:33:10 2019 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.fdt,v 1.44 2019/03/13 12:17:45 jmcneill Exp $
+# $NetBSD: files.fdt,v 1.44.4.1 2019/11/18 19:33:10 martin Exp $
include "external/bsd/libfdt/conf/files.libfdt"
@@ -93,6 +93,10 @@
attach ausoc at fdt
file dev/fdt/ausoc.c ausoc
+device spdiftx
+attach spdiftx at fdt
+file dev/fdt/spdif_tx.c spdiftx
+
define fdt_display_timing
file dev/fdt/display_timing.c fdt_display_timing
diff -r bf484051020e -r d112eb12c3b1 sys/dev/fdt/spdif_tx.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/fdt/spdif_tx.c Mon Nov 18 19:33:10 2019 +0000
@@ -0,0 +1,114 @@
+/* $NetBSD: spdif_tx.c,v 1.1.2.2 2019/11/18 19:33:10 martin Exp $ */
+
+/*-
+ * Copyright (c) 2019 Jared McNeill <jmcneill%invisible.ca@localhost>
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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: spdif_tx.c,v 1.1.2.2 2019/11/18 19:33:10 martin Exp $");
+
+#include <sys/param.h>
+#include <sys/bus.h>
+#include <sys/device.h>
+#include <sys/systm.h>
+#include <sys/sysctl.h>
+#include <sys/kmem.h>
+
+#include <dev/audio/audio_dai.h>
+
+#include <dev/fdt/fdtvar.h>
+
+struct spdif_tx_softc {
+ device_t sc_dev;
+ struct audio_dai_device sc_dai;
+};
+
+static int spdif_tx_match(device_t, cfdata_t, void *);
+static void spdif_tx_attach(device_t, device_t, void *);
+
+static const char *compatible[] = {
+ "linux,spdif-dit",
+ NULL
+};
+
+CFATTACH_DECL_NEW(spdiftx, sizeof(struct spdif_tx_softc),
+ spdif_tx_match, spdif_tx_attach, NULL, NULL);
+
+static int
+spdif_tx_set_format(audio_dai_tag_t dai, u_int format)
+{
+ return 0;
+}
+
+static int
+spdif_tx_add_device(audio_dai_tag_t dai, audio_dai_tag_t aux)
+{
+ return 0;
+}
+
+static const struct audio_hw_if spdif_tx_hw_if = { };
+
+static audio_dai_tag_t
+spdif_tx_dai_get_tag(device_t dev, const void *data, size_t len)
+{
+ struct spdif_tx_softc * const sc = device_private(dev);
+
+ if (len != 4)
+ return NULL;
+
+ return &sc->sc_dai;
+}
+
+static struct fdtbus_dai_controller_func spdif_tx_dai_funcs = {
+ .get_tag = spdif_tx_dai_get_tag
+};
+
+static int
+spdif_tx_match(device_t parent, cfdata_t cf, void *aux)
+{
+ struct fdt_attach_args * const faa = aux;
+
+ return of_match_compatible(faa->faa_phandle, compatible);
+}
+
+static void
+spdif_tx_attach(device_t parent, device_t self, void *aux)
+{
+ struct spdif_tx_softc * const sc = device_private(self);
+ struct fdt_attach_args * const faa = aux;
+ const int phandle = faa->faa_phandle;
+
+ sc->sc_dev = self;
+
+ aprint_naive("\n");
+ aprint_normal(": SPDIF transmitter\n");
+
+ sc->sc_dai.dai_set_format = spdif_tx_set_format;
+ sc->sc_dai.dai_add_device = spdif_tx_add_device;
+ sc->sc_dai.dai_hw_if = &spdif_tx_hw_if;
+ sc->sc_dai.dai_dev = self;
+ sc->sc_dai.dai_priv = sc;
+ fdtbus_register_dai_controller(self, phandle, &spdif_tx_dai_funcs);
+}
Home |
Main Index |
Thread Index |
Old Index