ads131m_rmw_reg(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ ads131m_rmw_reg(9) ✨

okay so this is a page from the Kernel API Manual, bestie β€” it's ads131m_rmw_reg(9), and it's literally the "peek, tweak, put it back" girlie of the ADS131M driver family. let's get into it πŸ’…


🌸 NAME 🌸

ads131m_rmw_reg β€” reads, modifies, and writes a single register. that's it, that's the whole vibe. one register. read it, change it, send it back. iconic behavior honestly πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

int ads131m_rmw_reg (struct ads131m_priv *priv , u8 reg , u16 clear ,
u16 set );

yes she takes four arguments and yes she returns an int. she's lowkey built different ✨


πŸ’– ARGUMENTS πŸ’–

  • priv β€” the device private data structure. like, the whole personality of the device lives in here, and you're handing her over.
  • reg β€” the 8-bit register address. so it's a u8, keep it in that range, no cap.
  • clear β€” bitmask of bits to clear. the "βœ‚οΈ not you, not you" list.
  • set β€” bitmask of bits to set. the "πŸ‘‘ you, you, and also you" list.

πŸ”₯ DESCRIPTION πŸ”₯

so what does she actually do? she performs an atomic read-modify-write operation on a register. the way that works: she reads the register, applies the clear and set masks to it, and then writes the new value back β€” but only if it has changed. not her wasting a write for nothing, no ma'am. 🫢

atomic is the key word here babe, don't sleep on it β€” it's a read-modify-write as one operation, not three separate little errands. 🧚

⭐ RETURN ⭐

  • 0 on success β€” slay, we ate πŸ’…
  • a negative error code β€” something's giving wrong, go check it 😭

🌈 SEE ALSO 🌈

kernel file: ./drivers/iio/adc/ti-ads131m02.c β€” that's where the actual code hangs out, go say hi πŸ‘‘

and the whole friend group, fr fr:


okay that's the page!! mwah πŸ’‹ this one lives in ./drivers/iio/adc and the date on it is October 2026, so like… future girlie behavior honestly ⏳✨ stay hydrated, read your registers atomically, and remember: clear the bits you don't want, set the bits you do. periodt. πŸŽ€πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from