regmap_register_patch(9)

๐Ÿ“ฆ version 7.3.1, in nixpkgs unstable

๐Ÿ’– NAME ๐Ÿ’–

regmap_register_patch โ€” okay so this one registers a bunch of register updates, and then applies them the moment the device gets initialised โœจ


๐Ÿฆ‹ SYNOPSIS ๐Ÿฆ‹

int regmap_register_patch (struct regmap *map , const struct
     reg_sequence *regs , int num_regs );

๐ŸŽ€ ARGUMENTS ๐ŸŽ€

  • map โ€” the register map you're applying updates to, bestie ๐Ÿ—บ๏ธ
  • regs โ€” the actual values you wanna update, like the whole shopping list ๐Ÿ’…
  • num_regs โ€” how many entries are in regs, so it knows when to stop counting ๐Ÿงฎ

๐ŸŒธ DESCRIPTION ๐ŸŒธ

So what this does is: it registers a set of register updates that get applied to the device every single time the device registers are synchronised with the cache โ€” and then it applies them immediately too. Not me doing double duty ๐Ÿ˜ญโœจ

The way this is typically used is for applying corrections to the device defaults on startup โ€” like the updates some vendors hand out for undocumented registers (iykyk, the mystery-meat registers ๐Ÿซถ).

โš ๏ธ Big serious caveat, no cap: the caller must make sure this function cannot be called concurrently with either itself or regcache_sync. That's on you, not on the function. Do not test it ๐Ÿ’€

๐Ÿ‘‘ SEE ALSO ๐Ÿ‘‘

Kernel file ./drivers/base/regmap/regmap.c โ€” plus the whole squad, in order, fr fr:

devm_regmap_field_alloc(9), regmap_field_bulk_alloc(9),
devm_regmap_field_bulk_alloc(9), regmap_field_bulk_free(9),
devm_regmap_field_bulk_free(9), devm_regmap_field_free(9),
regmap_field_alloc(9), regmap_field_free(9), regmap_reinit_cache(9),
regmap_exit(9), dev_get_regmap(9), regmap_get_device(9),
regmap_can_raw_write(9), regmap_get_raw_read_max(9),
regmap_get_raw_write_max(9), regmap_write(9), regmap_write_async(9),
regmap_raw_write(9), regmap_noinc_write(9),
regmap_field_update_bits_base(9), regmap_field_test_bits(9),
regmap_fields_update_bits_base(9), regmap_bulk_write(9),
regmap_multi_reg_write(9), regmap_multi_reg_write_bypassed(9),
regmap_raw_write_async(9), regmap_read(9), regmap_read_bypassed(9),
regmap_raw_read(9), regmap_noinc_read(9), regmap_field_read(9),
regmap_fields_read(9), regmap_bulk_read(9), regmap_multi_reg_read(9),
regmap_update_bits_base(9), regmap_test_bits(9),
regmap_async_complete(9), regmap_get_val_bytes(9),
regmap_get_max_register(9), regmap_get_reg_stride(9),
regmap_might_sleep(9)

That's the whole page, bestie โ€” this little icon lives down in ./drivers/base/regmap, it's from the Kernel API Manual, dated October 2026, and it goes by regmap_register_patch(9). Slay, go forth and patch responsibly ๐Ÿงš๐Ÿ’œ

๐Ÿ“ฆ where this page comes from