stw481x_get_pctl_reg(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ¦‹ stw481x_get_pctl_reg(9) πŸ¦‹

hii bestie, welcome to the Kernel API Manual πŸ’– we're talking about the iconic little function stw481x_get_pctl_reg(9) today, and yes it's giving kernel-internals main character energy.


🌸 NAME 🌸

stw481x_get_pctl_reg β€” get a power control register. That's the whole vibe, no cap.


✨ SYNOPSIS ✨

int stw481x_get_pctl_reg (struct stw481x *stw481x , u8 reg );

like, it's an int function, and these are the exact types, periodt 🫢


πŸŽ€ ARGUMENTS πŸŽ€

  • stw481x β€” handle to the stw481x chip. Your lil' chip handle, basically.
  • reg β€” power control register to fetch. The specific one you're grabbing.

🧚 DESCRIPTION 🧚

okay so the power control registers are a set of one-time-programmable registers in its own register space. The way you access them is by writing address bits to these two registers:

  • bits 7,6,5 of PCTL_REG_LO correspond to the 3 LSBs of the address
  • bits 8,9 of PCTL_REG_HI correspond to the 2 MSBs of the address

so together that forms an address space of 5 bits, i.e. 32 registers, and 0x00 ... 0x1f can be obtained. slay ✨


πŸ’… SEE ALSO πŸ’…

  • Kernel file ./drivers/mfd/stw481x.c β€” go peek, iykyk πŸ‘‘

xoxo gossip kernel girl πŸ’‹ this gem came from ./drivers/mfd, dated October 2026 πŸŒˆπŸ’–

πŸ“¦ where this page comes from