Skip to content

Commit 1899946

Browse files
committed
Merge tag 'i3c/for-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux
Pull i3c updates from Alexandre Belloni: "Subsystem: - transfer pid from boardinfo to device info Drivers: - dw-i3c-master: stop hardcoding initial speed" * tag 'i3c/for-6.3' of git://git.kernel.org/pub/scm/linux/kernel/git/i3c/linux: i3c: master: dw: stop hardcoding initial speed i3c: transfer pid from boardinfo to device info
2 parents b1f1382 + 510d235 commit 1899946

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

drivers/i3c/master.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1438,6 +1438,7 @@ static int i3c_master_early_i3c_dev_add(struct i3c_master_controller *master,
14381438
{
14391439
struct i3c_device_info info = {
14401440
.static_addr = boardinfo->static_addr,
1441+
.pid = boardinfo->pid,
14411442
};
14421443
struct i3c_dev_desc *i3cdev;
14431444
int ret;

drivers/i3c/master/dw-i3c-master.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ static int dw_i3c_clk_cfg(struct dw_i3c_master *master)
531531
if (hcnt < SCL_I3C_TIMING_CNT_MIN)
532532
hcnt = SCL_I3C_TIMING_CNT_MIN;
533533

534-
lcnt = DIV_ROUND_UP(core_rate, I3C_BUS_TYP_I3C_SCL_RATE) - hcnt;
534+
lcnt = DIV_ROUND_UP(core_rate, master->base.bus.scl_rate.i3c) - hcnt;
535535
if (lcnt < SCL_I3C_TIMING_CNT_MIN)
536536
lcnt = SCL_I3C_TIMING_CNT_MIN;
537537

@@ -541,7 +541,8 @@ static int dw_i3c_clk_cfg(struct dw_i3c_master *master)
541541
if (!(readl(master->regs + DEVICE_CTRL) & DEV_CTRL_I2C_SLAVE_PRESENT))
542542
writel(BUS_I3C_MST_FREE(lcnt), master->regs + BUS_FREE_TIMING);
543543

544-
lcnt = DIV_ROUND_UP(I3C_BUS_TLOW_OD_MIN_NS, core_period);
544+
lcnt = max_t(u8,
545+
DIV_ROUND_UP(I3C_BUS_TLOW_OD_MIN_NS, core_period), lcnt);
545546
scl_timing = SCL_I3C_TIMING_HCNT(hcnt) | SCL_I3C_TIMING_LCNT(lcnt);
546547
writel(scl_timing, master->regs + SCL_I3C_OD_TIMING);
547548

0 commit comments

Comments
 (0)