Source-Changes-HG archive

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

[src/jmcneill-audiomp3]: src/sys/dev/pci/hdaudio adapt to audiomp api changes



details:   https://anonhg.NetBSD.org/src/rev/c857929f1ecb
branches:  jmcneill-audiomp3
changeset: 771327:c857929f1ecb
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Nov 19 23:40:07 2011 +0000

description:
adapt to audiomp api changes

diffstat:

 sys/dev/pci/hdaudio/hdafg.c       |  32 +++++++++++++++++++++++++-------
 sys/dev/pci/hdaudio/hdaudio.c     |   8 ++++----
 sys/dev/pci/hdaudio/hdaudio_pci.c |   6 +++---
 3 files changed, 32 insertions(+), 14 deletions(-)

diffs (165 lines):

diff -r 9a2e3d0fc040 -r c857929f1ecb sys/dev/pci/hdaudio/hdafg.c
--- a/sys/dev/pci/hdaudio/hdafg.c       Sat Nov 19 23:36:38 2011 +0000
+++ b/sys/dev/pci/hdaudio/hdafg.c       Sat Nov 19 23:40:07 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hdafg.c,v 1.10 2011/10/25 00:00:13 jmcneill Exp $ */
+/* $NetBSD: hdafg.c,v 1.10.4.1 2011/11/19 23:40:07 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd <support%precedence.co.uk@localhost>
@@ -60,7 +60,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.10 2011/10/25 00:00:13 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdafg.c,v 1.10.4.1 2011/11/19 23:40:07 jmcneill Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -285,6 +285,8 @@
 
 struct hdafg_softc {
        device_t                        sc_dev;
+       kmutex_t                        sc_lock;
+       kmutex_t                        sc_intr_lock;
        struct hdaudio_softc            *sc_host;
        struct hdaudio_codec            *sc_codec;
        struct hdaudio_function_group   *sc_fg;
@@ -361,8 +363,8 @@
 static int     hdafg_set_port(void *, mixer_ctrl_t *);
 static int     hdafg_get_port(void *, mixer_ctrl_t *);
 static int     hdafg_query_devinfo(void *, mixer_devinfo_t *);
-static void *  hdafg_allocm(void *, int, size_t, struct malloc_type *, int);
-static void    hdafg_freem(void *, void *, struct malloc_type *);
+static void *  hdafg_allocm(void *, int, size_t);
+static void    hdafg_freem(void *, void *, size_t);
 static int     hdafg_getdev(void *, struct audio_device *);
 static size_t  hdafg_round_buffersize(void *, int, size_t);
 static paddr_t hdafg_mappage(void *, void *, off_t, int);
@@ -373,6 +375,7 @@
 static int     hdafg_trigger_input(void *, void *, void *, int,
                                      void (*)(void *), void *,
                                      const audio_params_t *);
+static void    hdafg_get_locks(void *, kmutex_t **, kmutex_t **);
 
 static const struct audio_hw_if hdafg_hw_if = {
        .query_encoding         = hdafg_query_encoding,
@@ -392,6 +395,7 @@
        .get_props              = hdafg_get_props,
        .trigger_output         = hdafg_trigger_output,
        .trigger_input          = hdafg_trigger_input,
+       .get_locks              = hdafg_get_locks,
 };
 
 static int
@@ -3545,6 +3549,9 @@
 
        sc->sc_dev = self;
 
+       mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE);
+       mutex_init(&sc->sc_intr_lock, MUTEX_DEFAULT, IPL_SCHED);
+
        callout_init(&sc->sc_jack_callout, 0);
        callout_setfunc(&sc->sc_jack_callout,
            hdafg_hp_switch_handler, sc);
@@ -3713,6 +3720,9 @@
        if (mx)
                kmem_free(mx, sc->sc_nmixers * sizeof(*mx));
 
+       mutex_destroy(&sc->sc_lock);
+       mutex_destroy(&sc->sc_intr_lock);
+
        pmf_device_deregister(self);
 
        return 0;
@@ -4032,8 +4042,7 @@
 }
 
 static void *
-hdafg_allocm(void *opaque, int direction, size_t size,
-    struct malloc_type *type, int flags)
+hdafg_allocm(void *opaque, int direction, size_t size)
 {
        struct hdaudio_audiodev *ad = opaque;
        struct hdaudio_stream *st;
@@ -4056,7 +4065,7 @@
 }
 
 static void
-hdafg_freem(void *opaque, void *addr, struct malloc_type *type)
+hdafg_freem(void *opaque, void *addr, size_t size)
 {
        struct hdaudio_audiodev *ad = opaque;
        struct hdaudio_stream *st;
@@ -4167,6 +4176,15 @@
        return 0;
 }
 
+static void
+hdafg_get_locks(void *opaque, kmutex_t **intr, kmutex_t **thread)
+{
+       struct hdaudio_audiodev *ad = opaque;
+
+       *intr = &ad->ad_sc->sc_intr_lock;
+       *thread = &ad->ad_sc->sc_lock;
+}
+
 static int
 hdafg_unsol(device_t self, uint8_t tag)
 {
diff -r 9a2e3d0fc040 -r c857929f1ecb sys/dev/pci/hdaudio/hdaudio.c
--- a/sys/dev/pci/hdaudio/hdaudio.c     Sat Nov 19 23:36:38 2011 +0000
+++ b/sys/dev/pci/hdaudio/hdaudio.c     Sat Nov 19 23:40:07 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio.c,v 1.16 2011/11/04 15:32:34 jakllsch Exp $ */
+/* $NetBSD: hdaudio.c,v 1.16.2.1 2011/11/19 23:40:07 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd <support%precedence.co.uk@localhost>
@@ -30,7 +30,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.16 2011/11/04 15:32:34 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.16.2.1 2011/11/19 23:40:07 jmcneill Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -778,8 +778,8 @@
        KASSERT(sc->sc_memvalid == true);
 
        sc->sc_dev = dev;
-       mutex_init(&sc->sc_corb_mtx, MUTEX_DEFAULT, IPL_AUDIO);
-       mutex_init(&sc->sc_stream_mtx, MUTEX_DEFAULT, IPL_AUDIO);
+       mutex_init(&sc->sc_corb_mtx, MUTEX_DEFAULT, IPL_SCHED);
+       mutex_init(&sc->sc_stream_mtx, MUTEX_DEFAULT, IPL_SCHED);
 
        hdaudio_init(sc);
 
diff -r 9a2e3d0fc040 -r c857929f1ecb sys/dev/pci/hdaudio/hdaudio_pci.c
--- a/sys/dev/pci/hdaudio/hdaudio_pci.c Sat Nov 19 23:36:38 2011 +0000
+++ b/sys/dev/pci/hdaudio/hdaudio_pci.c Sat Nov 19 23:40:07 2011 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: hdaudio_pci.c,v 1.8 2011/02/12 15:15:34 jmcneill Exp $ */
+/* $NetBSD: hdaudio_pci.c,v 1.8.6.1 2011/11/19 23:40:07 jmcneill Exp $ */
 
 /*
  * Copyright (c) 2009 Precedence Technologies Ltd <support%precedence.co.uk@localhost>
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hdaudio_pci.c,v 1.8 2011/02/12 15:15:34 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hdaudio_pci.c,v 1.8.6.1 2011/11/19 23:40:07 jmcneill Exp $");
 
 #include <sys/types.h>
 #include <sys/param.h>
@@ -141,7 +141,7 @@
                return;
        }
        intrstr = pci_intr_string(pa->pa_pc, ih);
-       sc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_AUDIO,
+       sc->sc_ih = pci_intr_establish(pa->pa_pc, ih, IPL_SCHED,
            hdaudio_pci_intr, sc);
        if (sc->sc_ih == NULL) {
                aprint_error_dev(self, "couldn't establish interrupt");



Home | Main Index | Thread Index | Old Index