Lines Matching refs:off
62 uint32_t off; member
110 static uint32_t xec_compute_frequency(uint32_t clk, uint32_t on, uint32_t off) in xec_compute_frequency() argument
112 return ((clk * XEC_PWM_FREQ_PF)/((on + 1) + (off + 1))); in xec_compute_frequency()
135 uint32_t *on, uint32_t *off) in xec_compute_on_off() argument
142 *off = on_off - *on - 2; in xec_compute_on_off()
145 static uint32_t xec_compute_dc(uint32_t on, uint32_t off) in xec_compute_dc() argument
147 int dc = (on + 1) + (off + 1); in xec_compute_dc()
190 uint32_t *on, uint32_t *off) in xec_select_best_div_on_off() argument
199 div, div_comp, on, off); in xec_select_best_div_on_off()
217 hc_params->off); in xec_compare_params()
224 lc_params->off); in xec_compare_params()
237 params->on, params->off, params->div); in xec_compare_params()
244 uint32_t on, uint32_t off) in xec_compute_and_set_parameters() argument
254 dc = xec_compute_dc(on, off); in xec_compute_and_set_parameters()
265 && (off <= UINT16_MAX)) { in xec_compute_and_set_parameters()
267 hc_params.off = off; in xec_compute_and_set_parameters()
278 &hc_params.off); in xec_compute_and_set_parameters()
280 hc_params.div, hc_params.on, hc_params.off); in xec_compute_and_set_parameters()
290 &lc_params.off); in xec_compute_and_set_parameters()
292 lc_params.div, lc_params.on, lc_params.off); in xec_compute_and_set_parameters()
309 regs->COUNT_OFF = params->off; in xec_compute_and_set_parameters()
324 uint32_t on, off; in pwm_xec_set_cycles() local
335 off = period_cycles - pulse_cycles; in pwm_xec_set_cycles()
337 target_freq = xec_compute_frequency(MCHP_PWM_INPUT_FREQ_HI, on, off); in pwm_xec_set_cycles()
352 xec_compute_and_set_parameters(dev, target_freq, on, off); in pwm_xec_set_cycles()