Skip to content

Commit 4d1e246

Browse files
plbossartvinodkoul
authored andcommitted
soundwire: intel_ace2x: add sync_arm/sync_go helpers
Same functionality as before, but with the registers moved to the HDaudio multi-link area. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Reviewed-by: Péter Ujfalusi <peter.ujfalusi@linux.intel.com> Reviewed-by: Ranjani Sridharan <ranjani.sridharan@linux.intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20230515071042.2038-16-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent d2f0daf commit 4d1e246

1 file changed

Lines changed: 39 additions & 0 deletions

File tree

drivers/soundwire/intel_ace2x.c

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,41 @@ static int intel_link_power_down(struct sdw_intel *sdw)
116116
return ret;
117117
}
118118

119+
static void intel_sync_arm(struct sdw_intel *sdw)
120+
{
121+
unsigned int link_id = sdw->instance;
122+
123+
mutex_lock(sdw->link_res->shim_lock);
124+
125+
hdac_bus_eml_sdw_sync_arm_unlocked(sdw->link_res->hbus, link_id);
126+
127+
mutex_unlock(sdw->link_res->shim_lock);
128+
}
129+
130+
static int intel_sync_go_unlocked(struct sdw_intel *sdw)
131+
{
132+
int ret;
133+
134+
ret = hdac_bus_eml_sdw_sync_go_unlocked(sdw->link_res->hbus);
135+
if (ret < 0)
136+
dev_err(sdw->cdns.dev, "%s: SyncGO clear failed: %d\n", __func__, ret);
137+
138+
return ret;
139+
}
140+
141+
static int intel_sync_go(struct sdw_intel *sdw)
142+
{
143+
int ret;
144+
145+
mutex_lock(sdw->link_res->shim_lock);
146+
147+
ret = intel_sync_go_unlocked(sdw);
148+
149+
mutex_unlock(sdw->link_res->shim_lock);
150+
151+
return ret;
152+
}
153+
119154
/*
120155
* DAI operations
121156
*/
@@ -283,6 +318,10 @@ const struct sdw_intel_hw_ops sdw_intel_lnl_hw_ops = {
283318

284319
.link_power_up = intel_link_power_up,
285320
.link_power_down = intel_link_power_down,
321+
322+
.sync_arm = intel_sync_arm,
323+
.sync_go_unlocked = intel_sync_go_unlocked,
324+
.sync_go = intel_sync_go,
286325
};
287326
EXPORT_SYMBOL_NS(sdw_intel_lnl_hw_ops, SOUNDWIRE_INTEL);
288327

0 commit comments

Comments
 (0)