diff mbox series

soundwire: cadence: Write to correct address for each FIFO chunk

Message ID 20220917123517.229153-1-rf@opensource.cirrus.com
State Accepted
Commit 3ed96fb4a6d8426f766687ff02fc5fb5f91575fd
Headers show
Series soundwire: cadence: Write to correct address for each FIFO chunk | expand

Commit Message

Richard Fitzgerald Sept. 17, 2022, 12:35 p.m. UTC
_cdns_xfer_msg() must add the fragment offset to msg->addr to get the
base target address of each FIFO chunk. Otherwise every chunk will
be written to the first 32 register addresses.

Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
---
 drivers/soundwire/cadence_master.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Pierre-Louis Bossart Sept. 19, 2022, 8:39 a.m. UTC | #1
On 9/17/22 14:35, Richard Fitzgerald wrote:
> _cdns_xfer_msg() must add the fragment offset to msg->addr to get the
> base target address of each FIFO chunk. Otherwise every chunk will
> be written to the first 32 register addresses.
> 
> Signed-off-by: Richard Fitzgerald <rf@opensource.cirrus.com>
> ---
>  drivers/soundwire/cadence_master.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c
> index 3ef472049980..ca241bbeadd9 100644
> --- a/drivers/soundwire/cadence_master.c
> +++ b/drivers/soundwire/cadence_master.c
> @@ -569,7 +569,7 @@ _cdns_xfer_msg(struct sdw_cdns *cdns, struct sdw_msg *msg, int cmd,
>  	}
>  
>  	base = CDNS_MCP_CMD_BASE;
> -	addr = msg->addr;
> +	addr = msg->addr + offset;

LGTM, probably means that sending a large command broken in several
pieces never worked. D'oh.

Reviewed-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>

Thanks Richard!

>  
>  	for (i = 0; i < count; i++) {
>  		data = FIELD_PREP(CDNS_MCP_CMD_DEV_ADDR, msg->dev_num);
diff mbox series

Patch

diff --git a/drivers/soundwire/cadence_master.c b/drivers/soundwire/cadence_master.c
index 3ef472049980..ca241bbeadd9 100644
--- a/drivers/soundwire/cadence_master.c
+++ b/drivers/soundwire/cadence_master.c
@@ -569,7 +569,7 @@  _cdns_xfer_msg(struct sdw_cdns *cdns, struct sdw_msg *msg, int cmd,
 	}
 
 	base = CDNS_MCP_CMD_BASE;
-	addr = msg->addr;
+	addr = msg->addr + offset;
 
 	for (i = 0; i < count; i++) {
 		data = FIELD_PREP(CDNS_MCP_CMD_DEV_ADDR, msg->dev_num);