Lines Matching refs:on
61 uint32_t on; 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
141 *on = ((on_off * dc) / XEC_PWM_DC_PF) - 1; in xec_compute_on_off()
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()
150 dc = (((uint64_t)(on + 1) * XEC_PWM_DC_PF) / dc); 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()
216 hc_params->on, in xec_compare_params()
223 lc_params->on, 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()
264 && (on <= UINT16_MAX) in xec_compute_and_set_parameters()
266 hc_params.on = on; in xec_compute_and_set_parameters()
277 &hc_params.on, in xec_compute_and_set_parameters()
280 hc_params.div, hc_params.on, hc_params.off); in xec_compute_and_set_parameters()
289 &lc_params.on, in xec_compute_and_set_parameters()
292 lc_params.div, lc_params.on, lc_params.off); in xec_compute_and_set_parameters()
308 regs->COUNT_ON = params->on; in xec_compute_and_set_parameters()
324 uint32_t on, off; in pwm_xec_set_cycles() local
334 on = 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()