Skip to content

Commit 5b3f661

Browse files
plbossartvinodkoul
authored andcommitted
soundwire: intel_ace2x: set the clock source
Insert clock setup after power-up and before setting up the SYNCPRD, per hardware recommendations. Signed-off-by: Pierre-Louis Bossart <[email protected]> Reviewed-by: Rander Wang <[email protected]> Signed-off-by: Bard Liao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent a206d2e commit 5b3f661

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

drivers/soundwire/intel_ace2x.c

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,20 @@ static void intel_shim_vs_init(struct sdw_intel *sdw)
3333
usleep_range(10, 15);
3434
}
3535

36+
static void intel_shim_vs_set_clock_source(struct sdw_intel *sdw, u32 source)
37+
{
38+
void __iomem *shim_vs = sdw->link_res->shim_vs;
39+
u32 val;
40+
41+
val = intel_readl(shim_vs, SDW_SHIM2_INTEL_VS_LVSCTL);
42+
43+
u32p_replace_bits(&val, source, SDW_SHIM2_INTEL_VS_LVSCTL_MLCS);
44+
45+
intel_writel(shim_vs, SDW_SHIM2_INTEL_VS_LVSCTL, val);
46+
47+
dev_dbg(sdw->cdns.dev, "clock source %d LVSCTL %#x\n", source, val);
48+
}
49+
3650
static int intel_shim_check_wake(struct sdw_intel *sdw)
3751
{
3852
void __iomem *shim_vs;
@@ -100,6 +114,8 @@ static int intel_link_power_up(struct sdw_intel *sdw)
100114
goto out;
101115
}
102116

117+
intel_shim_vs_set_clock_source(sdw, clock_source);
118+
103119
if (!*shim_mask) {
104120
/* we first need to program the SyncPRD/CPU registers */
105121
dev_dbg(sdw->cdns.dev, "first link up, programming SYNCPRD\n");

0 commit comments

Comments
 (0)