adis_update_bits(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 for val, you can get undesired behavior when the register you're updating is 16bit. 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:


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