adis_update_bits(9)
π adis_update_bits(9) β the locked-version glow-up
okay so bestie, this is a page from the Kernel API Manual, and it's about a lil wrapper macro named adis_update_bits. Think of it as the locked version of adis_update_bits_base β the one that comes with the locks already handled so you don't have to think about it. iykyk. π
β¨ SYNOPSIS β¨
adis_update_bits (adis , reg , mask , val );
that's it, that's the whole call. four things in, vibes out. π¦
πΈ ARGUMENTS πΈ
adisβ the adis device itself. the main character, the whole point. πregβ the address of the lower of the two registers. yes, lower β there's two of them and this is the bottom one, don't come for me, that's just how it is.maskβ the bitmask that says which bits we're changing. your little selection filter. πvalβ the value being written. this is the one you gotta be careful with (more on that below, bestie π«Ά).
π§ DESCRIPTION π§
so this macro lowkey does something kinda clever: it evaluates sizeof of val at compile time, and then calls adis_update_bits_base accordingly. clever girl behavior fr fr. β¨
β οΈ real talk though: if you use MACROS/DEFINES forval, you can get undesired behavior when the register you're updating is16bit. not a drill, not a vibe, just a genuine footgun. π use an actual typed value and sleep peacefully.
π SEE ALSO π
all the siblings, cousins, and extended family β no cap, this is the whole group chat:
- Kernel file
./include/linux/iio/imu/adis.h struct adis_data(9)struct adis_ops(9)struct adis(9)adis_reset(9)__adis_write_reg_8(9)__adis_write_reg_16(9)__adis_write_reg_32(9)__adis_read_reg_16(9)__adis_read_reg_32(9)adis_write_reg(9)adis_read_reg(9)adis_write_reg_8(9)adis_write_reg_16(9)adis_write_reg_32(9)adis_read_reg_16(9)adis_read_reg_32(9)adis_update_bits_base(9)
and that's the page, bestie π this icon lives over in ./include/linux/iio/imu, dated October 2026, and honestly? she ate. now go update some bits. periodt. πβ¨
π¦ 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