From fd314950d4854edabd3900a1bd380f1d55da29b6 Mon Sep 17 00:00:00 2001 From: jmcneill Date: Sun, 26 Jul 2015 17:54:33 +0000 Subject: [PATCH] Skip stream reset if HDAUDIO_FLAG_NO_STREAM_RESET flag is set. --- sys/dev/hdaudio/hdaudio.c | 7 ++++--- sys/dev/hdaudio/hdaudiovar.h | 5 ++++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/sys/dev/hdaudio/hdaudio.c b/sys/dev/hdaudio/hdaudio.c index f54d8bb99f67..9daeb426532a 100644 --- a/sys/dev/hdaudio/hdaudio.c +++ b/sys/dev/hdaudio/hdaudio.c @@ -1,4 +1,4 @@ -/* $NetBSD: hdaudio.c,v 1.2 2015/05/20 18:28:32 riastradh Exp $ */ +/* $NetBSD: hdaudio.c,v 1.3 2015/07/26 17:54:33 jmcneill Exp $ */ /* * Copyright (c) 2009 Precedence Technologies Ltd @@ -30,7 +30,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.2 2015/05/20 18:28:32 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: hdaudio.c,v 1.3 2015/07/26 17:54:33 jmcneill Exp $"); #include #include @@ -1215,7 +1215,8 @@ hdaudio_stream_start(struct hdaudio_stream *st, int blksize, KASSERT(st->st_bdl.dma_valid == true); hdaudio_stream_stop(st); - hdaudio_stream_reset(st); + if ((sc->sc_flags & HDAUDIO_FLAG_NO_STREAM_RESET) == 0) + hdaudio_stream_reset(st); /* * Configure buffer descriptor list diff --git a/sys/dev/hdaudio/hdaudiovar.h b/sys/dev/hdaudio/hdaudiovar.h index ac0cfb5b5282..b3806e633af1 100644 --- a/sys/dev/hdaudio/hdaudiovar.h +++ b/sys/dev/hdaudio/hdaudiovar.h @@ -1,4 +1,4 @@ -/* $NetBSD: hdaudiovar.h,v 1.3 2015/05/30 13:47:03 jmcneill Exp $ */ +/* $NetBSD: hdaudiovar.h,v 1.4 2015/07/26 17:54:33 jmcneill Exp $ */ /* * Copyright (c) 2009 Precedence Technologies Ltd @@ -157,6 +157,9 @@ struct hdaudio_softc { struct hdaudio_stream sc_stream[HDAUDIO_MAX_STREAMS]; uint32_t sc_stream_mask; kmutex_t sc_stream_mtx; + + uint32_t sc_flags; +#define HDAUDIO_FLAG_NO_STREAM_RESET 0x0001 }; int hdaudio_attach(device_t, struct hdaudio_softc *);