pwm_get_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’œ pwm_get_state(9) β€” like, the Kernel API Manual, bestie ✨

okay so real talk: this is pwm_get_state(9) from the Kernel API Manual, and it's genuinely one of the chillest little functions in the whole PWM universe. no cap. it just... tells you what the state is. that's it. that's the vibe. πŸŽ€


✨ NAME ✨

pwm_get_state β€” retrieve the current PWM state πŸ¦‹

like, it gets the state. the current one. the PWM one. iykyk πŸ’…


🌸 SYNOPSIS 🌸

void pwm_get_state (const struct pwm_device *pwm , struct pwm_state
*state );

not me writing this out exactly as-is because every character matters, periodt πŸ’–


🫢 ARGUMENTS 🫢

  • pwm β€” the PWM device, bestie. this is the one you're asking about πŸ‘‘
  • state β€” the state you're gonna fill with the current PWM state. it's giving "empty cup, please pour the truth into it" πŸ“

πŸ”₯ DESCRIPTION πŸ”₯

okay so here's the tea β˜• β€” the PWM state that gets returned represents the state that was applied by a previous call to pwm_apply_might_sleep. that's the whole point. that's the lore.

and lowkey, drivers may have to slightly tweak that state before programming it to hardware. like, a little glow-up before it hits the metal. just a smidge. don't @ me πŸ™ˆ

now, the important bit β€” if pwm_apply_might_sleep was never called, then this returns either:

  • the current hardware state (if supported), or
  • the default settings πŸ’€

so either way you're getting something, it's just a question of which something. main character energy from a function that literally always has an answer ✨


🌈 SEE ALSO 🌈

Kernel file ./include/linux/pwm.h β€” and honestly the whole extended friend group:

all of them. every single one. i would never do my girls dirty by leaving one out πŸ’…πŸ‘‘


ngl this whole page lives rent-free in ./include/linux, and it's dated October 2026 🌸 so yeah, go off, future-era manpage. mwah πŸ’‹

that's the whole thing bestie β€” go fill that state and slay πŸ§šβ€β™€οΈβ­

πŸ“¦ where this page comes from