From patchwork Thu Mar 9 15:21:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emil Abildgaard Svendsen X-Patchwork-Id: 661134 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 C6B32C74A4B for ; Thu, 9 Mar 2023 20:45:33 +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 66AA318B2; Thu, 9 Mar 2023 21:44:41 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 66AA318B2 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1678394731; bh=sClGgJMOqiLyR5gJzID1/eRHH03dcO6tGY9/YjY3dOE=; h=To:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From:Reply-To:Cc:From; b=bbMP058mRRgm1UEkikG8sForbjNbxehus/BAXV/ssM/oZZDSCZmDLtpRNjT3Yj/dL MimIS7HhCq7klN2NHDKNbzLofLMZbaBJOVfYnEG+iQ8VB2HG3HxLnOcFGeZpYS9yuj t2gp8MdkjnuwW1G4tjmVv4AtztqjuEj75zuScaPw= Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id C9D19F804FE; Thu, 9 Mar 2023 21:44:03 +0100 (CET) To: "broonie@kernel.org" , "lgirdwood@gmail.com" , "tiwai@suse.com" Subject: [PATCH] ASoC: hdmi-codec: fix inverted tx in shutdown/startup Date: Thu, 9 Mar 2023 15:21:59 +0000 X-Mailman-Rule-Hits: nonmember-moderation 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 X-Mailman-Approved-At: Thu, 09 Mar 2023 20:44:01 +0000 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: MIME-Version: 1.0 Message-ID: <167839464271.26.16975349743399016667@mailman-core.alsa-project.org> X-Patchwork-Original-From: Emil Abildgaard Svendsen via Alsa-devel From: Emil Abildgaard Svendsen Reply-To: Emil Abildgaard Svendsen Cc: =?windows-1252?q?Alvin_=8Aipraga?= , "alsa-devel@alsa-project.org" , "linux-patches@vger.kernel.org" , Emil Abildgaard Svendsen Content-Disposition: inline Fix ignore logic on shutdown and startup. It broke single cpu single hdmi-codec with a single supported stream direction. Inverting TX fixes it. Truth table for when to ignore. +--------------+----+--------+-----+ +--------+-----+ | has_playback | has_capture | TX | | Before | Now | +--------------+-------------+-----+ +--------+-----+ | 0 | 0 | 0 | | 1 | 1 | +--------------+-------------+-----+ +--------+-----+ | 0 | 0 | 1 | | 1 | 1 | +--------------+-------------+-----+ +--------+-----+ | 0 | 1 | 0 | | 1 | 0 | +--------------+-------------+-----+ +--------+-----+ | 0 | 1 | 1 | | 0 | 1 | +--------------+-------------+-----+ +--------+-----+ | 1 | 0 | 0 | | 0 | 1 | +--------------+-------------+-----+ +--------+-----+ | 1 | 0 | 1 | | 1 | 0 | +--------------+-------------+-----+ +--------+-----+ | 1 | 1 | 0 | | 0 | 0 | +--------------+-------------+-----+ +--------+-----+ | 1 | 1 | 1 | | 0 | 0 | +--------------+-------------+-----+ +--------+-----+ Signed-off-by: Emil Svendsen Link: https://lore.kernel.org/r/20230308125503.3917903-1-emas@bang-olufsen.dk --- sound/soc/codecs/hdmi-codec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/hdmi-codec.c b/sound/soc/codecs/hdmi-codec.c index e111d9e60233..6d980fbc4207 100644 --- a/sound/soc/codecs/hdmi-codec.c +++ b/sound/soc/codecs/hdmi-codec.c @@ -432,7 +432,7 @@ static int hdmi_codec_startup(struct snd_pcm_substream *substream, bool has_playback = !hcp->hcd.no_i2s_playback; int ret = 0; - if (!((has_playback && !tx) || (has_capture && tx))) + if (!((has_playback && tx) || (has_capture && !tx))) return 0; mutex_lock(&hcp->lock); @@ -477,7 +477,7 @@ static void hdmi_codec_shutdown(struct snd_pcm_substream *substream, bool has_capture = !hcp->hcd.no_i2s_capture; bool has_playback = !hcp->hcd.no_i2s_playback; - if (!((has_playback && !tx) || (has_capture && tx))) + if (!((has_playback && tx) || (has_capture && !tx))) return; hcp->chmap_idx = HDMI_CODEC_CHMAP_IDX_UNKNOWN;