From patchwork Tue Aug 8 16:47:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Fitzgerald X-Patchwork-Id: 711607 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 F2A5EC001B0 for ; Tue, 8 Aug 2023 16:49:45 +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 3958010E; Tue, 8 Aug 2023 18:48:54 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 3958010E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1691513384; bh=lvKDcEoRWQ6YKf4a107xBqeM8eXRf4rJpfiunZBNgEo=; 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=YxQGrrNJ0XROftAq2d+n0GqQGj/vV2rGAZS2qwj6PK7fp4liEl4v01K0Gfw859Rto YYJVHYzSno8TZ/WfFVA7xYa2e/M/0gDfIl5DBHWVVY7Ns5/vTL7/sdw6n903t+Jj9G QRFXvZqMy/Syy3oT7F6QPp3XMJewVQCFytQ2pIWU= Received: by alsa1.perex.cz (Postfix, from userid 50401) id A58E1F805A9; Tue, 8 Aug 2023 18:47:32 +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 F1949F805AD; Tue, 8 Aug 2023 18:47:31 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 5BC53F8057F; Tue, 8 Aug 2023 18:47:27 +0200 (CEST) Received: from mx0b-001ae601.pphosted.com (mx0b-001ae601.pphosted.com [67.231.152.168]) (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 89230F80538 for ; Tue, 8 Aug 2023 18:47:08 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 89230F80538 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=O/pVAMLE Received: from pps.filterd (m0077474.ppops.net [127.0.0.1]) by mx0b-001ae601.pphosted.com (8.17.1.22/8.17.1.22) with ESMTP id 378GfYwG012826; Tue, 8 Aug 2023 11:47:07 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cirrus.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s= PODMain02222019; bh=7RZLhRQ+381XYUDrqoqfoe0OVQjJKugGtd0GWZHvb+4=; b= O/pVAMLEaRntg+Ct3WXnVTbK6hmMBeSwKpZPzyWrb+VqZjQd2GLEul+R7gUkuUFx 2NiOZEbPJNiwuEqWvbeM1mtSX0ZiQrckGtX7LANoOEZT0hP75Ts6tKOtz+sBHhfq 3uafn4i2w/ij1Cjcco0BRkkQStBS/+7G2kEGkjPCLcYZkjtvMf9CaWgLnY43R3ZM qZ08SVK8+6I9YHXmNleskA1zVS8AZI+W1SqY72D7zGReY17KT84/Su9AMOLW5vLn QQoWaV//qC0vgb8KNdKOFxrsNCmGDRyRa6HyRSCpjiqyU+BJvsyCwKe5qsOL2Ys7 0SgMTt6a5ddVEahHGwFMnQ== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0b-001ae601.pphosted.com (PPS) with ESMTPS id 3s9juhtucr-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 08 Aug 2023 11:47:07 -0500 (CDT) Received: from ediex02.ad.cirrus.com (198.61.84.81) by ediex01.ad.cirrus.com (198.61.84.80) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Tue, 8 Aug 2023 17:47:05 +0100 Received: from ediswmail.ad.cirrus.com (198.61.86.93) by anon-ediex02.ad.cirrus.com (198.61.84.81) with Microsoft SMTP Server id 15.2.1118.30 via Frontend Transport; Tue, 8 Aug 2023 17:47:05 +0100 Received: from EDIN4L06LR3.ad.cirrus.com (EDIN4L06LR3.ad.cirrus.com [198.61.64.220]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 4E8963575; Tue, 8 Aug 2023 16:47:05 +0000 (UTC) From: Richard Fitzgerald To: CC: , , , Richard Fitzgerald Subject: [PATCH 3/5] ASoC: cs35l56: Wait for control port ready during system-resume Date: Tue, 8 Aug 2023 17:47:00 +0100 Message-ID: <20230808164702.21272-4-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230808164702.21272-1-rf@opensource.cirrus.com> References: <20230808164702.21272-1-rf@opensource.cirrus.com> MIME-Version: 1.0 X-Proofpoint-GUID: XHuMFLKBPZboRX8wriv0npaa4Urk6y63 X-Proofpoint-ORIG-GUID: XHuMFLKBPZboRX8wriv0npaa4Urk6y63 X-Proofpoint-Spam-Reason: safe Message-ID-Hash: M4YTRS4KJH6LIEBCOHA65YO3QZBVPADW X-Message-ID-Hash: M4YTRS4KJH6LIEBCOHA65YO3QZBVPADW X-MailFrom: prvs=3584a5a98c=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 CS35L56 could be hard-reset during a system suspend-resume cycle, either by the codec driver, in cs35l56_system_resume_early(), or by ACPI. After a hard reset the driver must wait for the control port to be ready (datasheet tIRS time) before attempting to access the CS35L56. Signed-off-by: Richard Fitzgerald --- 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 9560059c867b..094bcbd0a174 100644 --- a/sound/soc/codecs/cs35l56.c +++ b/sound/soc/codecs/cs35l56.c @@ -952,6 +952,12 @@ int cs35l56_system_resume(struct device *dev) dev_dbg(dev, "system_resume\n"); + /* + * We might have done a hard reset or the CS35L56 was power-cycled + * so wait for control port to be ready. + */ + cs35l56_wait_control_port_ready(); + /* Undo pm_runtime_force_suspend() before re-enabling the irq */ ret = pm_runtime_force_resume(dev); if (cs35l56->base.irq)