meson_calc_reg_and_bit(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… meson_calc_reg_and_bit(9) β€” the Kernel API Manual moment

okay so bestie, welcome to the Kernel API Manual entry for meson_calc_reg_and_bit(9) ✨ this is the little helper that literally does the math so you don't have to β€” it figures out the register and the bit for a pin πŸŽ€


✨ NAME ✨

meson_calc_reg_and_bit β€” calculate register and bit for a pin 🧚

no cap, that's the whole job. it computes. it slays. periodt πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

void meson_calc_reg_and_bit (const struct meson_bank *bank , unsigned
       int pin , enum meson_reg_type reg_type , unsigned int *reg , unsigned
       int *bit );

look at that signature. iconic. it returns void because it doesn't hand you a value back β€” it fills in the pointers you gave it 😌


🌸 ARGUMENTS 🌸

  • bank β€” the bank that's holding your pin 🏦 like, which bank is it in, bestie
  • pin β€” the pin number πŸ”’ the actual number of the pin you're obsessed with
  • reg_type β€” the type of register you need (pull-enable, pull, etc...) πŸŽ€ yes it's one of those meson_reg_type situations
  • reg β€” the computed register offset πŸ“ this is where the answer lands
  • bit β€” the computed bit ⭐ and this is where the other answer lands
heads up: reg and bit are unsigned int * β€” they're output params, so the function writes into them. you bring the pointers, it brings the math 🫢

πŸ”₯ SEE ALSO πŸ”₯

  • Kernel file ./drivers/pinctrl/meson/pinctrl-meson.c β€” go read the source, it's giving main character energy πŸ“–
  • meson_get_bank(9) β€” the sibling function, the way that they're a matched set πŸ˜­πŸ’–

and that's the whole vibe check 🌈 ngl this one is short and sweet β€” the manual page lives at ./drivers/pinctrl/meson, dated October 2026, and it's the meson_calc_reg_and_bit(9) page you just read πŸ’œ byeee, go calculate some registers πŸ¦‹βœ¨

πŸ“¦ where this page comes from