Lines Matching refs:setup
292 struct stm32f7_i2c_setup setup; member
371 struct stm32f7_i2c_setup *setup, in stm32f7_i2c_compute_timing() argument
376 setup->clock_src); in stm32f7_i2c_compute_timing()
378 setup->speed_freq); in stm32f7_i2c_compute_timing()
391 if (setup->speed >= STM32_I2C_SPEED_END) { in stm32f7_i2c_compute_timing()
393 setup->speed, STM32_I2C_SPEED_END - 1); in stm32f7_i2c_compute_timing()
397 if ((setup->rise_time > i2c_specs[setup->speed].rise_max) || in stm32f7_i2c_compute_timing()
398 (setup->fall_time > i2c_specs[setup->speed].fall_max)) { in stm32f7_i2c_compute_timing()
401 setup->rise_time, i2c_specs[setup->speed].rise_max, in stm32f7_i2c_compute_timing()
402 setup->fall_time, i2c_specs[setup->speed].fall_max); in stm32f7_i2c_compute_timing()
406 if (setup->dnf > STM32F7_I2C_DNF_MAX) { in stm32f7_i2c_compute_timing()
409 setup->dnf, STM32F7_I2C_DNF_MAX); in stm32f7_i2c_compute_timing()
413 if (setup->speed_freq > i2c_specs[setup->speed].rate) { in stm32f7_i2c_compute_timing()
415 setup->speed_freq, i2c_specs[setup->speed].rate); in stm32f7_i2c_compute_timing()
421 (setup->analog_filter ? in stm32f7_i2c_compute_timing()
424 (setup->analog_filter ? in stm32f7_i2c_compute_timing()
426 dnf_delay = setup->dnf * i2cclk; in stm32f7_i2c_compute_timing()
428 sdadel_min = i2c_specs[setup->speed].hddat_min + setup->fall_time - in stm32f7_i2c_compute_timing()
429 af_delay_min - (setup->dnf + 3) * i2cclk; in stm32f7_i2c_compute_timing()
431 sdadel_max = i2c_specs[setup->speed].vddat_max - setup->rise_time - in stm32f7_i2c_compute_timing()
432 af_delay_max - (setup->dnf + 4) * i2cclk; in stm32f7_i2c_compute_timing()
434 scldel_min = setup->rise_time + i2c_specs[setup->speed].sudat_min; in stm32f7_i2c_compute_timing()
485 clk_max = NSEC_PER_SEC / i2c_specs[setup->speed].rate_min; in stm32f7_i2c_compute_timing()
486 clk_min = NSEC_PER_SEC / i2c_specs[setup->speed].rate_max; in stm32f7_i2c_compute_timing()
504 if ((tscl_l < i2c_specs[setup->speed].l_min) || in stm32f7_i2c_compute_timing()
513 setup->rise_time + setup->fall_time; in stm32f7_i2c_compute_timing()
516 (tscl_h >= i2c_specs[setup->speed].h_min) && in stm32f7_i2c_compute_timing()
563 struct stm32f7_i2c_setup *setup) in stm32f7_i2c_setup_timing() argument
567 setup->speed = i2c_dev->speed; in stm32f7_i2c_setup_timing()
568 setup->speed_freq = i2c_specs[setup->speed].rate; in stm32f7_i2c_setup_timing()
569 setup->clock_src = clk_get_rate(i2c_dev->clk); in stm32f7_i2c_setup_timing()
571 if (!setup->clock_src) { in stm32f7_i2c_setup_timing()
577 ret = stm32f7_i2c_compute_timing(i2c_dev, setup, in stm32f7_i2c_setup_timing()
584 setup->speed = i2c_dev->speed; in stm32f7_i2c_setup_timing()
585 setup->speed_freq = in stm32f7_i2c_setup_timing()
586 i2c_specs[setup->speed].rate; in stm32f7_i2c_setup_timing()
589 i2c_specs[setup->speed].rate); in stm32f7_i2c_setup_timing()
602 setup->speed, setup->speed_freq, setup->clock_src); in stm32f7_i2c_setup_timing()
604 setup->rise_time, setup->fall_time); in stm32f7_i2c_setup_timing()
606 (setup->analog_filter ? "On" : "Off"), setup->dnf); in stm32f7_i2c_setup_timing()
644 if (i2c_dev->setup.analog_filter) in stm32f7_i2c_hw_config()
655 STM32F7_I2C_CR1_DNF(i2c_dev->setup.dnf)); in stm32f7_i2c_hw_config()
1806 const struct stm32f7_i2c_setup *setup; in stm32f7_i2c_probe() local
1892 setup = of_device_get_match_data(&pdev->dev); in stm32f7_i2c_probe()
1893 if (!setup) { in stm32f7_i2c_probe()
1898 i2c_dev->setup = *setup; in stm32f7_i2c_probe()
1903 i2c_dev->setup.rise_time = rise_time; in stm32f7_i2c_probe()
1908 i2c_dev->setup.fall_time = fall_time; in stm32f7_i2c_probe()
1910 ret = stm32f7_i2c_setup_timing(i2c_dev, &i2c_dev->setup); in stm32f7_i2c_probe()