/linux-6.12.1/drivers/pwm/ |
D | pwm-xilinx.c | 100 u64 period_cycles, duty_cycles; in xilinx_pwm_apply() local 115 period_cycles = min_t(u64, state->period, U32_MAX * NSEC_PER_SEC); in xilinx_pwm_apply() 116 period_cycles = mul_u64_u32_div(period_cycles, rate, NSEC_PER_SEC); in xilinx_pwm_apply() 117 period_cycles = min_t(u64, period_cycles, priv->max + 2); in xilinx_pwm_apply() 118 if (period_cycles < 2) in xilinx_pwm_apply() 130 if (duty_cycles >= period_cycles) in xilinx_pwm_apply() 131 duty_cycles = period_cycles - 1; in xilinx_pwm_apply() 135 duty_cycles = period_cycles; in xilinx_pwm_apply() 139 tlr0 = xilinx_timer_tlr_cycles(priv, tcsr0, period_cycles); in xilinx_pwm_apply()
|
D | pwm-ep93xx.c | 53 unsigned long period_cycles; in ep93xx_pwm_apply() local 102 period_cycles = c; in ep93xx_pwm_apply() 104 c = period_cycles; in ep93xx_pwm_apply() 109 if (period_cycles < 0x10000 && duty_cycles < 0x10000) { in ep93xx_pwm_apply() 113 if (period_cycles > term) { in ep93xx_pwm_apply() 114 writew(period_cycles, base + EP93XX_PWMx_TERM_COUNT); in ep93xx_pwm_apply() 118 writew(period_cycles, base + EP93XX_PWMx_TERM_COUNT); in ep93xx_pwm_apply()
|
D | pwm-lpc32xx.c | 35 int period_cycles, duty_cycles; in lpc32xx_pwm_config() local 40 period_cycles = div64_u64(c * period_ns, in lpc32xx_pwm_config() 42 if (!period_cycles || period_cycles > 256) in lpc32xx_pwm_config() 44 if (period_cycles == 256) in lpc32xx_pwm_config() 45 period_cycles = 0; in lpc32xx_pwm_config() 57 val |= (period_cycles << 8) | duty_cycles; in lpc32xx_pwm_config()
|
D | pwm-tiehrpwm.c | 110 unsigned long period_cycles[NUM_PWM_CHANNEL]; member 221 u32 period_cycles, duty_cycles; in ehrpwm_pwm_config() local 232 period_cycles = (unsigned long)c; in ehrpwm_pwm_config() 234 if (period_cycles < 1) { in ehrpwm_pwm_config() 235 period_cycles = 1; in ehrpwm_pwm_config() 249 if (pc->period_cycles[i] && in ehrpwm_pwm_config() 250 (pc->period_cycles[i] != period_cycles)) { in ehrpwm_pwm_config() 265 pc->period_cycles[pwm->hwpwm] = period_cycles; in ehrpwm_pwm_config() 268 if (set_prescale_div(period_cycles/PERIOD_MAX, &ps_divval, in ehrpwm_pwm_config() 280 period_cycles = period_cycles / ps_divval; in ehrpwm_pwm_config() [all …]
|
D | pwm-pxa.c | 72 unsigned long period_cycles, prescale, pv, dc; in pxa_pwm_config() local 80 period_cycles = c; in pxa_pwm_config() 82 if (period_cycles < 1) in pxa_pwm_config() 83 period_cycles = 1; in pxa_pwm_config() 84 prescale = (period_cycles - 1) / 1024; in pxa_pwm_config() 85 pv = period_cycles / (prescale + 1) - 1; in pxa_pwm_config()
|
D | pwm-imx27.c | 222 unsigned long period_cycles, duty_cycles, prescale; in pwm_imx27_apply() local 233 period_cycles = c; in pwm_imx27_apply() 235 prescale = period_cycles / 0x10000 + 1; in pwm_imx27_apply() 237 period_cycles /= prescale; in pwm_imx27_apply() 247 if (period_cycles > 2) in pwm_imx27_apply() 248 period_cycles -= 2; in pwm_imx27_apply() 250 period_cycles = 0; in pwm_imx27_apply() 267 writel(period_cycles, imx->mmio_base + MX3_PWMPR); in pwm_imx27_apply()
|
D | pwm-omap-dmtimer.c | 151 u32 period_cycles, duty_cycles; in pwm_omap_dmtimer_config() local 193 period_cycles = pwm_omap_dmtimer_get_clock_cycles(clk_rate, period_ns); in pwm_omap_dmtimer_config() 196 if (period_cycles < 2) { in pwm_omap_dmtimer_config() 209 } else if (duty_cycles >= period_cycles) { in pwm_omap_dmtimer_config() 214 duty_cycles = period_cycles - 1; in pwm_omap_dmtimer_config() 220 DIV_ROUND_CLOSEST_ULL((u64)NSEC_PER_SEC * period_cycles, in pwm_omap_dmtimer_config() 223 load_value = (DM_TIMER_MAX - period_cycles) + 1; in pwm_omap_dmtimer_config()
|
D | pwm-vt8500.c | 77 unsigned long period_cycles, prescale, pv, dc; in vt8500_pwm_config() local 90 period_cycles = c; in vt8500_pwm_config() 92 if (period_cycles < 1) in vt8500_pwm_config() 93 period_cycles = 1; in vt8500_pwm_config() 94 prescale = (period_cycles - 1) / 4096; in vt8500_pwm_config() 95 pv = period_cycles / (prescale + 1) - 1; in vt8500_pwm_config()
|
D | pwm-tiecap.c | 53 u32 period_cycles, duty_cycles; in ecap_pwm_config() local 60 period_cycles = (u32)c; in ecap_pwm_config() 62 if (period_cycles < 1) { in ecap_pwm_config() 63 period_cycles = 1; in ecap_pwm_config() 84 writel(period_cycles, pc->mmio_base + CAP1); in ecap_pwm_config() 92 writel(period_cycles, pc->mmio_base + CAP3); in ecap_pwm_config()
|
D | pwm-bcm2835.c | 65 unsigned long long period_cycles; in bcm2835_pwm_apply() local 90 period_cycles = DIV_ROUND_CLOSEST_ULL(state->period * pc->rate, NSEC_PER_SEC); in bcm2835_pwm_apply() 93 if (period_cycles < PERIOD_MIN) in bcm2835_pwm_apply() 96 writel(period_cycles, pc->base + PERIOD(pwm->hwpwm)); in bcm2835_pwm_apply()
|
D | pwm-mxs.c | 54 unsigned int period_cycles, duty_cycles; in mxs_pwm_apply() local 85 period_cycles = c; in mxs_pwm_apply() 101 writel(PERIOD_PERIOD(period_cycles) | pol_bits | PERIOD_CDIV(div), in mxs_pwm_apply()
|
D | pwm-rz-mtu3.c | 113 u64 period_cycles) in rz_mtu3_pwm_calculate_prescale() argument 122 prescaled_period_cycles = period_cycles >> 16; in rz_mtu3_pwm_calculate_prescale() 323 u64 period_cycles; in rz_mtu3_pwm_config() local 333 period_cycles = mul_u64_u32_div(state->period, rz_mtu3_pwm->rate, in rz_mtu3_pwm_config() 335 prescale = rz_mtu3_pwm_calculate_prescale(rz_mtu3_pwm, period_cycles); in rz_mtu3_pwm_config() 350 pv = rz_mtu3_pwm_calculate_pv_or_dc(period_cycles, prescale); in rz_mtu3_pwm_config()
|