public inbox for linux-i3c@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v1] i3c: mipi-i3c-hci: Support SETDASA CCC
@ 2024-11-13  3:58 Billy Tsai
  2024-11-14 15:22 ` Jarkko Nikula
  2024-11-18 13:30 ` Alexandre Belloni
  0 siblings, 2 replies; 3+ messages in thread
From: Billy Tsai @ 2024-11-13  3:58 UTC (permalink / raw)
  To: alexandre.belloni, jarkko.nikula, Shyam-sundar.S-k,
	Guruvendra.Punugupati, krishnamoorthi.m, billy_tsai, linux-i3c,
	linux-kernel

When the I3C subsystem wants to assign a dynamic address using the SETDASA
CCC, it needs to attach the I3C device with device info that includes only
the static address. In the HCI, if the driver want to send this SETDASA
CCC, a DAT entry is required to temporarily fill the device's static
address into the dynamic address field. Afterward, the reattach API will
be executed to update the DAT with the correct dynamic addrees value.

Signed-off-by: Billy Tsai <billy_tsai@aspeedtech.com>
---
 drivers/i3c/master/mipi-i3c-hci/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/i3c/master/mipi-i3c-hci/core.c b/drivers/i3c/master/mipi-i3c-hci/core.c
index a82c47c9986d..6655e8396a35 100644
--- a/drivers/i3c/master/mipi-i3c-hci/core.c
+++ b/drivers/i3c/master/mipi-i3c-hci/core.c
@@ -438,7 +438,8 @@ static int i3c_hci_attach_i3c_dev(struct i3c_dev_desc *dev)
 			kfree(dev_data);
 			return ret;
 		}
-		mipi_i3c_hci_dat_v1.set_dynamic_addr(hci, ret, dev->info.dyn_addr);
+		mipi_i3c_hci_dat_v1.set_dynamic_addr(hci, ret,
+						     dev->info.dyn_addr ?: dev->info.static_addr);
 		dev_data->dat_idx = ret;
 	}
 	i3c_dev_set_master_data(dev, dev_data);
-- 
2.25.1


-- 
linux-i3c mailing list
linux-i3c@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-i3c

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-11-18 13:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-13  3:58 [PATCH v1] i3c: mipi-i3c-hci: Support SETDASA CCC Billy Tsai
2024-11-14 15:22 ` Jarkko Nikula
2024-11-18 13:30 ` Alexandre Belloni

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox