STRUCT REGMAP_BUS(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… struct regmap_bus(9) β€” kernel API manual, but make it make sense πŸŽ€

okay so bestie, this page is all about struct regmap_bus β€” the whole "describe a hardware bus so the register map infrastructure knows what to do with it" situation. yes it's from the kernel API manual. yes it's a lot. we're getting through it together πŸ’–


✨ NAME ✨

struct regmap_bus β€” a description of a hardware bus for the register map infrastructure. literally the little card your bus hands over so regmap knows its vibe πŸ¦‹


🌸 SYNOPSIS 🌸

struct regmap_bus {
    bool fast_io;
    bool free_on_exit;
    regmap_hw_write write;
    regmap_hw_gather_write gather_write;
    regmap_hw_async_write async_write;
    regmap_hw_reg_write reg_write;
    regmap_hw_reg_noinc_write reg_noinc_write;
    regmap_hw_reg_update_bits reg_update_bits;
    regmap_hw_read read;
    regmap_hw_reg_read reg_read;
    regmap_hw_reg_noinc_read reg_noinc_read;
    regmap_hw_free_context free_context;
    regmap_hw_async_alloc async_alloc;
    u8 read_flag_mask;
    enum regmap_endian reg_format_endian_default;
    enum regmap_endian val_format_endian_default;
    size_t max_raw_read;
    size_t max_raw_write;
};

πŸ‘‘ Members πŸ‘‘

okay this is the main character section, every single field, no skips, no cap πŸ’…

  • fast_io β€” register IO is fast. so fast. use a spinlock instead of a mutex to perform locking. ⚠️ heads up though: this field is ignored if custom lock/unlock functions are used (peep the lock/unlock fields of struct regmap_config). iykyk.
  • free_on_exit β€” kfree this on exit of regmap 🫢
  • write β€” the write operation. that's it, that's the vibe.
  • gather_write β€” write operation with split register/value. returns -ENOTSUPP if it's not implemented on a given device 😭
  • async_write β€” write operation which completes asynchronously. optional! and it must serialise with respect to non-async I/O β€” that part is not optional, bestie.
  • reg_write β€” write a single register value to the given register address. this write operation has to complete when returning from the function. periodt.
  • reg_noinc_write β€” write multiple register values to the same register. also has to complete when returning from the function. no leaving it hanging πŸ™ˆ
  • reg_update_bits β€” update bits operation, to be used against volatile registers. intended for devices supporting some mechanism for setting clearing bits without having to read/modify/write. iconic behaviour honestly ✨
  • read β€” read operation. the data is returned in the buffer used to transmit data. yes, same buffer. that's the whole trick 🧚
  • reg_read β€” read a single register value from a given register address.
  • reg_noinc_read β€” read multiple register values from the same register. this read operation has to complete when returning from the function. we said what we said.
  • free_context β€” free context. bye bestie πŸŽ€
  • async_alloc β€” allocate a regmap_async structure.
  • read_flag_mask β€” mask to be set in the top byte of the register when doing a read. top byte. mask. set it πŸ”₯
  • reg_format_endian_default β€” default endianness for formatted register addresses. used when the regmap_config specifies DEFAULT. if this is DEFAULT, BIG is assumed. that's the rule, don't come for me πŸ’€
  • val_format_endian_default β€” default endianness for formatted register values. used when the regmap_config specifies DEFAULT. if this is DEFAULT, BIG is assumed. same energy, different field πŸ’œ
  • max_raw_read β€” max raw read size that can be used on the bus. the limit, the boundary, the line we do not cross.
  • max_raw_write β€” max raw write size that can be used on the bus. same, but writing 🌈

πŸ”Ž SEE ALSO πŸ”Ž

it's giving "and here's everyone else in the friend group" β€” the kernel file ./include/linux/regmap.h, plus:


okay that's the whole thing, you ate that πŸ“ this lil page lives in ./include/linux, dated October 2026, and it's filed under struct regmap_bus(9) β€” mwah, go read some kernel source, ily, bye πŸ’–βœ¨

πŸ“¦ where this page comes from