STRUCT I2C_LOCK_OPERATIONS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct i2c_lock_operations(9) β€” like, the I2C locking ops page, bestie

okay so this is a page from the Kernel API Manual, and it's literally about struct i2c_lock_operations β€” the little struct that represents I2C locking operations. yes queen, locking. we love a mutually-exclusive moment. πŸ”’βœ¨


🌸 NAME

struct i2c_lock_operations β€” represent I2C locking operations

like, it is the representation. it's giving "the vibe of locking, formalized in a struct." no cap.


✨ SYNOPSIS

struct i2c_lock_operations {
    void (*lock_bus)(struct i2c_adapter *adapter, unsigned int flags);
    int (*trylock_bus)(struct i2c_adapter *adapter, unsigned int flags);
    void (*unlock_bus)(struct i2c_adapter *adapter, unsigned int flags);
 };

three function pointers, all with the same (struct i2c_adapter *adapter, unsigned int flags) energy. iconic symmetry tbh. 🫢

πŸŽ€ Members

  • lock_bus β€” Get exclusive access to an I2C bus segment. it's the "mine now, back off" one. πŸ”₯
  • trylock_bus β€” Try to get exclusive access to an I2C bus segment. note the try β€” it's the polite version, the "if you're free…? no? okay bestie, no worries" one. πŸ’…
  • unlock_bus β€” Release exclusive access to an I2C bus segment. the letting-go arc. we stan a clean release. πŸ¦‹

πŸ‘‘ Description

The main operations are wrapped by i2c_lock_bus and i2c_unlock_bus.

that's it, that's the description. short, sweet, main character energy. you don't go poking at these function pointers directly β€” the wrappers are the ones doing the actual handling, iykyk. ⭐


πŸ’– SEE ALSO

so many friends, fr fr. all of these live in the kernel file ./include/linux/i2c.h:

go read them, bestie. collect them all like Pokémon cards. 🌈


reminder: this page lives under ./include/linux β€” that's the source, don't come for me.

okay that's the whole thing!! πŸ“ sourced from ./include/linux, dated October 2026, and it's still struct i2c_lock_operations(9) β€” mwah, periodt. πŸ’œπŸ§šπŸŒΈ

πŸ“¦ where this page comes from