From patchwork Thu Sep 5 14:12:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13792432 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1DC8ECD5BC7 for ; Thu, 5 Sep 2024 14:14:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=RTW4BPjVBNC1txaO1Qybt7JrbkszqBjqcNmLmY+bYcs=; b=SaAQpe9Fs3qRs70u5NIOuAYQEJ 6XcUo86hGLFtUNMvYNSA2aAZEg2Nx+fB6ZZrA2gBIRKrJvVj0jpk2j6OSGulfL3FBE/vsUoZi7N05 MkKLaQqW3nXkRnOLWF4m/cT9vLATS5Urt1e9dJt7WmW2GvGKE5jwfT5xo/yyzKyQfSAjkmMddaiPL vO3IL0VwkfAulaceJpaXpGxWWyjdICkRvPDBstSRxTN1qTW7oPm0uPwyWWZFnX2eLOpseHtubeFI9 XdBRyI6JoginIYX/56eJhO/X6Pv9Hv4rCovDRUrgo5PJdZQYzedGW5Qns/C6If/jBzoAGCVhIo9bz gpnKZypA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDFs-00000008fCo-1cnx; Thu, 05 Sep 2024 14:14:36 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDEs-00000008et3-36sw for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 14:13:36 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-428e0d18666so6781755e9.3 for ; Thu, 05 Sep 2024 07:13:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1725545612; x=1726150412; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=RTW4BPjVBNC1txaO1Qybt7JrbkszqBjqcNmLmY+bYcs=; b=asizSxs+HIh2NAl1MzAZC6YznL8/rq/gMc6y3n5W7E67uoPnse8MJRW+6mjMKultxj BWCv2gE+D0VDAn3h9IKU6wlh/dXSkzAkO/bHbDyUgW9VL11vO8mSImm79rVmn3vBNUmR qzg6r54PQ4U5t6+xJou/21oWWHo6q1ZGCkdLDhePQ7ZbiNoHk7dZo9WjNDRIgTOlzyng R49YMLfC9NesRrRyFGVMKRrqzk5HO2utG/43ZjLX5QJjvNNhIhVjQ5revc+0xrjU8soq qhyr9V+2xWZlaEP3r8C1fy9cpEYg+tKRMUSY0efmgbzSO2H4B1OCzfCxFdRW1dryAjWi 1zBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725545612; x=1726150412; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RTW4BPjVBNC1txaO1Qybt7JrbkszqBjqcNmLmY+bYcs=; b=BMTGTkvLyvc+3QmMRxrtzra9QYD4kWwihakvVwzSL7JyEyEx71KiMgUTedXFPpNOGn dW3LNHn42SCet51wi3egvyzfLF3tOM/2ixBEXCVApMz/xD1LF4UbwBVrEHg6KBW+vu0r DWJ9wBReNlYguP/EroDJMD7OK69trav2NEVNFxkJTmu3nKFNKgN0ZPSKBjxbTk3NbGJc q4Ba0lPXedLKi+LBngrF96JdZZMQvsUHM7ytgBBVgnUoUbKL/Zb4GzNQGi6v01dcnmwo IyIze3WsddczC7n23IEUCCghWMD3S7mMxF14YirGo/tTkWS+q6hJUvQMTFOJtmJxgJFQ BdZA== X-Forwarded-Encrypted: i=1; AJvYcCUMIIRZbRwYk0JA6CMdCijLfsagdJlg3pDXSRHtPm8KXn5AEt98a6ZlJrM11iTkSCFUfcMBkSWU7G3idciCYW7f@lists.infradead.org X-Gm-Message-State: AOJu0Yxqq1E8NH65vSkjXWlAi56qkyIJ4TLahCXPahgAzSCDOJIas7F+ fI62XDSwGF8OEv/Vo6XxM6B14gooa6uYcXs2X6DKBKVU9SaveITexrMF2jh5k2I= X-Google-Smtp-Source: AGHT+IHBWWTYTD/NiKOaA5SpW4N37gd2i4CApX3NZGiNIF1CauMco3Jpwv1V3JBttP1V61f4V94HEw== X-Received: by 2002:adf:eace:0:b0:374:c324:eab5 with SMTP id ffacd0b85a97d-374c324eb64mr10087549f8f.41.1725545612335; Thu, 05 Sep 2024 07:13:32 -0700 (PDT) Received: from toaster.baylibre.com ([2a01:e0a:3c5:5fb1:4763:343b:23f3:f45]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3749ef81146sm19514621f8f.82.2024.09.05.07.13.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 07:13:31 -0700 (PDT) From: Jerome Brunet Date: Thu, 05 Sep 2024 16:12:52 +0200 Subject: [PATCH 01/13] ALSA: pcm: add more sample rate definitions MIME-Version: 1.0 Message-Id: <20240905-alsa-12-24-128-v1-1-8371948d3921@baylibre.com> References: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> In-Reply-To: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> To: Jaroslav Kysela , Takashi Iwai , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Srinivas Kandagatla , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Jerome Brunet X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=4141; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=nbyk2pbjAgexYBySRE6v5MF/PkMeyNKLqiWP8pzL27U=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBm2bx+0hxsyOB1G3jUIFP2N4UKQAgjgwcIS7zpN P2ju1g982qJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCZtm8fgAKCRDm/A8cN/La heV4D/wJBqYO/X+0ODfULGsb4Og1L+bWaai0VSP8TToyZzfpSkmUyd/wXZtNo/BLpdsdAYyNKM5 K314rJcJfBbWXQT6XmgfRSjc/Kn7xKqFkrJzGUVtpiPlf82h6RW1M25nfekb1lMia6rvaBcRVcQ 15eM1ckLvlIhWZpcEvTaBFWW/V5TUcy64mpJX574qJCKbR0U071AqMTsYgdTJnptPAZOTqhLVDc uKbGoXvfX9F4KWs+YH3d3kjzeDeizAkXrRhv5NHoLeOUvvamYZggmjqJCRWS5oiLPn5JKvkig/L YOCgPtBn4QW8gZKxhOmRqLA2GG24RRADpaEWRPfIUziaeZMYJi2u06HA+gtyzP6gdrwimkS2FN/ ii3pA+MwjNoOrCKiHPzKFX1WpeoDruRDBkXtNfnubUsOQj9OI5lUdr0EQna1gUUiVKRKnTr7QDe DiZP64xgjmL/kT/YK6WrZ7BnJ3rpZSd1gOmn8vRYRjG88M3l1PdggL7LXUWSfXtYqxX1loVyR9M Q2ewA4GtbRX6qeWpf26VHv3j7tyVzLfDM2oaxTP1KOlHAp0V6r+4CIWKTst9cGt2ASHCbJgfdVw dA5qjMX3o7PP6ZwPnhwY/uNBmjUtZcX4ZseZNgdFDGYRUuKIb3qCaqAfVjMfRKuQB0XfOKo85A/ x/qauD5RnK44B/g== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_071334_936243_4D5EE2E7 X-CRM114-Status: GOOD ( 16.20 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org This adds a sample rate definition for 12kHz, 24kHz and 128kHz. Admittedly, just a few drivers are currently using these sample rates but there is enough of a recurrence to justify adding a definition for them and remove some custom rate constraint code while at it. The new definitions are not added to the interval definitions, such as SNDRV_PCM_RATE_8000_44100, because it would silently add new supported rates to drivers that may or may not support them. For sure the drivers have not been tested for these new rates so it is better to leave them out of interval definitions. That being said, the added rates are multiples of well know rates families, it is very likely that a lot of devices out there actually supports them. Signed-off-by: Jerome Brunet Reviewed-by: Charles Keepax Signed-off-by: Takashi Iwai Reviewed-by: Jaroslav Kysela Signed-off-by: Takashi Iwai Tested-by: Jerome Brunet Tested-by: Bard Liao --- include/sound/pcm.h | 31 +++++++++++++++++-------------- sound/core/pcm_native.c | 6 +++--- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/include/sound/pcm.h b/include/sound/pcm.h index 732121b934fd..c993350975a9 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h @@ -109,20 +109,23 @@ struct snd_pcm_ops { #define SNDRV_PCM_RATE_5512 (1U<<0) /* 5512Hz */ #define SNDRV_PCM_RATE_8000 (1U<<1) /* 8000Hz */ #define SNDRV_PCM_RATE_11025 (1U<<2) /* 11025Hz */ -#define SNDRV_PCM_RATE_16000 (1U<<3) /* 16000Hz */ -#define SNDRV_PCM_RATE_22050 (1U<<4) /* 22050Hz */ -#define SNDRV_PCM_RATE_32000 (1U<<5) /* 32000Hz */ -#define SNDRV_PCM_RATE_44100 (1U<<6) /* 44100Hz */ -#define SNDRV_PCM_RATE_48000 (1U<<7) /* 48000Hz */ -#define SNDRV_PCM_RATE_64000 (1U<<8) /* 64000Hz */ -#define SNDRV_PCM_RATE_88200 (1U<<9) /* 88200Hz */ -#define SNDRV_PCM_RATE_96000 (1U<<10) /* 96000Hz */ -#define SNDRV_PCM_RATE_176400 (1U<<11) /* 176400Hz */ -#define SNDRV_PCM_RATE_192000 (1U<<12) /* 192000Hz */ -#define SNDRV_PCM_RATE_352800 (1U<<13) /* 352800Hz */ -#define SNDRV_PCM_RATE_384000 (1U<<14) /* 384000Hz */ -#define SNDRV_PCM_RATE_705600 (1U<<15) /* 705600Hz */ -#define SNDRV_PCM_RATE_768000 (1U<<16) /* 768000Hz */ +#define SNDRV_PCM_RATE_12000 (1U<<3) /* 12000Hz */ +#define SNDRV_PCM_RATE_16000 (1U<<4) /* 16000Hz */ +#define SNDRV_PCM_RATE_22050 (1U<<5) /* 22050Hz */ +#define SNDRV_PCM_RATE_24000 (1U<<6) /* 24000Hz */ +#define SNDRV_PCM_RATE_32000 (1U<<7) /* 32000Hz */ +#define SNDRV_PCM_RATE_44100 (1U<<8) /* 44100Hz */ +#define SNDRV_PCM_RATE_48000 (1U<<9) /* 48000Hz */ +#define SNDRV_PCM_RATE_64000 (1U<<10) /* 64000Hz */ +#define SNDRV_PCM_RATE_88200 (1U<<11) /* 88200Hz */ +#define SNDRV_PCM_RATE_96000 (1U<<12) /* 96000Hz */ +#define SNDRV_PCM_RATE_128000 (1U<<13) /* 128000Hz */ +#define SNDRV_PCM_RATE_176400 (1U<<14) /* 176400Hz */ +#define SNDRV_PCM_RATE_192000 (1U<<15) /* 192000Hz */ +#define SNDRV_PCM_RATE_352800 (1U<<16) /* 352800Hz */ +#define SNDRV_PCM_RATE_384000 (1U<<17) /* 384000Hz */ +#define SNDRV_PCM_RATE_705600 (1U<<18) /* 705600Hz */ +#define SNDRV_PCM_RATE_768000 (1U<<19) /* 768000Hz */ #define SNDRV_PCM_RATE_CONTINUOUS (1U<<30) /* continuous range */ #define SNDRV_PCM_RATE_KNOT (1U<<31) /* supports more non-continuous rates */ diff --git a/sound/core/pcm_native.c b/sound/core/pcm_native.c index 44381514f695..7461a727615c 100644 --- a/sound/core/pcm_native.c +++ b/sound/core/pcm_native.c @@ -2418,13 +2418,13 @@ static int snd_pcm_hw_rule_sample_bits(struct snd_pcm_hw_params *params, return snd_interval_refine(hw_param_interval(params, rule->var), &t); } -#if SNDRV_PCM_RATE_5512 != 1 << 0 || SNDRV_PCM_RATE_192000 != 1 << 12 +#if SNDRV_PCM_RATE_5512 != 1 << 0 || SNDRV_PCM_RATE_768000 != 1 << 19 #error "Change this table" #endif static const unsigned int rates[] = { - 5512, 8000, 11025, 16000, 22050, 32000, 44100, - 48000, 64000, 88200, 96000, 176400, 192000, 352800, 384000, 705600, 768000 + 5512, 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, 64000, + 88200, 96000, 128000, 176400, 192000, 352800, 384000, 705600, 768000, }; const struct snd_pcm_hw_constraint_list snd_pcm_known_rates = { From patchwork Thu Sep 5 14:12:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13792434 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6CB1DCD5BC7 for ; Thu, 5 Sep 2024 14:16:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=30qVKHGzVWd3Ku48k2FUb5pg6hyRShvxsMxjgIodA3o=; b=J6nf6iaW5ZugtOyT3JUisQqMot t7kF1mBSZj3ACZfAxCYE2e+GyFrMzvCIS3N2j7Rh93NE6Btpp6VFarwOTjk0nCXzO5LgpxPDW/thu 20LiBsUeMgD5b5H2pE1dApG26/oImlOi217ejUoDIwHviiJlBMic3OyrtOUebynBtZ5HAGl34dcxf fuQWIiu0amBOpsvclwXYhpv+ryCZrg9QcRCAJmHcv3ZsM7/9kkme9fw2aBd/mGS1HGkeB0/Id7QGX wPwP5HAx3ynRyOuazjvKuJ8ojJXjtl9NfaeJdwLeSJLU6Mtq6gzPcA1nvrMW+19JEtpR5UrKiMaie J3ZhZTuQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDHk-00000008fic-1KTL; Thu, 05 Sep 2024 14:16:32 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDEu-00000008ety-0lci for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 14:13:38 +0000 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-374b9761eecso517327f8f.2 for ; Thu, 05 Sep 2024 07:13:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1725545614; x=1726150414; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=30qVKHGzVWd3Ku48k2FUb5pg6hyRShvxsMxjgIodA3o=; b=lDHA5PTGNEfAcCGgU4t8zCa33lyRBYForn79ZIGJNIFfNbwePZhICn0zbRLeg8hDrl PhKhOL2QflbL1yi8zRNbuQfsKKHylqs8Qe9lLygMNAxCY+BNKMNSeDSoVTc8GTNLp3NS GDgCapq1Rl1gZZfJkLySi2eDs1v03zh18/eGRHr0zqpGt8EfPJfuAhqID2uPs34EhMA4 USAMvAThK6V0ECDNUyo4fFYio5TgNqPaJ5nkpQa+aGBaFFkt+lemuzpqt/ZAHUSTRsr4 Vixiv+9Fpp/05dTAi2Vee6i0qin/IOAI2qnyncb9YU9CDmBU0eus1BEYmNPi+GmL0zeo GYEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725545614; x=1726150414; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=30qVKHGzVWd3Ku48k2FUb5pg6hyRShvxsMxjgIodA3o=; b=C+Ck3qlnYzm148CCBSrb00a2Ci76dTk3i6FnmCEb2RPp/+L+UE2MYNgEGVVvXPv9VL iEQCedQAVB/YO9W4qC4hvHoYKhUrzDzAW15X2QtjQZvw54n+Xpk0htYAxhdplcJGtvlj k+7R36w5/Pwrcj+o5Gnl9exwKrqzwVURXHEZ9934kWXKI+KxtAiksGZvMc7JB+2uYN8t 8Ut4OmbuHprp8CReg9i0GU3uDoi4JdZlkF4SaOlPva4zXQNwIhuiKqhMVSh4NcXiZt6a iFdWROIfvIEmnqPt7N4TcwJMjDUfjCr//MuZw9o6OihcT3uWFClP/A0/EIS2aJV7Lo1g Yikw== X-Forwarded-Encrypted: i=1; AJvYcCUinFBqjufO9lYPDlZziNnh/yKVivyfYIiRUBwrK5jrJt6hPxXqYSOtd7ViIb5ZOgkk/dOxaw5zYy15aNqqtr6l@lists.infradead.org X-Gm-Message-State: AOJu0YwmLB4W51puzCafZWdUatn21/hooihxG/6jVsw9Qp96oYX36tvF k9RflM4oH3BKd1Nwr7kcSxjPvNZrQT9c7ZotMDDsUv1p5qydwNhKNpf+uMn7bfs= X-Google-Smtp-Source: AGHT+IHIINA9ikiQAEU4EVqWqd096m95ELTkl7taBlSxkBiyU94e8ZbTjmpLrftCleoK5D80ZO2gcQ== X-Received: by 2002:adf:db4b:0:b0:371:9149:dc54 with SMTP id ffacd0b85a97d-374bce97a6emr12068945f8f.3.1725545613483; Thu, 05 Sep 2024 07:13:33 -0700 (PDT) Received: from toaster.baylibre.com ([2a01:e0a:3c5:5fb1:4763:343b:23f3:f45]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3749ef81146sm19514621f8f.82.2024.09.05.07.13.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 07:13:33 -0700 (PDT) From: Jerome Brunet Date: Thu, 05 Sep 2024 16:12:53 +0200 Subject: [PATCH 02/13] ALSA: cmipci: drop SNDRV_PCM_RATE_KNOT MIME-Version: 1.0 Message-Id: <20240905-alsa-12-24-128-v1-2-8371948d3921@baylibre.com> References: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> In-Reply-To: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> To: Jaroslav Kysela , Takashi Iwai , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Srinivas Kandagatla , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Jerome Brunet X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2894; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=vHEDI7Y2wONOCstSqdZiAYxiDnXUk239ce26xbMNwXE=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBm2bx+GwosY829uA79cwaR6MhJh5SrJ51PMsGpl bhPAAdHb9KJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCZtm8fgAKCRDm/A8cN/La hQQ1EACX7oZZnRmZybF4ZVzlqM6krwmIFsFCSWMj8+fdpuUMLvds6lhBPbPqTlrzVjo6Axvntzi a0zUc7Sk7LBRV47wqdoqWKq0lP0ZLCWpTCZ7U+kY31Hq1PzMJVpXVE8qWlx/I0EOyXvvR8LwVC/ Zr2CtgHmNwUHARlovbaLEPJ8q8quzX2hzcBi4tF3++zWTrDEHx6yoxLUAOPDkFufctmIXw4yoGI RlLaxlH/YA/wUntceJj4IHQhRkjllvEMGTGI5ZJrDna5pFd12UfXF36yOA77k8umwbZ8gkF0Df4 dqs1Dt3X7Y3oT0AzChJNtNyk0HyRPNHf75Pt85UpwxbieNy2jCYgLABqZCDa9MoWZ4EzPIvtKYs ZO1BE6UcfxcLjHN92HOigMvm0ANZ0XUVQaM1NA1MFzkulMwzO9oF31CjFK231j3PKvFgxP/pgLd GqTh9JNwFLWEw7R2+ZZwoJK00+GXqIkR0JYM93RL/zpdbR3DZ/N50xJgl59kPrqkBEbqVW2vPxA 6WwLE3cV8pMe5AkKxcucwDxVjyiExPtW4uNslSYYxx+tS06mVbMaCAG1eSvFouupZ2DAV0fkaJc KMAX1MuSgXX22BAkazYem6fH5Fy4XlkiFOXnkDmaJPOz2vpR8U+K5aX+UnguNsQqdAfyVRFKdXX /aT3qhPoNhM7mMA== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_071336_259081_D85BDDE2 X-CRM114-Status: GOOD ( 13.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The custom rate constraint list was necessary to support 128kHz. This rate is now available through SNDRV_PCM_RATE_128000. Use it and drop the custom rate constraint rule. Signed-off-by: Jerome Brunet --- sound/pci/cmipci.c | 32 +++++++++----------------------- 1 file changed, 9 insertions(+), 23 deletions(-) diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index 36014501f7ed..e3cac73517d6 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c @@ -1570,14 +1570,6 @@ static const struct snd_pcm_hardware snd_cmipci_capture_spdif = .fifo_size = 0, }; -static const unsigned int rate_constraints[] = { 5512, 8000, 11025, 16000, 22050, - 32000, 44100, 48000, 88200, 96000, 128000 }; -static const struct snd_pcm_hw_constraint_list hw_constraints_rates = { - .count = ARRAY_SIZE(rate_constraints), - .list = rate_constraints, - .mask = 0, -}; - /* * check device open/close */ @@ -1649,11 +1641,9 @@ static int snd_cmipci_playback_open(struct snd_pcm_substream *substream) SNDRV_PCM_RATE_96000; runtime->hw.rate_max = 96000; } else if (cm->chip_version == 55) { - err = snd_pcm_hw_constraint_list(runtime, 0, - SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates); - if (err < 0) - return err; - runtime->hw.rates |= SNDRV_PCM_RATE_KNOT; + runtime->hw.rates |= SNDRV_PCM_RATE_88200 | + SNDRV_PCM_RATE_96000 | + SNDRV_PCM_RATE_128000; runtime->hw.rate_max = 128000; } snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 0x10000); @@ -1675,11 +1665,9 @@ static int snd_cmipci_capture_open(struct snd_pcm_substream *substream) runtime->hw.rate_min = 41000; runtime->hw.rates = SNDRV_PCM_RATE_44100 | SNDRV_PCM_RATE_48000; } else if (cm->chip_version == 55) { - err = snd_pcm_hw_constraint_list(runtime, 0, - SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates); - if (err < 0) - return err; - runtime->hw.rates |= SNDRV_PCM_RATE_KNOT; + runtime->hw.rates |= SNDRV_PCM_RATE_88200 | + SNDRV_PCM_RATE_96000 | + SNDRV_PCM_RATE_128000; runtime->hw.rate_max = 128000; } snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 0x10000); @@ -1715,11 +1703,9 @@ static int snd_cmipci_playback2_open(struct snd_pcm_substream *substream) SNDRV_PCM_RATE_96000; runtime->hw.rate_max = 96000; } else if (cm->chip_version == 55) { - err = snd_pcm_hw_constraint_list(runtime, 0, - SNDRV_PCM_HW_PARAM_RATE, &hw_constraints_rates); - if (err < 0) - return err; - runtime->hw.rates |= SNDRV_PCM_RATE_KNOT; + runtime->hw.rates |= SNDRV_PCM_RATE_88200 | + SNDRV_PCM_RATE_96000 | + SNDRV_PCM_RATE_128000; runtime->hw.rate_max = 128000; } snd_pcm_hw_constraint_minmax(runtime, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, 0, 0x10000); From patchwork Thu Sep 5 14:12:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13792436 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CE496CD5BC8 for ; Thu, 5 Sep 2024 14:17:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EZ4OWj1M1ZpMsgNdFCjWDSBf4jaOw7GENdrNyJWLeh4=; b=4U7eRrKb0ZtXrzNpJiUkDZ2TFo YiUsdqKckyiKeGzuEmj3vfAb1VpTU333Ifgv80rAXUmKZ0cG6AIyNOm8RyIvYJzCrOjQfCdOyosz0 nA7H3urDXzyHdw2XVvw0fHGSgFpMOQp1V98qdgyibceW4v54yJ8JKFCe1tX/uVAcyJZZuXzLB6hrw hso24tAkv8A+ukue4MVEjVI4sWqtQHNWAiX2oy6qmjgTnYCJe4jyIO7hiyeX+emjB9vOagv5ziErJ jJh9YLAuT8EFnVRRTrt10WxzHQ+ZufzXa9hFwtuVluD+xUqXrUB5pLogaun6aDsERTYy4B1whOiIC kv09jqOQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDIf-00000008fzB-46FZ; Thu, 05 Sep 2024 14:17:29 +0000 Received: from mail-wr1-x42f.google.com ([2a00:1450:4864:20::42f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDEv-00000008euK-0uae for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 14:13:38 +0000 Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-3787f30d892so506304f8f.0 for ; Thu, 05 Sep 2024 07:13:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1725545615; x=1726150415; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=EZ4OWj1M1ZpMsgNdFCjWDSBf4jaOw7GENdrNyJWLeh4=; b=NmUt4c0oXArXBZBG/im9t6x5DRuOesTmmnD4lS8ogc7q/RExvVY9YeTFvJmtajjQQT VfYZq3gwtUaFBO/9LqnWgVvmcYplDajMQnbFrkFXvIHvTQn2yIrKteeLmBGNTFnmsWK3 n5NHKbkcxFTR0urC0GnYOuWPzQOcCyVwnaDYAIre20k4tLxex3IOi6XjQXet42FOs6+g xNpQNRBLIFAXeqbQHrHaWHIHoElZom40tUvN2pbAO7CJq3eASrQEZZy1vpym7WT2JsIb iJbDuhAex/H4nCSlpVvkz9RadPooBWqRepoP9kpfZmIpqpovAEwKVkL/3ACiY3C4+u2U MXkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725545615; x=1726150415; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EZ4OWj1M1ZpMsgNdFCjWDSBf4jaOw7GENdrNyJWLeh4=; b=jFFfKvmKczfa3xgdBdOnkc8DhKrXIoI48LbFvt/qUmTi192qlC/xAAiBEhyxRCMv5u m838y/AdOBSjM6BoMnvsy1PsB8YuYm60T40kbAqFMVLDfo3R36X9XQQxIh8pIYHwQ0qT +OEnwZrK95ASV4WkLLKGwVjyFKq3u6rs5Inu+ixZ8e4Fs4gdzrE4LeiRf8VRNKrMwPbt j8gHLCax3bib+euNK2+40VbxRciZFQi5WV70TjxhkqKl1fsZn9Bqm0cH6aL2+YjOeKRr Y7NtcmoPy0n27Thm+iogWMOqCY05ewipFgnK/abNzUsyDBJTk08vcBQzfOE/75QPihWP TV4A== X-Forwarded-Encrypted: i=1; AJvYcCXLzb1yUEI5+dJ5KvaIizfrW/7hPAWku4ibc/1GoOVpsQXTw7RCmY/WzvPHwYVXac3f+ZOgR9ixUIJlky4mfuS2@lists.infradead.org X-Gm-Message-State: AOJu0Yy6583RC1YH3rG5fFAFpLaabSY//qlIxK6exNPgFrJtk9r2l6NV 3spSZ1yUGslrKlB0P0yiTTrtM/g8XyIYsafZNZljMAUVLO6LCXOzJlc0CUthEto= X-Google-Smtp-Source: AGHT+IFQfpi2p18CVl/s3bTmgrKQh6HdDCkB/ZnyhlaiBCzX95JZK0PtErVMddC8kBx8lcb0js+0/g== X-Received: by 2002:adf:9b86:0:b0:374:becb:d9de with SMTP id ffacd0b85a97d-374bf1c7963mr11972286f8f.44.1725545614620; Thu, 05 Sep 2024 07:13:34 -0700 (PDT) Received: from toaster.baylibre.com ([2a01:e0a:3c5:5fb1:4763:343b:23f3:f45]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3749ef81146sm19514621f8f.82.2024.09.05.07.13.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 07:13:34 -0700 (PDT) From: Jerome Brunet Date: Thu, 05 Sep 2024 16:12:54 +0200 Subject: [PATCH 03/13] ALSA: emu10k1: drop SNDRV_PCM_RATE_KNOT MIME-Version: 1.0 Message-Id: <20240905-alsa-12-24-128-v1-3-8371948d3921@baylibre.com> References: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> In-Reply-To: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> To: Jaroslav Kysela , Takashi Iwai , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Srinivas Kandagatla , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Jerome Brunet X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2791; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=JlFXCBTD6wmPGs3Xc+eBXJCnNEzFsRasRZacDAmL1po=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBm2bx/F8WSx9SFo+Mm9aAwm5w5LTGeCtAOKiZNf Pbdd3RViiaJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCZtm8fwAKCRDm/A8cN/La hTO8EACfpShxFfUfKBhcVOFgGnGLNcUrNcxHpvHeMT6YKdbtHho2dcF4RxIgzZdG3+MPzTgKCsW qKwzGfpKhAFRS6wz5tGK2UDhdk9tmZbGfUuW6KsvzNurvkxqxjpLh6jkrxbwhOlIIj+gSeIsihV 1RzUbnyNg04AeMAF12l3PCpFSDVgbG/0/gxVUZJx36yb1cvmXRleVELUnsz+i8WZls+5AtDZkE9 jtQsHRZyN5VXTEqPk7THy7bb6rstqW6VdH0/jPmShDW6iTIvQCj5p8a0HpoQd+/K9aiYYjlqOdm aqK+TDzCsgimu0ca4dqsAkGaSZty17/RfWigRs9LBY5l20spNTAO/JIrXatmZqYlarMJjKNKPqO CEF4exBkSiDErgJkF6us0XqfEr+iNGXQ87/u8K8uN5+WbFHv4ynZDkpkXALb6BQFlB0aCCW4cAb oOiDds2ZlszM5mDHqjnYAO5vk3Sme/eAsXFMp6UlcqgJ8cq03VUPPJncB3iDzZrp/84D+/wzsZc 9AQkvBpyzPJyMenwxVTwPk9xpACxwpyZXwcgBdQ1xynVrzwLyUe38AV6DW3kPzeky8TxBY/eZ1i OV1dJqvbu8GAQ8b0IjB7E9YlEFZq0QpqCANP9bBuHv0scQAgZlA615zxiwoWpWzpc5DHYUDAnZp LIBw1U57xD093jg== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_071337_296933_A43C9452 X-CRM114-Status: GOOD ( 14.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The custom rate constraint lists were necessary to support 12kHz and 24kHz. These rates are now available through SNDRV_PCM_RATE_12000 and SNDRV_PCM_RATE_24000. Use them and drop the custom rate constraint rules. Signed-off-by: Jerome Brunet --- sound/pci/emu10k1/emupcm.c | 31 +++++-------------------------- 1 file changed, 5 insertions(+), 26 deletions(-) diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c index 7f4c1b38d6ec..1bf6e3d652f8 100644 --- a/sound/pci/emu10k1/emupcm.c +++ b/sound/pci/emu10k1/emupcm.c @@ -147,16 +147,6 @@ static const struct snd_pcm_hw_constraint_list hw_constraints_capture_buffer_siz .mask = 0 }; -static const unsigned int capture_rates[8] = { - 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000 -}; - -static const struct snd_pcm_hw_constraint_list hw_constraints_capture_rates = { - .count = 8, - .list = capture_rates, - .mask = 0 -}; - static unsigned int snd_emu10k1_capture_rate_reg(unsigned int rate) { switch (rate) { @@ -174,16 +164,6 @@ static unsigned int snd_emu10k1_capture_rate_reg(unsigned int rate) } } -static const unsigned int audigy_capture_rates[9] = { - 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 -}; - -static const struct snd_pcm_hw_constraint_list hw_constraints_audigy_capture_rates = { - .count = 9, - .list = audigy_capture_rates, - .mask = 0 -}; - static unsigned int snd_emu10k1_audigy_capture_rate_reg(unsigned int rate) { switch (rate) { @@ -207,17 +187,16 @@ static void snd_emu10k1_constrain_capture_rates(struct snd_emu10k1 *emu, { if (emu->card_capabilities->emu_model && emu->emu1010.word_clock == 44100) { - // This also sets the rate constraint by deleting SNDRV_PCM_RATE_KNOT runtime->hw.rates = SNDRV_PCM_RATE_11025 | \ SNDRV_PCM_RATE_22050 | \ SNDRV_PCM_RATE_44100; runtime->hw.rate_min = 11025; runtime->hw.rate_max = 44100; - return; + } else if (emu->audigy) { + runtime->hw.rates = SNDRV_PCM_RATE_8000_48000 | + SNDRV_PCM_RATE_12000 | + SNDRV_PCM_RATE_24000; } - snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, - emu->audigy ? &hw_constraints_audigy_capture_rates : - &hw_constraints_capture_rates); } static void snd_emu1010_constrain_efx_rate(struct snd_emu10k1 *emu, @@ -1053,7 +1032,7 @@ static const struct snd_pcm_hardware snd_emu10k1_capture = SNDRV_PCM_INFO_RESUME | SNDRV_PCM_INFO_MMAP_VALID), .formats = SNDRV_PCM_FMTBIT_S16_LE, - .rates = SNDRV_PCM_RATE_8000_48000 | SNDRV_PCM_RATE_KNOT, + .rates = SNDRV_PCM_RATE_8000_48000 | SNDRV_PCM_RATE_24000, .rate_min = 8000, .rate_max = 48000, .channels_min = 1, From patchwork Thu Sep 5 14:12:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13792437 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 96CFBCD5BC8 for ; Thu, 5 Sep 2024 14:18:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=7h3IxLII25IyrhC+KVhfj3YGVmIHw6kd015YpmGIJ8c=; b=ON1OwZd1LeSi3StBSI5D+27GEq ORSM6HFanQrpNTlZ3sooqd6pdJ1jFvV+8Kmt7dxU4pbpnUOdRle2sof6+0kIyASJ3izjP2CVm+q9t zfsHDs+HsIUu243nMpMWebzEQnPYnFNzbCcUEnRuKDnTK6DjLcLU0dmxOkR3W0HhihYI1P/uypv4j IOskehSTVeIzNhOPhf1aExh3rzhD4gTg8KMcnnyFFU45XglATbjOTLhNHc8eAYLLz5/wUnkO0emGP J3n60zIlMtfd9vdjeJYrktJIf8cbKV6u7dE7i5iRu9pon/J4hoz2I48piZy8/EVqEhBBmKJfjlV2s +9RRHI+g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDJd-00000008gJh-1pCj; Thu, 05 Sep 2024 14:18:29 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDEw-00000008euf-08Rt for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 14:13:39 +0000 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-374b9761eecso517349f8f.2 for ; Thu, 05 Sep 2024 07:13:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1725545616; x=1726150416; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=7h3IxLII25IyrhC+KVhfj3YGVmIHw6kd015YpmGIJ8c=; b=JPr/kNvBtXzWjdLSqBGb0p/f3rPsSUFovYZ9Gbm2jvqw2OKiHLhjX5UQKRqI4rqXq1 K5SpUpC4FlFpWRd7T43cdb40JLp7sK3V5HJkJ9j9oVbTzKjuncct/0HJEFlGyr1xFN7v U3Aka6GWYROpGqOg5gKINeEx+a90icn9rpH3AGKR6JAkwgB4LlZET9UW10lIgUNa93VF wYmjFG8RKdg0Sedlm81kOHYLy1YCBM+776V0bC+eT/Kt4KoM6pCzaeHOGmtyimB7TGpo ZVcwiLeSGnTgn3BKz2+5m/2/XyiChwTrd7UIsYcCAsYsyGWT2P/O1J2AZ2vdhuMIt2yI japg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725545616; x=1726150416; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=7h3IxLII25IyrhC+KVhfj3YGVmIHw6kd015YpmGIJ8c=; b=kOr7Tfnut42dJscvNPS3STjCyfkFvPW8AN5vGsh6PUcPuaH3jS8KyRHCR6tYcyHzyK YMTNdym6MjxsfXlT5Tuf3pUVBIuHU8wEvCy6ok4kqpsqVZUsZNMbBF3fkASNntPXlLeI tOnl3QgdT3+x5TBgbp+n4496FpMspwXXdQBlnVnE4VaV+u6/4LzQw96fKAlhAERH/CnE fnVSDh5ZjohQj5M6zIREwkPa+zXyx0VYimnRjaQB/tSmL2ZE9wJPW4ow06qXq9pL6YTO PQgGkxxEEnPShjdZB/OyUmLxIJHmCVJ1aB+Z/Qia4rDziDxfGh3+f3o6IGAAmqMWHA/j 6XEg== X-Forwarded-Encrypted: i=1; AJvYcCUQ4yyyH1szkQY7ZBHML83kS9pemdiUPBOIuqDzOCcOMQCVATxk4/FwQ9BHG/ErdgM9kr+hmVmxI7re8cvg60eG@lists.infradead.org X-Gm-Message-State: AOJu0YzT2vdJ8VUEug2MQb9i4M5t+jdvp6tO4Gy8Ws6EApGH1rw5BCcm 2w46ztZcJLYoHhj6+XIw7KCrbcxG2+94fIA4MBc1X+eWGUGuIw3uQY5gDFjvpL4= X-Google-Smtp-Source: AGHT+IEbUswTlTIXY9IFqrPyLxkDRDlQG32Uf8DYiNRcFcDxuqbhWX0zczTUJWneGpA3Bu0lLOXdbQ== X-Received: by 2002:a5d:6783:0:b0:369:9358:4634 with SMTP id ffacd0b85a97d-374bcea7a66mr11693722f8f.19.1725545615753; Thu, 05 Sep 2024 07:13:35 -0700 (PDT) Received: from toaster.baylibre.com ([2a01:e0a:3c5:5fb1:4763:343b:23f3:f45]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3749ef81146sm19514621f8f.82.2024.09.05.07.13.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 07:13:35 -0700 (PDT) From: Jerome Brunet Date: Thu, 05 Sep 2024 16:12:55 +0200 Subject: [PATCH 04/13] ALSA: hdsp: drop SNDRV_PCM_RATE_KNOT MIME-Version: 1.0 Message-Id: <20240905-alsa-12-24-128-v1-4-8371948d3921@baylibre.com> References: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> In-Reply-To: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> To: Jaroslav Kysela , Takashi Iwai , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Srinivas Kandagatla , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Jerome Brunet X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2330; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=KOHw3cK09GmDelIdzy0PFMcoAWRfmYIV3CJePnQGlsA=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBm2byAGCtXNMv4zmeK8xaUD9ydPbkZKpBUTd6RJ QmFXFNp3uWJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCZtm8gAAKCRDm/A8cN/La hf1yD/4484C6jyc9McqeqL7Zucii06qG7GJ75NozKsnq8MPLDo2S3U55W/KesC1pT/XlYmui5O2 WyYY+W88+0wV/3Gf+vCvsKfG+47ttqBGTLd6i3DriWETBgKOplOzy7khdZt4qQl2lq3QvlwQY2O fMR3FwzCuob0a5AOZY064ZlG+tdaJCjX7kN0tibF6v8V376AVcK4EG1m42WWkyr3mzoBUXnDE/S G3VCsaOynVmaj+A7RhefYy8/Jp5hk5a7NzccvkAdi+46WNv2yHTiQ+NhfBOyFmA4mQy32kk4QQU zsKwfVv37g2Vu0n32++cIo+WbjO1LU97hg/G8TxAfmhZHCoYPJsnCvtsl5Kye8lS1gzZNl8391E plrRXUEa3Rjr5eU6AUpm7MUjJY9wt2tlPO1nqhQL3boLXlIXSf2HYD3RIk/ou94L0ko+cVdTOQp Ve+Cd9BUZfApUzijH1AbFiW340rwalm0TjEGfFakod+mh2pUnN7Oj3IWsIT8tMUm5sG7noniinD SYXScq21wOtzJy6vEva0I7MtUT8lH0/Jd+rPRyPZTWn8GdbwM4VFxuJ2szOfhP5Low0NGD6kfmf UmizqtBtrmrhX+O5yCwyDWK7hheosHrjYGIDBHYhs/oDB5vK0EVwRxwTeYpaGWrbJIHVxsu0lC5 yLro4DIal4JBB4Q== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_071338_118481_7BCFA65C X-CRM114-Status: GOOD ( 13.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The custom rate constraint list was necessary to support 128kHz. This rate is now available through SNDRV_PCM_RATE_128000. Use it and drop the custom rate constraint rule. Signed-off-by: Jerome Brunet --- sound/pci/rme9652/hdsp.c | 18 ++++++------------ 1 file changed, 6 insertions(+), 12 deletions(-) diff --git a/sound/pci/rme9652/hdsp.c b/sound/pci/rme9652/hdsp.c index 713ca262a0e9..1c504a591948 100644 --- a/sound/pci/rme9652/hdsp.c +++ b/sound/pci/rme9652/hdsp.c @@ -4301,14 +4301,6 @@ static const struct snd_pcm_hw_constraint_list hdsp_hw_constraints_period_sizes .mask = 0 }; -static const unsigned int hdsp_9632_sample_rates[] = { 32000, 44100, 48000, 64000, 88200, 96000, 128000, 176400, 192000 }; - -static const struct snd_pcm_hw_constraint_list hdsp_hw_constraints_9632_sample_rates = { - .count = ARRAY_SIZE(hdsp_9632_sample_rates), - .list = hdsp_9632_sample_rates, - .mask = 0 -}; - static int snd_hdsp_hw_rule_in_channels(struct snd_pcm_hw_params *params, struct snd_pcm_hw_rule *rule) { @@ -4499,8 +4491,9 @@ static int snd_hdsp_playback_open(struct snd_pcm_substream *substream) runtime->hw.rate_min = runtime->hw.rate_max = hdsp->system_sample_rate; } else if (hdsp->io_type == H9632) { runtime->hw.rate_max = 192000; - runtime->hw.rates = SNDRV_PCM_RATE_KNOT; - snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hdsp_hw_constraints_9632_sample_rates); + runtime->hw.rates |= (SNDRV_PCM_RATE_128000 | + SNDRV_PCM_RATE_176400 | + SNDRV_PCM_RATE_192000); } if (hdsp->io_type == H9632) { runtime->hw.channels_min = hdsp->qs_out_channels; @@ -4575,8 +4568,9 @@ static int snd_hdsp_capture_open(struct snd_pcm_substream *substream) runtime->hw.channels_min = hdsp->qs_in_channels; runtime->hw.channels_max = hdsp->ss_in_channels; runtime->hw.rate_max = 192000; - runtime->hw.rates = SNDRV_PCM_RATE_KNOT; - snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &hdsp_hw_constraints_9632_sample_rates); + runtime->hw.rates |= (SNDRV_PCM_RATE_128000 | + SNDRV_PCM_RATE_176400 | + SNDRV_PCM_RATE_192000); } snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, snd_hdsp_hw_rule_in_channels, hdsp, From patchwork Thu Sep 5 14:12:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13792438 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 0E53ACD5BC7 for ; Thu, 5 Sep 2024 14:19:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=IcCu+DWFXbg2fAQ79jKiLK8pzJONU6/x+rmv87WbABM=; b=lg4AkfybZx8cJ8pfxprrL2gbJm iYBOF8sDUkhuB88AMc7iTmB/yqbBUDLQtEWkPwuH7aOw9mZWgywDgT+FLw+UtdE6E4DsNNHycQc3Y rWvDtr6Ai3oaQgpuLzIoV9Z8VO/n/C0cO/osnVr/enM1VCtARFn1oP9jD+MNHGmVomklqXhEtG3hK AJ1BAgWWYZmLJEe9Ilqc4cUofku7HQBAycChWRXg3zFqQbWlRcTv5Br4vt6yHG/iKyvZ+Z+JtwOLj j0j9lLCe93zsEFAsjdmbKL4ONPFJ1RWdD8CZMga/WnnXxkRfvd+N6lBGocNt37Yp544yG7hiUvHjj U2rWk3Bg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDKY-00000008gak-3HHV; Thu, 05 Sep 2024 14:19:26 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDEx-00000008evD-1GAT for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 14:13:40 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-42bb81e795bso6816195e9.1 for ; Thu, 05 Sep 2024 07:13:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1725545617; x=1726150417; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=IcCu+DWFXbg2fAQ79jKiLK8pzJONU6/x+rmv87WbABM=; b=KroQCjtZ8pJjKBTsxmKF8SagC6+2YYQYOTnd0IG85EXEANERbZn5QZhQxu+gqYVmZP 838gGfuB/xO161uSG9nB/NtY5pAHJoI0H6GP//zd0TNH6AE1Kp1TU7PuLymSrUlQXcJw yuQFtGhjyCj+AiljfuAJeUCZZ3xeo9VSomMialxdfUdJYwxxFNrksynZsU0B1Zqc1JYW ATqPuYKK/9wHNRp/U45oK99v4QUL9eiikd9LFkCeweTIFTPeWopfIKHw0xjLuAuTduGA fq+ibKzfm8h51Tj9SyW3UqmPQH7C74bMLa2V5U1IV9DVIBfvCg6BqvMHgYXar4Fnfggb 4DaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725545617; x=1726150417; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IcCu+DWFXbg2fAQ79jKiLK8pzJONU6/x+rmv87WbABM=; b=YqSAob6uJJLc2M7SOjGg6Za5bZ3AsS/BGMhaRQMf/g2NNA2je8UV1Mu1Xj+eiiPXBl fHxbKTDLsPcNc+q1l0FOv2hhAW+e+aOnnK4UMNy+1CggxjX8pfeV1Xt1ptU+Bjgkmgm3 TKl0TXX4uvw2PveZgLLk7PXSt5wUgxrM81SllbusvTCG0Z9hCQyWKGJINf08NYerKbJa xXySEQ8vCPGDg9fKxLn0nqGNc0Bdjz7P4nLkIpGWV2d+eH0ZfcdXdUingGdzyzEjoBIR y+GV5Q3u+XNuerGolmUCo56J4tHd2MRAKA+EN8p+HQ4EWamIMBxXFoXnTBKhpvH9rAY4 mnag== X-Forwarded-Encrypted: i=1; AJvYcCVYN+hOE9NMDQ4rCno/AfiF7OPoTrkMlQ/26i3G8k1pvlYRW+mFKL5TtWIkZoZxuKl5YxwqDW2zYvAISE7ScYfF@lists.infradead.org X-Gm-Message-State: AOJu0Yx4hrSAMVhF2TAkMJIyyVvXmKHJY+Jr5DANKm3sHhAnsU3kr7KB XkBEJ1KjI3KvqX3oHnQGt8n1nSFPvrgwi6WffI0YThiBvQg7aQ79OoiFRlcW9sk= X-Google-Smtp-Source: AGHT+IFIEHR55riZlgeQGJQjXuyOXmmTN+5SiNQQq3UpC9AB9eRnK6WUg+y3HQedvVtwF3WTVV2akQ== X-Received: by 2002:adf:fa4c:0:b0:374:bb1b:d8a1 with SMTP id ffacd0b85a97d-374bb1bd9c6mr11130169f8f.13.1725545616938; Thu, 05 Sep 2024 07:13:36 -0700 (PDT) Received: from toaster.baylibre.com ([2a01:e0a:3c5:5fb1:4763:343b:23f3:f45]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3749ef81146sm19514621f8f.82.2024.09.05.07.13.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 07:13:36 -0700 (PDT) From: Jerome Brunet Date: Thu, 05 Sep 2024 16:12:56 +0200 Subject: [PATCH 05/13] ALSA: hdspm: drop SNDRV_PCM_RATE_KNOT MIME-Version: 1.0 Message-Id: <20240905-alsa-12-24-128-v1-5-8371948d3921@baylibre.com> References: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> In-Reply-To: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> To: Jaroslav Kysela , Takashi Iwai , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Srinivas Kandagatla , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Jerome Brunet X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1580; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=Xv0vuHB6OmJEPDWj7YbALy0svxpRq+MGIQhgNIVXe28=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBm2byBQJXpw0tKm9S1aoNQuw0gFMk22/TxwdNAJ DQo1OePFpeJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCZtm8gQAKCRDm/A8cN/La hb6CD/44tlADSXvh8LtznvSCnCRWDjibNp3ZPrngVla5rHZENvj/3bhJd4z2yqP+n5D9sGXGqDG 4xNTMjbtLBxWXfJQTNFD1EkV6IIjuGJvW0i5NwXFyIS34ysoOE0hI9Q8FqVDCddEonzuY7wcjy5 RnJBiUvZoKOO9WcpWEP3gm0VGniXudhEWa0SBL7G3ojs3j7TOXDF1Mceym7wTQKYJGZlZDCUohC H91vxd6zdshPH/qzyMI9jqGpjwkqY2lpHww/KZ9tQqPpy2VS2MXPgl4llQyPpIxxvbcQj56iZcR CsjdRZRWF4PE/aTCl1T8mbSUU/XmInE7C+yqydfXqxp0jd0vFsy8ZojjGp6JDfs6NgGn16EYbS6 ViY4U2XOqdcXgXkg8ttNgs6JaEhjx1XrkRddp7NYnj11EVJIwwo/zODYBuBCYZJNSctuqG3MvJG IxM9AEefJBxIgyfUskHexjjJBa6NJhU/6ux0FNEN/ukrTRbxmCOFacv1jZ+uqo2BL71xYSl8GNq oAny7kUhtzHYyMG7I8Ifp0TH9qEtXeY5QApAGE+oIPYKpe8btMam/nMJCyBhUY7PotLSrYd97T2 yQ+H8YXAew9HF16sTUciTp1/QB5QSU3YEVOEMQOpwc/MS7pQvwWhwZQonuGU/QQHJOQwvSsMelf DIHwWZKP7oiAz4A== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_071339_411259_274EB564 X-CRM114-Status: GOOD ( 12.61 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The custom rate constraint list was necessary to support 128kHz. This rate is now available through SNDRV_PCM_RATE_128000. Use it and drop the custom rate constraint rule. Signed-off-by: Jerome Brunet --- sound/pci/rme9652/hdspm.c | 16 +--------------- 1 file changed, 1 insertion(+), 15 deletions(-) diff --git a/sound/pci/rme9652/hdspm.c b/sound/pci/rme9652/hdspm.c index c3f930a8f78d..dad974378e00 100644 --- a/sound/pci/rme9652/hdspm.c +++ b/sound/pci/rme9652/hdspm.c @@ -6032,18 +6032,6 @@ static int snd_hdspm_hw_rule_out_channels(struct snd_pcm_hw_params *params, return snd_interval_list(c, 3, list, 0); } - -static const unsigned int hdspm_aes32_sample_rates[] = { - 32000, 44100, 48000, 64000, 88200, 96000, 128000, 176400, 192000 -}; - -static const struct snd_pcm_hw_constraint_list -hdspm_hw_constraints_aes32_sample_rates = { - .count = ARRAY_SIZE(hdspm_aes32_sample_rates), - .list = hdspm_aes32_sample_rates, - .mask = 0 -}; - static int snd_hdspm_open(struct snd_pcm_substream *substream) { struct hdspm *hdspm = snd_pcm_substream_chip(substream); @@ -6096,9 +6084,7 @@ static int snd_hdspm_open(struct snd_pcm_substream *substream) } if (AES32 == hdspm->io_type) { - runtime->hw.rates |= SNDRV_PCM_RATE_KNOT; - snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, - &hdspm_hw_constraints_aes32_sample_rates); + runtime->hw.rates |= SNDRV_PCM_RATE_128000; } else { snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, (playback ? From patchwork Thu Sep 5 14:12:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13792439 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 1829CCD5BC8 for ; Thu, 5 Sep 2024 14:20:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=rfaUW45B+7KlIF+mUGq7uC7AFp3mgjyj9XJFdT/ylM8=; b=eoKZDBSlYa+M0V4WWkxPc+m5vz XD+vT8MNgtTcRgPTP9dB9ZbLjnVQrXfkBoVPqSx2E6qdVkmQr8yyvH5CWGNQgnGvK4K3yK5zmrBy2 pvvTAAaRMHsd3nhhbAb/icFjLHyEj72E2JbP4P5zxCpEJlnxgW+S5JIuCUdXvnrRZc+jjeh6peksh eczW5JNzYI6/mnRsTczcwsOHOQ0WbnQcZ5mwqNDVVPGJfjeVgygy8ZT/9ZHQsM/bm/Qg4oV6qMfLe uubLy7FRWhnWDCr4xQSjBpZvaTzQply2Vt483i7j+lcOEo5hnBXD7lfIoMR19azaPPwzgPFPTnBxS DobKS9KA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDLU-00000008gp0-3qQD; Thu, 05 Sep 2024 14:20:24 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDEy-00000008evi-1rfo for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 14:13:41 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-42bbf138477so7681365e9.2 for ; Thu, 05 Sep 2024 07:13:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1725545618; x=1726150418; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=rfaUW45B+7KlIF+mUGq7uC7AFp3mgjyj9XJFdT/ylM8=; b=DUb/eYjJkwYtPVWvOQTFGhLUyT3QtQUsDEnt5hQaoZm5K9meKq9QQfu1KePlmDCxDm fcok4KQB1IU2bn3X55M8bMBR1rwINLV42oa9nerNfd5+XEEypLDaBllQ2Sh+q9SZMnkI qUY/S7mde+xd/ag46HPSqxQxF304886vJcLGopUU6NbyegnpdKiyggrSCgSQlTx4rXEn wWbRuadd7mSaoVOVQ7k+z7HLe3JgMUNGSIlEr4o4Ori9EunQbkTaLtKG6ylPWenABmCm CpqtuXE5G4g793BhSDfVp8sTEL7TKgk6WsAZjZukxOmLnAV+j97zq9PpL+3oaVF/0O/N 7Diw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725545618; x=1726150418; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=rfaUW45B+7KlIF+mUGq7uC7AFp3mgjyj9XJFdT/ylM8=; b=vZTFbtnO/U0i0M6uH8Hi8Sy0b7A7zmVE5FgdVjH5kLnSJPk/vRFaLHj/UeOylqlXNH TKyp5w/uCFmYhcHawj6MTTBVCydpMPUAyBdp6028orOUQQSYf9rTGJMXq8o0ojIEanq7 lm/UKaH6k62jRWVs4fSViqQ48MU3vsat2BVHtJj4Ort5x7a7wvhO3uZMAUGOR7PqnnuC LU6nwKVCU7OXgAuV0LfLUw3CBruYZJ/EmMzKIrmOsJ+yhW+YCi9N7DTBDDlxrtKgB2SQ zSzOwMVr4CB6WAZpW7rXVs1pEbw0OIoNOoUSeQae3OkZI+4K+aObeKaK2oeT/4EU/VkG X7Gw== X-Forwarded-Encrypted: i=1; AJvYcCVsELe6RYjZdxHyiCxgjjGEe8VcfodJMagrWywLy70UFaR2Oa2zBd4IHCR15DhA+eUXigTOFHNxosSIHqc3DqcZ@lists.infradead.org X-Gm-Message-State: AOJu0YwDBVQ4sxJa5rVTMqx+z/k6Wv59PlZMxXWi3vE6ItFGSoeJly1p eMgLxrnCdsBys7/Wod7ZX2VBAP61NtGSeOXmjOPi5RbDsnzZfKDI2wZESg0z8ME= X-Google-Smtp-Source: AGHT+IGtEzlkmi1X9qAKFgSrVIwQmTXSMDlgcMdhQ2tpsl988QCRJs9wFHdgsZEawo3apfr7sYtKiA== X-Received: by 2002:a05:600c:502b:b0:42b:a2fd:3e52 with SMTP id 5b1f17b1804b1-42c880f40a3mr88769815e9.22.1725545618149; Thu, 05 Sep 2024 07:13:38 -0700 (PDT) Received: from toaster.baylibre.com ([2a01:e0a:3c5:5fb1:4763:343b:23f3:f45]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3749ef81146sm19514621f8f.82.2024.09.05.07.13.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 07:13:37 -0700 (PDT) From: Jerome Brunet Date: Thu, 05 Sep 2024 16:12:57 +0200 Subject: [PATCH 06/13] ASoC: cs35l36: drop SNDRV_PCM_RATE_KNOT MIME-Version: 1.0 Message-Id: <20240905-alsa-12-24-128-v1-6-8371948d3921@baylibre.com> References: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> In-Reply-To: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> To: Jaroslav Kysela , Takashi Iwai , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Srinivas Kandagatla , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Jerome Brunet X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2349; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=JZU8jHCoVhWoac780UCorUbM0BqAjQdqy8oNh22CxhQ=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBm2byC+AUfKGYETlq0b9gY/V2ov1G04CRqslpi1 7kwAIe43VWJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCZtm8ggAKCRDm/A8cN/La hTTBD/4lpKyPM5exBNshRD/UjVrzJvz8M+5ZOQUfD0ozwld2V9Qt3a0FUU3uYi79qgHSCf8xupo Q5ymJGLATRBZRBe/t5FLYyRwO3JxBd4haRCcoI2wwtpJ/dOeF7tBsORVGQMUTPhxXr5UdYlgjd8 dP1xfVoS+3hKilEy78jfGtMXMCguR8ozxcuQaAz1NCfuw+NN8Llq1DRApOoZuf5GlyQZw1z7gE8 PahoISJjrdhbgoPjPxf1VusTyA5hGqOnHxawFudFhXri4mUz520kU0Se0odb/Z8HpQKoD8JOKh5 dYByJWYcvszzEfKQqaUnlmFwaXdD6pTnp5VIdE2dssdkJsJbv1HzX2LtJFUWwa9A10wOT13heKg FHY01BWTLFlg++fMYfd3D1+GeTb0ebIWqvMhzHPwgPIdCuVKSgi1yXfWulxQRhFZmCAiiA6+NZu OcQknXux/ONA/p6FGjLqI+wKedl40/9ZV7IKGGgAFjxlwhoR9iBtn9LEY3bPePFvs1ZGbiz+tTB //Saii6d+XdarIq3na3e6koDqu/Gm7oeypPmBGNfpbwfT8ouwQbukGynEuRRw6pGs1YLJ2NcNoh QCGdpsksvt8z4C6YnYAS8/PJi5YwEfdrDVUfJN5GhaZvunchvMtuf7YXYdUWcsCXr6mS0zog7E1 9vcDEwbRdon5ERg== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_071340_528756_3B62DB3C X-CRM114-Status: GOOD ( 14.35 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The custom rate constraint list was necessary to support 12kHz and 24kHz. These rates are now available through SNDRV_PCM_RATE_12000 and SNDRV_PCM_RATE_24000. Use them and drop the custom rate constraint rule. Signed-off-by: Jerome Brunet Reviewed-by: Charles Keepax --- sound/soc/codecs/cs35l36.c | 34 ++++++++++++---------------------- 1 file changed, 12 insertions(+), 22 deletions(-) diff --git a/sound/soc/codecs/cs35l36.c b/sound/soc/codecs/cs35l36.c index cbea79bd8980..b49c6905e872 100644 --- a/sound/soc/codecs/cs35l36.c +++ b/sound/soc/codecs/cs35l36.c @@ -949,32 +949,22 @@ static const struct cs35l36_pll_config *cs35l36_get_clk_config( return NULL; } -static const unsigned int cs35l36_src_rates[] = { - 8000, 12000, 11025, 16000, 22050, 24000, 32000, - 44100, 48000, 88200, 96000, 176400, 192000, 384000 -}; - -static const struct snd_pcm_hw_constraint_list cs35l36_constraints = { - .count = ARRAY_SIZE(cs35l36_src_rates), - .list = cs35l36_src_rates, -}; - -static int cs35l36_pcm_startup(struct snd_pcm_substream *substream, - struct snd_soc_dai *dai) -{ - snd_pcm_hw_constraint_list(substream->runtime, 0, - SNDRV_PCM_HW_PARAM_RATE, &cs35l36_constraints); - - return 0; -} - static const struct snd_soc_dai_ops cs35l36_ops = { - .startup = cs35l36_pcm_startup, .set_fmt = cs35l36_set_dai_fmt, .hw_params = cs35l36_pcm_hw_params, .set_sysclk = cs35l36_dai_set_sysclk, }; +#define CS35L36_RATES ( \ + SNDRV_PCM_RATE_8000_48000 | \ + SNDRV_PCM_RATE_12000 | \ + SNDRV_PCM_RATE_24000 | \ + SNDRV_PCM_RATE_88200 | \ + SNDRV_PCM_RATE_96000 | \ + SNDRV_PCM_RATE_176400 | \ + SNDRV_PCM_RATE_192000 | \ + SNDRV_PCM_RATE_384000) + static struct snd_soc_dai_driver cs35l36_dai[] = { { .name = "cs35l36-pcm", @@ -983,14 +973,14 @@ static struct snd_soc_dai_driver cs35l36_dai[] = { .stream_name = "AMP Playback", .channels_min = 1, .channels_max = 8, - .rates = SNDRV_PCM_RATE_KNOT, + .rates = CS35L36_RATES, .formats = CS35L36_RX_FORMATS, }, .capture = { .stream_name = "AMP Capture", .channels_min = 1, .channels_max = 8, - .rates = SNDRV_PCM_RATE_KNOT, + .rates = CS35L36_RATES, .formats = CS35L36_TX_FORMATS, }, .ops = &cs35l36_ops, From patchwork Thu Sep 5 14:12:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13792441 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 67E44CD5BC8 for ; Thu, 5 Sep 2024 14:21:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=2Z+rj5y3R0mNy6TrxdjS8zRh7/rFaHDdfIRk7QJqw5Y=; b=jyONq0+KPPMEdQIhldgS/063HH GkqEYu0KpsJuNU4Xq1zhW6UTa6L8bVRyQxC3zf3P06v4coP5g3uLSuCy2nYMDBSRsZ5oaC7aHE05r 4rDuXsY1bAEmQpcMPoKhblkmHtV1pDAH4pgTkluUVo30i6ketvNKx91E3w0t0gm6A2FQ4jY+eDnUH Sg5geCoEZV46Y6I3glmwpmEVAH6wiCTueBNQi1ch5sYwY/ekXmu6Sw9u0c3GIHY0jeIQQMPgIjMwh B2WZ1yRF9rhz5LdCweyOk3PdMipALY44ogSATVe02IzpBZ1W4cdAmAHrTi+3qycZcOjjegBsPylr1 C6JTPl1w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDMP-00000008gy0-48s1; Thu, 05 Sep 2024 14:21:21 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDEy-00000008ewM-3XCh for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 14:13:42 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-42c7bc97423so8868965e9.0 for ; Thu, 05 Sep 2024 07:13:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1725545619; x=1726150419; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=2Z+rj5y3R0mNy6TrxdjS8zRh7/rFaHDdfIRk7QJqw5Y=; b=UFLY5SxAd55uZDSlSO2UICC9nqEFQMlcN1BMr1Dkxc2o/jaYk4+A31cz+MhFA0FTFx i3kG0An/NG2C5ipaj1z61N/99KztYQAiUlBeQOFiXpU5nsYSGKHT2zgjsZRYqjfWwm6H atHkJJfCT11rXH1/tobWK0QoojZ3jceCul6xQGuPsYgG9Au3pSJW9ay9A8W5n2czbmIk 7h2rgxtkqWg9AUl3ujnPozd+JKt2IIPTckWERRxHsf+hepZJfsAMW8CKTrtnxitTiFD/ ERGiyiK58zqpCvdjtJ0EA2KnCAeLSnBWR3WpbWD2GYuSZPEYWXWSExtSTHhRJIQA8Pln aa1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725545619; x=1726150419; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2Z+rj5y3R0mNy6TrxdjS8zRh7/rFaHDdfIRk7QJqw5Y=; b=IhYCuBPR6a0BHKmRt3qGrbbVfUVueuFiEN/IZk3t1WPt0CxZisLeuwzPLmR+nTZxqC hJR6AMTCLodD8dm7VtKZIVIDSIeDDTioK/ecqvfmVHAsB3aEOJT829miBYBj7E7Nr2Aq 8fS7ITKnY6PxwKYaUWmgqB53aW9I5btn3sAsNxBSCADZrX1xWux4G1Q0rpRAWqmBDgbc eqnGjbJ0JFxZLXBMQha9HGQKRTx3ndyvUCpfhMfB4K5ip+OnhZtmLGG0fdU5SEBCem2p NxZ1X5YldVuYo/MqqmPNnRxqMY1SZ0TL+OS/+bRtAkzyyVnDFV/xSI0LvAOATKMX1oAa sr4A== X-Forwarded-Encrypted: i=1; AJvYcCWxBc4ZyEr1YFDLrJOzYQITo1wYcarJPl6uBbfe+7iPhj0Ra7G82y4pJ21RbSt8DK9pp4KLSKTNTFkgVFoKxFmX@lists.infradead.org X-Gm-Message-State: AOJu0YzFAXzvZO85tOv7vY3LFfZMzRuIfykZOcwWj2rjrfwYXK2I6axr VZqPYYvUZiME67puh4eS/oIcMXUNCmSIxB8WSProcFVsG+7e+Enx/rdgt1zYCOY= X-Google-Smtp-Source: AGHT+IFnCqbQW/W0tCcOFZOUTrgOvDDfD/BF7Qm+j3pcmxyp5nmWJMclM/a4f2XaIjQkMTPnmvJFyQ== X-Received: by 2002:a05:600c:291:b0:426:5b44:2be7 with SMTP id 5b1f17b1804b1-42c9e82bb6cmr1594685e9.10.1725545619306; Thu, 05 Sep 2024 07:13:39 -0700 (PDT) Received: from toaster.baylibre.com ([2a01:e0a:3c5:5fb1:4763:343b:23f3:f45]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3749ef81146sm19514621f8f.82.2024.09.05.07.13.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 07:13:38 -0700 (PDT) From: Jerome Brunet Date: Thu, 05 Sep 2024 16:12:58 +0200 Subject: [PATCH 07/13] ASoC: cs35l41: drop SNDRV_PCM_RATE_KNOT MIME-Version: 1.0 Message-Id: <20240905-alsa-12-24-128-v1-7-8371948d3921@baylibre.com> References: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> In-Reply-To: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> To: Jaroslav Kysela , Takashi Iwai , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Srinivas Kandagatla , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Jerome Brunet X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2629; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=/9PPWU/V3ndhMwxKTLQBCr4ABO0MKQnJNgh6SuoSWJA=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBm2byDjJ5MAQwKUXUi9Qx9lRk2zC2qtJAg3cVqb F68ud1AS6GJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCZtm8gwAKCRDm/A8cN/La hbs7D/9jkFwqwrmKgv0ZhPh3d28WC+JMl2LeePbM44C62MIMmX09vhcW2vLNov6JfPakVj22wyO 8sScRFOllDrWOHNaBxlRiYfCl3X0/qiuzBDB9JOrCpl4ag5IT8bRf9zGVqZvJ35O+DvurKLz9c/ zm05MLmKv1tlE3WTKoOTjB2GjDiFhEd68kCrkmBols9ApTtWxut7rV4yjIJk/+2gxaO1lc5iOCE xyKIumdiL7cAyQYLyQ5k5qi+1tPU7jf94tIDGTd8iiucGvZ+BhfVjcSsfBhoXEIDKuPIGxQdxvV yrGNlJIx4GYc5iYEXWWE02UY0JMkgCsVurF476/18TTh02FgffBqaLjlo8bC0C+efK4ipU36wZ5 QQOJq7uLQuEQ7kC6NQ4I9D64jRE9+NA4R11zvlvDh0MXAntJfxDogIJDmFiJ3cQoVXCBIBoppdm J7DTxylEbgD5dlPXFgGUW3yCALXVgGoJwyg6afC81A96488Yd2bPDXZk3Saz9WiQ6Oz3E6V5WwE BKUjPqjy15Q3pVWSIc7YzFLJ4MeRww/EZUBLPCftmmUNT7PSTYhgRekdcPuUeEaeKiFzuh9iJzB /k9TzDFclI7URRUkSFQv04/lO6TfZjdfpD2HAJ3DqXYuR1ty+S9c2nVkBcbfrl/yTePFp8+xd6t pBlkHqVpOmWX1Gg== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_071340_985296_ADEEAE51 X-CRM114-Status: GOOD ( 15.62 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The custom rate constraint list was necessary to support 12kHz and 24kHz. These rates are now available through SNDRV_PCM_RATE_12000 and SNDRV_PCM_RATE_24000. Use them and drop the custom rate constraint rule. Signed-off-by: Jerome Brunet Reviewed-by: Charles Keepax --- sound/soc/codecs/cs35l41.c | 34 +++++++++++----------------------- 1 file changed, 11 insertions(+), 23 deletions(-) diff --git a/sound/soc/codecs/cs35l41.c b/sound/soc/codecs/cs35l41.c index 1688c2c688f0..07a5cab35fe1 100644 --- a/sound/soc/codecs/cs35l41.c +++ b/sound/soc/codecs/cs35l41.c @@ -808,26 +808,6 @@ static int cs35l41_get_clk_config(int freq) return -EINVAL; } -static const unsigned int cs35l41_src_rates[] = { - 8000, 12000, 11025, 16000, 22050, 24000, 32000, - 44100, 48000, 88200, 96000, 176400, 192000 -}; - -static const struct snd_pcm_hw_constraint_list cs35l41_constraints = { - .count = ARRAY_SIZE(cs35l41_src_rates), - .list = cs35l41_src_rates, -}; - -static int cs35l41_pcm_startup(struct snd_pcm_substream *substream, - struct snd_soc_dai *dai) -{ - if (substream->runtime) - return snd_pcm_hw_constraint_list(substream->runtime, 0, - SNDRV_PCM_HW_PARAM_RATE, - &cs35l41_constraints); - return 0; -} - static int cs35l41_component_set_sysclk(struct snd_soc_component *component, int clk_id, int source, unsigned int freq, int dir) @@ -974,13 +954,21 @@ static void cs35l41_component_remove(struct snd_soc_component *component) } static const struct snd_soc_dai_ops cs35l41_ops = { - .startup = cs35l41_pcm_startup, .set_fmt = cs35l41_set_dai_fmt, .hw_params = cs35l41_pcm_hw_params, .set_sysclk = cs35l41_dai_set_sysclk, .set_channel_map = cs35l41_set_channel_map, }; +#define CS35L41_RATES ( \ + SNDRV_PCM_RATE_8000_48000 | \ + SNDRV_PCM_RATE_12000 | \ + SNDRV_PCM_RATE_24000 | \ + SNDRV_PCM_RATE_88200 | \ + SNDRV_PCM_RATE_96000 | \ + SNDRV_PCM_RATE_176400 | \ + SNDRV_PCM_RATE_192000) + static struct snd_soc_dai_driver cs35l41_dai[] = { { .name = "cs35l41-pcm", @@ -989,14 +977,14 @@ static struct snd_soc_dai_driver cs35l41_dai[] = { .stream_name = "AMP Playback", .channels_min = 1, .channels_max = 2, - .rates = SNDRV_PCM_RATE_KNOT, + .rates = CS35L41_RATES, .formats = CS35L41_RX_FORMATS, }, .capture = { .stream_name = "AMP Capture", .channels_min = 1, .channels_max = 4, - .rates = SNDRV_PCM_RATE_KNOT, + .rates = CS35L41_RATES, .formats = CS35L41_TX_FORMATS, }, .ops = &cs35l41_ops, From patchwork Thu Sep 5 14:12:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13792442 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id F3A2FCD5BC7 for ; Thu, 5 Sep 2024 14:22:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Sxrac1nWcSLd8cTfx3t0NuLkVpF4P7zBU6WUMa4X7WI=; b=hRct7mdBwmd4066lXzEXXUIaOQ btHv8DVrMZeQJ9ZQMB/ouQv0dcSRVkp5FM+OI6DrIhwYIlrn3EBWHTzJ0kWX06BZ3m+RkwgSREYKg KYnBA49pusG3c6hBmP8cU4Z/tO3bmBEXO9kMQJnNkyXmKc44wU9OmS3rxgMP5FOkS4zN2wCbh9vr5 YlxUI2Z6JRdLuGkCsCkMS8tSUsw60vxNBjtrHz6BYrrhbG5qgu39p25oTeytoqcB8ldbWxOPOuU75 PqJmEZrjR6VTIZ/yYaJ+DhxP0Unerzs0bS8Cf7vD7+qN0jq9mWfgWiPsk6P96hvO213sUUBKkHSLt t9+1tRRA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDNM-00000008hAK-1KIk; Thu, 05 Sep 2024 14:22:20 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDF0-00000008ex8-19CP for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 14:13:43 +0000 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-374c7d14191so1086620f8f.0 for ; Thu, 05 Sep 2024 07:13:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1725545621; x=1726150421; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Sxrac1nWcSLd8cTfx3t0NuLkVpF4P7zBU6WUMa4X7WI=; b=MR683Klnaok2TbspB4Y+0tW2eH+NW+79Zf70kBEtAwNJ0pH+AaHgFsZsJwjvc127e7 nh63teeuzamKb+98ReTtPmFLI7LQmsHc8bdGsLgRep+XQqiukKCngld+whL42gy00Qs/ i3RCeps7W8gd7ttYHXK5sogQl/zxSrAnbSI5fDhu5bu/KMSVXx0gkRV+nRjHYV5pEVkU s5/0Em6sCZjv/Yz8s4Qdt+chwSOKKNRHZWYO8e7BPZnirxgFAV3t6LDSoQXkQEbnpn43 I3ZOqNJiJ6bRBggUDjhFgsI7PYepa7p4YwaOAspvjjqWM8cvBtxm9uAceWiu5dlVF3Uy VQvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725545621; x=1726150421; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Sxrac1nWcSLd8cTfx3t0NuLkVpF4P7zBU6WUMa4X7WI=; b=dRHCcIJuzrh54HMyPek0CfBsMrGkOkIJeyfLQQMYV0fIzBYVowxc/yo/1GEIQSFPFf b7EknV1Z9hR2NPWVkljTsSe9Gl0+UkxA4h1R8EQ3vvCgoz1QsI2R6ccEtbVGxI11VTZO m/D5Gtbbb91A82JVpdoimFXQ4yw7BUQnQl5u6a7reIRIwtDJGU83AzH607z+vezbMeaZ NDTBzKHxTJpHiV+N0aIcUEP5CKDAEojrflPu00Ie/vp6ZToPlT6OAZqLUucL2ykpdccc HsxAcC9KysmQVWCs0EVyAuPywl4iQuJSFb5WwMOaVgF2FI56LdfRsl/lch0qZxt6wzTE 2odg== X-Forwarded-Encrypted: i=1; AJvYcCWiupKxbK+j8w2uXMSmssQbhBUacetVKTr4DmaJ2JlG3yCXcQWqZ9witO2KXJJmY0YCYSntpudKG7mX50gS9GRC@lists.infradead.org X-Gm-Message-State: AOJu0YzaTbr72C2ItO9eP5TyeACRyprrWIQloghBwzY1hCnhui3NYpEH CdbtiSTI6WKYyUHcdCDaWQf0g5x/cr9/+8ibLCqUgT1YvWL/HevnGCoiJdapYXw= X-Google-Smtp-Source: AGHT+IH+jM4E6XFtH4yV7dt/MuKKbSnx0kbRDSQ+9W6MalNelsQvYVX6PPe8E18bCCVxO02rcsQe3A== X-Received: by 2002:adf:e709:0:b0:374:c57e:1ea9 with SMTP id ffacd0b85a97d-3779b847aaamr3814838f8f.18.1725545620447; Thu, 05 Sep 2024 07:13:40 -0700 (PDT) Received: from toaster.baylibre.com ([2a01:e0a:3c5:5fb1:4763:343b:23f3:f45]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3749ef81146sm19514621f8f.82.2024.09.05.07.13.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 07:13:40 -0700 (PDT) From: Jerome Brunet Date: Thu, 05 Sep 2024 16:12:59 +0200 Subject: [PATCH 08/13] ASoC: cs53l30: drop SNDRV_PCM_RATE_KNOT MIME-Version: 1.0 Message-Id: <20240905-alsa-12-24-128-v1-8-8371948d3921@baylibre.com> References: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> In-Reply-To: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> To: Jaroslav Kysela , Takashi Iwai , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Srinivas Kandagatla , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Jerome Brunet X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2106; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=x86FNaEpjnIyR5OAZHCSCK5+o+umgxvyBNNfEVUoPH4=; b=kA0DAAoB5vwPHDfy2oUByyZiAGbZvISh5e9yuIZ6fhegOdIwe1HpWFPSz5lzuBx/Xh1lYE/Go IkCMwQAAQoAHRYhBPThWa4Y8/VtXxu3G+b8Dxw38tqFBQJm2byEAAoJEOb8Dxw38tqFxS8P/Auz glLnhOinsM4qpstMYih0MgMyBfS5BkRGvvQv78UV/Mi4Y8Aa/TZLWyjY5DtZ/ifYi+CQ1mTVKlM fcvpqaydV1yQs26SZX4WwftbI6yvH2ep63gu1gDMjNg19JM3CN5m+K17jL0N/nz9WJm1MifPHX0 CNs9yhK3TaHhbDqsTKS1R3GGdjmRhYzEOFOECZI16OAgDUyHSyCrNW9moGzFE90b+luipqUKZYv CgEEa8t5PtgYBbB5DBVfQ9eMRMIMSffn7PBsaFLmvekhISH5e9iTm53/pGNBxXez7iYdm0BkOau vxSImcNyZd3McfPzz+NcUN4krQat144fofS0bz2ZDjZChOqX/TXst/bxAf9hnPBQM3b4HX9sOeA GX3y0BOPb71vdZWkk6q9tslY+DdFju7R1b1+At5rH+AwFH6L1ClGTEQ+hIwr5rLQ9WZMjtMe3Q4 LbTkhY3khwyp9PYpDApAnR/o+LCtt4LyWOVy2A8cLmtmKHIulIL6Oqw3zqLeAWzKZvlGW+8WGrI jgeK+AU37YkFNpFF3YeM20MIXa6aDJ3PywF0zLVWsQ4sfVMUuHsWUNLAfsFSKbDjt7pF7tT6x/m qX3KDTzkCWSW6GZbgBS9jXRx00jM91w75beWJJ/mZ4V9YR1pAhuPwwo/oVQiZGMZQkmMR/MaAbj NaY1l X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_071342_355808_0822450F X-CRM114-Status: GOOD ( 14.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The custom rate constraint list was necessary to support 12kHz and 24kHz. These rates are now available through SNDRV_PCM_RATE_12000 and SNDRV_PCM_RATE_24000. Use them and drop the custom rate constraint rule. Signed-off-by: Jerome Brunet Reviewed-by: Charles Keepax --- sound/soc/codecs/cs53l30.c | 24 +++--------------------- 1 file changed, 3 insertions(+), 21 deletions(-) diff --git a/sound/soc/codecs/cs53l30.c b/sound/soc/codecs/cs53l30.c index bcbaf28a0b2d..28f4be37dec1 100644 --- a/sound/soc/codecs/cs53l30.c +++ b/sound/soc/codecs/cs53l30.c @@ -739,24 +739,6 @@ static int cs53l30_set_tristate(struct snd_soc_dai *dai, int tristate) CS53L30_ASP_3ST_MASK, val); } -static unsigned int const cs53l30_src_rates[] = { - 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 -}; - -static const struct snd_pcm_hw_constraint_list src_constraints = { - .count = ARRAY_SIZE(cs53l30_src_rates), - .list = cs53l30_src_rates, -}; - -static int cs53l30_pcm_startup(struct snd_pcm_substream *substream, - struct snd_soc_dai *dai) -{ - snd_pcm_hw_constraint_list(substream->runtime, 0, - SNDRV_PCM_HW_PARAM_RATE, &src_constraints); - - return 0; -} - /* * Note: CS53L30 counts the slot number per byte while ASoC counts the slot * number per slot_width. So there is a difference between the slots of ASoC @@ -843,14 +825,14 @@ static int cs53l30_mute_stream(struct snd_soc_dai *dai, int mute, int stream) return 0; } -/* SNDRV_PCM_RATE_KNOT -> 12000, 24000 Hz, limit with constraint list */ -#define CS53L30_RATES (SNDRV_PCM_RATE_8000_48000 | SNDRV_PCM_RATE_KNOT) +#define CS53L30_RATES (SNDRV_PCM_RATE_8000_48000 | \ + SNDRV_PCM_RATE_12000 | \ + SNDRV_PCM_RATE_24000) #define CS53L30_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S20_3LE |\ SNDRV_PCM_FMTBIT_S24_LE) static const struct snd_soc_dai_ops cs53l30_ops = { - .startup = cs53l30_pcm_startup, .hw_params = cs53l30_pcm_hw_params, .set_fmt = cs53l30_set_dai_fmt, .set_sysclk = cs53l30_set_sysclk, From patchwork Thu Sep 5 14:13:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13792443 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 572C0CD5BC8 for ; Thu, 5 Sep 2024 14:23:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fLGY2r4E5D5nEZeix2orNxNRil3E6loR/QGg/DpFo+A=; b=df8BuMgCxArFIOXC4/i4JWCGs+ dv6aLnCT9EhWvf4SIYoios63DUqH+B4WsJRzV/ivvPBVsT43j+6xwVsHCSvDGLQCsZUQNKGthquS9 MQ6ZBa4aQcIGZeHvJnk43mWoGxVUX/xsoOsGstbUNkJpwzK+NdoimIYHfbv6Xf+LDI0Y6LXYkTfiv ZDQqodwBGFZ6Gmk+41ersZaCle4AHUGxxg14cX/J0kkeBEIINNPh5DcB3uhAXRgw+23RUd7fEkfGk GsDUoIEo71Z0ZscdnjJDQ5oBarBETtap8KZFppT7A1Qi6O4MqIkwjCXJ2x4iuRqbnAYtU6RlaDmIq pyUFDBcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDOH-00000008hIc-0cSi; Thu, 05 Sep 2024 14:23:17 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDF1-00000008exa-0qUx for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 14:13:44 +0000 Received: by mail-wm1-x335.google.com with SMTP id 5b1f17b1804b1-42c828c8863so7070365e9.3 for ; Thu, 05 Sep 2024 07:13:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1725545622; x=1726150422; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=fLGY2r4E5D5nEZeix2orNxNRil3E6loR/QGg/DpFo+A=; b=T3NC+TuUk2/jVy/FhVYFIECodx0cKtA8KN7h8d0DETTDHfh9CrkyOJI9u20OIbBZi9 SHayMLunP6GNYfhvnhOe58Ia8+0AtOVevXE/srEp4o5dYL9xSd/LlIIbItSRAh3tN2f8 slUAP6oaUyB9l1mlTiSAVua5oxDa/uJzmqf/Omd96IfungBMB/wkyQ7lFzSfteMhcJLC 4P1JIGtpRQQv3nQ1HDz73l7s7zrogzRATaXe82fwifTcx3LR0gVNo/4Pv0A0YMXm2ah1 nNfPXgsl8EmsQBLA7zSi0O4r0G/iBJtw1x5kGKuPOS7dUBicge2geQ2u/K1CY5GOFgfH NMHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725545622; x=1726150422; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fLGY2r4E5D5nEZeix2orNxNRil3E6loR/QGg/DpFo+A=; b=rkIoE9fM3AXt7K2nypBVK2AKo4eNghOosNShVoZfc1idzkgcM/QTsAWuEe+ZQpgjo1 Cz93PslJasje2h6bf1nBVQGppGw+A7JDD6f1LhsRRoA5cMPc5Jj2srMo62NdeRwSLTvY pbRPM75Q9yHaIBhjJNKdGOMWjbOrdMdzz5z0JuNfi1iOUk+lGRm0Rs0eCkNRYJXqzoyC o6NkkLjVFiYztud25SbCV/ePPy7WWEFQG+bmGLtRD04odvVkNMs5a/I8HIvDxtyxoWNa owLYqh8br2Ve5G7cwWk8R8IS4c7HV8vNTvzPKlnZ4W4gpHM//VrPjJes3ZgbHKUDPGFp hFcA== X-Forwarded-Encrypted: i=1; AJvYcCU+KI+dC1zNm6VDFCOnVf7s6NCWybI1FYKtCsBMGF8kHKkPqQaxWdvxafKK0+3nPoK0WNzPqFl6ni3Xvvque9Nx@lists.infradead.org X-Gm-Message-State: AOJu0Yz+kBfaYq/0JTAJwdWjf77c+hoB5xvUmkDFBogdqGQqcS1tO7hE ZGsitJ9DzfBdX7kM6DYlIPQ0Lar9ulLSLhrnnpPo6DC3nl3GKuIdHHa7fBtCkMc= X-Google-Smtp-Source: AGHT+IEGRCC4e+BbZUypR7krz2a4gQq1qGWOiNgWFE+vKhBXsfkEaZmALu0yOYGqYwZOJmoKA993YQ== X-Received: by 2002:a05:600c:3d92:b0:42b:afbb:171b with SMTP id 5b1f17b1804b1-42be48fa9e7mr115228615e9.35.1725545621670; Thu, 05 Sep 2024 07:13:41 -0700 (PDT) Received: from toaster.baylibre.com ([2a01:e0a:3c5:5fb1:4763:343b:23f3:f45]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3749ef81146sm19514621f8f.82.2024.09.05.07.13.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 07:13:41 -0700 (PDT) From: Jerome Brunet Date: Thu, 05 Sep 2024 16:13:00 +0200 Subject: [PATCH 09/13] ASoC: Intel: avs: drop SNDRV_PCM_RATE_KNOT MIME-Version: 1.0 Message-Id: <20240905-alsa-12-24-128-v1-9-8371948d3921@baylibre.com> References: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> In-Reply-To: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> To: Jaroslav Kysela , Takashi Iwai , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Srinivas Kandagatla , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Jerome Brunet X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2545; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=drSScU2kqBTHjL0A8KzaYHR+/F7xoFGHMQYfWWJ7pnE=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBm2byF5Z7tNiZhe6e816749oi0zUTNuNg77PRA8 jsKC/9KehyJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCZtm8hQAKCRDm/A8cN/La hbCND/9QmZRemz2Otghu3R9RnK3p2ChrnyTSdSBbVXRpvQu/8ZIqU4Co8aEGyMpZhAzh+ZuourF QXKy8b8BOGlBLpuvtssdH83C857coUohvv9CGY5KiaznFQNnFAFO8G9pLCGrmLnSktHRYT3E6UE RNKE9tQXZNDwele7SVDxFKC5H5cmBcOBo35DAhZUCC159eSbvPmJ2LRb1eHgVwEHA4+u+uaKH0B 7FxNeK3JSYRbXU6Bic8nvp8GBMwYUvqahENbQG/vqG4FZqpHuXfVXwqcCJYfTLtVo6CgJhbb3KN xFgGKl5P9noIkOjIsK2TcWjCgQvCx2k05xiBjiwIHLQjVxuSSCULF0dp1uT8462NSn5Wlq/a72o WuVevmzC5mcpPSm7VVTmxDgBEsyoQfydLTw0p67qMvlBQGEBv0MKgEAp0GFgxu5dX4NmYQmvgi8 Noo9s1SYgOHLvx38mjsM4MfZ8hQ2KUBiAhVIZwrxY3prg+t55nyv7hrbebTdEeXXacxmkb+0/HH UeGw9nMm8XZggMrqc4OkHYSVSL+X30tj2m8zbuyEkpVrOnM5jZqRku0n/p8muHSAaXrH3gXFW7Q K1e/20qPKuebTTG9S/YrlyLCQBL1VzQF4nQfwwFaXHlvwGUO5F5toZYfcCK451E5lTMSAxb1Csb oFNIoD886sMAeSA== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_071343_291976_D78C0692 X-CRM114-Status: GOOD ( 14.28 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The custom rate constraint list was necessary to support 12kHz, 24kHz and 128kHz. These rates are now available through SNDRV_PCM_RATE_12000, SNDRV_PCM_RATE_24000 and SNDRV_PCM_RATE_128000. Use them and drop the custom rate constraint rule. Signed-off-by: Jerome Brunet Reviewed-by: Cezary Rojewski --- sound/soc/intel/avs/pcm.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/sound/soc/intel/avs/pcm.c b/sound/soc/intel/avs/pcm.c index c76b86254a8b..afc0fc74cf94 100644 --- a/sound/soc/intel/avs/pcm.c +++ b/sound/soc/intel/avs/pcm.c @@ -471,16 +471,6 @@ static int hw_rule_param_size(struct snd_pcm_hw_params *params, struct snd_pcm_h static int avs_pcm_hw_constraints_init(struct snd_pcm_substream *substream) { struct snd_pcm_runtime *runtime = substream->runtime; - static const unsigned int rates[] = { - 8000, 11025, 12000, 16000, - 22050, 24000, 32000, 44100, - 48000, 64000, 88200, 96000, - 128000, 176400, 192000, - }; - static const struct snd_pcm_hw_constraint_list rate_list = { - .count = ARRAY_SIZE(rates), - .list = rates, - }; int ret; ret = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); @@ -492,10 +482,6 @@ static int avs_pcm_hw_constraints_init(struct snd_pcm_substream *substream) if (ret < 0) return ret; - ret = snd_pcm_hw_constraint_list(runtime, 0, SNDRV_PCM_HW_PARAM_RATE, &rate_list); - if (ret < 0) - return ret; - /* Adjust buffer and period size based on the audio format. */ snd_pcm_hw_rule_add(runtime, 0, SNDRV_PCM_HW_PARAM_BUFFER_SIZE, hw_rule_param_size, NULL, SNDRV_PCM_HW_PARAM_FORMAT, SNDRV_PCM_HW_PARAM_CHANNELS, @@ -1332,7 +1318,9 @@ static const struct snd_soc_dai_driver i2s_dai_template = { .channels_min = 1, .channels_max = 8, .rates = SNDRV_PCM_RATE_8000_192000 | - SNDRV_PCM_RATE_KNOT, + SNDRV_PCM_RATE_12000 | + SNDRV_PCM_RATE_24000 | + SNDRV_PCM_RATE_128000, .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE, .subformats = SNDRV_PCM_SUBFMTBIT_MSBITS_20 | @@ -1343,7 +1331,9 @@ static const struct snd_soc_dai_driver i2s_dai_template = { .channels_min = 1, .channels_max = 8, .rates = SNDRV_PCM_RATE_8000_192000 | - SNDRV_PCM_RATE_KNOT, + SNDRV_PCM_RATE_12000 | + SNDRV_PCM_RATE_24000 | + SNDRV_PCM_RATE_128000, .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE, .subformats = SNDRV_PCM_SUBFMTBIT_MSBITS_20 | From patchwork Thu Sep 5 14:13:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13792444 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E26BBCD5BC8 for ; Thu, 5 Sep 2024 14:24:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=SMGhXEw0EMiOdueZyPaJHCVqWqxyBmUIEc+9ejnTuMw=; b=fqxzGZpth736sJNPM7OjmyVsOk NCnvP7PheBXmy/ES0/XZVlrjSNR5d79LpB6WEpCpUhBaHEegKaPdENzgR63CO6iP2jc/JO9AkNiF9 QqguENNh9Gef7HBbWCLwShOoMjRKnZoY/0QAvcgMZY2JGdvg59JFbRkCngKs1WH+QpOesn85Y2MRV AwH7CSYnoKCXNAGo3DNRSF+NicVP5d2Seuu082tsHcULs6oIRq+Ds6V+QeA7FQsMalEn/t7C2dcqD OMSm3H0jRS7MXllU+O33hDPMn21LO3gfFHz4u2sGze9DZUTmp+Vl36rXMTPDV3MKO0RvynAXqSYBo x86/CJYw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDPD-00000008hSm-3cXT; Thu, 05 Sep 2024 14:24:15 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDF2-00000008eyA-27AT for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 14:13:45 +0000 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-374d29ad870so488312f8f.3 for ; Thu, 05 Sep 2024 07:13:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1725545623; x=1726150423; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=SMGhXEw0EMiOdueZyPaJHCVqWqxyBmUIEc+9ejnTuMw=; b=zvAJFo/+x9FhEA8s9RIu1kMZ82HkxvZHRnv3uNPs4z9jeGt9x2+4bZnin0MmAQRMjt tWLdvX29MkF1bJL2WlXH8vZyFIG9lw8YkDsoh30iET9wL4n5lAiholdg+7g6hx9w/88d UWWRAt758QQLn7uaD9P4RyQNkOo010xPkB7t2y/ZbYuq4ZKaRpPvH+9piWA4TkdkgIzs YKL7JeRif9OiuoFhsvXZxkk/MRl6r+jn1V0bViT1yrhstp8QtoIND88zitHpPNwqHbgS QutUeal+PMBhVwcTOfpOjWi+hR64VWQZWNt1Kqss6kCdBM4Lz3emYpo+GMe7A+o1+urT zl8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725545623; x=1726150423; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=SMGhXEw0EMiOdueZyPaJHCVqWqxyBmUIEc+9ejnTuMw=; b=pS8OSm4mhR1vk3OTenwnuHn60lL+i5cnjl1YBgN2ZQxAMgBSfm1qjj+asKaYRQR9Gg bienTrupwKN8PcrrLbKfoWdoEGVEpB7a4tM1nWsLdFjhjA/RbkZU63ce/yCLNcu4QuhN SWVY+xAVd6U6Qgxcd5+WxeRDVvUhiltvSewISGQghspqTRlBYe5l/Qs/s557UgPln3JE y9PcQUioWR64xBCB01kxElg0Y20eqBaAASW9+IMRvEkY12uel1HLd9LrBvRWeBONj159 Qg+c67Ck2CM+/aaj7VQPej/h8R8lXcvlX3n8ktOWn4EhEmaaV6JR/dVBfwfw2RomhKTi duUw== X-Forwarded-Encrypted: i=1; AJvYcCWhempMimKNs1/E/5klkz42t38q0C5fuw9uaCQbApTBGkwWdC2jd2Fa25X0gw39fYPLhq8MKSbJGcdu5bY2FmjX@lists.infradead.org X-Gm-Message-State: AOJu0YxfNcu5m8zuOjdrEJFVDrhQdjcgKeXHqTQ1CQVLZH2e0c8ibzPI 1M7c+Pbcn8yHxHLekYdm5NgR9eJu4YhCWw2/S/DHMuj+pzUjCqnIzt8qZA79di4= X-Google-Smtp-Source: AGHT+IHBquwgcDoVsD6UjFSAJZlg+wE5YNTlLR8lb6J1pcatZPhdoPS1oDkj1/VU2ExhbxuANwuKeQ== X-Received: by 2002:adf:e592:0:b0:34d:ae98:4e7 with SMTP id ffacd0b85a97d-374bf1c7b74mr11792893f8f.41.1725545622875; Thu, 05 Sep 2024 07:13:42 -0700 (PDT) Received: from toaster.baylibre.com ([2a01:e0a:3c5:5fb1:4763:343b:23f3:f45]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3749ef81146sm19514621f8f.82.2024.09.05.07.13.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 07:13:42 -0700 (PDT) From: Jerome Brunet Date: Thu, 05 Sep 2024 16:13:01 +0200 Subject: [PATCH 10/13] ASoC: qcom: q6asm-dai: drop SNDRV_PCM_RATE_KNOT MIME-Version: 1.0 Message-Id: <20240905-alsa-12-24-128-v1-10-8371948d3921@baylibre.com> References: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> In-Reply-To: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> To: Jaroslav Kysela , Takashi Iwai , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Srinivas Kandagatla , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Jerome Brunet X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2940; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=XXaaAVjkchY/rqKPr1ocH7WdZ2HyLktu1KzKeahPou8=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBm2byGxo81ExacfBJI81+ntmOih8+z3ldyeNe5p 14qWKO8BtOJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCZtm8hgAKCRDm/A8cN/La hSBoD/9eW7KOYMCCavytluGtMs7KD2nL+UinfgARTNGDbqp5udgQ2B6jgk3T88uxIPdnxYUe3cj MjiyvaOUVqBJZlzj4NCJMzBEQY4ADrkc/UCpwYvzKCOaRm5UlDKwXsAnQIPZh/oL3+nc2hAY5dX yRLYnghzyXECZkDFTFo/MixLa4LoYMbD/lyKQrPBQzXXQK8UFfL8nQaHpVSiR22tFP9XgDKN2Yd /ufhKtaKHzuc1whFPon6rF5tBMwNrGmwJws406yr3+fZIBgIOFJjF/L/Ln6huP832EFvxStoPtD UJTiKpTxP4gqIbBCubzoQalXtJ3KIb05Jxdg3kGERNkhtnHxIpAH0UtMuDGLNHnhoXC/AzRGGMw Os6aIVYzFvb90va5lQxHbNBbS6h+bWCktz7t1FCiAHZXddfb3GA88MSew6NtAieiq8gba3O6Vu+ hNtDdt/5IKKYktss2RWYAb6Z3gAJKwWzfWE1edd7fWeo+cphCfD2cpI/Oj7xPECGdDn8xsZKwVM dVkosxTnKkC502b3DS64t+8SPm9Y9ZHD5se/X9kna6uaV6ScfLWh3wwFRZXrkB95RukPC/8CH83 EkPqzT4q1kZgT/oltlSBnTUPkW1BTMPEuEIrfmTi3TlO5b+KTWwHq4lQfDOJnIC9k775yfgUVx4 UQwYLqEzwD2MhVw== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_071344_582700_743D6CBF X-CRM114-Status: GOOD ( 14.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The custom rate constraint list was necessary to support 12kHz and 24kHz. These rates are now available through SNDRV_PCM_RATE_12000 and SNDRV_PCM_RATE_24000. Use them and drop the custom rate constraint rule. Signed-off-by: Jerome Brunet --- sound/soc/qcom/qdsp6/q6asm-dai.c | 31 ++++++++++--------------------- 1 file changed, 10 insertions(+), 21 deletions(-) diff --git a/sound/soc/qcom/qdsp6/q6asm-dai.c b/sound/soc/qcom/qdsp6/q6asm-dai.c index 3913706ccdc5..045100c94352 100644 --- a/sound/soc/qcom/qdsp6/q6asm-dai.c +++ b/sound/soc/qcom/qdsp6/q6asm-dai.c @@ -128,8 +128,13 @@ static const struct snd_pcm_hardware q6asm_dai_hardware_playback = { #define Q6ASM_FEDAI_DRIVER(num) { \ .playback = { \ .stream_name = "MultiMedia"#num" Playback", \ - .rates = (SNDRV_PCM_RATE_8000_192000| \ - SNDRV_PCM_RATE_KNOT), \ + .rates = (SNDRV_PCM_RATE_8000_48000 | \ + SNDRV_PCM_RATE_12000 | \ + SNDRV_PCM_RATE_24000 | \ + SNDRV_PCM_RATE_88200 | \ + SNDRV_PCM_RATE_96000 | \ + SNDRV_PCM_RATE_176400 | \ + SNDRV_PCM_RATE_192000), \ .formats = (SNDRV_PCM_FMTBIT_S16_LE | \ SNDRV_PCM_FMTBIT_S24_LE), \ .channels_min = 1, \ @@ -139,8 +144,9 @@ static const struct snd_pcm_hardware q6asm_dai_hardware_playback = { }, \ .capture = { \ .stream_name = "MultiMedia"#num" Capture", \ - .rates = (SNDRV_PCM_RATE_8000_48000| \ - SNDRV_PCM_RATE_KNOT), \ + .rates = (SNDRV_PCM_RATE_8000_48000 | \ + SNDRV_PCM_RATE_12000 | \ + SNDRV_PCM_RATE_24000), \ .formats = (SNDRV_PCM_FMTBIT_S16_LE | \ SNDRV_PCM_FMTBIT_S24_LE), \ .channels_min = 1, \ @@ -152,18 +158,6 @@ static const struct snd_pcm_hardware q6asm_dai_hardware_playback = { .id = MSM_FRONTEND_DAI_MULTIMEDIA##num, \ } -/* Conventional and unconventional sample rate supported */ -static unsigned int supported_sample_rates[] = { - 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000, - 88200, 96000, 176400, 192000 -}; - -static struct snd_pcm_hw_constraint_list constraints_sample_rates = { - .count = ARRAY_SIZE(supported_sample_rates), - .list = supported_sample_rates, - .mask = 0, -}; - static const struct snd_compr_codec_caps q6asm_compr_caps = { .num_descriptors = 1, .descriptor[0].max_ch = 2, @@ -390,11 +384,6 @@ static int q6asm_dai_open(struct snd_soc_component *component, else if (substream->stream == SNDRV_PCM_STREAM_CAPTURE) runtime->hw = q6asm_dai_hardware_capture; - ret = snd_pcm_hw_constraint_list(runtime, 0, - SNDRV_PCM_HW_PARAM_RATE, - &constraints_sample_rates); - if (ret < 0) - dev_info(dev, "snd_pcm_hw_constraint_list failed\n"); /* Ensure that buffer size is a multiple of period size */ ret = snd_pcm_hw_constraint_integer(runtime, SNDRV_PCM_HW_PARAM_PERIODS); From patchwork Thu Sep 5 14:13:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13792445 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D19E3CD5BC7 for ; Thu, 5 Sep 2024 14:25:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NInuXK75oVteTq8w9+Oc9GnjLQbH18gVkPWMAJJFJ/U=; b=lVX7Ty0OvIyB8fRvMvQ2Ttqqtw VDlqbybHPTw2yWhyHJOsJ0DOkFcNG8J+DxpJHHRri8uJaVag60O/AgIdb4W55ikIvjgouNyDMOPgl pzMrlgsIsYV8xlTanmLMh9zuVNf1r+VWgLDzbdi6gIBFu34sid7s3eLsffmzEbagAYjvbCdbgijXK aL/9hKUM/qFmEfExlabHz3npEwh6b8lqScuDxTioPejWIn0F1pAilROsIuZX43HFfZj9aeE0WwCsE 8NX6m0ZIr1tkv760+yWsTa0259GoOrxsWy4JzejTbt2OxXCk7NuUiYxhLxzQGn+xrgnaIb1drHzDl 4rMdd1xA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDQ8-00000008hdy-47HP; Thu, 05 Sep 2024 14:25:12 +0000 Received: from mail-wm1-x329.google.com ([2a00:1450:4864:20::329]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDF4-00000008eyY-15wC for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 14:13:47 +0000 Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-42c7bc97423so8869955e9.0 for ; Thu, 05 Sep 2024 07:13:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1725545624; x=1726150424; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=NInuXK75oVteTq8w9+Oc9GnjLQbH18gVkPWMAJJFJ/U=; b=A6pmHA6hefslJS5B0WUWIqtCPMITnw4hIGfU28XP4WPneYOR/T6PraIx1+lRbCVkW7 BB4Lys7CJW6wdHbFWPLSU5W09gLqyMjNIQhTqacfL92vVirmj6GWqRm9fUhVVv51p0hn H5IH6xoAvH9PsueylUy+y7zxsBUBN5Gs3Cg/wjmUE0M7p30Fs/NUhTQ6hYAG/GvxKahH 8mYJGt/Rl+6xh5vhxdxP94ZtZzaR2x9m0WtSrKJmBGfchysyXtafB7W7rXSi4ZadfXRY E1NYDtwYyRfHXBS+dt7GM7SLVh1Z6HhlCYyNIKZZL3R/5tdo2ZeNwW5d2yA5aI4MCFDC +KpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725545624; x=1726150424; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NInuXK75oVteTq8w9+Oc9GnjLQbH18gVkPWMAJJFJ/U=; b=d0DBpY0TTs/TDlmNw8nxy0WNh4iout5eIAVi8MjvejpqCmV1fnOAczdJIIK6mH/FqF HpKNFyiRBmzw228ihbyGN4OPm200HkiLoiMm5jx0ds7wr0XfIlc/3Bd6iMpzuG6uewCn 9sDxQgb/jikr3Nu45H6WbE1P9OSNraVPGCypN9/sqe3nqY0ye15RYj5Chpa4L2/yTTYG 8W6vUxJdcrLV9Ed98LMp7dQAUIrQOeO4NGZC2/jmIgEpTXAdHg7R3I1sG2xtMC9eRZTo Hh6vw1zzcaE8YqyhE8uiX3R882xFWwNEw5B348zDGEryWvGSXn+KWNsE8FpYwjgF3XrM V56g== X-Forwarded-Encrypted: i=1; AJvYcCXZteShBFkSyRRI+eW988NkqpU8fWGOOnh8McGmu6l7ovY2XmgGPRYCUQPblu+7FwlkdJ5z1wuQ9oyFyEGqWIqd@lists.infradead.org X-Gm-Message-State: AOJu0Yy1zo4vx9VAb9b2r2Fngu5Oy+5a/wXaWghEKUBEenlXoVUt/X+Z GVoQksO9NRNuUvyBJzt43rrcIYrsb6kj6hHpPP5CZRencCN8tQMY42LAZdEBCvg= X-Google-Smtp-Source: AGHT+IF1Rnp0BlEo/3O3FvtMVAQD9zYxpmEVsCSjem+AnuxVcV5GOUWE75yL3i/75iLee6d74WlhdA== X-Received: by 2002:a05:600c:4f4e:b0:426:5e8e:aa48 with SMTP id 5b1f17b1804b1-42c9a36ce9bmr25508875e9.22.1725545624078; Thu, 05 Sep 2024 07:13:44 -0700 (PDT) Received: from toaster.baylibre.com ([2a01:e0a:3c5:5fb1:4763:343b:23f3:f45]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3749ef81146sm19514621f8f.82.2024.09.05.07.13.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 07:13:43 -0700 (PDT) From: Jerome Brunet Date: Thu, 05 Sep 2024 16:13:02 +0200 Subject: [PATCH 11/13] ASoC: sunxi: sun4i-codec: drop SNDRV_PCM_RATE_KNOT MIME-Version: 1.0 Message-Id: <20240905-alsa-12-24-128-v1-11-8371948d3921@baylibre.com> References: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> In-Reply-To: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> To: Jaroslav Kysela , Takashi Iwai , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Srinivas Kandagatla , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Jerome Brunet X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2799; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=1uqZdGxPQGBnP8j4g6VlFe4rJuLJoGF/D9uni1/dnBU=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBm2byHCX1aj4AmJj1Q1JWPzGMx85ey7eOOxJr+R rAU5MJYHhGJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCZtm8hwAKCRDm/A8cN/La he0WD/9ZWAdHLFmtFB3mqYO/QGvuN52rpe1DwhCaM2ZCwcGDXqJ2yN32wMIZlvW2Ws2qBR7xuJq mZ6HjgYXOG0wJIW3Pe9fiUdRSxdJM7ILbnodGi7Mpb1b8f9TITFHjR9OCxaskxFs6MlMTsovZco TyhNEo7x4TbKgjNxELQKMqvTW4A7XA/Uz05XKJ1Ys0tZ/AsiJccuDCmv0Igy5VezRVRubCOjzwz A+2bUFPbOtq0OPrKr8Z2tfZkjKdR0RDuNcEV0SGtwWIijxxhlEy+eidNFq1tzVQbTTcPzNHObnu /iU5f7f3tExu0ipT1WcGmJrb6WePR8T5r/iQul8HGDekZnPnXDFutlqNZZsX5EYdOajvF4klddC mP7PzOAG0QHyZkgwOU7JwrwetBknkEeeA+KFAMKU/30+Q6bWsIXE9UDjBR9ZvxgWts8ey+nP8/o Z8LKus8tsEv23crdsPdSGzxJNQuC0x2SqBhoqk9e+Lk2qECPJorgQHhIANw6BMd0Mp43ugYA7J8 zqWrr6BzE3JtJKGjfH+Lyad+DpAmzLHAjEsoE9nvV8ZP9qdQq473Tbn1ePNgDQjkEdndiv5N2HA bUJdAvFHiQqTxVq/x7icSTe7dOwERMEm0XEF05xTExrKh1d8lbdlaIqbjp2sZbXHoI7Sy4/dOtC FIFFrECzeVOEwHg== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_071346_337113_7F5894B1 X-CRM114-Status: GOOD ( 15.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The custom rate constraint lists was necessary to support 12kHz and 24kHz. These rates are now available through SNDRV_PCM_RATE_12000 and SNDRV_PCM_RATE_24000. Use them and drop the custom rate constraint rule. Signed-off-by: Jerome Brunet --- sound/soc/sunxi/sun4i-codec.c | 28 +++++++++------------------- 1 file changed, 9 insertions(+), 19 deletions(-) diff --git a/sound/soc/sunxi/sun4i-codec.c b/sound/soc/sunxi/sun4i-codec.c index a2618ed650b0..25af47b63bdd 100644 --- a/sound/soc/sunxi/sun4i-codec.c +++ b/sound/soc/sunxi/sun4i-codec.c @@ -577,28 +577,12 @@ static int sun4i_codec_hw_params(struct snd_pcm_substream *substream, hwrate); } - -static unsigned int sun4i_codec_src_rates[] = { - 8000, 11025, 12000, 16000, 22050, 24000, 32000, - 44100, 48000, 96000, 192000 -}; - - -static struct snd_pcm_hw_constraint_list sun4i_codec_constraints = { - .count = ARRAY_SIZE(sun4i_codec_src_rates), - .list = sun4i_codec_src_rates, -}; - - static int sun4i_codec_startup(struct snd_pcm_substream *substream, struct snd_soc_dai *dai) { struct snd_soc_pcm_runtime *rtd = snd_soc_substream_to_rtd(substream); struct sun4i_codec *scodec = snd_soc_card_get_drvdata(rtd->card); - snd_pcm_hw_constraint_list(substream->runtime, 0, - SNDRV_PCM_HW_PARAM_RATE, &sun4i_codec_constraints); - /* * Stop issuing DRQ when we have room for less than 16 samples * in our TX FIFO @@ -626,6 +610,13 @@ static const struct snd_soc_dai_ops sun4i_codec_dai_ops = { .prepare = sun4i_codec_prepare, }; +#define SUN4I_CODEC_RATES ( \ + SNDRV_PCM_RATE_8000_48000 | \ + SNDRV_PCM_RATE_12000 | \ + SNDRV_PCM_RATE_24000 | \ + SNDRV_PCM_RATE_96000 | \ + SNDRV_PCM_RATE_192000) + static struct snd_soc_dai_driver sun4i_codec_dai = { .name = "Codec", .ops = &sun4i_codec_dai_ops, @@ -635,7 +626,7 @@ static struct snd_soc_dai_driver sun4i_codec_dai = { .channels_max = 2, .rate_min = 8000, .rate_max = 192000, - .rates = SNDRV_PCM_RATE_CONTINUOUS, + .rates = SUN4I_CODEC_RATES, .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE, .sig_bits = 24, @@ -646,7 +637,7 @@ static struct snd_soc_dai_driver sun4i_codec_dai = { .channels_max = 2, .rate_min = 8000, .rate_max = 48000, - .rates = SNDRV_PCM_RATE_CONTINUOUS, + .rates = SUN4I_CODEC_RATES, .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE, .sig_bits = 24, @@ -1233,7 +1224,6 @@ static const struct snd_soc_component_driver sun4i_codec_component = { #endif }; -#define SUN4I_CODEC_RATES SNDRV_PCM_RATE_CONTINUOUS #define SUN4I_CODEC_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ SNDRV_PCM_FMTBIT_S32_LE) From patchwork Thu Sep 5 14:13:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13792449 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 22F78CD5BC7 for ; Thu, 5 Sep 2024 14:26:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fVHTuNGWpcFrdg1z92VZwboxKWfkM9u5ktFj5pVRY10=; b=uvRcz8CJarCE/bstDmhGzecz1d Z8DRdmkOyxS5f8glr5j2se+fqYpn5hmc2BXoXp4CdxtOKfTUkAJZ9iWx75fxP6oYoS+q0slco/XfB cbPyBDbxxaMz8iXc2wwiAUWcQAQM0YR8XqoMa0TlEY9G9PMTVu2C84I8cBZG3wQ2LwgtUJI9V/0gK IPpej/JMdJPd97D+5w/so/wKDZ91SVj3ntQfGqjJFLY35+xwjU7MC6hEvpK3zTxOuahYn/oUaGeoj jbi9brwKDAFiEey+0v87kv/ObWzFHK4IwE0JtEMPSjI//5CjpRDB6qUgGSIIdunVPIirSB+RJhTHi Asj1WRQQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDR5-00000008hmV-07iO; Thu, 05 Sep 2024 14:26:11 +0000 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDF4-00000008eyi-3kPw for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 14:13:48 +0000 Received: by mail-wr1-x42d.google.com with SMTP id ffacd0b85a97d-374bfc395a5so529135f8f.0 for ; Thu, 05 Sep 2024 07:13:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1725545625; x=1726150425; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=fVHTuNGWpcFrdg1z92VZwboxKWfkM9u5ktFj5pVRY10=; b=lDYDcEuRTrvye6miiWyI3B6vG/Y5DXYhaRSYbOtwzDYiKXT9JsMId+7K4BpLHP/oOX qKQBqoA45mXLorrNh0m4yhyl8ykxxiz9RYwuyoXBGHGdDQl+pu6w5FcXAUwaiXgHbN4u fVXIwqTGoAoh2vtYySqAsZw6M7o3/pvaNJTuNG1F7uieCT69e0SySuaX1VZggbJoVuQd 3bS5sKNCAMt8dHmE53YGsCJL75jBNQSBcR6hxPsxGAZ2V1PMmi7BAq6MNm42546hbESX qW4TrMfeLRJxqrFimOfa7I9gyBdOhTnhXa6kWKo/uAhC4pAzukWZ5kq1i8UNtKouIQT6 J7dQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725545625; x=1726150425; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fVHTuNGWpcFrdg1z92VZwboxKWfkM9u5ktFj5pVRY10=; b=Yy3jgyamBc8cdwMP9wMjzHI4XA2a+W8OW/pFyyZc3KVXjJ13SZH83P0VsnhQ1ZXdn2 ddMe5RrgpSbao92m24PJjlMUdoRI9RllHNScTf9qL8I4yDLkL1IuP3oxyE+Crvz+Ebvw yvT/vcYDbVju46mHgkiRcpMXixUJenbxgC5JFHfXck8tv/TbRJvy1WGDOO5lq2cYwsqG M9NXmnMvp53QxFMnKiu+Hhq0/q2qy9C+/2q2Dk4PlxUvvgmP6bwy7zIW2oUqtXXVEGlc 43TEB5NCbrR4IteCG3Tc95XOR8HygzH5TcquGjLo2EqaEphEDOcs/bICeHVPHWSNScds Dnwg== X-Forwarded-Encrypted: i=1; AJvYcCXYKGKMC7zjh9d181PgcWxfUJlneuuly6kugH6Ao1+7uswL0RHFFuh4dxlqoRTuI0LsSoaQcPop2zy9HXIwUgrI@lists.infradead.org X-Gm-Message-State: AOJu0YxiD/vMEATtyYxzhZsScfTEWcD30WNNK/lnaSW/fqwjsumlBpQN aQU/CO9Mzbu/a9rympx7EZuI7q0idCt6KmzSUTXB3bOeFBaEi2aTyjiY/8NVT1Y= X-Google-Smtp-Source: AGHT+IHAt5Z9yvfW2N2+9sKeMO31xt1LKMyq74worjfNWzRpMuSL5RmIi0iCLuGFdoOTEvAgdLpsNg== X-Received: by 2002:adf:ee52:0:b0:374:c7cd:8818 with SMTP id ffacd0b85a97d-3779b847c99mr3905848f8f.22.1725545625178; Thu, 05 Sep 2024 07:13:45 -0700 (PDT) Received: from toaster.baylibre.com ([2a01:e0a:3c5:5fb1:4763:343b:23f3:f45]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3749ef81146sm19514621f8f.82.2024.09.05.07.13.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 07:13:44 -0700 (PDT) From: Jerome Brunet Date: Thu, 05 Sep 2024 16:13:03 +0200 Subject: [PATCH 12/13] ASoC: cs35l34: drop useless rate contraint MIME-Version: 1.0 Message-Id: <20240905-alsa-12-24-128-v1-12-8371948d3921@baylibre.com> References: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> In-Reply-To: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> To: Jaroslav Kysela , Takashi Iwai , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Srinivas Kandagatla , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Jerome Brunet X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1810; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=zpT7vKk5RwGNqc2qh5o2gdsxY4SIBJHwPSpJGqPGkl0=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBm2byHCu0z886qTeaxytjbJcYPUhvLKi6a5nmcQ KBa6BdBIQyJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCZtm8hwAKCRDm/A8cN/La hWBED/9N7WEhGEgo9YoopFhslbk0WKky2qk9oskEHauCvF+Zre638/Xs1VKjHXi5gaW9DFsewCe 8BXQmpqic/g4g/KZ1bSU1gtRPJzWuQUM2sbKRbPjwKl3ZjZY3skXMdvGDktmbmAUEjQfWYyaHGp Mx+5cb9seHfCb9CfRzA7CBAiPP9QKgLirL/w73Efii1rED79nzvGyZyiUotDKkV5jCOn6FQJumq 2kH2l4bM25BHOjvqtDCybOuKSbj7gxcC5aHitquhM9xq+pLrqkhPRa6z442lqP0GQNio182qG6a tIc3t4wI1L3D0bmggbA+qpNban+Ue2uHEMMlamtUZvCv45CGzqAbASvy0/rEos+HTWwVE0syyuL JpIFB4+crXOpQK5VoFJM1QBkYIHzuqFCN472OafDNVoVMS9d9QAQkn4UkaOoufUcAP3WZsBQ1wm QeWNgOVhBKM0MI9XohaVpY7JjPL2dzNlkWnHTFmWKBrew3BfxxImdzNm3eNalKpVXBQHwQJ3di8 26bAL9glcTCmq2VhAatgJCb3Xnuml1EF8l9LtKVa58KbBQRytqxBms114Bu0XK0mS1EzsfGzgLT a3nLAh2/+yq1IsqtNqQxdX9kmziJfWm6CZAgMhKfP3/5UJTczHgjPwpCTCZ222w1+iJ0I5R4BP7 cbzeB5PHdHllGJw== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_071346_983955_0500E8A8 X-CRM114-Status: GOOD ( 14.15 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The cs35l34 adds a useless rate constraint on startup. It does not set SNDRV_PCM_RATE_KNOT and the rates set are already a subset of the ones provided in the constraint list, so it is a no-op. From the rest of the code, it is likely HW supports more than the 32, 44.1 and 48kHz listed in CS35L34_RATES but there is no way to know for sure without proper documentation. Keep the driver as it is for now and just drop the useless constraint. Signed-off-by: Jerome Brunet Reviewed-by: Charles Keepax --- sound/soc/codecs/cs35l34.c | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/sound/soc/codecs/cs35l34.c b/sound/soc/codecs/cs35l34.c index e63a518e3b8e..287b27476a10 100644 --- a/sound/soc/codecs/cs35l34.c +++ b/sound/soc/codecs/cs35l34.c @@ -562,26 +562,6 @@ static int cs35l34_pcm_hw_params(struct snd_pcm_substream *substream, return ret; } -static const unsigned int cs35l34_src_rates[] = { - 8000, 11025, 12000, 16000, 22050, 24000, 32000, 44100, 48000 -}; - - -static const struct snd_pcm_hw_constraint_list cs35l34_constraints = { - .count = ARRAY_SIZE(cs35l34_src_rates), - .list = cs35l34_src_rates, -}; - -static int cs35l34_pcm_startup(struct snd_pcm_substream *substream, - struct snd_soc_dai *dai) -{ - - snd_pcm_hw_constraint_list(substream->runtime, 0, - SNDRV_PCM_HW_PARAM_RATE, &cs35l34_constraints); - return 0; -} - - static int cs35l34_set_tristate(struct snd_soc_dai *dai, int tristate) { @@ -639,7 +619,6 @@ static int cs35l34_dai_set_sysclk(struct snd_soc_dai *dai, } static const struct snd_soc_dai_ops cs35l34_ops = { - .startup = cs35l34_pcm_startup, .set_tristate = cs35l34_set_tristate, .set_fmt = cs35l34_set_dai_fmt, .hw_params = cs35l34_pcm_hw_params, From patchwork Thu Sep 5 14:13:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerome Brunet X-Patchwork-Id: 13792450 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E1CC7CD5BC8 for ; Thu, 5 Sep 2024 14:27:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References :Message-Id:Content-Transfer-Encoding:Content-Type:MIME-Version:Subject:Date: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=u3kylnJVXfNp6rw3d/1irQrhp19zNyQdKhcZsUU9cnk=; b=Q/tqPZmie+uBDqXo2nYs/NR2Wv 2+VXWr0urp10LlzZmbY1ZQDY8FxEftRyAldalLzGF2MicaR/UPYei2KJS7McTADf1eOl716g/atNk o5CkCbBxp6pPiQSXO5TX3iU+pU2m2ebhUfkoB02xkxCCABRjFoeXy8pQ1+4tTxVj46UFHM3IWTsai VFZLGTpljDZb3BhrIsKzoCMNWB8GQctP2/jNdRyIANlhNYCNVblhzwSZryS/0FPoDZeSueIOgea6i A58LTEmR0ZKN/XZF9yhgPuiKDtzNzW0w8FQNI1zF9CwYjzCHkS/roESv5AxS7kVLufI1eK7YVOzn5 Yw8mp1WA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDS0-00000008i2U-1gNo; Thu, 05 Sep 2024 14:27:08 +0000 Received: from mail-wm1-x334.google.com ([2a00:1450:4864:20::334]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1smDF6-00000008ezl-3Hdz for linux-arm-kernel@lists.infradead.org; Thu, 05 Sep 2024 14:13:50 +0000 Received: by mail-wm1-x334.google.com with SMTP id 5b1f17b1804b1-42bb885f97eso11299385e9.0 for ; Thu, 05 Sep 2024 07:13:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1725545627; x=1726150427; darn=lists.infradead.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=u3kylnJVXfNp6rw3d/1irQrhp19zNyQdKhcZsUU9cnk=; b=dLtfnG7IrfTZfAnwTP3j9u7B4YNF6Gr2jHLeqqdiK59MZHUa8QT1+CeuaNjbevP++2 rkFzCxiVe66VVh4Bm1A5bmScSh/o+puYhxXfZvTakIvGu9BMyIHXOD8ASumdOXP7lo/D 3MECkb9vafwZu8xP6sUDgfmwexHpZVwlSVUFGF/8LJK0xIk8GPc80frzhb/U+jMUAdUK tUAKuBUJ9eGMBPvybOZQe5UX8pxMkNp+oOee1P3/mZQU306kbWPIgUq4CzHrlp/egakT Fv7xUUiZmS8g1xbaEwHOOoKzMu8FSlQm6oklNslvwTnSgxwiY2pkV7+zXrGTStvRBt/B OSrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725545627; x=1726150427; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=u3kylnJVXfNp6rw3d/1irQrhp19zNyQdKhcZsUU9cnk=; b=OXsMJvssxFgQH1qNG6LG7L9JtdJyqka4ZOdbl2ilKgflaald9RElTp9Pra4nolOFw6 jxKRv+Joyhn7zxZ8xkrRh6kw9FEenLKwzFfUJKHHIWif474JkgGunD5+Kbz1GKAaLaQM aSDUBTAJ5bXC3T/JiRTw3GbV0T6rUTaAn3Ob0nMr9yfmmP1GgW0yXjTawSy9/kPiqPM+ QboqIlkVrl/RCrXdqVrTOZ+x5sBhKXbCk4Fx4kfvm7aXMhyGgOA9YDJN2QO4/isv52VY 1AgVNPRNQIsjRWyZKwerLNSG0/PAjJJ2b+sAHsMakeZw+YleDnvRmbkU/4SNsuT7vN0R jUHg== X-Forwarded-Encrypted: i=1; AJvYcCUe4CySeeiRRDYskh6osEBMKRVPSwxw49ZPU/6Cvk+T0jKzGFpbKm1s75LdcKPu0UGn0Gf4nZ4cLHTNtS6TbsVz@lists.infradead.org X-Gm-Message-State: AOJu0YyvJpO4kbJ+bk3R4UZM2Gwjrs79rwX2R6QPWpACPZx4+nPEatK4 GURX3QwwXv5hxmMKh8BpNFXOsfsYoxh+TRny9GiaqoKMjnM0SPwbUN06AuKWAQc= X-Google-Smtp-Source: AGHT+IFM7C/kDhVKsqo8gQ6poeqRmyyUiqotKRoAB2OwlkxpEQHF6JubaidKOiZBM8wLmGV88wvgwA== X-Received: by 2002:adf:f745:0:b0:374:bd00:d1e with SMTP id ffacd0b85a97d-377998aafbcmr3833233f8f.3.1725545626528; Thu, 05 Sep 2024 07:13:46 -0700 (PDT) Received: from toaster.baylibre.com ([2a01:e0a:3c5:5fb1:4763:343b:23f3:f45]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-3749ef81146sm19514621f8f.82.2024.09.05.07.13.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Sep 2024 07:13:46 -0700 (PDT) From: Jerome Brunet Date: Thu, 05 Sep 2024 16:13:04 +0200 Subject: [PATCH 13/13] ASoC: spdif: extend supported rates to 768kHz MIME-Version: 1.0 Message-Id: <20240905-alsa-12-24-128-v1-13-8371948d3921@baylibre.com> References: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> In-Reply-To: <20240905-alsa-12-24-128-v1-0-8371948d3921@baylibre.com> To: Jaroslav Kysela , Takashi Iwai , David Rhodes , Richard Fitzgerald , Liam Girdwood , Mark Brown , Cezary Rojewski , Pierre-Louis Bossart , Liam Girdwood , Peter Ujfalusi , Bard Liao , Ranjani Sridharan , Kai Vehmanen , Srinivas Kandagatla , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland Cc: linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, patches@opensource.cirrus.com, alsa-devel@alsa-project.org, linux-arm-msm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, Jerome Brunet X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1441; i=jbrunet@baylibre.com; h=from:subject:message-id; bh=HGKKWuwE3+8ouI0WFbu/VAtPy+LRBtX+ATMaNod25ho=; b=owEBbQKS/ZANAwAKAeb8Dxw38tqFAcsmYgBm2byIdu+85ezuHy93WyoVP+yWVeGiEH5uiklbm ulYpPtqetGJAjMEAAEKAB0WIQT04VmuGPP1bV8btxvm/A8cN/LahQUCZtm8iAAKCRDm/A8cN/La hSFOD/9TXxTKB/AmL9i5/scP75UlZWF2gxl0FZzdSxtB9odmLY4QtohIVqBLWKF/m10g5rOpk+x eUR9f+9WMuTP6Ya1RfwSxUydN9Vc/CGtInW+6uPNAQq9ucANTIRbu/ZwEjpoyraXshUAXjaq6ky i0TlxG4s7qKuY/0ZLoQLKSylnqxgUEqxPMGe/ys5q6eqbJAF8Z5wmgu0efKW+a2HPZsFkATOaUA HNR5J4aoEDZ+YlNh79i9yFG5Cfv0BuZp2s7wKrE6/xbN5pe7STe2mPjnaLtLzjJunezCPpgOR5g zFXVHXXxuS518z0uYjIp1Lu8LsE+Hok0Yy+1hMNvd+jctg0iQWNxZ9Y8YflraJ8/HnSpZPeQJgr ajQDDm9amsoB6wGM7YpsQiE7GTN+cA0QMRlp30521hVu/6yeCEDqZyW+8qkdtDIt1EJb3JhMsx4 VzLTkeMEdHtWZ2GXKlfNvNaWYnksLfi6q2C7T08h05VzXkohE8jSmP9WHeoPMFtMG8rnjXN9Rrx 6mwyHNApsEomVX5gx0JcJxBDpXKKW5Ny6b6KTDXQus4C+j+lF1E3NndGyGbZX2uDtBDEERybCRF 4Rpja3xmwdlmvg31mLCavX9pnnV9xJGyiSS0z6e4s/b2yBf/m7IIBNzHuKZY6LpRt186CTo7+ze OH0S7WtKYhGB5nQ== X-Developer-Key: i=jbrunet@baylibre.com; a=openpgp; fpr=F29F26CF27BAE1A9719AE6BDC3C92AAF3E60AED9 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240905_071348_853998_816A4C43 X-CRM114-Status: GOOD ( 12.49 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org IEC958-3 defines sampling rate up to 768 kHz. Such rates maybe used with high bandwidth IEC958 links, such as eARC. Signed-off-by: Jerome Brunet --- sound/soc/codecs/spdif_receiver.c | 3 ++- sound/soc/codecs/spdif_transmitter.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/spdif_receiver.c b/sound/soc/codecs/spdif_receiver.c index 862e0b654a1c..310123d2bb5f 100644 --- a/sound/soc/codecs/spdif_receiver.c +++ b/sound/soc/codecs/spdif_receiver.c @@ -28,7 +28,8 @@ static const struct snd_soc_dapm_route dir_routes[] = { { "Capture", NULL, "spdif-in" }, }; -#define STUB_RATES SNDRV_PCM_RATE_8000_192000 +#define STUB_RATES (SNDRV_PCM_RATE_8000_768000 | \ + SNDRV_PCM_RATE_128000) #define STUB_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ SNDRV_PCM_FMTBIT_S20_3LE | \ SNDRV_PCM_FMTBIT_S24_LE | \ diff --git a/sound/soc/codecs/spdif_transmitter.c b/sound/soc/codecs/spdif_transmitter.c index 736518921555..db51a46e689d 100644 --- a/sound/soc/codecs/spdif_transmitter.c +++ b/sound/soc/codecs/spdif_transmitter.c @@ -21,7 +21,8 @@ #define DRV_NAME "spdif-dit" -#define STUB_RATES SNDRV_PCM_RATE_8000_192000 +#define STUB_RATES (SNDRV_PCM_RATE_8000_768000 | \ + SNDRV_PCM_RATE_128000) #define STUB_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | \ SNDRV_PCM_FMTBIT_S20_3LE | \ SNDRV_PCM_FMTBIT_S24_LE | \