mma9551_set_power_state(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… mma9551_set_power_state β€” a kernel API manual moment

okay so bestie, we're literally in the Kernel API Manual today and the main character is mma9551_set_power_state. yes it's a function. yes it's about power. yes we're gonna get into it. 🫢


✨ NAME ✨

mma9551_set_power_state β€” sets runtime PM state

like, it sets the runtime PM state. that's the whole vibe. no cap.


🌸 SYNOPSIS 🌸

int mma9551_set_power_state (struct i2c_client *client , bool on );

that return type is int btw, and it takes two things: an I2C client and a boolean. we love a two-argument icon.


πŸŽ€ ARGUMENTS πŸŽ€

  • client β€” the I2C client. that's the device we're talking to, she's the main character here πŸ’–
  • on β€” pass true to power the device on, pass false to power it off. literally just on/off bestie, you got this ⭐

πŸ¦‹ DESCRIPTION πŸ¦‹

Resume or suspend the device using Runtime PM. the way it just... resumes or suspends. iconic behaviour honestly.

and here's the little detail everyone forgets: the device will suspend after the autosuspend delay. so like, it doesn't yeet itself into suspend instantly, it waits out the delay first. don't @ me, that's just what the manpage says πŸ™ˆ


πŸ”₯ RETURN πŸ”₯

  • 0 on success πŸŽ‰
  • a negative value on failure 😭

that's it. zero is the good one. negative means something went sideways. vibe check accordingly.


πŸ‘‘ SEE ALSO πŸ‘‘

the kernel file lives right here, go peek:

  • Kernel file ./drivers/iio/accel/mma9551_core.c

and the whole friend group, all of these:

seriously, read them all, they're all slay πŸ’œ


kudos to ./drivers/iio/accel for being the source β€” dated October 2026, no cap 🌈✨

that's the page bestie, go forth and manage your runtime power state responsibly πŸ’…πŸŒΈ

πŸ“¦ where this page comes from