From patchwork Mon Sep 18 13:39:36 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 13389651 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 1C4B8CD37B0 for ; Mon, 18 Sep 2023 13:44:58 +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 4E87B20C; Mon, 18 Sep 2023 15:44:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 4E87B20C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1695044696; bh=FfBIQhnDOMOczPVWM3Pz9qcen/kHIrK/vME9pRWKLoA=; 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=PQc6ENxe20yoBOi1cSciWb6iOnLSsYCDoGFPewmIp0sMJ2orGNEx6kmurdkjkSMNh YM/ztzwynkL5N+uv6FityDQxCNNHH+SwTnFUucS0Gnw5ql9eQbBFpCBx2H+gcxSgo5 aOOQyqlD1KB9fyN7OECJ/6z7i7eS1F0ZcaWbEv6g= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 3CD58F80614; Mon, 18 Sep 2023 15:41:01 +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 5E0C5F80613; Mon, 18 Sep 2023 15:41:00 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 21317F805D3; 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 C604FF805C0 for ; Mon, 18 Sep 2023 15:40:36 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz C604FF805C0 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=b4OVX7/y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695044438; x=1726580438; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=FfBIQhnDOMOczPVWM3Pz9qcen/kHIrK/vME9pRWKLoA=; b=b4OVX7/yL/ofTUWSrg5TKlxcucpmUiF/ggLnchVHO/NEQTiRP46mFl3r D5GOm2th5Pjz5w4iKWs3reGl0NPtOXOJ/DfpH13AZ5GAuFO3ZKTEiXttP j+UhiSr1i+0yUuWBxkHeHsDLtOUwzH8fYt42tz+OG2Mp/c5fWxZreDk3i zbgccmCJGIBIsCRnTbC4NU+YObjjFJQVoyo0p7CEsE92ECGJgOLgvj3nr UhvOS37ZRrDIu48KCECFL0UIeKvrBavzw2jqJHAGedGF0U4/yCPt6PWbe 2R0gBa4p8yrjzpRaec14Spcxve28G9HSln5IrnPj63J/q375SJ+yMu222 g==; X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="466003850" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="466003850" 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:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="745826038" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="745826038" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orsmga002.jf.intel.com with ESMTP; 18 Sep 2023 06:40:30 -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 13/17] ASoC: SOF: Intel: Switch to new stream-format interface Date: Mon, 18 Sep 2023 15:39:36 +0200 Message-Id: <20230918133940.3676091-14-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: WW6UKULWOBAPAEG4PDBN4NKWEP72SGI7 X-Message-ID-Hash: WW6UKULWOBAPAEG4PDBN4NKWEP72SGI7 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/sof/intel/hda-dai-ops.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sound/soc/sof/intel/hda-dai-ops.c b/sound/soc/sof/intel/hda-dai-ops.c index 494ced2b746e..fb5989888ff4 100644 --- a/sound/soc/sof/intel/hda-dai-ops.c +++ b/sound/soc/sof/intel/hda-dai-ops.c @@ -208,14 +208,15 @@ static unsigned int hda_calc_stream_format(struct snd_sof_dev *sdev, struct snd_soc_dai *codec_dai = asoc_rtd_to_codec(rtd, 0); unsigned int link_bps; unsigned int format_val; + unsigned int bps; if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) link_bps = codec_dai->driver->playback.sig_bits; else link_bps = codec_dai->driver->capture.sig_bits; + bps = snd_hdac_stream_format_bps(params_format(params), SNDRV_PCM_SUBFORMAT_STD, link_bps); - format_val = snd_hdac_calc_stream_format(params_rate(params), params_channels(params), - params_format(params), link_bps, 0); + format_val = snd_hdac_stream_format(params_channels(params), bps, params_rate(params)); dev_dbg(sdev->dev, "format_val=%#x, rate=%d, ch=%d, format=%d\n", format_val, params_rate(params), params_channels(params), params_format(params));