Module Name: src
Committed By: jmcneill
Date: Sat Nov 19 23:40:07 UTC 2011
Modified Files:
src/sys/dev/pci/hdaudio [jmcneill-audiomp3]: hdafg.c hdaudio.c
hdaudio_pci.c
Log Message:
adapt to audiomp api changes
To generate a diff of this commit:
cvs rdiff -u -r1.10 -r1.10.4.1 src/sys/dev/pci/hdaudio/hdafg.c
cvs rdiff -u -r1.16 -r1.16.2.1 src/sys/dev/pci/hdaudio/hdaudio.c
cvs rdiff -u -r1.8 -r1.8.6.1 src/sys/dev/pci/hdaudio/hdaudio_pci.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/pci/hdaudio/hdafg.c
diff -u src/sys/dev/pci/hdaudio/hdafg.c:1.10 src/sys/dev/pci/hdaudio/hdafg.c:1.10.4.1
--- src/sys/dev/pci/hdaudio/hdafg.c:1.10 Tue Oct 25 00:00:13 2011
+++ src/sys/dev/pci/hdaudio/hdafg.c Sat Nov 19 23:40:07 2011
@@ -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 <[email protected]>
@@ -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 hdaudio_audiodev {
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_halt_input(void *);
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_output(void *,
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 @@ static const struct audio_hw_if hdafg_hw
.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 @@ hdafg_attach(device_t parent, device_t s
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 @@ hdafg_detach(device_t self, int flags)
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 @@ hdafg_query_devinfo(void *opaque, mixer_
}
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 @@ hdafg_allocm(void *opaque, int direction
}
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 @@ hdafg_trigger_input(void *opaque, void *
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)
{
Index: src/sys/dev/pci/hdaudio/hdaudio.c
diff -u src/sys/dev/pci/hdaudio/hdaudio.c:1.16 src/sys/dev/pci/hdaudio/hdaudio.c:1.16.2.1
--- src/sys/dev/pci/hdaudio/hdaudio.c:1.16 Fri Nov 4 15:32:34 2011
+++ src/sys/dev/pci/hdaudio/hdaudio.c Sat Nov 19 23:40:07 2011
@@ -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 <[email protected]>
@@ -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 @@ hdaudio_attach(device_t dev, struct hdau
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);
Index: src/sys/dev/pci/hdaudio/hdaudio_pci.c
diff -u src/sys/dev/pci/hdaudio/hdaudio_pci.c:1.8 src/sys/dev/pci/hdaudio/hdaudio_pci.c:1.8.6.1
--- src/sys/dev/pci/hdaudio/hdaudio_pci.c:1.8 Sat Feb 12 15:15:34 2011
+++ src/sys/dev/pci/hdaudio/hdaudio_pci.c Sat Nov 19 23:40:07 2011
@@ -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 <[email protected]>
@@ -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 @@ hdaudio_pci_attach(device_t parent, devi
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");