Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pwm: Better document return value of pwm_round_waveform_might_sleep()

Better explain how pwm_round_waveform_might_sleep() (and so the
respective lowlevel driver callback) is supposed to round and the
meaning of the return value.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/db84abf1e82e4498fc0e7c318d2673771d0039fe.1744120697.git.ukleinek@kernel.org
[ukleinek: Fix a rst formatting issue reported by Stephen Rothwell]
Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>

authored by

Uwe Kleine-König and committed by
Uwe Kleine-König
e463b05d bd897149

+6 -2
+6 -2
drivers/pwm/core.c
··· 229 229 * these two calls and the waveform determined by 230 230 * pwm_round_waveform_might_sleep() cannot be implemented any more. 231 231 * 232 - * Returns 0 on success, 1 if there is no valid hardware configuration matching 233 - * the input waveform under the PWM rounding rules or a negative errno. 232 + * Usually all values passed in @wf are rounded down to the nearest possible 233 + * value (in the order period_length_ns, duty_length_ns and then 234 + * duty_offset_ns). Only if this isn't possible, a value might grow. 235 + * 236 + * Returns 0 on success, 1 if at least one value had to be rounded up or a 237 + * negative errno. 234 238 */ 235 239 int pwm_round_waveform_might_sleep(struct pwm_device *pwm, struct pwm_waveform *wf) 236 240 {