ad7944_chain_mode_alloc(9)
π 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 thedevm_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 of2channels:voltageandtimestamp. 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
- 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