summaryrefslogtreecommitdiff
path: root/drivers/i3c
diff options
context:
space:
mode:
authorDavid Nyström <david.nystrom@est.tech>2026-02-19 21:58:03 +0100
committerAlexandre Belloni <alexandre.belloni@bootlin.com>2026-04-12 16:32:11 +0200
commit8ea0b60bc00d86b5ce33837487f4d16ae212f70a (patch)
tree43c43892959917154ab7210e3d6537fbd2e248a2 /drivers/i3c
parent335c21a2bb47585fdeb87c169d91f09b399c1d3d (diff)
i3c: master: Add sysfs option to rescan bus via entdaa
Allow userspace to request dynamic address assignment, which is useful for i3cdev devices with broken hot-join support. This will assign dynamic addresses to all devices on the I3C bus which are currently unassigned. Signed-off-by: David Nyström <david.nystrom@est.tech> Reviewed-by: Frank Li <Frank.Li@nxp.com> Reviewed-by: Meagan Lloyd <meaganlloyd@linux.microsoft.com> Link: https://patch.msgid.link/20260219-i3c_rescan-v6-1-b81d6cc3cb30@est.tech Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
Diffstat (limited to 'drivers/i3c')
-rw-r--r--drivers/i3c/master.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c
index 9e6be49bebb2..53b34b4f44a2 100644
--- a/drivers/i3c/master.c
+++ b/drivers/i3c/master.c
@@ -758,6 +758,32 @@ static ssize_t dev_nack_retry_count_store(struct device *dev,
static DEVICE_ATTR_RW(dev_nack_retry_count);
+static ssize_t do_daa_store(struct device *dev,
+ struct device_attribute *attr,
+ const char *buf, size_t count)
+{
+ struct i3c_master_controller *master = dev_to_i3cmaster(dev);
+ bool val;
+ int ret;
+
+ if (kstrtobool(buf, &val))
+ return -EINVAL;
+
+ if (!val)
+ return -EINVAL;
+
+ if (!master->init_done)
+ return -EAGAIN;
+
+ ret = i3c_master_do_daa(master);
+ if (ret)
+ return ret;
+
+ return count;
+}
+
+static DEVICE_ATTR_WO(do_daa);
+
static struct attribute *i3c_masterdev_attrs[] = {
&dev_attr_mode.attr,
&dev_attr_current_master.attr,
@@ -769,6 +795,7 @@ static struct attribute *i3c_masterdev_attrs[] = {
&dev_attr_dynamic_address.attr,
&dev_attr_hdrcap.attr,
&dev_attr_hotjoin.attr,
+ &dev_attr_do_daa.attr,
NULL,
};
ATTRIBUTE_GROUPS(i3c_masterdev);