From nobody Mon Feb 9 21:19:08 2026 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFB39C77B7E for ; Thu, 1 Jun 2023 15:47:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233844AbjFAPr6 (ORCPT ); Thu, 1 Jun 2023 11:47:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233351AbjFAPrz (ORCPT ); Thu, 1 Jun 2023 11:47:55 -0400 Received: from mx0b-001ae601.pphosted.com (mx0a-001ae601.pphosted.com [67.231.149.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F99A12C for ; Thu, 1 Jun 2023 08:47:53 -0700 (PDT) Received: from pps.filterd (m0077473.ppops.net [127.0.0.1]) by mx0a-001ae601.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 351CPISW014930; Thu, 1 Jun 2023 10:47:34 -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=355x8jO3FklscijqP8iOoHIKeA5AzWWMpoYZCrN+AXQ=; b=NKJPMeGqwiEdT95H0XmPFVumwV4rx8UohHDq4F4kvqE2EmxRNBcOGYzMkgaFlTNXimVb nu+z0KuaBdEWC7Zi6aXhaLD3t/qmtF/GoqNn0vRdbgOyDw+/3Pp0SUXGAmZRGM3pCBda ACVyzjkydUsnw10cHVnUIr0xPpAchuzfOFh8Eb+eEeztImUP0h6ZUIEMIY/5mjdmmgHM FuyJqDg6jTd5aVyqYSrgqnjwvbXKI3+zD77JFtJ5o99NVNYm2TU4NWhKBjIWxLKthQkn cUq/nzQlN14M01j0CWxQECiaTQBnqTe7hQA/tGwn/4pAX/wHKAdCIuiFEJjw56NIt90J +g== Received: from ediex01.ad.cirrus.com ([84.19.233.68]) by mx0a-001ae601.pphosted.com (PPS) with ESMTPS id 3quf90x42d-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 01 Jun 2023 10:47:34 -0500 Received: from ediex01.ad.cirrus.com (198.61.84.80) 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.26; Thu, 1 Jun 2023 16:47:31 +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.26 via Frontend Transport; Thu, 1 Jun 2023 16:47:31 +0100 Received: from edi-sw-dsktp-006.ad.cirrus.com (edi-sw-dsktp-006.ad.cirrus.com [198.90.251.127]) by ediswmail.ad.cirrus.com (Postfix) with ESMTP id 62A2411C6; Thu, 1 Jun 2023 15:47:31 +0000 (UTC) From: Richard Fitzgerald To: , , CC: , , , Simon Trimmer , Richard Fitzgerald Subject: [PATCH v4 02/12] ASoC: cs35l56: Make cs35l56_system_reset() code more generic Date: Thu, 1 Jun 2023 16:47:21 +0100 Message-ID: <20230601154731.3210572-3-rf@opensource.cirrus.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20230601154731.3210572-1-rf@opensource.cirrus.com> References: <20230601154731.3210572-1-rf@opensource.cirrus.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Proofpoint-GUID: 1OScOTe_4IiMUiOY7yVA6H989d0RYAjc X-Proofpoint-ORIG-GUID: 1OScOTe_4IiMUiOY7yVA6H989d0RYAjc X-Proofpoint-Spam-Reason: safe Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" From: Simon Trimmer The function can be more easily reused in HDA if the tracking of whether a soft reset is being performed and whether the device is connected to a SoundWire bus is moved out of the function. Signed-off-by: Simon Trimmer Signed-off-by: Richard Fitzgerald Acked-by: Mark Brown --- sound/soc/codecs/cs35l56.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/cs35l56.c b/sound/soc/codecs/cs35l56.c index 7acd0492ecdd..983b0c005b37 100644 --- a/sound/soc/codecs/cs35l56.c +++ b/sound/soc/codecs/cs35l56.c @@ -802,10 +802,8 @@ static const struct reg_sequence cs35l56_system_reset_= seq[] =3D { REG_SEQ0(CS35L56_DSP_VIRTUAL1_MBOX_1, CS35L56_MBOX_CMD_SYSTEM_RESET), }; =20 -static void cs35l56_system_reset(struct cs35l56_private *cs35l56) +static void cs35l56_system_reset(struct cs35l56_private *cs35l56, bool is_= soundwire) { - cs35l56->soft_resetting =3D true; - /* * Must enter cache-only first so there can't be any more register * accesses other than the controlled system reset sequence below. @@ -816,7 +814,7 @@ static void cs35l56_system_reset(struct cs35l56_private= *cs35l56) ARRAY_SIZE(cs35l56_system_reset_seq)); =20 /* On SoundWire the registers won't be accessible until it re-enumerates.= */ - if (cs35l56->sdw_peripheral) + if (is_soundwire) return; =20 usleep_range(CS35L56_CONTROL_PORT_READY_US, CS35L56_CONTROL_PORT_READY_US= + 400); @@ -883,7 +881,8 @@ static void cs35l56_patch(struct cs35l56_private *cs35l= 56) =20 init_completion(&cs35l56->init_completion); =20 - cs35l56_system_reset(cs35l56); + cs35l56->soft_resetting =3D true; + cs35l56_system_reset(cs35l56, !!cs35l56->sdw_peripheral); =20 if (cs35l56->sdw_peripheral) { /* @@ -1547,7 +1546,8 @@ int cs35l56_init(struct cs35l56_private *cs35l56) =20 if (!cs35l56->base.reset_gpio) { dev_dbg(cs35l56->base.dev, "No reset gpio: using soft reset\n"); - cs35l56_system_reset(cs35l56); + cs35l56->soft_resetting =3D true; + cs35l56_system_reset(cs35l56, !!cs35l56->sdw_peripheral); if (cs35l56->sdw_peripheral) { /* Keep alive while we wait for re-enumeration */ pm_runtime_get_noresume(cs35l56->base.dev); --=20 2.30.2