ad7944_chain_mode_alloc(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… ad7944_chain_mode_alloc β€” a Kernel API Manual moment

okay so bestie, welcome to the <pink>ad7944_chain_mode_alloc</pink> page ✨ this is from the Kernel API Manual, and it's literally the glow-up you need for daisy-chained devices. buckle up πŸŽ€


🌸 NAME 🌸

ad7944_chain_mode_alloc β€” allocate and initialize channel specs and buffers for daisy-chained devices πŸ¦‹

like, it makes the channel specs and the buffers, and it also sets them up. both. she does both. πŸ‘‘


✨ SYNOPSIS ✨

int ad7944_chain_mode_alloc(struct device *dev,
                            const struct iio_chan_spec *chan_template,
                            u32 n_chain_dev,
                            struct iio_chan_spec **chain_chan,
                            void **chain_mode_buf,
                            unsigned long **chain_scan_masks);

that signature is long and honestly it's giving main character energy πŸ’… every single pointer is doing its job, no cap.


🫢 ARGUMENTS 🫢

  • dev β€” the device for the devm_ functions 🧚 this is the one whose lifetime rules you're riding on, iykyk.
  • chan_template β€” the channel template for the devices. it's an array of 2 channels: voltage and timestamp. that's the blueprint, bestie, don't lose it πŸ’–
  • n_chain_dev β€” the number of devices in the chain. yes, the whole little chain 🌈 count them properly, fr fr.
  • chain_chan β€” pointer to receive the allocated channel specs. it's an out-param, so she gets filled in for you πŸ‘€
  • chain_mode_buf β€” pointer to receive the allocated rx buffer. also an out-param. also getting filled in πŸ“
  • chain_scan_masks β€” pointer to receive the allocated scan masks. yep, third out-param, still slaying πŸŽ€

⭐ RETURN ⭐

0 on success πŸŽ‰ and a negative error code on failure 😭 (if it's negative, it's not a vibe β€” check it, please and thank you).


πŸ‘‘ SEE ALSO πŸ‘‘

  • Kernel file ./drivers/iio/adc/ad7944.c β€” literally the source, go read her πŸ’œ
  • ad7944_convert_and_acquire(9) β€” the related manual page, highly recommend πŸ¦‹

quick vibe check: the out-params (chain_chan, chain_mode_buf, chain_scan_masks) are pointers to receive the allocated things β€” so don't pass garbage and then act surprised. πŸ™ˆ

and that's the whole page, bestie πŸ’– this little gem lives under ./drivers/iio/adc and it's dated October 2026 β€” from the Kernel API Manual, no less. go forth and daisy-chain responsibly πŸŒΈπŸ’…βœ¨

πŸ“¦ where this page comes from