Commit f29fd331 authored by Vitor Soares's avatar Vitor Soares Committed by Boris Brezillon

i3c: master: dw-i3c-master: fix i3c_attach/reattach

This patch fix i3c_attach/reattach functions.

During the i3c_attach the driver ignores the static address used for
SETDASA CCC command.

During the i3c_reattach the driver doesn't update master->addrs[data->index]
with new address if old_dyn_addr = 0.

Fixes: 1dd728f5 ("i3c: master: Add driver for Synopsys DesignWare IP")
Signed-off-by: default avatarVitor Soares <vitor.soares@synopsys.com>
Signed-off-by: default avatarBoris Brezillon <bbrezillon@kernel.org>
parent 0fac32f2
...@@ -901,9 +901,6 @@ static int dw_i3c_master_reattach_i3c_dev(struct i3c_dev_desc *dev, ...@@ -901,9 +901,6 @@ static int dw_i3c_master_reattach_i3c_dev(struct i3c_dev_desc *dev,
master->regs + master->regs +
DEV_ADDR_TABLE_LOC(master->datstartaddr, data->index)); DEV_ADDR_TABLE_LOC(master->datstartaddr, data->index));
if (!old_dyn_addr)
return 0;
master->addrs[data->index] = dev->info.dyn_addr; master->addrs[data->index] = dev->info.dyn_addr;
return 0; return 0;
...@@ -925,11 +922,11 @@ static int dw_i3c_master_attach_i3c_dev(struct i3c_dev_desc *dev) ...@@ -925,11 +922,11 @@ static int dw_i3c_master_attach_i3c_dev(struct i3c_dev_desc *dev)
return -ENOMEM; return -ENOMEM;
data->index = pos; data->index = pos;
master->addrs[pos] = dev->info.dyn_addr; master->addrs[pos] = dev->info.dyn_addr ? : dev->info.static_addr;
master->free_pos &= ~BIT(pos); master->free_pos &= ~BIT(pos);
i3c_dev_set_master_data(dev, data); i3c_dev_set_master_data(dev, data);
writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(dev->info.dyn_addr), writel(DEV_ADDR_TABLE_DYNAMIC_ADDR(master->addrs[pos]),
master->regs + master->regs +
DEV_ADDR_TABLE_LOC(master->datstartaddr, data->index)); DEV_ADDR_TABLE_LOC(master->datstartaddr, data->index));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment