From ec41afaa5d4e72c8c17a8d5df090acd9be7e855e Mon Sep 17 00:00:00 2001 From: Ryan McClelland Date: Fri, 12 Jul 2024 13:41:41 -0700 Subject: [PATCH] drivers: i3c: add KConfig to perform rstact during bus init Sometimes, performing a rstact which will reset all devices during init on the bus may not be ideal. Add a KConfig to easily turn off. Signed-off-by: Ryan McClelland --- drivers/i3c/Kconfig | 7 +++++++ drivers/i3c/i3c_common.c | 2 ++ 2 files changed, 9 insertions(+) diff --git a/drivers/i3c/Kconfig b/drivers/i3c/Kconfig index ca3fde0318a..a30b5ee801b 100644 --- a/drivers/i3c/Kconfig +++ b/drivers/i3c/Kconfig @@ -105,6 +105,13 @@ config I3C_CONTROLLER_INIT_PRIORITY may not be addressable until addresses are assigned by the controller. +config I3C_INIT_RSTACT + bool "Perform Reset Action During Bus Initialization" + default y + help + This determines whether the bus initialization routine + sends a reset action command to I3C targets. + comment "Device Drivers" rsource "Kconfig.nxp" diff --git a/drivers/i3c/i3c_common.c b/drivers/i3c/i3c_common.c index 53a7e812076..01dcadd46e0 100644 --- a/drivers/i3c/i3c_common.c +++ b/drivers/i3c/i3c_common.c @@ -639,6 +639,7 @@ int i3c_bus_init(const struct device *dev, const struct i3c_dev_list *dev_list) bool need_daa = true; struct i3c_ccc_events i3c_events; +#ifdef CONFIG_I3C_INIT_RSTACT /* * Reset all connected targets. Also reset dynamic * addresses for all devices as we have no idea what @@ -661,6 +662,7 @@ int i3c_bus_init(const struct device *dev, const struct i3c_dev_list *dev_list) LOG_DBG("Broadcast RSTACT (peripehral) was NACK."); } } +#endif if (i3c_ccc_do_rstdaa_all(dev) != 0) { LOG_DBG("Broadcast RSTDAA was NACK.");