Skip to content

Commit 3d912d1

Browse files
Chao Songvinodkoul
authored andcommitted
soundwire: intel: read AC timing control register before updating it
Start from ACE1.x, DOAISE is added to AC timing control register bit 5, it combines with DOAIS to get effective timing, and has the default value 1. The current code fills DOAIS, DACTQE and DODS bits to a variable initialized to zero, and updates the variable to AC timing control register. With this operation, We change DOAISE to 0, and force a much more aggressive timing. The timing is even unable to form a working waveform on SDA pin on Meteorlake. This patch uses read-modify-write operation for the AC timing control register access, thus makes sure those bits not supposed and intended to change are not touched. Signed-off-by: Chao Song <chao.song@linux.intel.com> Reviewed-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/20230515081301.12921-1-yung-chuan.liao@linux.intel.com Signed-off-by: Vinod Koul <vkoul@kernel.org>
1 parent 6dd0776 commit 3d912d1

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

drivers/soundwire/intel.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ static void intel_shim_init(struct sdw_intel *sdw)
260260
{
261261
void __iomem *shim = sdw->link_res->shim;
262262
unsigned int link_id = sdw->instance;
263-
u16 ioctl = 0, act = 0;
263+
u16 ioctl = 0, act;
264264

265265
/* Initialize Shim */
266266
ioctl |= SDW_SHIM_IOCTL_BKE;
@@ -281,6 +281,7 @@ static void intel_shim_init(struct sdw_intel *sdw)
281281

282282
intel_shim_glue_to_master_ip(sdw);
283283

284+
act = intel_readw(shim, SDW_SHIM_CTMCTL(link_id));
284285
u16p_replace_bits(&act, 0x1, SDW_SHIM_CTMCTL_DOAIS);
285286
act |= SDW_SHIM_CTMCTL_DACTQE;
286287
act |= SDW_SHIM_CTMCTL_DODS;

0 commit comments

Comments
 (0)