History

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

Linus Torvalds committed 3 years ago

Commit a0a6c762 parents ab425fe 08dcf075 files · +45 −3Browse files

Unified · Split

5 files
  1. MAINTAINERS +1 −2
  2. drivers/i3c/device.c +20 −0
  3. drivers/i3c/internals.h +1 −0
  4. drivers/i3c/master.c +19 −0
  5. include/linux/i3c/device.h +4 −1
MAINTAINERS+1−2
@@ -9770,8 +9770,7 @@ F: Documentation/devicetree/bindings/i3c/cdns,i3c-master.yaml · 9769 unmodified lines
9770F: drivers/i3c/master/i3c-master-cdns.c9770F: drivers/i3c/master/i3c-master-cdns.c
9771 9771
9772I3C DRIVER FOR SYNOPSYS DESIGNWARE9772I3C DRIVER FOR SYNOPSYS DESIGNWARE
9773M: Vitor Soares <vitor.soares@synopsys.com>9773S: Orphan
9774S: Maintained
9775F: Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.yaml9774F: Documentation/devicetree/bindings/i3c/snps,dw-i3c-master.yaml
9776F: drivers/i3c/master/dw*9775F: drivers/i3c/master/dw*
9777 9776
drivers/i3c/device.c+20−0
@@ -50,6 +50,26 @@ int i3c_device_do_priv_xfers(struct i3c_device *dev, · 49 unmodified lines
50}50}
51EXPORT_SYMBOL_GPL(i3c_device_do_priv_xfers);51EXPORT_SYMBOL_GPL(i3c_device_do_priv_xfers);
52 52
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 */
61int 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}
71EXPORT_SYMBOL_GPL(i3c_device_do_setdasa);
72
53/**73/**
54 * i3c_device_get_info() - get I3C device information74 * i3c_device_get_info() - get I3C device information
55 *75 *
drivers/i3c/internals.h+1−0
@@ -15,6 +15,7 @@ extern struct bus_type i3c_bus_type; · 14 unmodified lines
15void i3c_bus_normaluse_lock(struct i3c_bus *bus);15void i3c_bus_normaluse_lock(struct i3c_bus *bus);
16void i3c_bus_normaluse_unlock(struct i3c_bus *bus);16void i3c_bus_normaluse_unlock(struct i3c_bus *bus);
17 17
18int i3c_dev_setdasa_locked(struct i3c_dev_desc *dev);
18int i3c_dev_do_priv_xfers_locked(struct i3c_dev_desc *dev,19int i3c_dev_do_priv_xfers_locked(struct i3c_dev_desc *dev,
19 struct i3c_priv_xfer *xfers,20 struct i3c_priv_xfer *xfers,
20 int nxfers);21 int nxfers);
drivers/i3c/master.c+19−0
@@ -2708,6 +2708,25 @@ int i3c_master_unregister(struct i3c_master_controller *master) · 2707 unmodified lines
2708}2708}
2709EXPORT_SYMBOL_GPL(i3c_master_unregister);2709EXPORT_SYMBOL_GPL(i3c_master_unregister);
2710 2710
2711int 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
2711int i3c_dev_do_priv_xfers_locked(struct i3c_dev_desc *dev,2730int i3c_dev_do_priv_xfers_locked(struct i3c_dev_desc *dev,
2712 struct i3c_priv_xfer *xfers,2731 struct i3c_priv_xfer *xfers,
2713 int nxfers)2732 int nxfers)
include/linux/i3c/device.h+4−1
@@ -287,12 +287,15 @@ static inline void i3c_i2c_driver_unregister(struct i3c_driver *i3cdrv, · 286 unmodified lines
287#define module_i3c_i2c_driver(__i3cdrv, __i2cdrv) \287#define module_i3c_i2c_driver(__i3cdrv, __i2cdrv) \
288 module_driver(__i3cdrv, \288 module_driver(__i3cdrv, \
289 i3c_i2c_driver_register, \289 i3c_i2c_driver_register, \
290 i3c_i2c_driver_unregister)290 i3c_i2c_driver_unregister, \
291 __i2cdrv)
291 292
292int i3c_device_do_priv_xfers(struct i3c_device *dev,293int i3c_device_do_priv_xfers(struct i3c_device *dev,
293 struct i3c_priv_xfer *xfers,294 struct i3c_priv_xfer *xfers,
294 int nxfers);295 int nxfers);
295 296
297int i3c_device_do_setdasa(struct i3c_device *dev);
298
296void i3c_device_get_info(struct i3c_device *dev, struct i3c_device_info *info);299void i3c_device_get_info(struct i3c_device *dev, struct i3c_device_info *info);
297 300
298struct i3c_ibi_payload {301struct i3c_ibi_payload {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t