From patchwork Mon Sep 18 13:39:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 13389650 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 583F0C46CA1 for ; Mon, 18 Sep 2023 13:44:44 +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 4254AAE8; Mon, 18 Sep 2023 15:43:52 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4254AAE8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1695044682; bh=Gz/1+njUgLxx9Rz/XETZUFmZSy5upBn6Lrtgnmkm43M=; 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=o4twSARZkii7SRBwib45Yrtuu7niGG8/ZfD5iKsvoRHxwJntnxc9sCBJIN2pm3X7i k0UsiKUi2xt+uwmXaRt1Z5q9lnBXsXXkOWr+uWfbaRi1YcuYhiOd4JW/Gxt6SlMYQz L7QWHUa9g92aYB1y7ddbvUoS0l8XekR+/DclfVA8= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 96544F80606; Mon, 18 Sep 2023 15:40:57 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id EAD6FF80606; Mon, 18 Sep 2023 15:40:56 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 09775F805D3; Mon, 18 Sep 2023 15:40:42 +0200 (CEST) Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.43]) (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 A7E0CF8025A for ; Mon, 18 Sep 2023 15:40:34 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz A7E0CF8025A 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=LcALRODS DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695044435; x=1726580435; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=Gz/1+njUgLxx9Rz/XETZUFmZSy5upBn6Lrtgnmkm43M=; b=LcALRODSaV3o4+dC2KySlxz+z7JcJB5zvyMxG730Prgs6tCXUnF2eAUq XF7tTnLzPhQFF/wI8KodIyXRbUCDV+1IWsnK/epLbL5QkTN1ME5VAcSOT 7NMnvToqWPesWIcYYlvY4B8t5zxE+GoqV5v9jAmKxp5g/E27azPiX6SLO bPiWzo9bgoqPc6qRG5M2sEbW5rYqsHSzQvVw8v/+NmEnnoYJnTfb11gi/ hRZe5HYW+e/62Anxf1lOcu+gdezOSp4r7iaay9rftA/CwG1X6zx8K8vR2 1oAtr0PvCC/H1r2Rr7x79nUqUhn+8IHpACyC3UkgzX0q+IcGRzpRJxsrW Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="466003827" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="466003827" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Sep 2023 06:40:26 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="745825977" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="745825977" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orsmga002.jf.intel.com with ESMTP; 18 Sep 2023 06:40:24 -0700 From: Cezary Rojewski To: broonie@kernel.org, tiwai@suse.com, perex@perex.cz Cc: alsa-devel@alsa-project.org, amadeuszx.slawinski@linux.intel.com, pierre-louis.bossart@linux.intel.com, hdegoede@redhat.com, Cezary Rojewski Subject: [PATCH v2 10/17] ASoC: codecs: hdac_hda: Switch to new stream-format interface Date: Mon, 18 Sep 2023 15:39:33 +0200 Message-Id: <20230918133940.3676091-11-cezary.rojewski@intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230918133940.3676091-1-cezary.rojewski@intel.com> References: <20230918133940.3676091-1-cezary.rojewski@intel.com> MIME-Version: 1.0 Message-ID-Hash: QW6VJIFST2OART4U2X7M2WMQR2S4MEXT X-Message-ID-Hash: QW6VJIFST2OART4U2X7M2WMQR2S4MEXT 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 be66853afbe2..7e308dac07d4 100644 --- a/sound/soc/codecs/hdac_hda.c +++ b/sound/soc/codecs/hdac_hda.c @@ -207,18 +207,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",