From patchwork Thu Nov 16 11:22:48 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 744454 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 24149C54FB9 for ; Thu, 16 Nov 2023 11:24:41 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 7A43D829; Thu, 16 Nov 2023 12:23:49 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 7A43D829 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1700133879; bh=kbupxWkleH9GdPSf9XvomWn0I/aCj77+qUF28ZlW3tc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=n8b2+Da/VXIJ6pi2mNoz6V/ANHKKOF1gUv0PDFJU5n/6UHy764mgDXzs4x/Zp+L9C gyvWQKAz4ZimJBvhMD8p3M7A21XlNk0/g9YdA2u37UCsD/oxqe+TzuBdImLOfK5Nvb IMMUCQ9xsuyK+RBGu86VyNgVk0g23Cf9pb9gwzH4= Received: by alsa1.perex.cz (Postfix, from userid 50401) id B76FDF805C3; Thu, 16 Nov 2023 12:22:23 +0100 (CET) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id C921FF805BD; Thu, 16 Nov 2023 12:22:21 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id EB4B0F8057F; Thu, 16 Nov 2023 12:22:13 +0100 (CET) Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 1C11DF8055C for ; Thu, 16 Nov 2023 12:22:00 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 1C11DF8055C Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=bz51cOzt DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1700133722; x=1731669722; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=kbupxWkleH9GdPSf9XvomWn0I/aCj77+qUF28ZlW3tc=; b=bz51cOztdq9E4T7ZdWsVTDoCnQo8lYzaIGWIJj2wKNXIiKwtYsNBq50H xT5UyaCdDStFUp4QAmoIxl6r3GvikHtEipuBJQO6GVl4YsntQ1wH/LFBW AX5yMtzbe/jQimc6h7iCMQxAgRv5irQ8m80UHgsDdVCCHZdoYRTTktSgb X+C9DK66kZekiEG150BkXEhY4JIl5AnA4pt5+zSvUCwNjnYoEIX1C9QY2 kwIpwDWDRXKFPTP2lbzN1smlRYT9P9gqexTCSaMuX7FpZpWeHAi4yCCv+ aJaYyDglstlU2R4kcNkd8OshLf2RLAaXL1dv8hA2308oC+jFRldZt1ENe w==; X-IronPort-AV: E=McAfee;i="6600,9927,10895"; a="457562024" X-IronPort-AV: E=Sophos;i="6.03,308,1694761200"; d="scan'208";a="457562024" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Nov 2023 03:21:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.03,308,1694761200"; d="scan'208";a="6698240" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by fmviesa002.fm.intel.com with ESMTP; 16 Nov 2023 03:21:57 -0800 From: Cezary Rojewski To: broonie@kernel.org, tiwai@suse.com, perex@perex.cz Cc: alsa-devel@alsa-project.org, linux-sound@vger.kernel.org, amadeuszx.slawinski@linux.intel.com, pierre-louis.bossart@linux.intel.com, hdegoede@redhat.com, Cezary Rojewski Subject: [PATCH v4 09/16] ASoC: codecs: hdac_hda: Switch to new stream-format interface Date: Thu, 16 Nov 2023 12:22:48 +0100 Message-Id: <20231116112255.1584795-10-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20231116112255.1584795-1-cezary.rojewski@intel.com> References: <20231116112255.1584795-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Message-ID-Hash: IG2JCKBQBX67YZMF5UH4XOCBJJU2U7EX X-Message-ID-Hash: IG2JCKBQBX67YZMF5UH4XOCBJJU2U7EX X-MailFrom: cezary.rojewski@intel.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: To provide option for selecting different bit-per-sample than just the maximum one, use the new format calculation mechanism. Acked-by: Mark Brown Signed-off-by: Cezary Rojewski --- sound/soc/codecs/hdac_hda.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/sound/soc/codecs/hdac_hda.c b/sound/soc/codecs/hdac_hda.c index 355f30779a34..c08375672661 100644 --- a/sound/soc/codecs/hdac_hda.c +++ b/sound/soc/codecs/hdac_hda.c @@ -215,18 +215,16 @@ static int hdac_hda_dai_hw_params(struct snd_pcm_substream *substream, struct hdac_hda_priv *hda_pvt; unsigned int format_val; unsigned int maxbps; + unsigned int bps; if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) maxbps = dai->driver->playback.sig_bits; else maxbps = dai->driver->capture.sig_bits; + bps = snd_hdac_stream_format_bps(params_format(params), SNDRV_PCM_SUBFORMAT_STD, maxbps); hda_pvt = snd_soc_component_get_drvdata(component); - format_val = snd_hdac_calc_stream_format(params_rate(params), - params_channels(params), - params_format(params), - maxbps, - 0); + format_val = snd_hdac_stream_format(params_channels(params), bps, params_rate(params)); if (!format_val) { dev_err(dai->dev, "invalid format_val, rate=%d, ch=%d, format=%d, maxbps=%d\n",