Lines Matching refs:lcnt
571 u8 hcnt, lcnt; in dw_i3c_clk_cfg() local
583 lcnt = DIV_ROUND_UP(core_rate, master->base.bus.scl_rate.i3c) - hcnt; in dw_i3c_clk_cfg()
584 if (lcnt < SCL_I3C_TIMING_CNT_MIN) in dw_i3c_clk_cfg()
585 lcnt = SCL_I3C_TIMING_CNT_MIN; in dw_i3c_clk_cfg()
587 scl_timing = SCL_I3C_TIMING_HCNT(hcnt) | SCL_I3C_TIMING_LCNT(lcnt); in dw_i3c_clk_cfg()
596 writel(BUS_I3C_MST_FREE(lcnt), master->regs + BUS_FREE_TIMING); in dw_i3c_clk_cfg()
597 master->bus_free_timing = BUS_I3C_MST_FREE(lcnt); in dw_i3c_clk_cfg()
600 lcnt = max_t(u8, in dw_i3c_clk_cfg()
601 DIV_ROUND_UP(I3C_BUS_TLOW_OD_MIN_NS, core_period), lcnt); in dw_i3c_clk_cfg()
602 scl_timing = SCL_I3C_TIMING_HCNT(hcnt) | SCL_I3C_TIMING_LCNT(lcnt); in dw_i3c_clk_cfg()
606 lcnt = DIV_ROUND_UP(core_rate, I3C_BUS_SDR1_SCL_RATE) - hcnt; in dw_i3c_clk_cfg()
607 scl_timing = SCL_EXT_LCNT_1(lcnt); in dw_i3c_clk_cfg()
608 lcnt = DIV_ROUND_UP(core_rate, I3C_BUS_SDR2_SCL_RATE) - hcnt; in dw_i3c_clk_cfg()
609 scl_timing |= SCL_EXT_LCNT_2(lcnt); in dw_i3c_clk_cfg()
610 lcnt = DIV_ROUND_UP(core_rate, I3C_BUS_SDR3_SCL_RATE) - hcnt; in dw_i3c_clk_cfg()
611 scl_timing |= SCL_EXT_LCNT_3(lcnt); in dw_i3c_clk_cfg()
612 lcnt = DIV_ROUND_UP(core_rate, I3C_BUS_SDR4_SCL_RATE) - hcnt; in dw_i3c_clk_cfg()
613 scl_timing |= SCL_EXT_LCNT_4(lcnt); in dw_i3c_clk_cfg()
623 u16 hcnt, lcnt; in dw_i2c_clk_cfg() local
632 lcnt = DIV_ROUND_UP(I3C_BUS_I2C_FMP_TLOW_MIN_NS, core_period); in dw_i2c_clk_cfg()
633 hcnt = DIV_ROUND_UP(core_rate, I3C_BUS_I2C_FM_PLUS_SCL_RATE) - lcnt; in dw_i2c_clk_cfg()
635 SCL_I2C_FMP_TIMING_LCNT(lcnt); in dw_i2c_clk_cfg()
639 lcnt = DIV_ROUND_UP(I3C_BUS_I2C_FM_TLOW_MIN_NS, core_period); in dw_i2c_clk_cfg()
640 hcnt = DIV_ROUND_UP(core_rate, I3C_BUS_I2C_FM_SCL_RATE) - lcnt; in dw_i2c_clk_cfg()
642 SCL_I2C_FM_TIMING_LCNT(lcnt); in dw_i2c_clk_cfg()
646 writel(BUS_I3C_MST_FREE(lcnt), master->regs + BUS_FREE_TIMING); in dw_i2c_clk_cfg()
647 master->bus_free_timing = BUS_I3C_MST_FREE(lcnt); in dw_i2c_clk_cfg()