Lines Matching full:psc
57 u32 psc; member
96 * Other channels are already enabled, so the configured PSC and in stm32_pwm_round_waveform_tohw()
99 ret = regmap_read(priv->regmap, TIM_PSC, &wfhw->psc); in stm32_pwm_round_waveform_tohw()
108 (u64)NSEC_PER_SEC * (wfhw->psc + 1)); in stm32_pwm_round_waveform_tohw()
140 u64 psc = mul_u64_u64_div_u64(wf->period_length_ns, rate, in stm32_pwm_round_waveform_tohw() local
144 wfhw->psc = min_t(u64, psc, MAX_TIM_PSC); in stm32_pwm_round_waveform_tohw()
147 (u64)NSEC_PER_SEC * (wfhw->psc + 1)); in stm32_pwm_round_waveform_tohw()
168 (u64)NSEC_PER_SEC * (wfhw->psc + 1)); in stm32_pwm_round_waveform_tohw()
185 …dev_dbg(&chip->dev, "pwm#%u: %lld/%lld [+%lld] @%lu -> CCER: %08x, PSC: %08x, ARR: %08x, CCR: %08x… in stm32_pwm_round_waveform_tohw()
187 rate, wfhw->ccer, wfhw->psc, wfhw->arr, wfhw->ccr); in stm32_pwm_round_waveform_tohw()
224 …wf->period_length_ns = stm32_pwm_mul_u64_u64_div_u64_roundup(((u64)wfhw->psc + 1) * (wfhw->arr + 1… in stm32_pwm_round_waveform_fromhw()
227 ccr_ns = stm32_pwm_mul_u64_u64_div_u64_roundup(((u64)wfhw->psc + 1) * wfhw->ccr, in stm32_pwm_round_waveform_fromhw()
232 stm32_pwm_mul_u64_u64_div_u64_roundup(((u64)wfhw->psc + 1) * (wfhw->arr + 1 - wfhw->ccr), in stm32_pwm_round_waveform_fromhw()
246 …dev_dbg(&chip->dev, "pwm#%u: CCER: %08x, PSC: %08x, ARR: %08x, CCR: %08x @%lu -> %lld/%lld [+%lld]… in stm32_pwm_round_waveform_fromhw()
247 pwm->hwpwm, wfhw->ccer, wfhw->psc, wfhw->arr, wfhw->ccr, rate, in stm32_pwm_round_waveform_fromhw()
271 ret = regmap_read(priv->regmap, TIM_PSC, &wfhw->psc); in stm32_pwm_read_waveform()
318 /* If there are other channels enabled, don't update PSC and ARR */ in stm32_pwm_write_waveform()
320 u32 psc, arr; in stm32_pwm_write_waveform() local
322 ret = regmap_read(priv->regmap, TIM_PSC, &psc); in stm32_pwm_write_waveform()
326 if (psc != wfhw->psc) { in stm32_pwm_write_waveform()
340 ret = regmap_write(priv->regmap, TIM_PSC, wfhw->psc); in stm32_pwm_write_waveform()
539 unsigned int psc = 0, icpsc, scale; in stm32_pwm_capture() local
566 while ((div > priv->max_arr) && (psc < MAX_TIM_PSC)) { in stm32_pwm_capture()
567 psc++; in stm32_pwm_capture()
569 do_div(div, psc + 1); in stm32_pwm_capture()
572 regmap_write(priv->regmap, TIM_PSC, psc); in stm32_pwm_capture()
607 if (psc && scale > 1) { in stm32_pwm_capture()
609 psc /= scale; in stm32_pwm_capture()
610 regmap_write(priv->regmap, TIM_PSC, psc); in stm32_pwm_capture()
618 prd = (unsigned long long)raw_prd * (psc + 1) * NSEC_PER_SEC; in stm32_pwm_capture()
674 prd = (unsigned long long)raw_prd * (psc + 1) * NSEC_PER_SEC; in stm32_pwm_capture()
676 dty = (unsigned long long)raw_dty * (psc + 1) * NSEC_PER_SEC; in stm32_pwm_capture()