Skip to content

Commit a0a6c76

Browse files
committed
Merge tag 'i3c/for-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux
Pull i3c updates from Alexandre Belloni: "A non-urgent fix and SETDASA is now exported to drivers" * tag 'i3c/for-6.2' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux: MAINTAINERS: mark I3C DRIVER FOR SYNOPSYS DESIGNWARE orphan i3c: export SETDASA method i3c: Correct the macro module_i3c_i2c_driver
2 parents ab425fe + 08dcf07 commit a0a6c76

File tree

5 files changed

+45
-3
lines changed

5 files changed

+45
-3
lines changed

MAINTAINERS

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9770,8 +9770,7 @@ F: Documentation/devicetree/bindings/i3c/cdns,i3c-master.yaml
97709770
F: drivers/i3c/master/i3c-master-cdns.c
97719771

97729772
I3C DRIVER FOR SYNOPSYS DESIGNWARE
9773-
M: Vitor Soares <[email protected]>
9774-
S: Maintained
9773+
S: Orphan
97759774
F: Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.yaml
97769775
F: drivers/i3c/master/dw*
97779776

drivers/i3c/device.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,26 @@ int i3c_device_do_priv_xfers(struct i3c_device *dev,
5050
}
5151
EXPORT_SYMBOL_GPL(i3c_device_do_priv_xfers);
5252

53+
/**
54+
* i3c_device_do_setdasa() - do I3C dynamic address assignement with
55+
* static address
56+
*
57+
* @dev: device with which the DAA should be done
58+
*
59+
* Return: 0 in case of success, a negative error core otherwise.
60+
*/
61+
int i3c_device_do_setdasa(struct i3c_device *dev)
62+
{
63+
int ret;
64+
65+
i3c_bus_normaluse_lock(dev->bus);
66+
ret = i3c_dev_setdasa_locked(dev->desc);
67+
i3c_bus_normaluse_unlock(dev->bus);
68+
69+
return ret;
70+
}
71+
EXPORT_SYMBOL_GPL(i3c_device_do_setdasa);
72+
5373
/**
5474
* i3c_device_get_info() - get I3C device information
5575
*

drivers/i3c/internals.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ extern struct bus_type i3c_bus_type;
1515
void i3c_bus_normaluse_lock(struct i3c_bus *bus);
1616
void i3c_bus_normaluse_unlock(struct i3c_bus *bus);
1717

18+
int i3c_dev_setdasa_locked(struct i3c_dev_desc *dev);
1819
int i3c_dev_do_priv_xfers_locked(struct i3c_dev_desc *dev,
1920
struct i3c_priv_xfer *xfers,
2021
int nxfers);

drivers/i3c/master.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,6 +2708,25 @@ int i3c_master_unregister(struct i3c_master_controller *master)
27082708
}
27092709
EXPORT_SYMBOL_GPL(i3c_master_unregister);
27102710

2711+
int i3c_dev_setdasa_locked(struct i3c_dev_desc *dev)
2712+
{
2713+
struct i3c_master_controller *master;
2714+
2715+
if (!dev)
2716+
return -ENOENT;
2717+
2718+
master = i3c_dev_get_master(dev);
2719+
if (!master)
2720+
return -EINVAL;
2721+
2722+
if (!dev->boardinfo || !dev->boardinfo->init_dyn_addr ||
2723+
!dev->boardinfo->static_addr)
2724+
return -EINVAL;
2725+
2726+
return i3c_master_setdasa_locked(master, dev->info.static_addr,
2727+
dev->boardinfo->init_dyn_addr);
2728+
}
2729+
27112730
int i3c_dev_do_priv_xfers_locked(struct i3c_dev_desc *dev,
27122731
struct i3c_priv_xfer *xfers,
27132732
int nxfers)

include/linux/i3c/device.h

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,12 +287,15 @@ static inline void i3c_i2c_driver_unregister(struct i3c_driver *i3cdrv,
287287
#define module_i3c_i2c_driver(__i3cdrv, __i2cdrv) \
288288
module_driver(__i3cdrv, \
289289
i3c_i2c_driver_register, \
290-
i3c_i2c_driver_unregister)
290+
i3c_i2c_driver_unregister, \
291+
__i2cdrv)
291292

292293
int i3c_device_do_priv_xfers(struct i3c_device *dev,
293294
struct i3c_priv_xfer *xfers,
294295
int nxfers);
295296

297+
int i3c_device_do_setdasa(struct i3c_device *dev);
298+
296299
void i3c_device_get_info(struct i3c_device *dev, struct i3c_device_info *info);
297300

298301
struct i3c_ibi_payload {

0 commit comments

Comments
 (0)