From nobody Fri May 17 19:31:05 2024 X-Original-To: dev-commits-src-branches@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 4Vgxs56zZfz5Lfyv; Fri, 17 May 2024 19:31:05 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vgxs55TSHz4vQD; Fri, 17 May 2024 19:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974265; 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=uiJcYE5KtTuZp21pe7mxSqhRHxVkXitSrE+7Mfv94xQ=; b=CgYycF2tA+S1evyJSHj6JOyV+5BrC8NBsqDfGt0KWSdqKEpgi93btacw8j1gVge/eaOKCy dG3o6Bv5nveAtfonpk1W6zYfXOHRWpuy7JNSqmhfQwTa2iGl9zddZA4HzsHZjJNrzoWPxe itMYn6dDNytoAU8OZ1cVzQ0RdeDJ1FQMoHjPEsi2Z5CiyD5coN9w7edAfJEZeiwfCvA4ml jM5CNROZwxj43uuwBQXneIZFwhTbBOSJVHdNIAp5ebRaJOfiGwR10dJtF/k19DeoHvDRHy CJ2LbRIa0ZCzjC0m1Ud+1ePxyVQkgZ2CvCg3CgfuXYUf01t5Wsu9Qo3jLMnMbw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715974265; a=rsa-sha256; cv=none; b=ZXllqlv7HReeEP/nfARQ0NuNXbOaUQHVMskhxfvGDKe08vcd4vvPVvq4++1vVidcyB9Ty+ aN67bo9SniVSr7UKCbux9pMetmDM3x0cKZRewA4DFKGbKzyNWDhohIit9FV75h6GcOyshz Q8mECbJ83tIZ+clghcqpKYYX3nfinlXiuy0NiEHfeAn9Je1n2ymdyl64/mgFPT3UccaI6G nvk5nBxahCfXDGDxuO7VwuK3kIehhNGI/MMJPMGgZVQBHqlJZsjGr2Iv9xKbqJiJfFOXcn LPhIQe22IlsvIxje1jVQCldfUp8+rcPFuNCRSs80/UplB9qPbD4+qKfuq0sUjw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715974265; 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=uiJcYE5KtTuZp21pe7mxSqhRHxVkXitSrE+7Mfv94xQ=; b=UmNe8taB9soozfddAhEshGvfY71Jwcm6nhTXHzl9DxbxO2rb+5c+f5/Y21y+Tuf5r2OMT6 908B8lLsoP4kmli6qBQufB17HyLX2rS8rNc9SHCVxg9Wt2b7kNzJOMHliaj3Ux2lPIcvBr vkdYL6tAu6mkwtUG8VquU9KYExqhb/U2T/oWxiegp4UEeXQDRR1dEmYtwgcTesMzxEQf7R THxXNAQxKoCi75L7Im0KtbA4HC3n1FmkUo9a7rGj5iqcztI6evd/UuAvR9Fk/UNz+20EcA 3x4eS6z8BgKjfa7rDKZWMRGPyKglYO8ndftpTWUbVGp1dGNysrc+wT8C7OTanQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Vgxs554LMzvfD; Fri, 17 May 2024 19:31:05 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44HJV5rX099814; Fri, 17 May 2024 19:31:05 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44HJV5CK099811; Fri, 17 May 2024 19:31:05 GMT (envelope-from git) Date: Fri, 17 May 2024 19:31:05 GMT Message-Id: <202405171931.44HJV5CK099811@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Christos Margiolis Subject: git: 6f6cc9324131 - stable/14 - sound: Remove unused dsp_cdevs[] fields and devices List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@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/stable/14 X-Git-Reftype: branch X-Git-Commit: 6f6cc9324131a1db629336d93d0ccf6e68609b48 Auto-Submitted: auto-generated The branch stable/14 has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=6f6cc9324131a1db629336d93d0ccf6e68609b48 commit 6f6cc9324131a1db629336d93d0ccf6e68609b48 Author: Christos Margiolis AuthorDate: 2024-05-06 18:32:25 +0000 Commit: Christos Margiolis CommitDate: 2024-05-17 19:30:35 +0000 sound: Remove unused dsp_cdevs[] fields and devices These fields and devices are unused as of e8c0d15a64fa ("sound: Get rid of snd_clone and use DEVFS_CDEVPRIV(9)"). While here, remove unused SND_DEV_* defines from pcm/sound.h and convert the list to an enum. Sponsored by: The FreeBSD Foundation MFC after: 1 week Reviewed by: dev_submerge.ch, markj Differential Revision: https://reviews.freebsd.org/D45013 (cherry picked from commit 72cbd381075a2eb22a070505334d1ce92ec2d7ad) --- sys/dev/sound/pcm/dsp.c | 57 +++++++++-------------------------------------- sys/dev/sound/pcm/sound.h | 50 +++++++++-------------------------------- 2 files changed, 21 insertions(+), 86 deletions(-) diff --git a/sys/dev/sound/pcm/dsp.c b/sys/dev/sound/pcm/dsp.c index 9c31fff7e8cd..6c3d76e27b6b 100644 --- a/sys/dev/sound/pcm/dsp.c +++ b/sys/dev/sound/pcm/dsp.c @@ -203,13 +203,6 @@ relchns(struct dsp_cdevpriv *priv, uint32_t prio) CHN_UNLOCK(priv->wrch); } -/* duplex / simplex cdev type */ -enum { - DSP_CDEV_TYPE_RDONLY, /* simplex read-only (record) */ - DSP_CDEV_TYPE_WRONLY, /* simplex write-only (play) */ - DSP_CDEV_TYPE_RDWR /* duplex read, write, or both */ -}; - #define DSP_F_VALID(x) ((x) & (FREAD | FWRITE)) #define DSP_F_DUPLEX(x) (((x) & (FREAD | FWRITE)) == (FREAD | FWRITE)) #define DSP_F_SIMPLEX(x) (!DSP_F_DUPLEX(x)) @@ -221,48 +214,18 @@ static const struct { char *name; char *sep; char *alias; - int use_sep; - int hw; - int max; - int volctl; - uint32_t fmt, spd; - int query; } dsp_cdevs[] = { - { SND_DEV_DSP, "dsp", ".", NULL, 0, 0, 0, 0, - SND_FORMAT(AFMT_U8, 1, 0), DSP_DEFAULT_SPEED, - DSP_CDEV_TYPE_RDWR }, - { SND_DEV_AUDIO, "audio", ".", NULL, 0, 0, 0, 0, - SND_FORMAT(AFMT_MU_LAW, 1, 0), DSP_DEFAULT_SPEED, - DSP_CDEV_TYPE_RDWR }, - { SND_DEV_DSP16, "dspW", ".", NULL, 0, 0, 0, 0, - SND_FORMAT(AFMT_S16_LE, 1, 0), DSP_DEFAULT_SPEED, - DSP_CDEV_TYPE_RDWR }, - { SND_DEV_DSPHW_PLAY, "dsp", ".p", NULL, 1, 1, SND_MAXHWCHAN, 1, - SND_FORMAT(AFMT_S16_LE, 2, 0), 48000, DSP_CDEV_TYPE_WRONLY }, - { SND_DEV_DSPHW_VPLAY, "dsp", ".vp", NULL, 1, 1, SND_MAXVCHANS, 1, - SND_FORMAT(AFMT_S16_LE, 2, 0), 48000, DSP_CDEV_TYPE_WRONLY }, - { SND_DEV_DSPHW_REC, "dsp", ".r", NULL, 1, 1, SND_MAXHWCHAN, 1, - SND_FORMAT(AFMT_S16_LE, 2, 0), 48000, DSP_CDEV_TYPE_RDONLY }, - { SND_DEV_DSPHW_VREC, "dsp", ".vr", NULL, 1, 1, SND_MAXVCHANS, 1, - SND_FORMAT(AFMT_S16_LE, 2, 0), 48000, DSP_CDEV_TYPE_RDONLY }, - { SND_DEV_DSPHW_CD, "dspcd", ".", NULL, 0, 0, 0, 0, - SND_FORMAT(AFMT_S16_LE, 2, 0), 44100, DSP_CDEV_TYPE_RDWR }, + { SND_DEV_DSP, "dsp", ".", NULL }, + { SND_DEV_DSPHW_PLAY, "dsp", ".p", NULL }, + { SND_DEV_DSPHW_VPLAY, "dsp", ".vp", NULL }, + { SND_DEV_DSPHW_REC, "dsp", ".r", NULL }, + { SND_DEV_DSPHW_VREC, "dsp", ".vr", NULL }, /* Low priority, OSSv4 aliases. */ - { SND_DEV_DSP, "dsp_ac3", ".", "dsp", 0, 0, 0, 0, - SND_FORMAT(AFMT_U8, 1, 0), DSP_DEFAULT_SPEED, - DSP_CDEV_TYPE_RDWR }, - { SND_DEV_DSP, "dsp_mmap", ".", "dsp", 0, 0, 0, 0, - SND_FORMAT(AFMT_U8, 1, 0), DSP_DEFAULT_SPEED, - DSP_CDEV_TYPE_RDWR }, - { SND_DEV_DSP, "dsp_multich", ".", "dsp", 0, 0, 0, 0, - SND_FORMAT(AFMT_U8, 1, 0), DSP_DEFAULT_SPEED, - DSP_CDEV_TYPE_RDWR }, - { SND_DEV_DSP, "dsp_spdifout", ".", "dsp", 0, 0, 0, 0, - SND_FORMAT(AFMT_U8, 1, 0), DSP_DEFAULT_SPEED, - DSP_CDEV_TYPE_RDWR }, - { SND_DEV_DSP, "dsp_spdifin", ".", "dsp", 0, 0, 0, 0, - SND_FORMAT(AFMT_U8, 1, 0), DSP_DEFAULT_SPEED, - DSP_CDEV_TYPE_RDWR }, + { SND_DEV_DSP, "dsp_ac3", ".", "dsp" }, + { SND_DEV_DSP, "dsp_mmap", ".", "dsp" }, + { SND_DEV_DSP, "dsp_multich", ".", "dsp" }, + { SND_DEV_DSP, "dsp_spdifout", ".", "dsp" }, + { SND_DEV_DSP, "dsp_spdifin", ".", "dsp" }, }; static void diff --git a/sys/dev/sound/pcm/sound.h b/sys/dev/sound/pcm/sound.h index d2ec480b45b0..5a750440cbea 100644 --- a/sys/dev/sound/pcm/sound.h +++ b/sys/dev/sound/pcm/sound.h @@ -228,45 +228,17 @@ struct snd_mixer; #define AFMT_NE (AFMT_SIGNED_NE | AFMT_U8_NE | AFMT_U16_NE | \ AFMT_U24_NE | AFMT_U32_NE) -/* - * Minor numbers for the sound driver. - * - * Unfortunately Creative called the codec chip of SB as a DSP. For this - * reason the /dev/dsp is reserved for digitized audio use. There is a - * device for true DSP processors but it will be called something else. - * In v3.0 it's /dev/sndproc but this could be a temporary solution. - */ - -#define SND_DEV_CTL 0 /* Control port /dev/mixer */ -#define SND_DEV_SEQ 1 /* Sequencer /dev/sequencer */ -#define SND_DEV_MIDIN 2 /* Raw midi access */ -#define SND_DEV_DSP 3 /* Digitized voice /dev/dsp */ -#define SND_DEV_AUDIO 4 /* Sparc compatible /dev/audio */ -#define SND_DEV_DSP16 5 /* Like /dev/dsp but 16 bits/sample */ -#define SND_DEV_STATUS 6 /* /dev/sndstat */ - /* #7 not in use now. */ -#define SND_DEV_SEQ2 8 /* /dev/sequencer, level 2 interface */ -#define SND_DEV_SNDPROC 9 /* /dev/sndproc for programmable devices */ -#define SND_DEV_PSS SND_DEV_SNDPROC /* ? */ -#define SND_DEV_NORESET 10 - -#define SND_DEV_DSPHW_PLAY 11 /* specific playback channel */ -#define SND_DEV_DSPHW_VPLAY 12 /* specific virtual playback channel */ -#define SND_DEV_DSPHW_REC 13 /* specific record channel */ -#define SND_DEV_DSPHW_VREC 14 /* specific virtual record channel */ - -#define SND_DEV_DSPHW_CD 15 /* s16le/stereo 44100Hz CD */ - -/* - * OSSv4 compatible device. For now, it serve no purpose and - * the cloning itself will forward the request to ordinary /dev/dsp - * instead. - */ -#define SND_DEV_DSP_MMAP 16 /* /dev/dsp_mmap */ -#define SND_DEV_DSP_AC3 17 /* /dev/dsp_ac3 */ -#define SND_DEV_DSP_MULTICH 18 /* /dev/dsp_multich */ -#define SND_DEV_DSP_SPDIFOUT 19 /* /dev/dsp_spdifout */ -#define SND_DEV_DSP_SPDIFIN 20 /* /dev/dsp_spdifin */ +enum { + SND_DEV_CTL = 0, /* Control port /dev/mixer */ + SND_DEV_SEQ, /* Sequencer /dev/sequencer */ + SND_DEV_MIDIN, /* Raw midi access */ + SND_DEV_DSP, /* Digitized voice /dev/dsp */ + SND_DEV_STATUS, /* /dev/sndstat */ + SND_DEV_DSPHW_PLAY, /* specific playback channel */ + SND_DEV_DSPHW_VPLAY, /* specific virtual playback channel */ + SND_DEV_DSPHW_REC, /* specific record channel */ + SND_DEV_DSPHW_VREC, /* specific virtual record channel */ +}; #define DSP_DEFAULT_SPEED 8000