mma9551_gpio_config(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… NAME πŸ’…

mma9551_gpio_config β€” okay so this is the function that configures a gpio, bestie. That's the whole vibe. Configuring. GPIO. Iconic.


✨ SYNOPSIS ✨

int mma9551_gpio_config (struct i2c_client *client , enum
       mma9551_gpio_pin pin , u8 app_id , u8 bitnum , int polarity );

Like, look at her. Five arguments. Main character energy fr fr. πŸŽ€


🫢 ARGUMENTS 🫢

  • client β€” the I2C client, obvs. Your device bestie.
  • pin β€” the GPIO pin you're configuring. Which one? You tell her. It's an enum mma9551_gpio_pin.
  • app_id β€” the Application ID. Yep. That one.
  • bitnum β€” the bit number of the status register that's getting assigned to the GPIO pin. Like, this bit goes there. Slay.
  • polarity β€” okay so this one has lore. The polarity parameter is described in section 6.2.2, page 66, of the Software Reference Manual. Basically (their word, not mine πŸ’€): polarity=0 means the interrupt line has the same value as the selected bit, while polarity=1 means the line is inverted. Lowkey important, highkey a mood.

🌸 DESCRIPTION 🌸

Assign a bit from an application's status register to a specific GPIO pin. That's it. That's the function. She takes a bit and she puts it on a pin and she's thriving. ✨

⚠️ Locking note, and do NOT skip this one: This function must be called with the device lock held. Locking is not handled inside the function. Callers should ensure they serialize access to the HW. Like, the function is not gonna hold your hand on this β€” that's a you problem, bestie. Lock up before you call her. πŸ”’

πŸ”₯ RETURN πŸ”₯

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

That's the whole contract. Zero good, negative bad, no in between, periodt.


πŸ¦‹ SEE ALSO πŸ¦‹

Kernel file ./drivers/iio/accel/mma9551_core.c β€” the mothership πŸ’–

And the whole friend group, no cap:


Okay that's the whole page, go configure your gpios responsibly, ily πŸ’œ

This lil masterpiece lives in ./drivers/iio/accel, dated October 2026, and it's the mma9551_gpio_config(9) page from the Kernel API Manual. Bye bestie, drink some water 🌈⭐

πŸ“¦ where this page comes from