Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1e906200 authored by Ramprasad Katkam's avatar Ramprasad Katkam Committed by Gerrit - the friendly Code Review server
Browse files

soc: swr-mstr: Avoid redunant delay for wcd934x



For codecs like tavil/tasha where the soundwire register access
is through codec bridge, the soundwire bus latency is absorbed
in slimbus io operations, hence do not require extra delay in
soundwire driver for io operations.

Change-Id: If77aa02f0c3c1755916b7a57776115d12e4f08bd
Signed-off-by: default avatarRamprasad Katkam <katkam@codeaurora.org>
parent 8766446f
Loading
Loading
Loading
Loading
+16 −7
Original line number Diff line number Diff line
@@ -448,11 +448,16 @@ static int swrm_cmd_fifo_rd_cmd(struct swr_mstr_ctrl *swrm, int *cmd_data,

	mutex_lock(&swrm->iolock);
	val = swrm_get_packed_reg_val(&swrm->rcmd_id, len, dev_addr, reg_addr);
	if (swrm->read) {
		/* skip delay if read is handled in platform driver */
		swr_master_write(swrm, SWRM_CMD_FIFO_RD_CMD, val);
	} else {
		/* wait for FIFO RD to complete to avoid overflow */
		usleep_range(100, 105);
		swr_master_write(swrm, SWRM_CMD_FIFO_RD_CMD, val);
		/* wait for FIFO RD CMD complete to avoid overflow */
		usleep_range(250, 255);
	}
retry_read:
	*cmd_data = swr_master_read(swrm, SWRM_CMD_FIFO_RD_FIFO_ADDR);
	dev_dbg(swrm->dev, "%s: reg: 0x%x, cmd_id: 0x%x, rcmd_id: 0x%x, \
@@ -496,7 +501,11 @@ static int swrm_cmd_fifo_wr_cmd(struct swr_mstr_ctrl *swrm, u8 cmd_data,
			dev_num: 0x%x, cmd_data: 0x%x\n", __func__,
			reg_addr, cmd_id, swrm->wcmd_id,dev_addr, cmd_data);
	swr_master_write(swrm, SWRM_CMD_FIFO_WR_CMD, val);
	/* wait for FIFO WR command to complete to avoid overflow */
	/*
	 * wait for FIFO WR command to complete to avoid overflow
	 * skip delay if write is handled in platform driver.
	 */
	if(!swrm->write)
		usleep_range(250, 255);
	if (cmd_id == 0xF) {
		/*