Lines Matching refs:init
380 static int i2c_compute_timing(struct stm32_i2c_init_s *init, in i2c_compute_timing() argument
406 specs = get_specs(init->bus_rate); in i2c_compute_timing()
408 DMSG("I2C speed out of bound: %"PRId32"Hz", init->bus_rate); in i2c_compute_timing()
416 if (init->rise_time > specs->rise_max || in i2c_compute_timing()
417 init->fall_time > specs->fall_max) { in i2c_compute_timing()
419 init->rise_time, specs->rise_max, in i2c_compute_timing()
420 init->fall_time, specs->fall_max); in i2c_compute_timing()
424 if (init->digital_filter_coef > STM32_I2C_DIGITAL_FILTER_MAX) { in i2c_compute_timing()
426 init->digital_filter_coef, STM32_I2C_DIGITAL_FILTER_MAX); in i2c_compute_timing()
431 if (init->analog_filter) { in i2c_compute_timing()
435 dnf_delay = init->digital_filter_coef * i2cclk; in i2c_compute_timing()
437 sdadel_min = specs->hddat_min + init->fall_time; in i2c_compute_timing()
438 delay = af_delay_min - ((init->digital_filter_coef + 3) * i2cclk); in i2c_compute_timing()
442 sdadel_max = specs->vddat_max - init->rise_time; in i2c_compute_timing()
443 delay = af_delay_max - ((init->digital_filter_coef + 4) * i2cclk); in i2c_compute_timing()
447 scldel_min = init->rise_time + specs->sudat_min; in i2c_compute_timing()
514 init->rise_time + in i2c_compute_timing()
515 init->fall_time; in i2c_compute_timing()
596 struct stm32_i2c_init_s *init, in i2c_setup_timing() argument
620 rc = i2c_compute_timing(init, clock_src, timing); in i2c_setup_timing()
623 if (init->bus_rate > I2C_STANDARD_RATE) { in i2c_setup_timing()
624 init->bus_rate = get_lower_rate(init->bus_rate); in i2c_setup_timing()
626 init->bus_rate); in i2c_setup_timing()
639 init->bus_rate, clock_src); in i2c_setup_timing()
641 init->rise_time, init->fall_time); in i2c_setup_timing()
643 init->analog_filter ? "On" : "Off", init->digital_filter_coef); in i2c_setup_timing()
686 struct stm32_i2c_init_s *init, in stm32_i2c_get_setup_from_fdt() argument
696 memset(init, 0, sizeof(*init)); in stm32_i2c_get_setup_from_fdt()
702 init->dt_status = info.status; in stm32_i2c_get_setup_from_fdt()
703 init->pbase = info.reg; in stm32_i2c_get_setup_from_fdt()
704 init->reg_size = info.reg_size; in stm32_i2c_get_setup_from_fdt()
706 res = clk_dt_get_by_index(fdt, node, 0, &init->clock); in stm32_i2c_get_setup_from_fdt()
712 init->rise_time = fdt32_to_cpu(*cuint); in stm32_i2c_get_setup_from_fdt()
714 init->rise_time = STM32_I2C_RISE_TIME_DEFAULT; in stm32_i2c_get_setup_from_fdt()
718 init->fall_time = fdt32_to_cpu(*cuint); in stm32_i2c_get_setup_from_fdt()
720 init->fall_time = STM32_I2C_FALL_TIME_DEFAULT; in stm32_i2c_get_setup_from_fdt()
724 init->bus_rate = fdt32_to_cpu(*cuint); in stm32_i2c_get_setup_from_fdt()
726 if (init->bus_rate > I2C_FAST_PLUS_RATE) { in stm32_i2c_get_setup_from_fdt()
728 init->bus_rate, I2C_FAST_PLUS_RATE); in stm32_i2c_get_setup_from_fdt()
732 init->bus_rate = I2C_STANDARD_RATE; in stm32_i2c_get_setup_from_fdt()