dev_get_regmap(9)
π
dev_get_regmap β the manual page for dev_get_regmap(9), bestie edition
okay so this is a Kernel API Manual page, and it's literally about going and grabbing the regmap for a device. that's it. that's the whole vibe. let's get into it β¨
β¨ NAME β¨
dev_get_regmap β obtain the regmap (if any) for a device π
πΈ SYNOPSIS πΈ
struct regmap * dev_get_regmap (struct device *dev , const char *name );
like... look at that signature. she's serving pointers. struct regmap * coming back at you, taking a struct device *dev and a const char *name. iconic. π«Ά
π¦ ARGUMENTS π¦
devβ the device you wanna retrieve the map for. your main character device, basically. πnameβ optional name for the register map, and usually it'sNULL. yeah, most of the time you just leave itNULLand let the kernel do its thing. π
π DESCRIPTION π
so what does it actually do?? it returns the regmap for the device if one is present, or NULL. no cap, that's the whole thing.
now about that name, because this is the part where people get it wrong:
- if
nameis specified, then it must match the name that was specified when registering the device. like, it has to be the exact same name. no vibe-matching, no "close enough" β it's a match or it's nothing. β - if
nameisNULL, then the first regmap found will be used. first come, first served, slay. π
devices with multiple register maps are very rare, and generic code should normally not need to specify a name. so like... if you're out here passing a name in generic code, bestie, why. π«Ά
π₯ SEE ALSO π₯
the kernel file lives at ./drivers/base/regmap/regmap.c β and here's the whole friend group, 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)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_register_patch(9)regmap_get_val_bytes(9)regmap_get_max_register(9)regmap_get_reg_stride(9)regmap_might_sleep(9)
like, that's the whole regmap extended universe. go read them. iykyk π§
and that's the page!! this lil gem comes from ./drivers/base/regmap, dated October 2026, and it's filed under dev_get_regmap(9). mwah, no notes, go get your regmap bestie πβ¨
π¦ 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