comedi_alloc...dev_readback(9)
π NAME π
comedi_alloc_subdev_readback β bestie, this one allocates the memory for your subdevice's readback β¨
π SYNOPSIS π
int comedi_alloc_subdev_readback (struct comedi_subdevice *s );
π¦ ARGUMENTS π¦
sβ the COMEDI subdevice. that's her. that's the one we're setting up π
πΈ DESCRIPTION πΈ
okay so here's the vibe: low-level COMEDI drivers call this to allocate an array that records the last values written to a subdevice's analog output channels (at least by the INSN_WRITE instruction), so they can be read back later by an INSN_READ instruction. iconic, honestly π«Ά
it also gives you a default handler for the INSN_READ instruction, unless one has already been set. no cap, it just handles that for you β¨
on success, s->readback points to the first element of the array, which is zero-filled. the low-level driver is responsible for updating its contents β that part's on you, bestie π
s->insn_read will be set to comedi_readback_insn_read unless it is already non-NULL.
returns 0 on success, -EINVAL if the subdevice has no channels, or -ENOMEM on allocation failure π (yes the last two are the sad paths, remember them fr fr)
π SEE ALSO π
kernel file ./drivers/comedi/drivers.c and also these besties:
comedi_set_hw_dev(9)comedi_alloc_devpriv(9)comedi_alloc_subdevices(9)comedi_readback_insn_read(9)comedi_timeout(9)comedi_dio_insn_config(9)comedi_dio_update_state(9)comedi_bytes_per_scan_cmd(9)comedi_bytes_per_scan(9)comedi_nscans_left(9)comedi_nsamples_left(9)comedi_inc_scan_progress(9)comedi_handle_events(9)comedi_load_firmware(9)__comedi_check_request_region(9)comedi_check_request_region(9)comedi_legacy_detach(9)comedi_auto_config(9)comedi_auto_unconfig(9)comedi_driver_register(9)comedi_driver_unregister(9)
okay that's the whole page, mwah π this came from the kernel file in ./drivers/comedi, dated October 2026, and it's page comedi_alloc...dev_readback(9) in the Kernel API Manual β go forth and slay your readback array πβπ
π¦ 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