@@ -216,14 +216,14 @@ static int __pwm_write_waveform(struct pwm_chip *chip, struct pwm_device *pwm, c
216216 *
217217 * Typically a given waveform cannot be implemented exactly by hardware, e.g.
218218 * because hardware only supports coarse period resolution or no duty_offset.
219- * This function returns the actually implemented waveform if you pass wf to
220- * pwm_set_waveform_might_sleep now.
219+ * This function returns the actually implemented waveform if you pass @ wf to
220+ * pwm_set_waveform_might_sleep() now.
221221 *
222222 * Note however that the world doesn't stop turning when you call it, so when
223- * doing
223+ * doing::
224224 *
225- * pwm_round_waveform_might_sleep(mypwm, &wf);
226- * pwm_set_waveform_might_sleep(mypwm, &wf, true);
225+ * pwm_round_waveform_might_sleep(mypwm, &wf);
226+ * pwm_set_waveform_might_sleep(mypwm, &wf, true);
227227 *
228228 * the latter might fail, e.g. because an input clock changed its rate between
229229 * these two calls and the waveform determined by
@@ -233,8 +233,9 @@ static int __pwm_write_waveform(struct pwm_chip *chip, struct pwm_device *pwm, c
233233 * value (in the order period_length_ns, duty_length_ns and then
234234 * duty_offset_ns). Only if this isn't possible, a value might grow.
235235 *
236- * Returns 0 on success, 1 if at least one value had to be rounded up or a
236+ * Returns: 0 on success, 1 if at least one value had to be rounded up or a
237237 * negative errno.
238+ * Context: May sleep.
238239 */
239240int pwm_round_waveform_might_sleep (struct pwm_device * pwm , struct pwm_waveform * wf )
240241{
@@ -291,6 +292,9 @@ EXPORT_SYMBOL_GPL(pwm_round_waveform_might_sleep);
291292 *
292293 * Stores the current configuration of the PWM in @wf. Note this is the
293294 * equivalent of pwm_get_state_hw() (and not pwm_get_state()) for pwm_waveform.
295+ *
296+ * Returns: 0 on success or a negative errno
297+ * Context: May sleep.
294298 */
295299int pwm_get_waveform_might_sleep (struct pwm_device * pwm , struct pwm_waveform * wf )
296300{
@@ -399,13 +403,17 @@ static int __pwm_set_waveform(struct pwm_device *pwm,
399403 *
400404 * Typically a requested waveform cannot be implemented exactly, e.g. because
401405 * you requested .period_length_ns = 100 ns, but the hardware can only set
402- * periods that are a multiple of 8.5 ns. With that hardware passing exact =
406+ * periods that are a multiple of 8.5 ns. With that hardware passing @ exact =
403407 * true results in pwm_set_waveform_might_sleep() failing and returning 1. If
404- * exact = false you get a period of 93.5 ns (i.e. the biggest period not bigger
408+ * @ exact = false you get a period of 93.5 ns (i.e. the biggest period not bigger
405409 * than the requested value).
406- * Note that even with exact = true, some rounding by less than 1 is
410+ * Note that even with @ exact = true, some rounding by less than 1 ns is
407411 * possible/needed. In the above example requesting .period_length_ns = 94 and
408- * exact = true, you get the hardware configured with period = 93.5 ns.
412+ * @exact = true, you get the hardware configured with period = 93.5 ns.
413+ *
414+ * Returns: 0 on success, 1 if was rounded up (if !@exact) or no perfect match was
415+ * possible (if @exact), or a negative errno
416+ * Context: May sleep.
409417 */
410418int pwm_set_waveform_might_sleep (struct pwm_device * pwm ,
411419 const struct pwm_waveform * wf , bool exact )
@@ -565,11 +573,6 @@ static bool pwm_state_valid(const struct pwm_state *state)
565573 return true;
566574}
567575
568- /**
569- * __pwm_apply() - atomically apply a new state to a PWM device
570- * @pwm: PWM device
571- * @state: new state to apply
572- */
573576static int __pwm_apply (struct pwm_device * pwm , const struct pwm_state * state )
574577{
575578 struct pwm_chip * chip ;
@@ -678,6 +681,9 @@ static int __pwm_apply(struct pwm_device *pwm, const struct pwm_state *state)
678681 * Cannot be used in atomic context.
679682 * @pwm: PWM device
680683 * @state: new state to apply
684+ *
685+ * Returns: 0 on success, or a negative errno
686+ * Context: May sleep.
681687 */
682688int pwm_apply_might_sleep (struct pwm_device * pwm , const struct pwm_state * state )
683689{
@@ -719,6 +725,9 @@ EXPORT_SYMBOL_GPL(pwm_apply_might_sleep);
719725 * Not all PWM devices support this function, check with pwm_might_sleep().
720726 * @pwm: PWM device
721727 * @state: new state to apply
728+ *
729+ * Returns: 0 on success, or a negative errno
730+ * Context: Any
722731 */
723732int pwm_apply_atomic (struct pwm_device * pwm , const struct pwm_state * state )
724733{
@@ -792,6 +801,9 @@ EXPORT_SYMBOL_GPL(pwm_get_state_hw);
792801 * This function will adjust the PWM config to the PWM arguments provided
793802 * by the DT or PWM lookup table. This is particularly useful to adapt
794803 * the bootloader config to the Linux one.
804+ *
805+ * Returns: 0 on success or a negative error code on failure.
806+ * Context: May sleep.
795807 */
796808int pwm_adjust_config (struct pwm_device * pwm )
797809{
0 commit comments