From patchwork Mon Sep 18 13:39:34 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cezary Rojewski X-Patchwork-Id: 13389649 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 DD446C46CA1 for ; Mon, 18 Sep 2023 13:44:19 +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 F40671EC; Mon, 18 Sep 2023 15:43:26 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz F40671EC DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1695044657; bh=4UOEvn702N4fihUnjUfPGzlzRNBWx+HvAKvLncMaRwQ=; 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=hHXBM7F5nQOYWKFRrfqOq0bEjteXyDNYDkrExUFgmlfWpGGRAQf3DcjxPviUdMiVo cCYmJQqD0v4KaA0PadWm0hUeiYifmuPBzDVCEN4N62rWh5ymPsNI92ZuVIm173UEN8 Wcvw40vtkLk88RTIODLPe4Nq8jMTKtFVDnelAcDs= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 0AAFBF805FB; Mon, 18 Sep 2023 15:40:54 +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 8D1F3F805F7; Mon, 18 Sep 2023 15:40:54 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id E9DADF805C2; Mon, 18 Sep 2023 15:40:39 +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 313D9F805B1 for ; Mon, 18 Sep 2023 15:40:35 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 313D9F805B1 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=nYBgDER3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695044436; x=1726580436; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=4UOEvn702N4fihUnjUfPGzlzRNBWx+HvAKvLncMaRwQ=; b=nYBgDER3KR0fhpq+ES36uiASW9vXKxVFG+ENRsRHBnAdWP2bDg0Zh65S xyYWprWgVVzJcyrYkgQkHjSmtiyu0LTCLzGYfm8urlAoiBJ3etKx7vjo7 XspjhWydb0Y7/X/hMMvZADYnZ652suZP+0mYUSgjJLomMOrSeNtuKtthO GRK8AKV7j7DsdXnFfjmPBEofj3G+KnfbwwH6j/beU+sZB+NKJDP8AOVhv u4yR27NjwUH0LThFnWPUjnu+WBmKMwC5e1Kh72NTI/N0rhq31+3wV+Geg CDKR+/BD+gPOMC7fX/kVgWWLGT4S7SMPq/cxbZFBGahxaDLoc4D8yr6lI g==; X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="466003834" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="466003834" 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:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10837"; a="745825997" X-IronPort-AV: E=Sophos;i="6.02,156,1688454000"; d="scan'208";a="745825997" Received: from crojewsk-ctrl.igk.intel.com ([10.102.9.28]) by orsmga002.jf.intel.com with ESMTP; 18 Sep 2023 06:40:26 -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 11/17] ASoC: codecs: hdac_hdmi: Switch to new stream-format interface Date: Mon, 18 Sep 2023 15:39:34 +0200 Message-Id: <20230918133940.3676091-12-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: WKTD5ZKWPUJXI32DIYSM5CEDUMRKGHEN X-Message-ID-Hash: WKTD5ZKWPUJXI32DIYSM5CEDUMRKGHEN 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_hdmi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/hdac_hdmi.c b/sound/soc/codecs/hdac_hdmi.c index 3e4f632d8665..824fb4862f22 100644 --- a/sound/soc/codecs/hdac_hdmi.c +++ b/sound/soc/codecs/hdac_hdmi.c @@ -468,13 +468,14 @@ static int hdac_hdmi_set_hw_params(struct snd_pcm_substream *substream, struct hdac_hdmi_priv *hdmi = snd_soc_dai_get_drvdata(dai); struct hdac_hdmi_dai_port_map *dai_map; struct hdac_hdmi_pcm *pcm; + unsigned int bps; int format; dai_map = &hdmi->dai_map[dai->id]; - format = snd_hdac_calc_stream_format(params_rate(hparams), - params_channels(hparams), params_format(hparams), - dai->driver->playback.sig_bits, 0); + bps = snd_hdac_stream_format_bps(params_format(hparams), SNDRV_PCM_SUBFORMAT_STD, + dai->driver->playback.sig_bits); + format = snd_hdac_stream_format(params_channels(hparams), bps, params_rate(hparams)); pcm = hdac_hdmi_get_pcm_from_cvt(hdmi, dai_map->cvt); if (!pcm)