Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/rockchip Add audio support



details:   https://anonhg.NetBSD.org/src/rev/782ebf411f82
branches:  trunk
changeset: 461114:782ebf411f82
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Nov 16 13:25:33 2019 +0000

description:
Add audio support

diffstat:

 sys/arch/arm/rockchip/rk_dwhdmi.c |  21 +++++++++++++++++++--
 1 files changed, 19 insertions(+), 2 deletions(-)

diffs (49 lines):

diff -r aac75f4fa353 -r 782ebf411f82 sys/arch/arm/rockchip/rk_dwhdmi.c
--- a/sys/arch/arm/rockchip/rk_dwhdmi.c Sat Nov 16 13:24:40 2019 +0000
+++ b/sys/arch/arm/rockchip/rk_dwhdmi.c Sat Nov 16 13:25:33 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rk_dwhdmi.c,v 1.2 2019/11/10 12:07:50 jmcneill Exp $ */
+/* $NetBSD: rk_dwhdmi.c,v 1.3 2019/11/16 13:25:33 jmcneill Exp $ */
 
 /*-
  * Copyright (c) 2019 Jared D. McNeill <jmcneill%invisible.ca@localhost>
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rk_dwhdmi.c,v 1.2 2019/11/10 12:07:50 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rk_dwhdmi.c,v 1.3 2019/11/16 13:25:33 jmcneill Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -194,6 +194,21 @@
        dwhdmi_phy_mode_set(dsc, mode, adjusted_mode);
 }
 
+static audio_dai_tag_t
+rk_dwhdmi_dai_get_tag(device_t dev, const void *data, size_t len)
+{
+       struct rk_dwhdmi_softc * const sc = device_private(dev);
+
+       if (len != 4)
+               return NULL;
+
+       return &sc->sc_base.sc_dai;
+}
+
+static struct fdtbus_dai_controller_func rk_dwhdmi_dai_funcs = {
+       .get_tag = rk_dwhdmi_dai_get_tag
+};
+
 static int
 rk_dwhdmi_match(device_t parent, cfdata_t cf, void *aux)
 {
@@ -287,6 +302,8 @@
        sc->sc_ports.dp_ep_activate = rk_dwhdmi_ep_activate;
        sc->sc_ports.dp_ep_get_data = rk_dwhdmi_ep_get_data;
        fdt_ports_register(&sc->sc_ports, self, phandle, EP_DRM_BRIDGE);
+
+       fdtbus_register_dai_controller(self, phandle, &rk_dwhdmi_dai_funcs);
 }
 
 CFATTACH_DECL_NEW(rk_dwhdmi, sizeof(struct rk_dwhdmi_softc),



Home | Main Index | Thread Index | Old Index