/linux-6.12.1/drivers/pwm/ |
D | pwm-lpc18xx-sct.c | 98 unsigned int period_ns; member 147 static void lpc18xx_pwm_config_period(struct pwm_chip *chip, u64 period_ns) in lpc18xx_pwm_config_period() argument 158 val = mul_u64_u64_div_u64(period_ns, lpc18xx_pwm->clk_rate, NSEC_PER_SEC); in lpc18xx_pwm_config_period() 192 int duty_ns, int period_ns) in lpc18xx_pwm_config() argument 197 if (period_ns < lpc18xx_pwm->min_period_ns || in lpc18xx_pwm_config() 198 period_ns > lpc18xx_pwm->max_period_ns) { in lpc18xx_pwm_config() 199 dev_err(pwmchip_parent(chip), "period %d not in range\n", period_ns); in lpc18xx_pwm_config() 213 if (requested_events > 2 && lpc18xx_pwm->period_ns != period_ns && in lpc18xx_pwm_config() 214 lpc18xx_pwm->period_ns) { in lpc18xx_pwm_config() 221 if ((requested_events <= 2 && lpc18xx_pwm->period_ns != period_ns) || in lpc18xx_pwm_config() [all …]
|
D | pwm-samsung.c | 65 u32 period_ns; member 309 int duty_ns, int period_ns, bool force_period) in __pwm_samsung_config() argument 322 if (chan->period_ns != period_ns || force_period) { in __pwm_samsung_config() 326 period = NSEC_PER_SEC / period_ns; in __pwm_samsung_config() 329 duty_ns, period_ns, period); in __pwm_samsung_config() 336 tcnt = period_ns / tin_ns; in __pwm_samsung_config() 373 chan->period_ns = period_ns; in __pwm_samsung_config() 381 int duty_ns, int period_ns) in pwm_samsung_config() argument 383 return __pwm_samsung_config(chip, pwm, duty_ns, period_ns, false); in pwm_samsung_config() 617 if (chan->period_ns) { in pwm_samsung_resume() [all …]
|
D | pwm-lp3943.c | 88 u64 duty_ns, u64 period_ns) in lp3943_pwm_config() argument 118 period_ns = clamp(period_ns, (u64)LP3943_MIN_PERIOD, (u64)LP3943_MAX_PERIOD); in lp3943_pwm_config() 119 val = (u8)((int)period_ns / LP3943_MIN_PERIOD - 1); in lp3943_pwm_config() 125 duty_ns = min(duty_ns, period_ns); in lp3943_pwm_config() 126 val = (u8)((int)duty_ns * LP3943_MAX_DUTY / (int)period_ns); in lp3943_pwm_config()
|
D | pwm-lpc32xx.c | 31 int duty_ns, int period_ns) in lpc32xx_pwm_config() argument 40 period_cycles = div64_u64(c * period_ns, in lpc32xx_pwm_config() 48 duty_cycles = div64_u64((unsigned long long)(period_ns - duty_ns) * 256, in lpc32xx_pwm_config() 49 period_ns); in lpc32xx_pwm_config()
|
D | pwm-pxa.c | 68 u64 duty_ns, u64 period_ns) in pxa_pwm_config() argument 78 c = c * period_ns; in pxa_pwm_config() 90 if (duty_ns == period_ns) in pxa_pwm_config() 93 dc = mul_u64_u64_div_u64(pv + 1, duty_ns, period_ns); in pxa_pwm_config()
|
D | pwm-fsl-ftm.c | 128 unsigned int period_ns, in fsl_pwm_calculate_period_clk() argument 137 c = c * period_ns; in fsl_pwm_calculate_period_clk() 155 unsigned int period_ns, in fsl_pwm_calculate_period() argument 162 ret = fsl_pwm_calculate_period_clk(fpc, period_ns, FSL_PWM_CLK_SYS, in fsl_pwm_calculate_period() 178 ret = fsl_pwm_calculate_period_clk(fpc, period_ns, m0, periodcfg); in fsl_pwm_calculate_period() 182 return fsl_pwm_calculate_period_clk(fpc, period_ns, m1, periodcfg); in fsl_pwm_calculate_period() 191 unsigned int period_ns = fsl_pwm_ticks_to_ns(fpc, period); in fsl_pwm_calculate_duty() local 194 do_div(duty, period_ns); in fsl_pwm_calculate_duty()
|
D | pwm-omap-dmtimer.c | 148 int duty_ns, int period_ns) in pwm_omap_dmtimer_config() argument 157 duty_ns, period_ns); in pwm_omap_dmtimer_config() 160 period_ns == pwm_get_period(pwm)) in pwm_omap_dmtimer_config() 193 period_cycles = pwm_omap_dmtimer_get_clock_cycles(clk_rate, period_ns); in pwm_omap_dmtimer_config() 199 period_ns, clk_rate); in pwm_omap_dmtimer_config() 212 duty_ns, period_ns, clk_rate); in pwm_omap_dmtimer_config()
|
D | pwm-tegra.c | 95 int duty_ns, int period_ns) in tegra_pwm_config() argument 109 c = DIV_ROUND_CLOSEST_ULL(c, period_ns); in tegra_pwm_config() 116 if (period_ns < pc->min_period_ns) in tegra_pwm_config() 145 period_ns); in tegra_pwm_config() 167 rate = mul_u64_u64_div_u64(pc->clk_rate, period_ns, in tegra_pwm_config()
|
D | pwm-rcar.c | 72 static int rcar_pwm_get_clock_division(struct rcar_pwm_chip *rp, int period_ns) in rcar_pwm_get_clock_division() argument 81 tmp = (u64)period_ns * clk_rate + div - 1; in rcar_pwm_get_clock_division() 106 int period_ns) in rcar_pwm_set_counter() argument 115 tmp = period_ns * 100ULL; in rcar_pwm_set_counter()
|
D | pwm-stmpe.c | 98 int duty_ns, int period_ns) in stmpe_24xx_pwm_config() argument 153 pwm->hwpwm, duty_ns, period_ns); in stmpe_24xx_pwm_config() 163 } else if (duty_ns == period_ns) { in stmpe_24xx_pwm_config() 187 duty = DIV_ROUND_CLOSEST(duty, period_ns); in stmpe_24xx_pwm_config()
|
D | pwm-img.c | 90 int duty_ns, int period_ns) in img_pwm_config() argument 98 if (period_ns < imgchip->min_period_ns || in img_pwm_config() 99 period_ns > imgchip->max_period_ns) { in img_pwm_config() 105 output_clk_hz = DIV_ROUND_UP(NSEC_PER_SEC, period_ns); in img_pwm_config() 126 duty = DIV_ROUND_UP(timebase * duty_ns, period_ns); in img_pwm_config()
|
D | pwm-twl-led.c | 74 int duty_ns, int period_ns) in twl4030_pwmled_config() argument 76 int duty_cycle = DIV_ROUND_UP(duty_ns * TWL4030_LED_MAX, period_ns) + 1; in twl4030_pwmled_config() 194 int duty_ns, int period_ns) in twl6030_pwmled_config() argument 196 int duty_cycle = (duty_ns * TWL6030_LED_MAX) / period_ns; in twl6030_pwmled_config()
|
D | pwm-mediatek.c | 119 int duty_ns, int period_ns) in pwm_mediatek_config() argument 140 cnt_period = DIV_ROUND_CLOSEST_ULL((u64)period_ns * 1000, resolution); in pwm_mediatek_config() 144 cnt_period = DIV_ROUND_CLOSEST_ULL((u64)period_ns * 1000, in pwm_mediatek_config() 150 dev_err(pwmchip_parent(chip), "period of %d ns not supported\n", period_ns); in pwm_mediatek_config()
|
D | pwm-brcmstb.c | 96 u64 duty_ns, u64 period_ns) in brcmstb_pwm_config() argument 108 if (duty_ns == period_ns) { in brcmstb_pwm_config() 124 pc = mul_u64_u64_div_u64(period_ns, rate, NSEC_PER_SEC); in brcmstb_pwm_config()
|
D | pwm-lpss.c | 125 int duty_ns, int period_ns) in pwm_lpss_prepare() argument 132 do_div(freq, period_ns); in pwm_lpss_prepare() 146 do_div(on_time_div, period_ns); in pwm_lpss_prepare()
|
D | pwm-sprd.c | 124 int duty_ns, int period_ns) in sprd_pwm_config() argument 140 duty = duty_ns * SPRD_PWM_MOD_MAX / period_ns; in sprd_pwm_config() 142 tmp = (u64)chn->clk_rate * period_ns; in sprd_pwm_config()
|
/linux-6.12.1/drivers/mtd/nand/raw/ |
D | renesas-nand-controller.c | 191 #define TO_CYCLES64(ps, period_ns) ((unsigned int)DIV_ROUND_UP_ULL(div_u64(ps, 1000), \ argument 192 period_ns)) 894 unsigned int period_ns = 1000000000 / rnandc->ext_clk_rate; in rnandc_setup_interface() local 911 TIMINGS_ASYN_TRWP(TO_CYCLES64(sdr->tRP_min, period_ns)) | in rnandc_setup_interface() 912 TIMINGS_ASYN_TRWH(TO_CYCLES64(sdr->tREH_min, period_ns)); in rnandc_setup_interface() 914 TIM_SEQ0_TCCS(TO_CYCLES64(sdr->tCCS_min, period_ns)) | in rnandc_setup_interface() 915 TIM_SEQ0_TADL(TO_CYCLES64(sdr->tADL_min, period_ns)) | in rnandc_setup_interface() 916 TIM_SEQ0_TRHW(TO_CYCLES64(sdr->tRHW_min, period_ns)) | in rnandc_setup_interface() 917 TIM_SEQ0_TWHR(TO_CYCLES64(sdr->tWHR_min, period_ns)); in rnandc_setup_interface() 919 TIM_SEQ1_TWB(TO_CYCLES64(sdr->tWB_max, period_ns)) | in rnandc_setup_interface() [all …]
|
D | pl35x-nand-controller.c | 99 #define TO_CYCLES(ps, period_ns) (DIV_ROUND_UP((ps) / 1000, period_ns)) argument 791 unsigned int period_ns, val; in pl35x_nfc_setup_interface() local 809 period_ns = NSEC_PER_SEC / clk_get_rate(mclk); in pl35x_nfc_setup_interface() 815 val = TO_CYCLES(sdr->tRC_min, period_ns); in pl35x_nfc_setup_interface() 823 val = TO_CYCLES(sdr->tWC_min, period_ns); in pl35x_nfc_setup_interface() 834 val = TO_CYCLES(sdr->tWP_min, period_ns); in pl35x_nfc_setup_interface() 839 val = TO_CYCLES(sdr->tCLR_min, period_ns); in pl35x_nfc_setup_interface() 844 val = TO_CYCLES(sdr->tAR_min, period_ns); in pl35x_nfc_setup_interface() 849 val = TO_CYCLES(sdr->tRR_min, period_ns); in pl35x_nfc_setup_interface()
|
/linux-6.12.1/include/linux/ |
D | pwm.h | 326 int period_ns) in pwm_config() argument 333 if (duty_ns < 0 || period_ns < 0) in pwm_config() 337 if (state.duty_cycle == duty_ns && state.period == period_ns) in pwm_config() 341 state.period = period_ns; in pwm_config() 445 int period_ns) in pwm_config() argument
|
/linux-6.12.1/drivers/gpu/drm/i915/ |
D | i915_pmu.c | 359 static void engine_sample(struct intel_engine_cs *engine, unsigned int period_ns) in engine_sample() argument 370 add_sample(&pmu->sample[I915_SAMPLE_WAIT], period_ns); in engine_sample() 372 add_sample(&pmu->sample[I915_SAMPLE_SEMA], period_ns); in engine_sample() 391 add_sample(&pmu->sample[I915_SAMPLE_BUSY], period_ns); in engine_sample() 395 engines_sample(struct intel_gt *gt, unsigned int period_ns) in engines_sample() argument 417 engine_sample(engine, period_ns); in engines_sample() 420 engine_sample(engine, period_ns); in engines_sample() 436 frequency_sample(struct intel_gt *gt, unsigned int period_ns) in frequency_sample() argument 469 val, period_ns / 1000); in frequency_sample() 475 period_ns / 1000); in frequency_sample() [all …]
|
/linux-6.12.1/drivers/gpu/drm/vkms/ |
D | vkms_crtc.c | 24 output->period_ns); in vkms_vblank_simulate() 71 out->period_ns = ktime_set(0, vblank->framedur_ns); in vkms_enable_vblank() 72 hrtimer_start(&out->vblank_hrtimer, out->period_ns, HRTIMER_MODE_REL); in vkms_enable_vblank() 110 *vblank_time -= output->period_ns; in vkms_get_vblank_timestamp()
|
/linux-6.12.1/drivers/net/ethernet/marvell/octeontx2/af/ |
D | ptp.c | 120 ktime_t delta_ns, period_ns; in ptp_reset_thresh() local 132 period_ns = ktime_set(0, (NSEC_PER_SEC + 100 - ptp_clock_hi)); in ptp_reset_thresh() 135 period_ns = ktime_set(0, (NSEC_PER_SEC + 100 - delta_ns)); in ptp_reset_thresh() 138 hrtimer_forward_now(hrtimer, period_ns); in ptp_reset_thresh() 146 ktime_t period_ns; in ptp_hrtimer_start() local 148 period_ns = ktime_set(0, (NSEC_PER_SEC + 100 - start_ns)); in ptp_hrtimer_start() 149 hrtimer_start(&ptp->hrtimer, period_ns, HRTIMER_MODE_REL); in ptp_hrtimer_start()
|
/linux-6.12.1/drivers/gpu/drm/vmwgfx/ |
D | vmwgfx_vkms.c | 171 du->vkms.period_ns); in vmw_vkms_vblank_simulate() 274 *vblank_time -= du->vkms.period_ns; in vmw_vkms_get_vblank_timestamp() 295 du->vkms.period_ns = ktime_set(0, vblank->framedur_ns); in vmw_vkms_enable_vblank() 296 hrtimer_start(&du->vkms.timer, du->vkms.period_ns, HRTIMER_MODE_REL); in vmw_vkms_enable_vblank() 312 du->vkms.period_ns = ktime_set(0, 0); in vmw_vkms_disable_vblank() 521 s64 nsecs = ktime_to_ns(du->vkms.period_ns); in vmw_vkms_lock_max_wait_ns()
|
/linux-6.12.1/drivers/net/ethernet/renesas/ |
D | ravb_ptp.c | 225 u64 period_ns; in ravb_ptp_perout() local 228 period_ns = req->period.sec * NSEC_PER_SEC + req->period.nsec; in ravb_ptp_perout() 236 if (period_ns > U32_MAX) { in ravb_ptp_perout() 246 perout->period = (u32)period_ns; in ravb_ptp_perout()
|
/linux-6.12.1/Documentation/driver-api/backlight/ |
D | lp855x-driver.rst | 47 * period_ns: 80 .period_ns = 1000000,
|