From nobody Mon Feb 9 12:26:48 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 5B27FC77B7D for ; Mon, 15 May 2023 06:52:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240366AbjEOGwP (ORCPT ); Mon, 15 May 2023 02:52:15 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240315AbjEOGvv (ORCPT ); Mon, 15 May 2023 02:51:51 -0400 Received: from mga04.intel.com (mga04.intel.com [192.55.52.120]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E7115171C for ; Sun, 14 May 2023 23:51:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1684133489; x=1715669489; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=wsFbcSJtx/AlSmGIw0DdUSJEopY6I39DINuaH9UuTy0=; b=S+NrvFbR0iDHJ5XGAcV6zcKUC6rqeVW1EuFQ5OBbsxGdvV3APGPQ+x/1 6h61y+zXBu6FZF536cbf5q9HBckn6uEXsubRnmaF6IDRtyjlXE1BpD1h1 hzOdysSETzY7UWw014WBKYtZRZ7/7JToO3EQ7NEBdYETZzef1JaXXH4iN w1V4pdsTQERQNGdf0nfq3mWul7lC3bIUigsbQk8KpSaxkUL0gWLzepxRb IMNpd3Ibw4nSswvB20i9fO4w+E8vLrF+kKZXbW1Qs6MHOV3jcj4xapuNU 9uApUMCyxHyiMn1MS8S3xtjZSi3s1j0G5CJQQOq2A0Hjv80sivUiSnOpM g==; X-IronPort-AV: E=McAfee;i="6600,9927,10710"; a="349966445" X-IronPort-AV: E=Sophos;i="5.99,275,1677571200"; d="scan'208";a="349966445" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2023 23:50:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10710"; a="694908736" X-IronPort-AV: E=Sophos;i="5.99,275,1677571200"; d="scan'208";a="694908736" Received: from bard-ubuntu.sh.intel.com ([10.239.185.57]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 May 2023 23:50:54 -0700 From: Bard Liao To: alsa-devel@alsa-project.org, vkoul@kernel.org, broonie@kernel.org, tiwai@suse.de Cc: linux-kernel@vger.kernel.org, vinod.koul@linaro.org, pierre-louis.bossart@linux.intel.com, bard.liao@intel.com Subject: [PATCH v2 15/26] soundwire: intel_ace2x: add sync_arm/sync_go helpers Date: Mon, 15 May 2023 15:10:31 +0800 Message-Id: <20230515071042.2038-16-yung-chuan.liao@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230515071042.2038-1-yung-chuan.liao@linux.intel.com> References: <20230515071042.2038-1-yung-chuan.liao@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pierre-Louis Bossart Same functionality as before, but with the registers moved to the HDaudio multi-link area. Signed-off-by: Pierre-Louis Bossart Reviewed-by: Rander Wang Reviewed-by: P=C3=A9ter Ujfalusi Reviewed-by: Ranjani Sridharan Signed-off-by: Bard Liao --- drivers/soundwire/intel_ace2x.c | 39 +++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/drivers/soundwire/intel_ace2x.c b/drivers/soundwire/intel_ace2= x.c index d6d5e6e070f4..20b8806f7de6 100644 --- a/drivers/soundwire/intel_ace2x.c +++ b/drivers/soundwire/intel_ace2x.c @@ -116,6 +116,41 @@ static int intel_link_power_down(struct sdw_intel *sdw) return ret; } =20 +static void intel_sync_arm(struct sdw_intel *sdw) +{ + unsigned int link_id =3D sdw->instance; + + mutex_lock(sdw->link_res->shim_lock); + + hdac_bus_eml_sdw_sync_arm_unlocked(sdw->link_res->hbus, link_id); + + mutex_unlock(sdw->link_res->shim_lock); +} + +static int intel_sync_go_unlocked(struct sdw_intel *sdw) +{ + int ret; + + ret =3D hdac_bus_eml_sdw_sync_go_unlocked(sdw->link_res->hbus); + if (ret < 0) + dev_err(sdw->cdns.dev, "%s: SyncGO clear failed: %d\n", __func__, ret); + + return ret; +} + +static int intel_sync_go(struct sdw_intel *sdw) +{ + int ret; + + mutex_lock(sdw->link_res->shim_lock); + + ret =3D intel_sync_go_unlocked(sdw); + + mutex_unlock(sdw->link_res->shim_lock); + + return ret; +} + /* * DAI operations */ @@ -283,6 +318,10 @@ const struct sdw_intel_hw_ops sdw_intel_lnl_hw_ops =3D= { =20 .link_power_up =3D intel_link_power_up, .link_power_down =3D intel_link_power_down, + + .sync_arm =3D intel_sync_arm, + .sync_go_unlocked =3D intel_sync_go_unlocked, + .sync_go =3D intel_sync_go, }; EXPORT_SYMBOL_NS(sdw_intel_lnl_hw_ops, SOUNDWIRE_INTEL); =20 --=20 2.25.1