Searched refs:duty_ns (Results 1 - 43 of 43) sorted by relevance

/linux-4.4.14/drivers/staging/iio/trigger/
H A Diio-trig-bfin-timer.h8 * @duty_ns: Length of the trigger pulse in nanoseconds.
14 * duty_ns are used to configure the type of the trigger pulse. If output_enable
16 * and duty_ns are ignored.
21 unsigned int duty_ns; member in struct:iio_bfin_timer_trigger_pdata
H A Diio-trig-bfin-timer.c233 val = (unsigned long long)get_sclk() * pdata->duty_ns; iio_bfin_tmr_trigger_probe()
/linux-4.4.14/drivers/pwm/
H A Dpwm-imx.c59 struct pwm_device *pwm, int duty_ns, int period_ns);
66 struct pwm_device *pwm, int duty_ns, int period_ns) imx_pwm_config_v1()
77 * register to follow the ratio of duty_ns vs. period_ns imx_pwm_config_v1()
88 u32 p = max * duty_ns / period_ns; imx_pwm_config_v1()
110 struct pwm_device *pwm, int duty_ns, int period_ns) imx_pwm_config_v2()
160 c = (unsigned long long)period_cycles * duty_ns; imx_pwm_config_v2()
204 struct pwm_device *pwm, int duty_ns, int period_ns) imx_pwm_config()
213 ret = imx->config(chip, pwm, duty_ns, period_ns); imx_pwm_config()
252 struct pwm_device *pwm, int duty_ns, int period_ns);
65 imx_pwm_config_v1(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) imx_pwm_config_v1() argument
109 imx_pwm_config_v2(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) imx_pwm_config_v2() argument
203 imx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) imx_pwm_config() argument
H A Dpwm-puv3.c39 * duty_ns = 10^9 * (PRESCALE + 1) * DC / PWM_CLK_RATE
42 int duty_ns, int period_ns) puv3_pwm_config()
62 if (duty_ns == period_ns) puv3_pwm_config()
65 dc = (pv + 1) * duty_ns / period_ns; puv3_pwm_config()
41 puv3_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) puv3_pwm_config() argument
H A Dpwm-mtk-disp.c68 int duty_ns, int period_ns) mtk_disp_pwm_config()
76 * Find period, high_width and clk_div to suit duty_ns and period_ns. mtk_disp_pwm_config()
80 * duty_ns = 10^9 * (clk_div + 1) * high_width / PWM_CLK_RATE mtk_disp_pwm_config()
83 * high_width = (PWM_CLK_RATE * duty_ns) / (10^9 * (clk_div + 1)) mtk_disp_pwm_config()
96 high_width = div64_u64(rate * duty_ns, div); mtk_disp_pwm_config()
67 mtk_disp_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) mtk_disp_pwm_config() argument
H A Dpwm-pca9685.c82 int duty_ns; member in struct:pca9685
92 int duty_ns, int period_ns) pca9685_pwm_config()
125 if (duty_ns == pca->duty_ns) { pca9685_pwm_config()
137 pca->duty_ns = duty_ns; pca9685_pwm_config()
139 if (duty_ns < 1) { pca9685_pwm_config()
150 if (duty_ns == period_ns) { pca9685_pwm_config()
177 duty = PCA9685_COUNTER_RANGE * (unsigned long long)duty_ns; pca9685_pwm_config()
317 pca->duty_ns = 0; pca9685_pwm_probe()
91 pca9685_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) pca9685_pwm_config() argument
H A Dpwm-ab8500.c28 int duty_ns, int period_ns) ab8500_pwm_config()
38 lower_val = duty_ns & 0x00FF; ab8500_pwm_config()
43 higher_val = ((duty_ns & 0x0300) >> 8); ab8500_pwm_config()
27 ab8500_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) ab8500_pwm_config() argument
H A Dpwm-lpss.c83 int duty_ns, int period_ns) pwm_lpss_config()
105 if (duty_ns <= 0) pwm_lpss_config()
106 duty_ns = 1; pwm_lpss_config()
107 on_time_div = 255 - (255 * duty_ns / period_ns); pwm_lpss_config()
82 pwm_lpss_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) pwm_lpss_config() argument
H A Dpwm-pxa.c61 * duty_ns = 10^9 * (PRESCALE + 1) * DC / PWM_CLK_RATE
64 int duty_ns, int period_ns) pxa_pwm_config()
87 if (duty_ns == period_ns) pxa_pwm_config()
90 dc = (pv + 1) * duty_ns / period_ns; pxa_pwm_config()
63 pxa_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) pxa_pwm_config() argument
H A Dpwm-brcmstb.c103 * The PWM core framework specifies that the "duty_ns" parameter is in fact the
107 int duty_ns, int period_ns) brcmstb_pwm_config()
115 * If asking for a duty_ns equal to period_ns, we need to substract brcmstb_pwm_config()
119 if (duty_ns == period_ns) { brcmstb_pwm_config()
139 tmp = (duty_ns + 1) * rate; brcmstb_pwm_config()
147 if (pc == PWM_PERIOD_MIN || (dc < PWM_ON_MIN && duty_ns)) brcmstb_pwm_config()
106 brcmstb_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) brcmstb_pwm_config() argument
H A Dpwm-rcar.c108 static int rcar_pwm_set_counter(struct rcar_pwm_chip *rp, int div, int duty_ns, rcar_pwm_set_counter() argument
122 tmp = duty_ns * 100ULL; rcar_pwm_set_counter()
150 int duty_ns, int period_ns) rcar_pwm_config()
159 /* Let the core driver set pwm->period if disabled and duty_ns == 0 */ rcar_pwm_config()
160 if (!test_bit(PWMF_ENABLED, &pwm->flags) && !duty_ns) rcar_pwm_config()
165 ret = rcar_pwm_set_counter(rp, div, duty_ns, period_ns); rcar_pwm_config()
149 rcar_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) rcar_pwm_config() argument
H A Dpwm-spear.c78 int duty_ns, int period_ns) spear_pwm_config()
86 * Find pv, dc and prescale to suit duty_ns and period_ns. This is done spear_pwm_config()
90 * duty_ns = 10^9 * (PRESCALE + 1) * DC / PWM_CLK_RATE spear_pwm_config()
93 * DC = (PWM_CLK_RATE * duty_ns) / (10^9 * (PRESCALE + 1)) spear_pwm_config()
101 val = clk_rate * duty_ns; spear_pwm_config()
104 /* if duty_ns and period_ns are not achievable then return */ spear_pwm_config()
77 spear_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) spear_pwm_config() argument
H A Dpwm-bcm-kona.c112 int duty_ns, int period_ns) kona_pwmc_config()
120 * Find period count, duty count and prescale to suit duty_ns and kona_pwmc_config()
124 * duty_ns = 10^9 * (PRESCALE + 1) * DC / PWM_CLK_RATE kona_pwmc_config()
127 * DC = (PWM_CLK_RATE * duty_ns) / (10^9 * (PRESCALE + 1)) kona_pwmc_config()
137 val = rate * duty_ns; kona_pwmc_config()
140 /* If duty_ns or period_ns are not achievable then return */ kona_pwmc_config()
111 kona_pwmc_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) kona_pwmc_config() argument
H A Dpwm-bfin.c66 int duty_ns, int period_ns) bfin_pwm_config()
76 val = (unsigned long long)period * duty_ns; bfin_pwm_config()
65 bfin_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) bfin_pwm_config() argument
H A Dpwm-crc.c67 int duty_ns, int period_ns) crc_pwm_config()
93 level = duty_ns * PWM_MAX_LEVEL / period_ns; crc_pwm_config()
66 crc_pwm_config(struct pwm_chip *c, struct pwm_device *pwm, int duty_ns, int period_ns) crc_pwm_config() argument
H A Dpwm-lpc32xx.c35 int duty_ns, int period_ns) lpc32xx_pwm_config()
66 c = 256 * duty_ns; lpc32xx_pwm_config()
34 lpc32xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) lpc32xx_pwm_config() argument
H A Dpwm-samsung.c63 * @duty_ns: current duty time in nanoseconds programmed to the hardware
68 u32 duty_ns; member in struct:samsung_pwm_channel
292 int duty_ns, int period_ns) pwm_samsung_config()
306 if (period_ns == chan->period_ns && duty_ns == chan->duty_ns) pwm_samsung_config()
322 dev_dbg(our_chip->chip.dev, "duty_ns=%d, period_ns=%d (%u)\n", pwm_samsung_config()
323 duty_ns, period_ns, period); pwm_samsung_config()
338 tcmp = duty_ns / tin_ns; pwm_samsung_config()
370 chan->duty_ns = duty_ns; pwm_samsung_config()
604 chan->duty_ns = 0; pwm_samsung_suspend()
291 pwm_samsung_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) pwm_samsung_config() argument
H A Dpwm-twl-led.c70 int duty_ns, int period_ns) twl4030_pwmled_config()
72 int duty_cycle = DIV_ROUND_UP(duty_ns * TWL4030_LED_MAX, period_ns) + 1; twl4030_pwmled_config()
152 int duty_ns, int period_ns) twl6030_pwmled_config()
154 int duty_cycle = (duty_ns * TWL6030_LED_MAX) / period_ns; twl6030_pwmled_config()
69 twl4030_pwmled_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) twl4030_pwmled_config() argument
151 twl6030_pwmled_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) twl6030_pwmled_config() argument
H A Dpwm-lpc18xx-sct.c137 * when duty_ns == period_ns. LPC18xx SCT allows to set a conflict lpc18xx_pwm_set_conflict_res()
166 struct pwm_device *pwm, int duty_ns) lpc18xx_pwm_config_duty()
172 val = (u64)duty_ns * lpc18xx_pwm->clk_rate; lpc18xx_pwm_config_duty()
185 int duty_ns, int period_ns) lpc18xx_pwm_config()
224 lpc18xx_pwm_config_duty(chip, pwm, duty_ns); lpc18xx_pwm_config()
165 lpc18xx_pwm_config_duty(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns) lpc18xx_pwm_config_duty() argument
184 lpc18xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) lpc18xx_pwm_config() argument
H A Dpwm-bcm2835.c66 int duty_ns, int period_ns) bcm2835_pwm_config()
76 writel(duty_ns / pc->scaler, pc->base + DUTY(pwm->hwpwm)); bcm2835_pwm_config()
65 bcm2835_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) bcm2835_pwm_config() argument
H A Dpwm-berlin.c59 int duty_ns, int period_ns) berlin_pwm_config()
82 cycles = tmp * duty_ns; berlin_pwm_config()
58 berlin_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm_dev, int duty_ns, int period_ns) berlin_pwm_config() argument
H A Dpwm-clps711x.c69 int duty_ns, int period_ns) clps711x_pwm_config()
77 duty = clps711x_get_duty(pwm, duty_ns); clps711x_pwm_config()
68 clps711x_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) clps711x_pwm_config() argument
H A Dpwm-ep93xx.c71 int duty_ns, int period_ns) ep93xx_pwm_config()
97 c *= duty_ns; ep93xx_pwm_config()
70 ep93xx_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) ep93xx_pwm_config() argument
H A Dpwm-jz4740.c109 int duty_ns, int period_ns) jz4740_pwm_config()
130 tmp = (unsigned long long)period * duty_ns; jz4740_pwm_config()
108 jz4740_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) jz4740_pwm_config() argument
H A Dpwm-mxs.c51 int duty_ns, int period_ns) mxs_pwm_config()
72 c *= duty_ns; mxs_pwm_config()
50 mxs_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) mxs_pwm_config() argument
H A Dpwm-tegra.c67 int duty_ns, int period_ns) tegra_pwm_config()
76 * Convert from duty_ns / period_ns to a fixed number of duty ticks tegra_pwm_config()
80 c = duty_ns * ((1 << PWM_DUTY_WIDTH) - 1) + period_ns / 2; tegra_pwm_config()
66 tegra_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) tegra_pwm_config() argument
H A Dpwm-tiecap.c63 * duty_ns = 10^9 * duty_cycles / PWM_CLK_RATE
66 int duty_ns, int period_ns) ecap_pwm_config()
86 c = c * duty_ns; ecap_pwm_config()
65 ecap_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) ecap_pwm_config() argument
H A Dpwm-fsl-ftm.c221 unsigned long duty_ns) fsl_pwm_calculate_duty()
227 duty = (unsigned long long)duty_ns * (val + 1); fsl_pwm_calculate_duty()
234 int duty_ns, int period_ns) fsl_pwm_config()
254 if (!fpc->period_ns && duty_ns) { fsl_pwm_config()
271 duty = fsl_pwm_calculate_duty(fpc, period_ns, duty_ns); fsl_pwm_config()
219 fsl_pwm_calculate_duty(struct fsl_pwm_chip *fpc, unsigned long period_ns, unsigned long duty_ns) fsl_pwm_calculate_duty() argument
233 fsl_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) fsl_pwm_config() argument
H A Dcore.c434 * @duty_ns: "on" time (in nanoseconds)
439 int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) pwm_config() argument
443 if (!pwm || duty_ns < 0 || period_ns <= 0 || duty_ns > period_ns) pwm_config()
446 err = pwm->chip->ops->config(pwm->chip, pwm, duty_ns, period_ns); pwm_config()
450 pwm->duty_cycle = duty_ns; pwm_config()
H A Dpwm-renesas-tpu.c253 int duty_ns, int period_ns) tpu_pwm_config()
283 if (duty_ns) { tpu_pwm_config()
285 / (NSEC_PER_SEC / duty_ns); tpu_pwm_config()
252 tpu_pwm_config(struct pwm_chip *chip, struct pwm_device *_pwm, int duty_ns, int period_ns) tpu_pwm_config() argument
H A Dpwm-sti.c116 int duty_ns, int period_ns) sti_pwm_config()
175 pwmvalx = cdata->max_pwm_cnt * duty_ns / period_ns; sti_pwm_config()
187 prescale, period_ns, duty_ns, pwmvalx); sti_pwm_config()
115 sti_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) sti_pwm_config() argument
H A Dpwm-atmel-hlcdc.c54 int duty_ns, int period_ns) atmel_hlcdc_pwm_config()
59 u64 pwmcval = duty_ns * 256; atmel_hlcdc_pwm_config()
52 atmel_hlcdc_pwm_config(struct pwm_chip *c, struct pwm_device *pwm, int duty_ns, int period_ns) atmel_hlcdc_pwm_config() argument
H A Dpwm-img.c89 int duty_ns, int period_ns) img_pwm_config()
124 duty = DIV_ROUND_UP(timebase * duty_ns, period_ns); img_pwm_config()
88 img_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) img_pwm_config() argument
H A Dpwm-lp3943.c99 int duty_ns, int period_ns) lp3943_pwm_config()
131 val = (u8)(duty_ns * LP3943_MAX_DUTY / period_ns); lp3943_pwm_config()
98 lp3943_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) lp3943_pwm_config() argument
H A Dpwm-rockchip.c102 int duty_ns, int period_ns) rockchip_pwm_config()
120 div = clk_rate * duty_ns; rockchip_pwm_config()
101 rockchip_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) rockchip_pwm_config() argument
H A Dpwm-sun4i.c100 int duty_ns, int period_ns) sun4i_pwm_config()
144 div *= duty_ns; sun4i_pwm_config()
99 sun4i_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) sun4i_pwm_config() argument
H A Dpwm-twl.c72 int duty_ns, int period_ns) twl_pwm_config()
74 int duty_cycle = DIV_ROUND_UP(duty_ns * TWL_PWM_MAX, period_ns) + 1; twl_pwm_config()
71 twl_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) twl_pwm_config() argument
H A Dpwm-vt8500.c81 int duty_ns, int period_ns) vt8500_pwm_config()
112 c = (unsigned long long)pv * duty_ns; vt8500_pwm_config()
80 vt8500_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) vt8500_pwm_config() argument
H A Dpwm-tiehrpwm.c234 * duty_ns = 10^9 * (ps_divval * duty_cycles) / PWM_CLK_RATE
237 int duty_ns, int period_ns) ehrpwm_pwm_config()
258 c = c * duty_ns; ehrpwm_pwm_config()
236 ehrpwm_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) ehrpwm_pwm_config() argument
H A Dpwm-atmel-tcb.c271 int duty_ns, int period_ns) atmel_tcb_pwm_config()
317 duty = div_u64(duty_ns, min); atmel_tcb_pwm_config()
270 atmel_tcb_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) atmel_tcb_pwm_config() argument
H A Dpwm-atmel.c108 int duty_ns, int period_ns) atmel_pwm_config()
138 div *= duty_ns; atmel_pwm_config()
107 atmel_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, int duty_ns, int period_ns) atmel_pwm_config() argument
/linux-4.4.14/include/linux/
H A Dpwm.h25 int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns);
46 static inline int pwm_config(struct pwm_device *pwm, int duty_ns, int period_ns) pwm_config() argument
162 int duty_ns, int period_ns);
/linux-4.4.14/drivers/gpu/drm/i915/
H A Dintel_panel.c548 int duty_ns; pwm_get_backlight() local
550 duty_ns = pwm_get_duty_cycle(panel->backlight.pwm); pwm_get_backlight()
551 return DIV_ROUND_UP(duty_ns * 100, CRC_PMIC_PWM_PERIOD_NS); pwm_get_backlight()
646 int duty_ns = DIV_ROUND_UP(level * CRC_PMIC_PWM_PERIOD_NS, 100); pwm_set_backlight() local
648 pwm_config(panel->backlight.pwm, duty_ns, CRC_PMIC_PWM_PERIOD_NS); pwm_set_backlight()

Completed in 527 milliseconds