pwm_apply_might_sleep(9)
β¨ pwm_apply_might_sleep π
okay bestie, welcome to the Kernel API Manual page for pwm_apply_might_sleep β yes that name is a mouthful, no we're not changing it, it's iconic actually. πΈ
So basically this function atomically applies a new state to a PWM device β one clean swap, no weird half-applied in-between mess. π¦
β οΈ real talk: this one cannot be used in atomic context. Like, at all. It's a sleep-y girlie and she needs her space. π
β¨ SYNOPSIS β¨
int pwm_apply_might_sleep (struct pwm_device *pwm , const struct
pwm_state *state );
that's it. that's the whole vibe check. two args, one int back. π
π ARGUMENTS π
pwmβ the PWM device itself. the main character. πstateβ the new state you want to apply to it. the glow-up you're giving it. β¨
π RETURN π
0on success π₯³- or a negative errno π (so like, check your return values, bestie, fr fr)
π§ CONTEXT π§
May sleep. π΄
no cap, if you're in atomic context and you call this, that's not on her β she told you she sleeps. π
π₯ SEE ALSO π₯
Kernel file ./drivers/pwm/core.c β that's where all the magic lives, go read it iykyk π
and then the whole squad, alphabetically-ish, all present and accounted for:
pwm_round_waveform_might_sleep(9)pwm_get_waveform_might_sleep(9)pwm_set_waveform_might_sleep(9)pwm_apply_atomic(9)pwm_get_state_hw(9)pwm_adjust_config(9)pwm_capture(9)pwm_request_from_chip(9)of_pwm_get(9)acpi_pwm_get(9)pwm_get(9)pwm_put(9)devm_pwm_get(9)devm_fwnode_pwm_get(9)__pwmchip_add(9)pwmchip_remove(9)pwm_add_table(9)pwm_remove_table(9)
like, the entire friend group showed up to the function's birthday party π«Άπ
that's the whole page, bestie β go forth and apply your PWM states atomically, and remember: she may sleep π΄π
huge thank you to the fine folks over at ./drivers/pwm β this one's dated October 2026, straight from the Kernel API Manual. mwah. πβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms