From patchwork Mon Oct 9 15:34:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 732577 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 C6357E95A96 for ; Mon, 9 Oct 2023 15:35:39 +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 3B6B9E10; Mon, 9 Oct 2023 17:34:47 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3B6B9E10 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1696865737; bh=028i+ogXB7F2kcZGDEuBAzQV6ZwCoTjJCoT8Xzj9/P8=; h=From:To:CC:Subject:Date:List-Id:List-Archive:List-Help:List-Owner: List-Post:List-Subscribe:List-Unsubscribe:From; b=dNcNWMoZSrdEWx42jggHbuKhvi6CavlGucf7Gph+Ok7aux1X37xBwk1XpHWwQGP/G VTbppGn2EZ+8XyHjxHsnELSoxdRj8OqZ4fgQHUiqgGZLsKHTfh2w/3yUzZUaha+8UW VZXArR5Lv3R3QAfbjtsNGYAuUuM/DZ5L4ERAu+/A= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 04C6FF80557; Mon, 9 Oct 2023 17:34:36 +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 67B23F80130; Mon, 9 Oct 2023 17:34:36 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 6BAEAF802BE; Mon, 9 Oct 2023 17:34:30 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) (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 8ABA6F80130 for ; Mon, 9 Oct 2023 17:34:21 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8ABA6F80130 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=cirrus.com header.i=@cirrus.com header.a=rsa-sha256 header.s=PODMain02222019 header.b=QsaUCaqh Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 3998HnwY015992; Mon, 9 Oct 2023 10:34:18 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding:content-type; s=PODMain02222019; bh=Y F8GMFdoqe5hznvMm3y2/t2RPeHrqis4CldRU1rABgw=; b=QsaUCaqh1Wbzs/Jt3 f+uizHqbTqVVG/3d3v3SYpbStO7gPr7zGJVJxmc4dnjHj2wXE1MrekR9+7+wzy0g 9/6u/eF+q0s7KcltCJjoWflfX16EdKiuqFPN30k9WVg+x9OOUNekPs0nmeEntNGN ySUion/ca1y/+EEEvjC5MnQ3fmwUx+liiE+7/rK6cnOrpGwLDGUEJrlUgjqF/feW mbGtAOTGWv6P9+n5nj45KDhGFX8N3NbbvALLcNqBKr5l9YhfZeTc7gsyEw9v5sGa 5QXEhl4OMq9X7cLxgw4py+XszGF0NcoTb531AV8nbSSHVeE4XTDKBwBN8j/fC6zJ 8mXnQ== Received: from ediex02.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3tkhkc1tyh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 09 Oct 2023 10:34:18 -0500 (CDT) Received: from ediex01.ad.cirrus.com (198.61.84.80) by ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.37; Mon, 9 Oct 2023 16:34:16 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server id 15.2.1118.37 via Frontend Transport; Mon, 9 Oct 2023 16:34:16 +0100 Received: from EDIN4L06LR3.ad.cirrus.com (EDIN4L06LR3.ad.cirrus.com [198.61.65.230]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id B14D5B06; Mon, 9 Oct 2023 15:34:15 +0000 (UTC) From: Richard Fitzgerald To: CC: , , , Richard Fitzgerald Subject: [PATCH] ASoC: cs35l56: ASP1 DOUT must default to Hi-Z when not transmitting Date: Mon, 9 Oct 2023 16:34:12 +0100 Message-ID: <20231009153412.30380-1-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Proofpoint-ORIG-GUID: etGRMJSsjEDt_F24RyJ-U4IEtwZvHZzI X-Proofpoint-GUID: etGRMJSsjEDt_F24RyJ-U4IEtwZvHZzI X-Proofpoint-Spam-Reason: safe Message-ID-Hash: RJ7VN3YM2BBZGWHKLOULGCYGA6AXZIGY X-Message-ID-Hash: RJ7VN3YM2BBZGWHKLOULGCYGA6AXZIGY X-MailFrom: prvs=5646de3b35=rf@opensource.cirrus.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: The ASP1 DOUT line must be defaulted to be high-impedance when it is not actually transmitting data for an active channel. In non-SoundWire modes ASP1 will usually be shared by multiple amps so each amp must only drive the line during the slot for an enabled TX channel. In SoundWire mode a custom firmware can use ASP1 as a secondary chip-to-chip audio link or as GPIO. It should be defaulted to high-impedance since by default the purpose of this pin is not known. Backport note: On kernel versions before 6.6 the cs35l56->base.regmap argument to regmap_set_bits() must be changed to cs35l56->regmap. Signed-off-by: Richard Fitzgerald Fixes: e49611252900 ("ASoC: cs35l56: Add driver for Cirrus Logic CS35L56") --- sound/soc/codecs/cs35l56.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c index 8ccdd3f134a5..45b4de3eff94 100644 --- a/sound/soc/codecs/cs35l56.c +++ b/sound/soc/codecs/cs35l56.c @@ -1197,6 +1197,12 @@ int cs35l56_init(struct cs35l56_private *cs35l56) /* Registers could be dirty after soft reset or SoundWire enumeration */ regcache_sync(cs35l56->base.regmap); + /* Set ASP1 DOUT to high-impedance when it is not transmitting audio data. */ + ret = regmap_set_bits(cs35l56->base.regmap, CS35L56_ASP1_CONTROL3, + CS35L56_ASP1_DOUT_HIZ_CTRL_MASK); + if (ret) + return dev_err_probe(cs35l56->base.dev, ret, "Failed to write ASP1_CONTROL3\n"); + cs35l56->base.init_done = true; complete(&cs35l56->init_completion);