meson_calc_reg_and_bit(9)
π 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, bestiepinβ the pin number π’ the actual number of the pin you're obsessed withreg_typeβ the type of register you need (pull-enable, pull, etc...) π yes it's one of thosemeson_reg_typesituationsregβ the computed register offset π this is where the answer landsbitβ the computed bit β and this is where the other answer lands
heads up:regandbitareunsigned 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
- 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