diff options
author | Przemyslaw Gaj <pgaj@cadence.com> | 2019-06-22 21:54:59 +0100 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@collabora.com> | 2019-08-11 10:48:28 +0200 |
commit | b1ac3a4b9aa2f68d498824f1235788e67b51b486 (patch) | |
tree | 2c2642336eaf927456d1fc0582c3cf35f94d8b30 /drivers/i3c/master.c | |
parent | fd3f8f3118c66c492c5fe05568569d26db258fbd (diff) |
i3c: add addr and lvr to i2c_dev_desc structure
I need to store address and lvr value for I2C devices without static definition
in DT. This allows secondary master to transmit DEFSLVS command properly.
Main changes between v4 and v5:
- Change in defslvs to use addr and lvr from i2c_dev_desc structure
- Change in CDNS and DW drivers to use addr and lvr from i2c_dev_desc structure
Signed-off-by: Przemyslaw Gaj <pgaj@cadence.com>
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Diffstat (limited to 'drivers/i3c/master.c')
-rw-r--r-- | drivers/i3c/master.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/i3c/master.c b/drivers/i3c/master.c index 87d0f349dd37..a38fdf325d30 100644 --- a/drivers/i3c/master.c +++ b/drivers/i3c/master.c @@ -600,6 +600,8 @@ i3c_master_alloc_i2c_dev(struct i3c_master_controller *master, dev->common.master = master; dev->boardinfo = boardinfo; + dev->addr = boardinfo->base.addr; + dev->lvr = boardinfo->lvr; return dev; } @@ -918,8 +920,8 @@ int i3c_master_defslvs_locked(struct i3c_master_controller *master) desc = defslvs->slaves; i3c_bus_for_each_i2cdev(bus, i2cdev) { - desc->lvr = i2cdev->boardinfo->lvr; - desc->static_addr = i2cdev->boardinfo->base.addr << 1; + desc->lvr = i2cdev->lvr; + desc->static_addr = i2cdev->addr << 1; desc++; } @@ -1586,8 +1588,8 @@ static void i3c_master_detach_free_devs(struct i3c_master_controller *master) common.node) { i3c_master_detach_i2c_dev(i2cdev); i3c_bus_set_addr_slot_status(&master->bus, - i2cdev->boardinfo->base.addr, - I3C_ADDR_SLOT_FREE); + i2cdev->addr, + I3C_ADDR_SLOT_FREE); i3c_master_free_i2c_dev(i2cdev); } } |