/openbmc/u-boot/test/dm/ |
H A D | panel.c | 24 uint period_ns; in dm_test_panel() local 33 ut_assertok(sandbox_pwm_get_config(pwm, 0, &period_ns, &duty_ns, in dm_test_panel() 39 ut_assertok(sandbox_pwm_get_config(pwm, 0, &period_ns, &duty_ns, in dm_test_panel() 41 ut_asserteq(1000, period_ns); in dm_test_panel() 49 ut_assertok(sandbox_pwm_get_config(pwm, 0, &period_ns, &duty_ns, in dm_test_panel() 54 ut_assertok(sandbox_pwm_get_config(pwm, 0, &period_ns, &duty_ns, in dm_test_panel() 59 ut_assertok(sandbox_pwm_get_config(pwm, 0, &period_ns, &duty_ns, in dm_test_panel() 65 ut_assertok(sandbox_pwm_get_config(pwm, 0, &period_ns, &duty_ns, in dm_test_panel() 71 ut_assertok(sandbox_pwm_get_config(pwm, 0, &period_ns, &duty_ns, in dm_test_panel()
|
/openbmc/linux/drivers/pwm/ |
H A D | pwm-lpc18xx-sct.c | 100 unsigned int period_ns; member 194 int duty_ns, int period_ns) in lpc18xx_pwm_config() argument 199 if (period_ns < lpc18xx_pwm->min_period_ns || in lpc18xx_pwm_config() 200 period_ns > lpc18xx_pwm->max_period_ns) { in lpc18xx_pwm_config() 215 if (requested_events > 2 && lpc18xx_pwm->period_ns != period_ns && in lpc18xx_pwm_config() 216 lpc18xx_pwm->period_ns) { in lpc18xx_pwm_config() 223 if ((requested_events <= 2 && lpc18xx_pwm->period_ns != period_ns) || in lpc18xx_pwm_config() 224 !lpc18xx_pwm->period_ns) { in lpc18xx_pwm_config() 225 lpc18xx_pwm->period_ns = period_ns; in lpc18xx_pwm_config() 227 pwm_set_period(&chip->pwms[i], period_ns); in lpc18xx_pwm_config() [all …]
|
H A D | pwm-samsung.c | 65 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() 651 if (chan->period_ns) { in pwm_samsung_resume() [all …]
|
H A D | pwm-lpc32xx.c | 30 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()
|
H A D | pwm-lp3943.c | 96 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()
|
H A D | pwm-pxa.c | 69 u64 duty_ns, u64 period_ns) in pxa_pwm_config() argument 79 c = c * period_ns; in pxa_pwm_config() 91 if (duty_ns == period_ns) in pxa_pwm_config() 94 dc = mul_u64_u64_div_u64(pv + 1, duty_ns, period_ns); in pxa_pwm_config()
|
H A D | pwm-omap-dmtimer.c | 153 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()
|
H A D | pwm-fsl-ftm.c | 129 unsigned int period_ns, in fsl_pwm_calculate_period_clk() argument 138 c = c * period_ns; in fsl_pwm_calculate_period_clk() 156 unsigned int period_ns, in fsl_pwm_calculate_period() argument 163 ret = fsl_pwm_calculate_period_clk(fpc, period_ns, FSL_PWM_CLK_SYS, in fsl_pwm_calculate_period() 179 ret = fsl_pwm_calculate_period_clk(fpc, period_ns, m0, periodcfg); in fsl_pwm_calculate_period() 183 return fsl_pwm_calculate_period_clk(fpc, period_ns, m1, periodcfg); in fsl_pwm_calculate_period() 192 unsigned int period_ns = fsl_pwm_ticks_to_ns(fpc, period); in fsl_pwm_calculate_duty() local 195 do_div(duty, period_ns); in fsl_pwm_calculate_duty()
|
H A D | pwm-tegra.c | 98 int duty_ns, int period_ns) in tegra_pwm_config() argument 112 c = DIV_ROUND_CLOSEST_ULL(c, period_ns); in tegra_pwm_config() 119 if (period_ns < pc->min_period_ns) in tegra_pwm_config() 148 period_ns); in tegra_pwm_config() 170 rate = mul_u64_u64_div_u64(pc->clk_rate, period_ns, in tegra_pwm_config()
|
H A D | pwm-rcar.c | 73 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()
|
/openbmc/u-boot/arch/arm/cpu/armv7/s5p-common/ |
H A D | pwm.c | 58 int pwm_config(int pwm_id, int duty_ns, int period_ns) in pwm_config() argument 75 if (period_ns > NS_IN_SEC || duty_ns > NS_IN_SEC || period_ns == 0) in pwm_config() 78 if (duty_ns > period_ns) in pwm_config() 81 frequency = NS_IN_SEC / period_ns; in pwm_config() 87 tcnt = period_ns / tin_ns; in pwm_config()
|
/openbmc/u-boot/drivers/pwm/ |
H A D | sandbox_pwm.c | 26 uint period_ns; member 45 *period_nsp = chan->period_ns; in sandbox_pwm_get_config() 54 uint period_ns, uint duty_ns) in sandbox_pwm_set_config() argument 62 chan->period_ns = period_ns; in sandbox_pwm_set_config()
|
H A D | pwm-imx-util.c | 48 int pwm_imx_get_parms(int period_ns, int duty_ns, unsigned long *period_c, in pwm_imx_get_parms() argument 59 c = c * period_ns; in pwm_imx_get_parms() 67 do_div(c, period_ns); in pwm_imx_get_parms()
|
H A D | rk_pwm.c | 38 static int rk_pwm_set_config(struct udevice *dev, uint channel, uint period_ns, in rk_pwm_set_config() argument 45 debug("%s: period_ns=%u, duty_ns=%u\n", __func__, period_ns, duty_ns); in rk_pwm_set_config() 51 period = lldiv((uint64_t)(priv->freq / 1000) * period_ns, 1000000); in rk_pwm_set_config()
|
H A D | exynos_pwm.c | 19 uint period_ns, uint duty_ns) in exynos_pwm_set_config() argument 31 __func__, dev->name, channel, period_ns, duty_ns); in exynos_pwm_set_config() 42 tcnt = period_ns / rate_ns; in exynos_pwm_set_config()
|
H A D | pwm-uclass.c | 21 int pwm_set_config(struct udevice *dev, uint channel, uint period_ns, in pwm_set_config() argument 29 return ops->set_config(dev, channel, period_ns, duty_ns); in pwm_set_config()
|
H A D | pwm-imx.c | 27 int pwm_config(int pwm_id, int duty_ns, int period_ns) in pwm_config() argument 36 pwm_imx_get_parms(period_ns, duty_ns, &period_cycles, &duty_cycles, in pwm_config()
|
H A D | sunxi_pwm.c | 66 uint period_ns, uint duty_ns) in sunxi_pwm_set_config() argument 75 debug("%s: period_ns=%u, duty_ns=%u\n", __func__, period_ns, duty_ns); in sunxi_pwm_set_config() 84 period = lldiv(scaled_freq * period_ns, nsecs_per_sec); in sunxi_pwm_set_config()
|
H A D | tegra_pwm.c | 18 uint period_ns, uint duty_ns) in tegra_pwm_set_config() argument 31 pulse_width = duty_ns * 255 / period_ns; in tegra_pwm_set_config()
|
/openbmc/u-boot/include/ |
H A D | pwm.h | 24 int (*set_config)(struct udevice *dev, uint channel, uint period_ns, 58 int pwm_set_config(struct udevice *dev, uint channel, uint period_ns, 84 int pwm_config (int pwm_id, int duty_ns, int period_ns);
|
/openbmc/u-boot/drivers/power/regulator/ |
H A D | pwm_regulator.c | 22 int period_ns; member 79 priv->period_ns, (priv->period_ns / 100) * duty_cycle); in pwm_regulator_set_voltage() 102 priv->period_ns = args.args[1]; in pwm_regulator_ofdata_to_platdata()
|
/openbmc/linux/drivers/mtd/nand/raw/ |
H A D | renesas-nand-controller.c | 192 period_ns)) 919 TIM_SEQ1_TWB(TO_CYCLES64(sdr->tWB_max, period_ns)) | in rnandc_setup_interface() 920 TIM_SEQ1_TRR(TO_CYCLES64(sdr->tRR_min, period_ns)) | in rnandc_setup_interface() 921 TIM_SEQ1_TWW(TO_CYCLES64(sdr->tWW_min, period_ns)); in rnandc_setup_interface() 936 TIM_GEN_SEQ0_D0(TO_CYCLES64(cle - cyc, period_ns)) | in rnandc_setup_interface() 937 TIM_GEN_SEQ0_D1(TO_CYCLES64(cle - cyc, period_ns)) | in rnandc_setup_interface() 938 TIM_GEN_SEQ0_D2(TO_CYCLES64(bef_dly, period_ns)) | in rnandc_setup_interface() 939 TIM_GEN_SEQ0_D3(TO_CYCLES64(ca_to_data, period_ns)); in rnandc_setup_interface() 948 TIM_GEN_SEQ1_D4(TO_CYCLES64(ale - cyc, period_ns)) | in rnandc_setup_interface() 950 TIM_GEN_SEQ1_D6(TO_CYCLES64(bef_dly, period_ns)) | in rnandc_setup_interface() [all …]
|
/openbmc/u-boot/drivers/video/ |
H A D | pwm_backlight.c | 41 uint period_ns; member 56 duty_cycle = priv->period_ns * (priv->cur_level - priv->min_level) / in set_pwm() 58 ret = pwm_set_config(priv->pwm, priv->channel, priv->period_ns, in set_pwm() 204 priv->period_ns = args.args[1]; in pwm_backlight_ofdata_to_platdata()
|
/openbmc/linux/include/linux/ |
H A D | pwm.h | 324 int period_ns) in pwm_config() argument 331 if (duty_ns < 0 || period_ns < 0) in pwm_config() 335 if (state.duty_cycle == duty_ns && state.period == period_ns) in pwm_config() 339 state.period = period_ns; in pwm_config() 424 int period_ns) in pwm_config() argument
|
/openbmc/qemu/hw/timer/ |
H A D | avr_timer16.c | 112 if (t16->period_ns == 0) { in avr_timer16_ns_to_ticks() 115 return t / t16->period_ns; in avr_timer16_ns_to_ticks() 130 CNT(t16) * t16->period_ns; in avr_timer16_recalc_reset_time() 171 t16->period_ns = NANOSECONDS_PER_SECOND / t16->freq_hz; in avr_timer16_clksrc_update() 172 trace_avr_timer16_clksrc_update(t16->freq_hz, t16->period_ns, in avr_timer16_clksrc_update() 236 t16->reset_time_ns + ((CNT(t16) + alarm_offset) * t16->period_ns); in avr_timer16_set_alarm() 239 trace_avr_timer16_next_alarm(alarm_offset * t16->period_ns); in avr_timer16_set_alarm()
|