@@ -543,18 +543,22 @@ static int dw_i3c_clk_cfg(struct dw_i3c_master *master)
543543
544544 scl_timing = SCL_I3C_TIMING_HCNT (hcnt ) | SCL_I3C_TIMING_LCNT (lcnt );
545545 writel (scl_timing , master -> regs + SCL_I3C_PP_TIMING );
546+ master -> i3c_pp_timing = scl_timing ;
546547
547548 /*
548549 * In pure i3c mode, MST_FREE represents tCAS. In shared mode, this
549550 * will be set up by dw_i2c_clk_cfg as tLOW.
550551 */
551- if (master -> base .bus .mode == I3C_BUS_MODE_PURE )
552+ if (master -> base .bus .mode == I3C_BUS_MODE_PURE ) {
552553 writel (BUS_I3C_MST_FREE (lcnt ), master -> regs + BUS_FREE_TIMING );
554+ master -> bus_free_timing = BUS_I3C_MST_FREE (lcnt );
555+ }
553556
554557 lcnt = max_t (u8 ,
555558 DIV_ROUND_UP (I3C_BUS_TLOW_OD_MIN_NS , core_period ), lcnt );
556559 scl_timing = SCL_I3C_TIMING_HCNT (hcnt ) | SCL_I3C_TIMING_LCNT (lcnt );
557560 writel (scl_timing , master -> regs + SCL_I3C_OD_TIMING );
561+ master -> i3c_od_timing = scl_timing ;
558562
559563 lcnt = DIV_ROUND_UP (core_rate , I3C_BUS_SDR1_SCL_RATE ) - hcnt ;
560564 scl_timing = SCL_EXT_LCNT_1 (lcnt );
@@ -565,6 +569,7 @@ static int dw_i3c_clk_cfg(struct dw_i3c_master *master)
565569 lcnt = DIV_ROUND_UP (core_rate , I3C_BUS_SDR4_SCL_RATE ) - hcnt ;
566570 scl_timing |= SCL_EXT_LCNT_4 (lcnt );
567571 writel (scl_timing , master -> regs + SCL_EXT_LCNT_TIMING );
572+ master -> ext_lcnt_timing = scl_timing ;
568573
569574 return 0 ;
570575}
@@ -586,16 +591,21 @@ static int dw_i2c_clk_cfg(struct dw_i3c_master *master)
586591 scl_timing = SCL_I2C_FMP_TIMING_HCNT (hcnt ) |
587592 SCL_I2C_FMP_TIMING_LCNT (lcnt );
588593 writel (scl_timing , master -> regs + SCL_I2C_FMP_TIMING );
594+ master -> i2c_fmp_timing = scl_timing ;
589595
590596 lcnt = DIV_ROUND_UP (I3C_BUS_I2C_FM_TLOW_MIN_NS , core_period );
591597 hcnt = DIV_ROUND_UP (core_rate , I3C_BUS_I2C_FM_SCL_RATE ) - lcnt ;
592598 scl_timing = SCL_I2C_FM_TIMING_HCNT (hcnt ) |
593599 SCL_I2C_FM_TIMING_LCNT (lcnt );
594600 writel (scl_timing , master -> regs + SCL_I2C_FM_TIMING );
601+ master -> i2c_fm_timing = scl_timing ;
595602
596603 writel (BUS_I3C_MST_FREE (lcnt ), master -> regs + BUS_FREE_TIMING );
604+ master -> bus_free_timing = BUS_I3C_MST_FREE (lcnt );
605+
597606 writel (readl (master -> regs + DEVICE_CTRL ) | DEV_CTRL_I2C_SLAVE_PRESENT ,
598607 master -> regs + DEVICE_CTRL );
608+ master -> i2c_slv_prsnt = true;
599609
600610 return 0 ;
601611}
@@ -650,7 +660,7 @@ static int dw_i3c_master_bus_init(struct i3c_master_controller *m)
650660
651661 writel (DEV_ADDR_DYNAMIC_ADDR_VALID | DEV_ADDR_DYNAMIC (ret ),
652662 master -> regs + DEVICE_ADDR );
653-
663+ master -> dev_addr = ret ;
654664 memset (& info , 0 , sizeof (info ));
655665 info .dyn_addr = ret ;
656666
@@ -1077,6 +1087,7 @@ static int dw_i3c_master_attach_i2c_dev(struct i2c_dev_desc *dev)
10771087
10781088 data -> index = pos ;
10791089 master -> devs [pos ].addr = dev -> addr ;
1090+ master -> devs [pos ].is_i2c_addr = true;
10801091 master -> free_pos &= ~BIT (pos );
10811092 i2c_dev_set_master_data (dev , data );
10821093
0 commit comments