From nobody Mon May 06 18:36:38 2024 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 4VY99L52xtz5J2lf; Mon, 06 May 2024 18:36:38 +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 4VY99L3VZwz4sQt; Mon, 6 May 2024 18:36:38 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1715020598; 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=7DMR9fH88aabKun0cGenUJn+ESHpsK48Mujdl2vWQO0=; b=bKQ3TXifsD6jluIIJwVQ4Ed7LpCGZ0RoRB4isaWSsCJrsiVHPOfGRtcaQIClbX2DzaBtzk zaG87xnaUVnTt7TBIfxhFvLvmLzp85WNtpLMInm/4GjhEjZnEOzkl0mOesaXselvCs7GWl A4QA7mELX/XwEym5mjnCATvYVegbxLQE/fzj9ZseF1M1TR5VhHJMY4Naa5/NOQLbyxeKGa +i7JHZmogfE9joShvqQ83SAhruya/rq0cWFOCQoWn2/suyaTfHpU/N+EwZQomn+tS2mLQf 90mB8J4RuAY44mJOPDFDfrOYH9xT4hffwQ0Up2gWdiQZ5/dHxRDClN+3mhlm2Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1715020598; a=rsa-sha256; cv=none; b=ZKHso7wieR49vnsDvyImSqmYrF0fOj+UQUiU/pRTGeqmqo7cWYQjcG9F6CvebNeIBgDDtG gmggmcNjlUFTydQTrUrTEERJ28IGxH1lVM6KTY9ZQp8zqav1/WypDjGpvrvKpjVLRk7wgt MWXOLaH35x2i+i1ublsPB9sddbQJlO/mDPIj+7n8KoGkVOItDNEnWdvZMLvKVH/1iFBI7H c6Yx1pEB/VERxf50C8YNmVjCgYOSbsz1zN4LDyUPVGcVH07smTvKXQ9uW0PIQKYjJNOzrQ JyApjhs/qvivCkFZ+0FTeSoqeFUwC2COChirmCgIQKE75ryU7PLBZKPH9vnlsw== 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=1715020598; 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=7DMR9fH88aabKun0cGenUJn+ESHpsK48Mujdl2vWQO0=; b=u0tEBcc9L3wk5CCadLudqT8Nik4faRqV3Zc+uikHL/BmvgybO/6ugng3eCHEotGPmjYiAm sOKAJ64mhc/RBxxRC+f8fZ4O/+csJKYa+IOilprP7A+ZmHE55dWjOaKBOXPX3XHOIUXi36 BvQZcniKuBOoDu9gAl9sbjdqP5JdiwDaMR2sNR81K20Qr7eFMaKszW15rlMajje/qe62Pl eRtHVBEbvgnwCxyFXyAtI0Eif9Wtjx2+heYG1wBhQGzW7Chwz0lVUfxkwpAL876Mbs6FeO 6iqXVe7WfdsXg6JLseJmCLUErsOCkSnpHQHfprAFkl3HOMDP3dec+EkhEOadvA== 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 4VY99L34Nfz17tD; Mon, 6 May 2024 18:36:38 +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 446IacdT060230; Mon, 6 May 2024 18:36:38 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 446Iacou060227; Mon, 6 May 2024 18:36:38 GMT (envelope-from git) Date: Mon, 6 May 2024 18:36:38 GMT Message-Id: <202405061836.446Iacou060227@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Christos Margiolis Subject: git: 72cbd381075a - main - sound: Remove unused dsp_cdevs[] fields and devices 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: 72cbd381075a2eb22a070505334d1ce92ec2d7ad Auto-Submitted: auto-generated The branch main has been updated by christos: URL: https://cgit.FreeBSD.org/src/commit/?id=72cbd381075a2eb22a070505334d1ce92ec2d7ad commit 72cbd381075a2eb22a070505334d1ce92ec2d7ad Author: Christos Margiolis AuthorDate: 2024-05-06 18:32:25 +0000 Commit: Christos Margiolis CommitDate: 2024-05-06 18:35:55 +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 --- 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