regmap_field_test_bits(9)
π regmap_field_test_bits(9) β the Kernel API Manual, bestie edition π
okay so real talk, we're in the Kernel API Manual today and the star of the show is regmap_field_test_bits(9). yes it's a whole mouthful, no you don't have to say it out loud, but you do have to understand it. it's giving "small function, big feelings" and honestly? iconic.
β¨ NAME β¨
regmap_field_test_bits β bestie's little vibe check for a register field: it checks whether all the bits you asked about are actually set. π¦
πΈ SYNOPSIS πΈ
int regmap_field_test_bits (struct regmap_field *field , unsigned int bits );
like, that's it. that's the whole signature. two args, one int coming back at you. slay. π
π ARGUMENTS π
fieldβ the register field we're operating on. the main character, if you will. πbitsβ the bits you wanna test. the little squad you're checking on. β
π DESCRIPTION π
so here's the tea β β this function gives you a tri-state answer and honestly it ate:
- it returns a negative
errnoif the underlyingregmap_field_readfails. like, the read itself flopped. π - it returns
0if at least one of the tested bits is not set. so like, close but not all of them showed up to the party. π - it returns
1if all tested bits are set. full squad present, everyone slayed. π₯
ngl that's a lot of meaning packed into one little int, and that's exactly why we respect it. no cap. π«Ά
lowkey important: it's all-or-nothing on the1. one missing bit and you're getting a0. that's the vibe check, and it is strict. β¨
π SEE ALSO π
okay this list is LONG, like genuinely a whole group chat of related functions, so let's get through it together. this is the Kernel file ./drivers/base/regmap/regmap.c crew π
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_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)
that's the whole roster, nobody left out, we don't do that here π
and that's the page!! this lil masterpiece lives in ./drivers/base/regmap and it's from the Kernel API Manual, dated October 2026 β go off, you absolute legend π§ββοΈπ
β¨π
π¦ 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