Lines Matching refs:period_cycles
90 uint32_t *period_cycles, uint32_t *pulse_cycles) in pwm_rcar_update_clk() argument
101 if (*period_cycles > RCAR_PWM_MAX_CYCLE) { in pwm_rcar_update_clk()
103 while (*period_cycles > RCAR_PWM_MAX_CYCLE) { in pwm_rcar_update_clk()
105 *period_cycles /= 2; in pwm_rcar_update_clk()
114 while (*period_cycles < (RCAR_PWM_MAX_CYCLE / 2)) { in pwm_rcar_update_clk()
119 *period_cycles *= 2; in pwm_rcar_update_clk()
135 static int pwm_rcar_set_cycles(const struct device *dev, uint32_t channel, uint32_t period_cycles, in pwm_rcar_set_cycles() argument
151 if (period_cycles == 0U || pulse_cycles == 0U || pulse_cycles > period_cycles) { in pwm_rcar_set_cycles()
157 config->reg_addr, pulse_cycles, period_cycles, in pwm_rcar_set_cycles()
158 (pulse_cycles * 100U / period_cycles)); in pwm_rcar_set_cycles()
174 if (period_cycles > RCAR_PWM_MAX_CYCLE || period_cycles < (RCAR_PWM_MAX_CYCLE / 2)) { in pwm_rcar_set_cycles()
176 ret = pwm_rcar_update_clk(config, channel, &period_cycles, &pulse_cycles); in pwm_rcar_set_cycles()
185 reg_val |= (period_cycles << RCAR_PWM_CNT_CYC_SHIFT); in pwm_rcar_set_cycles()