__pwmchip_add(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– __pwmchip_add β€” like, the Kernel API Manual page, bestie πŸ’–

okay so this is a kernel API manual page (man section 9, for the people taking notes πŸ“) and it's all about __pwmchip_add β€” the lowkey-but-iconic function that registers a brand new PWM chip. yes, the double-underscore one. she's the ✨real✨ one, and we're about to talk about why you probably shouldn't call her directly. πŸ‘€


✨ NAME ✨

__pwmchip_add β€” register a new PWM chip 🌸

like. that's it. that's her whole job. and she ate. πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

int __pwmchip_add (struct pwm_chip *chip , struct module *owner );

that's the whole call signature, no cap β€” an int coming back at ya, two arguments going in. 🫢


🧚 ARGUMENTS 🧚

  • chip β€” the PWM chip you wanna add. this is the main character of the whole operation, the thing being registered. πŸ”₯
  • owner β€” a reference to the module that's providing the chip. ngl this one has rules (see below, bestie, I'm not gonna let you fumble this πŸ™ˆ).

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the vibe: __pwmchip_add registers a new PWM chip. that's the whole thing. iconic, straightforward, we love a function with a clear purpose.

but listen β€” owner is supposed to be THIS_MODULE, and the page is extremely clear that you should use the pwmchip_add wrapper to do this right. like, the wrapper exists specifically so you don't have to think about it. use the wrapper. let the wrapper handle it. the wrapper is your bestie here. 🫢

fr fr, this is the kind of detail that bites you later if you skip it β€” the manpage straight up tells you to go through pwmchip_add, so go through pwmchip_add. πŸ’€

⭐ RETURN ⭐

  • 0 on success πŸŽ‰ (slay, the chip is registered)
  • a negative error code on failure 😭 (something went wrong, check the code)

🌈 SEE ALSO 🌈

the whole friend group showed up for this one, and I'm listing every single one because they all deserve their moment:


and that's the page, bestie!! πŸ¦‹ oh and before I forget β€” this one's filed under ./drivers/pwm and dated October 2026, so jot that down, and yes the page title is literally __pwmchip_add(9) again at the bottom. full circle. periodt. πŸ’œβœ¨

πŸ“¦ where this page comes from