samsung_gpio_pm_2bit_resume(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… samsung_gpio_pm_2bit_resume β€” from the Kernel API Manual, bestie ✨

okay so picture this: it's samsung_gpio_pm_2bit_resume(9) and she's the function that gets your GPIO bank back on its feet after a lil nap πŸ’€ β€” full breakdown below, no cap 🫢


✨ NAME ✨

samsung_gpio_pm_2bit_resume β€” restore the given GPIO bank, slay πŸ’–


πŸ¦‹ SYNOPSIS πŸ¦‹

void samsung_gpio_pm_2bit_resume (struct samsung_gpio_chip *chip );

πŸŽ€ ARGUMENTS πŸŽ€

  • chip β€” the chip information to resume. that's the whole vibe she needs to wake up 🌸

πŸ‘‘ DESCRIPTION πŸ‘‘

So she restores one of the GPIO banks that was saved during suspend ✨. Easy, right? NOT. This is not as simple as once thought, because there's a real possibility of glitches depending on the order that the CON and DAT registers are set in 😭 β€” yes the order literally matters, iykyk.

The three states the pin can be in are {IN,OUT,SFN}, which gives us 9 combinations of changes to check πŸ”₯. Three of these, if the pin stays in the same configuration, can be discounted (we don't need those, they're giving "nothing to see here" energy πŸ’…). That leaves us with the following, and honestly? iconic:

  • { IN => OUT } β€” Change DAT first
  • { IN => SFN } β€” Change CON first
  • { OUT => SFN } β€” Change CON first, so new data will not glitch
  • { OUT => IN } β€” Change CON first, so new data will not glitch
  • { SFN => IN } β€” Change CON first
  • { SFN => OUT } β€” Change DAT first, so new data will not glitch [1]

We do not currently deal with the UP registers, because these control weak resistors πŸ“ β€” so a small delay in change should not need to bring these into the calculations. she's just not in her era yet, and that's fine πŸ™ˆ.

[1] this assumes that writing to a pin DAT whilst in SFN will set the state for when it is next output ⭐

🌈 SEE ALSO 🌈

Kernel file ./arch/arm/mach-s3c/pm-gpio.c plus the whole friend group 🫢: samsung_pm_save_gpio(9), samsung_pm_save_gpios(9), samsung_pm_resume_gpio(9)


and that's the tea πŸ’œ β€” this one's from ./arch/arm/mach-s3c, dated October 2026, and it's literally the samsung_gpio_pm_2bit_resume(9) page. go off, kernel documentation βœ¨πŸŽ€πŸ’…

πŸ“¦ where this page comes from