Home
last modified time | relevance | path

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

12

/linux-4.19.296/drivers/pwm/
Dpwm-fsl-ftm.c93 int period_ns; member
172 unsigned long period_ns) in fsl_pwm_calculate_cycles() argument
177 c = c * period_ns; in fsl_pwm_calculate_cycles()
191 unsigned long period_ns, in fsl_pwm_calculate_period_cycles() argument
204 return fsl_pwm_calculate_cycles(fpc, period_ns); in fsl_pwm_calculate_period_cycles()
208 unsigned long period_ns) in fsl_pwm_calculate_period() argument
213 cycles = fsl_pwm_calculate_period_cycles(fpc, period_ns, in fsl_pwm_calculate_period()
231 cycles = fsl_pwm_calculate_period_cycles(fpc, period_ns, m0); in fsl_pwm_calculate_period()
239 return fsl_pwm_calculate_period_cycles(fpc, period_ns, m1); in fsl_pwm_calculate_period()
243 unsigned long period_ns, in fsl_pwm_calculate_duty() argument
[all …]
Dpwm-lpc18xx-sct.c100 unsigned int period_ns; member
148 static void lpc18xx_pwm_config_period(struct pwm_chip *chip, int period_ns) in lpc18xx_pwm_config_period() argument
153 val = (u64)period_ns * lpc18xx_pwm->clk_rate; in lpc18xx_pwm_config_period()
185 int duty_ns, int period_ns) in lpc18xx_pwm_config() argument
190 if (period_ns < lpc18xx_pwm->min_period_ns || in lpc18xx_pwm_config()
191 period_ns > lpc18xx_pwm->max_period_ns) { in lpc18xx_pwm_config()
192 dev_err(chip->dev, "period %d not in range\n", period_ns); in lpc18xx_pwm_config()
206 if (requested_events > 2 && lpc18xx_pwm->period_ns != period_ns && in lpc18xx_pwm_config()
207 lpc18xx_pwm->period_ns) { in lpc18xx_pwm_config()
214 if ((requested_events <= 2 && lpc18xx_pwm->period_ns != period_ns) || in lpc18xx_pwm_config()
[all …]
Dpwm-crc.c67 int duty_ns, int period_ns) in crc_pwm_config() argument
73 if (period_ns > PWM_MAX_PERIOD_NS) { in crc_pwm_config()
78 if (pwm_get_period(pwm) != period_ns) { in crc_pwm_config()
83 clk_div = PWM_BASE_CLK * period_ns / NSEC_PER_SEC; in crc_pwm_config()
93 level = duty_ns * PWM_MAX_LEVEL / period_ns; in crc_pwm_config()
Dpwm-samsung.c68 u32 period_ns; member
307 int duty_ns, int period_ns, bool force_period) in __pwm_samsung_config() argument
318 if (period_ns > NSEC_PER_SEC) in __pwm_samsung_config()
328 if (chan->period_ns != period_ns || force_period) { in __pwm_samsung_config()
332 period = NSEC_PER_SEC / period_ns; in __pwm_samsung_config()
335 duty_ns, period_ns, period); in __pwm_samsung_config()
342 tcnt = period_ns / tin_ns; in __pwm_samsung_config()
380 chan->period_ns = period_ns; in __pwm_samsung_config()
388 int duty_ns, int period_ns) in pwm_samsung_config() argument
390 return __pwm_samsung_config(chip, pwm, duty_ns, period_ns, false); in pwm_samsung_config()
[all …]
Dpwm-rcar.c71 static int rcar_pwm_get_clock_division(struct rcar_pwm_chip *rp, int period_ns) in rcar_pwm_get_clock_division() argument
84 if (period_ns <= max) in rcar_pwm_get_clock_division()
109 int period_ns) in rcar_pwm_set_counter() argument
118 tmp = period_ns * 100ULL; in rcar_pwm_set_counter()
146 int duty_ns, int period_ns) in rcar_pwm_config() argument
151 div = rcar_pwm_get_clock_division(rp, period_ns); in rcar_pwm_config()
165 ret = rcar_pwm_set_counter(rp, div, duty_ns, period_ns); in rcar_pwm_config()
Dpwm-puv3.c42 int duty_ns, int period_ns) in puv3_pwm_config() argument
49 c = c * period_ns; in puv3_pwm_config()
62 if (duty_ns == period_ns) in puv3_pwm_config()
65 dc = (pv + 1) * duty_ns / period_ns; in puv3_pwm_config()
Dpwm-pca9685.c85 int period_ns; member
258 int duty_ns, int period_ns) in pca9685_pwm_config() argument
265 if (period_ns != pca->period_ns) { in pca9685_pwm_config()
266 prescale = DIV_ROUND_CLOSEST(PCA9685_OSC_CLOCK_MHZ * period_ns, in pca9685_pwm_config()
286 pca->period_ns = period_ns; in pca9685_pwm_config()
307 if (duty_ns == period_ns) { in pca9685_pwm_config()
335 duty = DIV_ROUND_UP_ULL(duty, period_ns); in pca9685_pwm_config()
475 pca->period_ns = PCA9685_DEFAULT_PERIOD; in pca9685_pwm_probe()
Dpwm-lpc32xx.c34 int duty_ns, int period_ns) in lpc32xx_pwm_config() argument
43 period_cycles = div64_u64(c * period_ns, in lpc32xx_pwm_config()
51 duty_cycles = div64_u64((unsigned long long)(period_ns - duty_ns) * 256, in lpc32xx_pwm_config()
52 period_ns); in lpc32xx_pwm_config()
Dpwm-lp3943.c99 int duty_ns, int period_ns) in lp3943_pwm_config() argument
124 period_ns = clamp(period_ns, LP3943_MIN_PERIOD, LP3943_MAX_PERIOD); in lp3943_pwm_config()
125 val = (u8)(period_ns / LP3943_MIN_PERIOD - 1); in lp3943_pwm_config()
131 duty_ns = min(duty_ns, period_ns); in lp3943_pwm_config()
132 val = (u8)(duty_ns * LP3943_MAX_DUTY / period_ns); in lp3943_pwm_config()
Dpwm-omap-dmtimer.c97 int duty_ns, int period_ns) in pwm_omap_dmtimer_config() argument
107 duty_ns, period_ns); in pwm_omap_dmtimer_config()
111 period_ns == pwm_get_period(pwm)) { in pwm_omap_dmtimer_config()
147 period_cycles = pwm_omap_dmtimer_get_clock_cycles(clk_rate, period_ns); in pwm_omap_dmtimer_config()
153 period_ns, clk_rate); in pwm_omap_dmtimer_config()
166 duty_ns, period_ns, clk_rate); in pwm_omap_dmtimer_config()
Dpwm-pxa.c64 int duty_ns, int period_ns) in pxa_pwm_config() argument
75 c = c * period_ns; in pxa_pwm_config()
87 if (duty_ns == period_ns) in pxa_pwm_config()
90 dc = (pv + 1) * duty_ns / period_ns; in pxa_pwm_config()
Dpwm-bcm2835.c65 int duty_ns, int period_ns) in bcm2835_pwm_config() argument
78 if (period_ns <= MIN_PERIOD) { in bcm2835_pwm_config()
80 period_ns, MIN_PERIOD); in bcm2835_pwm_config()
85 writel(period_ns / scaler, pc->base + PERIOD(pwm->hwpwm)); in bcm2835_pwm_config()
Dpwm-stmpe.c104 int duty_ns, int period_ns) in stmpe_24xx_pwm_config() argument
157 pwm->hwpwm, duty_ns, period_ns); in stmpe_24xx_pwm_config()
167 } else if (duty_ns == period_ns) { in stmpe_24xx_pwm_config()
191 duty = DIV_ROUND_CLOSEST(duty, period_ns); in stmpe_24xx_pwm_config()
Dpwm-ep93xx.c71 int duty_ns, int period_ns) in ep93xx_pwm_config() argument
92 c *= period_ns; in ep93xx_pwm_config()
98 do_div(c, period_ns); in ep93xx_pwm_config()
Dpwm-jz4740.c87 int duty_ns, int period_ns) in jz4740_pwm_config() argument
96 tmp = (unsigned long long)clk_get_rate(jz4740->clk) * period_ns; in jz4740_pwm_config()
109 do_div(tmp, period_ns); in jz4740_pwm_config()
Dpwm-mxs.c45 int duty_ns, int period_ns) in mxs_pwm_config() argument
56 c = c * period_ns; in mxs_pwm_config()
67 do_div(c, period_ns); in mxs_pwm_config()
Dpwm-img.c96 int duty_ns, int period_ns) in img_pwm_config() argument
104 if (period_ns < pwm_chip->min_period_ns || in img_pwm_config()
105 period_ns > pwm_chip->max_period_ns) { in img_pwm_config()
111 output_clk_hz = DIV_ROUND_UP(NSEC_PER_SEC, period_ns); in img_pwm_config()
132 duty = DIV_ROUND_UP(timebase * duty_ns, period_ns); in img_pwm_config()
Dpwm-mediatek.c141 int duty_ns, int period_ns) in mtk_pwm_config() argument
158 cnt_period = DIV_ROUND_CLOSEST_ULL((u64)period_ns * 1000, resolution); in mtk_pwm_config()
162 cnt_period = DIV_ROUND_CLOSEST_ULL((u64)period_ns * 1000, in mtk_pwm_config()
168 dev_err(chip->dev, "period %d not supported\n", period_ns); in mtk_pwm_config()
Dpwm-twl-led.c70 int duty_ns, int period_ns) in twl4030_pwmled_config() argument
72 int duty_cycle = DIV_ROUND_UP(duty_ns * TWL4030_LED_MAX, period_ns) + 1; in twl4030_pwmled_config()
152 int duty_ns, int period_ns) in twl6030_pwmled_config() argument
154 int duty_cycle = (duty_ns * TWL6030_LED_MAX) / period_ns; in twl6030_pwmled_config()
Dpwm-tegra.c80 int duty_ns, int period_ns) in tegra_pwm_config() argument
94 c = DIV_ROUND_CLOSEST_ULL(c, period_ns); in tegra_pwm_config()
105 hz = DIV_ROUND_CLOSEST_ULL(100ULL * NSEC_PER_SEC, period_ns); in tegra_pwm_config()
Dpwm-lpss.c95 int duty_ns, int period_ns) in pwm_lpss_prepare() argument
102 do_div(freq, period_ns); in pwm_lpss_prepare()
116 do_div(on_time_div, period_ns); in pwm_lpss_prepare()
Dpwm-brcmstb.c107 int duty_ns, int period_ns) in brcmstb_pwm_config() argument
119 if (duty_ns == period_ns) { in brcmstb_pwm_config()
135 tmp = period_ns * rate; in brcmstb_pwm_config()
Dpwm-vt8500.c81 int duty_ns, int period_ns) in vt8500_pwm_config() argument
96 c = c * period_ns; in vt8500_pwm_config()
113 do_div(c, period_ns); in vt8500_pwm_config()
Dpwm-zx.c101 unsigned int duty_ns, unsigned int period_ns) in zx_pwm_config() argument
114 c = c * period_ns; in zx_pwm_config()
129 do_div(c, period_ns); in zx_pwm_config()
/linux-4.19.296/include/linux/
Dpwm.h264 int duty_ns, int period_ns);
332 int period_ns) in pwm_config() argument
339 if (duty_ns < 0 || period_ns < 0) in pwm_config()
343 if (state.duty_cycle == duty_ns && state.period == period_ns) in pwm_config()
347 state.period = period_ns; in pwm_config()
474 int period_ns) in pwm_config() argument

12