From nobody Fri Jan 2 16:58:20 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4djVJF3tC3z6Lvgm for ; Fri, 02 Jan 2026 16:58:21 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4djVJF0TNYz42RK for ; Fri, 02 Jan 2026 16:58:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767373101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tk6dwxl5KF8GWLJNYwhrOt1i5dwxIMCG0qJEhyUr390=; b=VO9EpKxCqZD4bL9VUvx2ZSvZ8EuKcC+8a+WK+Oa/0RD/oJsOujh14yHuIkx5o+cekJyFGH 9dfVXBPDH1yvT83jo85CatPU8VRkVzuwD78KoQ0eVl2lk0l8uLArkzwUsdwDXXLAmZK4oi T5CKQi3C7c8Ve2Iv++0mODBS622j8bzfvGk8BvrjPTgAkTdojYv/cC0lp4088LeGsAgMQq czPb7o7jdSdWspAomKVjpeJpzXeMR5rcSnHzdDJL6hBdOqGN9FVJhkfF7TmaNzywqFVJ+T 747JgP/0/9gPORAE4iE3RfArJCqTGjQJR+ziDqXp5ueMz572PIuDv7ASzTtIlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767373101; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=tk6dwxl5KF8GWLJNYwhrOt1i5dwxIMCG0qJEhyUr390=; b=cGDGtiGR7uGsp4tfSYPzVQCeYOtlJhME5Yk7vhSyUHdQlnrXeSm2M6E5AQffnI0lyHeKBt RzLDav7ULOsii+AvLxNK6wpHT+gFodDt9z2u96T0TdmQi/8OjmB6KUrw8B3C1pdrsjoPPn LDH3ofKEruCYVnDgOH+9qw3qEdq4Ujn0I4cohhChDSQcUqlRUFPTOH2gqEmnf+teehUtAK +p5az6VhP36ciYcRFPHBU8Y/qB2ncHZTj5iWLrxGyOSj5Zh8dbhtHzlAh0iUIHzM74jXPL XP+U+ShnmTMEOu5LWuAYtVY7+XFRVZduXq3QqlL0GkpXkqnyNBLfPE5RdjBaUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1767373101; a=rsa-sha256; cv=none; b=xGQ7manG7ZZcQtWjPJv15zpoq+BOhOv0eTkw2eTuHE5PiWg57iZU/VjDxRhsPflNLvbn2u Sf50T8zFVFH+Nf2xZaQ6bdDniMTmDupsWC2zagNnvL00/S/MiLrH3Leeysj4rNBsSjp6iO qFHEmYCKSKIDeEYk1Kqx/Vyoi/Vt/WeJoxt2ZmNl7z6yYWNc/datA70iMoud8g40GXTjep htgW4jE9QHxzSJMBUOMMY6MoyvOrnwFLsUxpmzEB7DC1KKs5FIn+dHdycIpbGiTStelznB +VFMuNMsyhsAkyb54ScLjOnSTUdBDO6h6pyQgGtwC/xCE43YivXHC3NGIOa2TQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4djVJD6wvZzBQG for ; Fri, 02 Jan 2026 16:58:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 249de by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 02 Jan 2026 16:58:20 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: e963472ef853 - main - snd_dummy: Initial MIDI support List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: christos X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: e963472ef8533fb39b581e746cdc2ddc7447dca2 Auto-Submitted: auto-generated Date: Fri, 02 Jan 2026 16:58:20 +0000 Message-Id: <6957f92c.249de.3911185a@gitrepo.freebsd.org> The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=e963472ef8533fb39b581e746cdc2ddc7447dca2 commit e963472ef8533fb39b581e746cdc2ddc7447dca2 Author: Christos Margiolis AuthorDate: 2026-01-02 16:56:07 +0000 Commit: Christos Margiolis CommitDate: 2026-01-02 16:58:05 +0000 snd_dummy: Initial MIDI support Because testing the midi/ code of sound(4) requires a physical MIDI device, add some basic MIDI support to snd_dummy(4) so that we can test patches to midi/ easier. Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D54127 --- sys/dev/sound/dummy.c | 47 +++++++++++++++++++++++++++++++++ sys/modules/sound/driver/dummy/Makefile | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) diff --git a/sys/dev/sound/dummy.c b/sys/dev/sound/dummy.c index 74ca1d0c924c..aec76339ae17 100644 --- a/sys/dev/sound/dummy.c +++ b/sys/dev/sound/dummy.c @@ -40,7 +40,10 @@ #endif #include +#include + #include +#include #define DUMMY_NPCHAN 1 #define DUMMY_NRCHAN 1 @@ -66,6 +69,8 @@ struct dummy_softc { struct callout callout; struct mtx lock; bool stopped; + struct mpu401 *mpu; + mpu401_intr_t *mpu_intr; }; static bool @@ -93,6 +98,9 @@ dummy_chan_io(void *arg) struct dummy_chan *ch; int i = 0; + if (sc->mpu_intr) + (sc->mpu_intr)(sc->mpu); + if (sc->stopped) return; @@ -294,6 +302,39 @@ static kobj_method_t dummy_mixer_methods[] = { MIXER_DECLARE(dummy_mixer); +static uint8_t +dummy_mpu_read(struct mpu401 *arg, void *sc, int reg) +{ + return (0); +} + +static void +dummy_mpu_write(struct mpu401 *arg, void *sc, int reg, unsigned char b) +{ +} + +static int +dummy_mpu_uninit(struct mpu401 *arg, void *cookie) +{ + struct dummy_softc *sc = cookie; + + mtx_lock(&sc->lock); + sc->mpu_intr = NULL; + sc->mpu = NULL; + mtx_unlock(&sc->lock); + + return (0); +} + +static kobj_method_t dummy_mpu_methods[] = { + KOBJMETHOD(mpufoi_read, dummy_mpu_read), + KOBJMETHOD(mpufoi_write, dummy_mpu_write), + KOBJMETHOD(mpufoi_uninit, dummy_mpu_uninit), + KOBJMETHOD_END +}; + +static DEFINE_CLASS(dummy_mpu, dummy_mpu_methods, 0); + static void dummy_identify(driver_t *driver, device_t parent) { @@ -354,6 +395,11 @@ dummy_attach(device_t dev) */ make_dev_alias(sc->info.dsp_dev, "dsp.dummy"); + sc->mpu = mpu401_init(&dummy_mpu_class, sc, dummy_chan_io, + &sc->mpu_intr); + if (sc->mpu == NULL) + return (ENXIO); + return (0); } @@ -368,6 +414,7 @@ dummy_detach(device_t dev) mtx_unlock(&sc->lock); callout_drain(&sc->callout); err = pcm_unregister(dev); + mpu401_uninit(sc->mpu); mtx_destroy(&sc->lock); return (err); diff --git a/sys/modules/sound/driver/dummy/Makefile b/sys/modules/sound/driver/dummy/Makefile index fb4127d35073..41dec7c83b4d 100644 --- a/sys/modules/sound/driver/dummy/Makefile +++ b/sys/modules/sound/driver/dummy/Makefile @@ -1,7 +1,7 @@ .PATH: ${SRCTOP}/sys/dev/sound KMOD= snd_dummy -SRCS= bus_if.h device_if.h +SRCS= bus_if.h device_if.h mpufoi_if.h SRCS+= dummy.c .include