pwm_get(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– pwm_get(9) πŸ’–

okay bestie, welcome to the Kernel API Manual β€” this is pwm_get(9) and it's literally the glow-up moment where your device finally gets its PWM. ✨


πŸŽ€ NAME πŸŽ€

pwm_get β€” look up and request a PWM device

Like, you're not just looking at it, you're claiming it. main character energy fr fr.


🌸 SYNOPSIS 🌸

struct pwm_device * pwm_get (struct device *dev , const char *con_id );

πŸ¦‹ ARGUMENTS πŸ¦‹

  • dev β€” device for PWM consumer. yes bestie, that's you, the consumer, living your consumer era πŸ’…
  • con_id β€” consumer name

✨ DESCRIPTION ✨

So here's the tea 🍡 β€” the lookup is first attempted using DT. That's step one, no skipping ahead.

If the device was not instantiated from a device tree, then a PWM chip and a relative index get looked up via a table supplied by board setup code (peep pwm_add_table for that one πŸ‘€).

Once a PWM chip has been found, the specified PWM device will be requested and is ready to be used. slay. that's it. it's ready. 🫢


πŸ”₯ RETURN πŸ”₯

A pointer to the requested PWM device β€” iconic, honestly πŸ‘‘

…or an ERR_PTR-encoded error code on failure 😭 (check it, bestie, don't just vibe with the pointer).


πŸ’œ SEE ALSO πŸ’œ

Kernel file ./drivers/pwm/core.c β€” plus the whole friend group:


ngl, if you grabbed a PWM and you're done with it, go say hi to pwm_put(9) β€” don't just leave it hanging πŸ™ˆ

okay and before you close the tab β€” big kisses from the ./drivers/pwm girlies, this one's dated October 2026 β­πŸŒˆπŸ’– mwah!

πŸ“¦ where this page comes from