Lines Matching refs:lcnt
522 u8 hcnt, lcnt; in dw_i3c_clk_cfg() local
534 lcnt = DIV_ROUND_UP(core_rate, I3C_BUS_TYP_I3C_SCL_RATE) - hcnt; in dw_i3c_clk_cfg()
535 if (lcnt < SCL_I3C_TIMING_CNT_MIN) in dw_i3c_clk_cfg()
536 lcnt = SCL_I3C_TIMING_CNT_MIN; in dw_i3c_clk_cfg()
538 scl_timing = SCL_I3C_TIMING_HCNT(hcnt) | SCL_I3C_TIMING_LCNT(lcnt); in dw_i3c_clk_cfg()
542 writel(BUS_I3C_MST_FREE(lcnt), master->regs + BUS_FREE_TIMING); in dw_i3c_clk_cfg()
544 lcnt = DIV_ROUND_UP(I3C_BUS_TLOW_OD_MIN_NS, core_period); in dw_i3c_clk_cfg()
545 scl_timing = SCL_I3C_TIMING_HCNT(hcnt) | SCL_I3C_TIMING_LCNT(lcnt); in dw_i3c_clk_cfg()
548 lcnt = DIV_ROUND_UP(core_rate, I3C_BUS_SDR1_SCL_RATE) - hcnt; in dw_i3c_clk_cfg()
549 scl_timing = SCL_EXT_LCNT_1(lcnt); in dw_i3c_clk_cfg()
550 lcnt = DIV_ROUND_UP(core_rate, I3C_BUS_SDR2_SCL_RATE) - hcnt; in dw_i3c_clk_cfg()
551 scl_timing |= SCL_EXT_LCNT_2(lcnt); in dw_i3c_clk_cfg()
552 lcnt = DIV_ROUND_UP(core_rate, I3C_BUS_SDR3_SCL_RATE) - hcnt; in dw_i3c_clk_cfg()
553 scl_timing |= SCL_EXT_LCNT_3(lcnt); in dw_i3c_clk_cfg()
554 lcnt = DIV_ROUND_UP(core_rate, I3C_BUS_SDR4_SCL_RATE) - hcnt; in dw_i3c_clk_cfg()
555 scl_timing |= SCL_EXT_LCNT_4(lcnt); in dw_i3c_clk_cfg()
564 u16 hcnt, lcnt; in dw_i2c_clk_cfg() local
573 lcnt = DIV_ROUND_UP(I3C_BUS_I2C_FMP_TLOW_MIN_NS, core_period); in dw_i2c_clk_cfg()
574 hcnt = DIV_ROUND_UP(core_rate, I3C_BUS_I2C_FM_PLUS_SCL_RATE) - lcnt; in dw_i2c_clk_cfg()
576 SCL_I2C_FMP_TIMING_LCNT(lcnt); in dw_i2c_clk_cfg()
579 lcnt = DIV_ROUND_UP(I3C_BUS_I2C_FM_TLOW_MIN_NS, core_period); in dw_i2c_clk_cfg()
580 hcnt = DIV_ROUND_UP(core_rate, I3C_BUS_I2C_FM_SCL_RATE) - lcnt; in dw_i2c_clk_cfg()
582 SCL_I2C_FM_TIMING_LCNT(lcnt); in dw_i2c_clk_cfg()
585 writel(BUS_I3C_MST_FREE(lcnt), master->regs + BUS_FREE_TIMING); in dw_i2c_clk_cfg()