sppctl_func_set(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… sppctl_func_set(9) β€” or as I call it, "the glow-up for your pin routing"

Okay so bestie, welcome to the Kernel API Manual for sppctl_func_set β€” this is the function that literally sets the pin of a fully-pinmux function. No cap, it's giving "let me rearrange your whole vibe" energy. ✨


🌸 SYNOPSIS 🌸

void sppctl_func_set (struct sppctl_pdata *pctl , u8 func , u8 val );

πŸŽ€ ARGUMENTS πŸŽ€

  • pctl β€” honestly? undescribed. mysterious. main character energy but zero backstory. 😭
  • func β€” also undescribed. it's giving "we ran out of documentation budget" fr fr.
  • val β€” undescribed too. the trio of mystery. πŸ’€

πŸ”₯ DESCRIPTION πŸ”₯

So here's the tea, bestie β€” the mask-fields and control-fields of a fully-pinmux function on the SP7021 are arranged like this, and yes it's giving spreadsheet realness:

func# | register |  mask-field  | control-field
-------+----------+--------------+--------------
 0    | base[0]  |  (22 : 16)   |   ( 6 : 0)
 1    | base[0]  |  (30 : 24)   |   (14 : 8)
 2    | base[1]  |  (22 : 16)   |   ( 6 : 0)
 3    | baeg[1]  |  (30 : 24)   |   (14 : 8)
 :    |    :     |      :       |       :

(and yes, baeg[1] is literally what it says in the original β€” I'm not fixing it, that's not my job, I just report the lore πŸ“–)

Now let me break it down for you because this is important:

The mask-fields? They're the bodyguards. They protect the control-fields from getting written into accidentally. So before you write a value into a control-field, you gotta set the corresponding bits in the mask-field first. Like, knock on the door before you walk in, y'know? πŸšͺ✨

The control-fields? They're the ones actually deciding where the function pin is going to be routed. They're the GPS. The vibe director. The "where are we going bestie" of the whole operation. πŸ—ΊοΈ

⚠️ And here's the lowkey crucial part: mask-fields and control-fields of even number of 'func' are located at bits (22:16) and (6:0) β€” while odd number of 'func's are located at bits (30:24) and (14:8). So like… even functions get the low bits, odd functions get the high bits. Don't mix them up or it's gonna be a whole mess. πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/pinctrl/sunplus/sppctl.c β€” and the whole friend group of related functions:

They're all part of the same pinctrl sunplus squad, iykyk. πŸ’œ


And that's the whole manual page bestie β€” every bit, every flag, every mask-field accounted for. Shoutout to ./drivers/pinctrl/sunplus for being the source of truth, and to October 2026 for the date stamp β€” this page said "I'm from the future" and meant it. 🫢

slay. periodt. go route those pins. πŸ’…βœ¨

πŸ“¦ where this page comes from