Home
last modified time | relevance | path

Searched refs:period_ns (Results 1 – 25 of 58) sorted by relevance

123

/Linux-v6.1/drivers/pwm/
Dpwm-lpc18xx-sct.c99 unsigned int period_ns; member
148 static void lpc18xx_pwm_config_period(struct pwm_chip *chip, u64 period_ns) in lpc18xx_pwm_config_period() argument
159 val = mul_u64_u64_div_u64(period_ns, lpc18xx_pwm->clk_rate, NSEC_PER_SEC); in lpc18xx_pwm_config_period()
193 int duty_ns, int period_ns) in lpc18xx_pwm_config() argument
198 if (period_ns < lpc18xx_pwm->min_period_ns || in lpc18xx_pwm_config()
199 period_ns > lpc18xx_pwm->max_period_ns) { in lpc18xx_pwm_config()
200 dev_err(chip->dev, "period %d not in range\n", period_ns); in lpc18xx_pwm_config()
214 if (requested_events > 2 && lpc18xx_pwm->period_ns != period_ns && in lpc18xx_pwm_config()
215 lpc18xx_pwm->period_ns) { in lpc18xx_pwm_config()
222 if ((requested_events <= 2 && lpc18xx_pwm->period_ns != period_ns) || in lpc18xx_pwm_config()
[all …]
Dpwm-samsung.c65 u32 period_ns; member
318 int duty_ns, int period_ns, bool force_period) in __pwm_samsung_config() argument
331 if (chan->period_ns != period_ns || force_period) { in __pwm_samsung_config()
335 period = NSEC_PER_SEC / period_ns; in __pwm_samsung_config()
338 duty_ns, period_ns, period); in __pwm_samsung_config()
345 tcnt = period_ns / tin_ns; in __pwm_samsung_config()
383 chan->period_ns = period_ns; in __pwm_samsung_config()
391 int duty_ns, int period_ns) in pwm_samsung_config() argument
393 return __pwm_samsung_config(chip, pwm, duty_ns, period_ns, false); in pwm_samsung_config()
653 if (chan->period_ns) { in pwm_samsung_resume()
[all …]
Dpwm-lp3943.c96 u64 duty_ns, u64 period_ns) in lp3943_pwm_config() argument
126 period_ns = clamp(period_ns, (u64)LP3943_MIN_PERIOD, (u64)LP3943_MAX_PERIOD); in lp3943_pwm_config()
127 val = (u8)((int)period_ns / LP3943_MIN_PERIOD - 1); in lp3943_pwm_config()
133 duty_ns = min(duty_ns, period_ns); in lp3943_pwm_config()
134 val = (u8)((int)duty_ns * LP3943_MAX_DUTY / (int)period_ns); in lp3943_pwm_config()
Dpwm-lpc32xx.c30 int duty_ns, int period_ns) in lpc32xx_pwm_config() argument
39 period_cycles = div64_u64(c * period_ns, in lpc32xx_pwm_config()
47 duty_cycles = div64_u64((unsigned long long)(period_ns - duty_ns) * 256, in lpc32xx_pwm_config()
48 period_ns); in lpc32xx_pwm_config()
Dpwm-pxa.c61 u64 duty_ns, u64 period_ns) in pxa_pwm_config() argument
72 c = c * period_ns; in pxa_pwm_config()
84 if (duty_ns == period_ns) in pxa_pwm_config()
87 dc = mul_u64_u64_div_u64(pv + 1, duty_ns, period_ns); in pxa_pwm_config()
Dpwm-omap-dmtimer.c153 int duty_ns, int period_ns) in pwm_omap_dmtimer_config() argument
162 duty_ns, period_ns); in pwm_omap_dmtimer_config()
165 period_ns == pwm_get_period(pwm)) in pwm_omap_dmtimer_config()
198 period_cycles = pwm_omap_dmtimer_get_clock_cycles(clk_rate, period_ns); in pwm_omap_dmtimer_config()
204 period_ns, clk_rate); in pwm_omap_dmtimer_config()
217 duty_ns, period_ns, clk_rate); in pwm_omap_dmtimer_config()
Dpwm-fsl-ftm.c133 unsigned int period_ns, in fsl_pwm_calculate_period_clk() argument
142 c = c * period_ns; in fsl_pwm_calculate_period_clk()
160 unsigned int period_ns, in fsl_pwm_calculate_period() argument
167 ret = fsl_pwm_calculate_period_clk(fpc, period_ns, FSL_PWM_CLK_SYS, in fsl_pwm_calculate_period()
183 ret = fsl_pwm_calculate_period_clk(fpc, period_ns, m0, periodcfg); in fsl_pwm_calculate_period()
187 return fsl_pwm_calculate_period_clk(fpc, period_ns, m1, periodcfg); in fsl_pwm_calculate_period()
196 unsigned int period_ns = fsl_pwm_ticks_to_ns(fpc, period); in fsl_pwm_calculate_duty() local
199 do_div(duty, period_ns); in fsl_pwm_calculate_duty()
Dpwm-tegra.c99 int duty_ns, int period_ns) in tegra_pwm_config() argument
113 c = DIV_ROUND_CLOSEST_ULL(c, period_ns); in tegra_pwm_config()
120 if (period_ns < pc->min_period_ns) in tegra_pwm_config()
149 (NSEC_PER_SEC / period_ns) << PWM_DUTY_WIDTH; in tegra_pwm_config()
160 rate = mul_u64_u64_div_u64(pc->clk_rate, period_ns, in tegra_pwm_config()
Dpwm-rcar.c73 static int rcar_pwm_get_clock_division(struct rcar_pwm_chip *rp, int period_ns) in rcar_pwm_get_clock_division() argument
82 tmp = (u64)period_ns * clk_rate + div - 1; in rcar_pwm_get_clock_division()
107 int period_ns) in rcar_pwm_set_counter() argument
116 tmp = period_ns * 100ULL; in rcar_pwm_set_counter()
Dpwm-stmpe.c100 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()
Dpwm-img.c92 int duty_ns, int period_ns) in img_pwm_config() argument
100 if (period_ns < imgchip->min_period_ns || in img_pwm_config()
101 period_ns > imgchip->max_period_ns) { in img_pwm_config()
107 output_clk_hz = DIV_ROUND_UP(NSEC_PER_SEC, period_ns); in img_pwm_config()
128 duty = DIV_ROUND_UP(timebase * duty_ns, period_ns); in img_pwm_config()
Dpwm-mediatek.c118 int duty_ns, int period_ns) in pwm_mediatek_config() argument
139 cnt_period = DIV_ROUND_CLOSEST_ULL((u64)period_ns * 1000, resolution); in pwm_mediatek_config()
143 cnt_period = DIV_ROUND_CLOSEST_ULL((u64)period_ns * 1000, in pwm_mediatek_config()
149 dev_err(chip->dev, "period of %d ns not supported\n", period_ns); in pwm_mediatek_config()
Dpwm-twl-led.c75 int duty_ns, int period_ns) in twl4030_pwmled_config() argument
77 int duty_cycle = DIV_ROUND_UP(duty_ns * TWL4030_LED_MAX, period_ns) + 1; in twl4030_pwmled_config()
196 int duty_ns, int period_ns) in twl6030_pwmled_config() argument
198 int duty_cycle = (duty_ns * TWL6030_LED_MAX) / period_ns; in twl6030_pwmled_config()
Dpwm-brcmstb.c97 u64 duty_ns, u64 period_ns) in brcmstb_pwm_config() argument
109 if (duty_ns == period_ns) { in brcmstb_pwm_config()
125 pc = mul_u64_u64_div_u64(period_ns, rate, NSEC_PER_SEC); in brcmstb_pwm_config()
Dpwm-lpss.c125 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()
Dpwm-sprd.c119 int duty_ns, int period_ns) in sprd_pwm_config() argument
135 duty = duty_ns * SPRD_PWM_MOD_MAX / period_ns; in sprd_pwm_config()
137 tmp = (u64)chn->clk_rate * period_ns; in sprd_pwm_config()
Dpwm-hibvt.c100 int duty_cycle_ns, int period_ns) in hibvt_pwm_config() argument
107 period = div_u64(freq * period_ns, 1000); in hibvt_pwm_config()
108 duty = div_u64(period * duty_cycle_ns, period_ns); in hibvt_pwm_config()
/Linux-v6.1/drivers/mtd/nand/raw/
Drenesas-nand-controller.c191 #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 …]
Dpl35x-nand-controller.c101 #define TO_CYCLES(ps, period_ns) (DIV_ROUND_UP((ps) / 1000, period_ns)) argument
784 unsigned int period_ns, val; in pl35x_nfc_setup_interface() local
802 period_ns = NSEC_PER_SEC / clk_get_rate(mclk); in pl35x_nfc_setup_interface()
808 val = TO_CYCLES(sdr->tRC_min, period_ns); in pl35x_nfc_setup_interface()
816 val = TO_CYCLES(sdr->tWC_min, period_ns); in pl35x_nfc_setup_interface()
827 val = TO_CYCLES(sdr->tWP_min, period_ns); in pl35x_nfc_setup_interface()
832 val = TO_CYCLES(sdr->tCLR_min, period_ns); in pl35x_nfc_setup_interface()
837 val = TO_CYCLES(sdr->tAR_min, period_ns); in pl35x_nfc_setup_interface()
842 val = TO_CYCLES(sdr->tRR_min, period_ns); in pl35x_nfc_setup_interface()
/Linux-v6.1/drivers/net/ethernet/marvell/octeontx2/af/
Dptp.c92 ktime_t delta_ns, period_ns; in ptp_reset_thresh() local
104 period_ns = ktime_set(0, (NSEC_PER_SEC + 100 - ptp_clock_hi)); in ptp_reset_thresh()
107 period_ns = ktime_set(0, (NSEC_PER_SEC + 100 - delta_ns)); in ptp_reset_thresh()
110 hrtimer_forward_now(hrtimer, period_ns); in ptp_reset_thresh()
118 ktime_t period_ns; in ptp_hrtimer_start() local
120 period_ns = ktime_set(0, (NSEC_PER_SEC + 100 - start_ns)); in ptp_hrtimer_start()
121 hrtimer_start(&ptp->hrtimer, period_ns, HRTIMER_MODE_REL); in ptp_hrtimer_start()
/Linux-v6.1/drivers/gpu/drm/i915/
Di915_pmu.c292 static void engine_sample(struct intel_engine_cs *engine, unsigned int period_ns) in engine_sample() argument
303 add_sample(&pmu->sample[I915_SAMPLE_WAIT], period_ns); in engine_sample()
305 add_sample(&pmu->sample[I915_SAMPLE_SEMA], period_ns); in engine_sample()
324 add_sample(&pmu->sample[I915_SAMPLE_BUSY], period_ns); in engine_sample()
328 engines_sample(struct intel_gt *gt, unsigned int period_ns) in engines_sample() argument
347 engine_sample(engine, period_ns); in engines_sample()
350 engine_sample(engine, period_ns); in engines_sample()
371 frequency_sample(struct intel_gt *gt, unsigned int period_ns) in frequency_sample() argument
404 intel_gpu_freq(rps, val), period_ns / 1000); in frequency_sample()
410 period_ns / 1000); in frequency_sample()
[all …]
/Linux-v6.1/include/linux/
Dpwm.h326 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()
437 int period_ns) in pwm_config() argument
/Linux-v6.1/drivers/gpu/drm/vkms/
Dvkms_crtc.c24 output->period_ns); in vkms_vblank_simulate()
73 out->period_ns = ktime_set(0, vblank->framedur_ns); in vkms_enable_vblank()
74 hrtimer_start(&out->vblank_hrtimer, out->period_ns, HRTIMER_MODE_REL); in vkms_enable_vblank()
113 *vblank_time -= output->period_ns; in vkms_get_vblank_timestamp()
/Linux-v6.1/Documentation/driver-api/backlight/
Dlp855x-driver.rst47 * period_ns:
80 .period_ns = 1000000,
/Linux-v6.1/drivers/net/ethernet/renesas/
Dravb_ptp.c232 u64 period_ns; in ravb_ptp_perout() local
235 period_ns = req->period.sec * NSEC_PER_SEC + req->period.nsec; in ravb_ptp_perout()
243 if (period_ns > U32_MAX) { in ravb_ptp_perout()
253 perout->period = (u32)period_ns; in ravb_ptp_perout()

123