Lines Matching refs:duty
442 lcko->def.freq, lcko->def.duty.num, in litex_clk_print_params()
443 lcko->def.duty.den, lcko->def.phase); in litex_clk_print_params()
447 lcko->ts_config.duty.num, lcko->ts_config.duty.den, in litex_clk_print_params()
452 lcko->config.duty.num, lcko->config.duty.den, in litex_clk_print_params()
845 struct clk_duty *duty) in litex_clk_get_duty_cycle() argument
867 duty->num = 1; in litex_clk_get_duty_cycle()
868 duty->den = 2; in litex_clk_get_duty_cycle()
882 duty->num = high_time * 10 + edge * 5; in litex_clk_get_duty_cycle()
883 duty->den = (divider + edge) * 10; in litex_clk_get_duty_cycle()
889 static inline uint8_t litex_clk_calc_duty_percent(struct clk_duty *duty) in litex_clk_calc_duty_percent() argument
893 ht = duty->num; in litex_clk_calc_duty_percent()
894 div = duty->den; in litex_clk_calc_duty_percent()
904 struct clk_duty duty; in litex_clk_calc_duty_normal() local
912 duty = lcko->ts_config.duty; in litex_clk_calc_duty_normal()
914 err = litex_clk_get_duty_cycle(lcko, &duty); in litex_clk_calc_duty_normal()
920 high_duty = litex_clk_calc_duty_percent(&duty); in litex_clk_calc_duty_normal()
945 lcko->config.duty.num = high_time_it * 100 + 50 in litex_clk_calc_duty_normal()
947 lcko->config.duty.den = divider * 100; in litex_clk_calc_duty_normal()
962 static inline int litex_clk_calc_duty_high_time(struct clk_duty *duty, in litex_clk_calc_duty_high_time() argument
967 high_duty = litex_clk_calc_duty_percent(duty) * divider; in litex_clk_calc_duty_high_time()
974 struct clk_duty *duty) in litex_clk_set_duty_cycle() argument
981 high_duty = litex_clk_calc_duty_percent(duty), in litex_clk_set_duty_cycle()
985 lcko->ts_config.duty = *duty; in litex_clk_set_duty_cycle()
987 lcko->id, duty->num, duty->den); in litex_clk_set_duty_cycle()
1014 litex_clk_calc_duty_percent(&lcko->config.duty)); in litex_clk_set_duty_cycle()
1507 ret = litex_clk_set_duty_cycle(lcko, &lcko->def.duty); in litex_clk_set_def_clkout()
1551 struct clk_duty duty; in litex_clk_get_status() local
1558 ret = litex_clk_get_duty_cycle(lcko, &duty); in litex_clk_get_status()
1562 setup->duty = litex_clk_calc_duty_percent(&duty); in litex_clk_get_status()
1571 struct clk_duty duty; in litex_clk_on() local
1590 duty_perc = litex_clk_calc_duty_percent(&lcko->config.duty); in litex_clk_on()
1591 if (duty_perc != setup->duty) { in litex_clk_on()
1592 duty.num = setup->duty; in litex_clk_on()
1593 duty.den = 100; in litex_clk_on()
1594 ret = litex_clk_set_duty_cycle(lcko, &duty); in litex_clk_on()
1681 lcko->ts_config.duty = lcko->def.duty; in litex_clk_init_clkouts()