soundwire: intel_ace2x: move and extend clock selection
The input clock to the SoundWire IP can be 38.4 MHz (xtal clock source) 24.576 MHz (audio cardinal clock) 96 MHz (internal Audio PLL) This patch moves the clock selection outside the mutex and add the new choices for 24.576 and 96 MHz, but doesn't add any functionality. Follow-up patches will add support for clock selection. Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Reviewed-by: Rander Wang <rander.wang@intel.com> Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com> Link: https://lore.kernel.org/r/20240326092030.1062802-6-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
parent
09ee49e3de
commit
769d69812b
@ -74,20 +74,29 @@ static int intel_link_power_up(struct sdw_intel *sdw)
|
||||
struct sdw_master_prop *prop = &bus->prop;
|
||||
u32 *shim_mask = sdw->link_res->shim_mask;
|
||||
unsigned int link_id = sdw->instance;
|
||||
u32 clock_source;
|
||||
u32 syncprd;
|
||||
int ret;
|
||||
|
||||
if (prop->mclk_freq % 6000000) {
|
||||
if (prop->mclk_freq % 2400000) {
|
||||
syncprd = SDW_SHIM_SYNC_SYNCPRD_VAL_24_576;
|
||||
clock_source = SDW_SHIM2_MLCS_CARDINAL_CLK;
|
||||
} else {
|
||||
syncprd = SDW_SHIM_SYNC_SYNCPRD_VAL_38_4;
|
||||
clock_source = SDW_SHIM2_MLCS_XTAL_CLK;
|
||||
}
|
||||
} else {
|
||||
syncprd = SDW_SHIM_SYNC_SYNCPRD_VAL_96;
|
||||
clock_source = SDW_SHIM2_MLCS_AUDIO_PLL_CLK;
|
||||
}
|
||||
|
||||
mutex_lock(sdw->link_res->shim_lock);
|
||||
|
||||
if (!*shim_mask) {
|
||||
/* we first need to program the SyncPRD/CPU registers */
|
||||
dev_dbg(sdw->cdns.dev, "first link up, programming SYNCPRD\n");
|
||||
|
||||
if (prop->mclk_freq % 6000000)
|
||||
syncprd = SDW_SHIM_SYNC_SYNCPRD_VAL_38_4;
|
||||
else
|
||||
syncprd = SDW_SHIM_SYNC_SYNCPRD_VAL_24;
|
||||
|
||||
ret = hdac_bus_eml_sdw_set_syncprd_unlocked(sdw->link_res->hbus, syncprd);
|
||||
if (ret < 0) {
|
||||
dev_err(sdw->cdns.dev, "%s: hdac_bus_eml_sdw_set_syncprd failed: %d\n",
|
||||
|
Loading…
Reference in New Issue
Block a user