@@ -200,6 +200,14 @@ struct i3c_device *dev_to_i3cdev(struct device *dev)
}
EXPORT_SYMBOL_GPL(dev_to_i3cdev);
+const struct i3c_device_id *i3c_get_device_id(struct i3c_device *i3cdev)
+{
+ const struct i3c_driver *i3cdrv = drv_to_i3cdrv(i3cdev->dev.driver);
+
+ return i3cdrv->id_table;
+}
+EXPORT_SYMBOL_GPL(i3c_get_device_id);
+
/**
* i3c_driver_register_with_owner() - register an I3C device driver
*
@@ -187,6 +187,7 @@ static inline struct i3c_driver *drv_to_i3cdrv(struct device_driver *drv)
struct device *i3cdev_to_dev(struct i3c_device *i3cdev);
struct i3c_device *dev_to_i3cdev(struct device *dev);
+const struct i3c_device_id *i3c_get_device_id(struct i3c_device *i3cdev);
static inline void i3cdev_set_drvdata(struct i3c_device *i3cdev,
void *data)
This helper return the i3c_device_id structure in order the client have access to the driver data. Signed-off-by: Vitor Soares <vitor.soares@synopsys.com> --- Changes in v2: move this function to drivers/i3c/device.c drivers/i3c/device.c | 8 ++++++++ include/linux/i3c/device.h | 1 + 2 files changed, 9 insertions(+)