mma9551_gpio_config(9)
π 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 anenum 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=0means the interrupt line has the same value as the selected bit, whilepolarity=1means 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 π₯
0on 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:
mma9551_read_config_byte(9)mma9551_write_config_byte(9)mma9551_read_status_byte(9)mma9551_read_config_word(9)mma9551_write_config_word(9)mma9551_read_status_word(9)mma9551_read_config_words(9)mma9551_read_status_words(9)mma9551_write_config_words(9)mma9551_update_config_bits(9)mma9551_read_version(9)mma9551_set_device_state(9)mma9551_set_power_state(9)mma9551_sleep(9)mma9551_read_accel_chan(9)mma9551_read_accel_scale(9)mma9551_app_reset(9)
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
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms