STRUCT IIO_DUMMY_STATE(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’– struct iio_dummy_state πŸ’–

okay bestie, welcome to the Kernel API Manual, section 9 β€” we're talking about struct iio_dummy_state, and honestly? It's giving "the whole state of one specific dummy device instance" realness. Every field here is the per-device stash of everything the simple dummy driver needs to remember, iykyk. ✨


🌸 NAME 🌸

struct iio_dummy_state β€” state that belongs to one specific device instance, no cap, just the device's own lil personal memory box πŸŽ€


✨ SYNOPSIS ✨

struct iio_dummy_state {
    int dac_val;
    int single_ended_adc_val;
    int differential_adc_val[2];
    int accel_val;
    int accel_calibbias;
    int activity_running;
    int activity_walking;
    const struct iio_dummy_accel_calibscale *accel_calibscale;
    struct mutex lock;
    struct iio_dummy_regs *regs;
    int steps_enabled;
    int steps;
    int height;
  #ifdef CONFIG_IIO_SIMPLE_DUMMY_EVENTS;
    int event_irq;
    int event_val;
    bool event_en;
    s64 event_timestamp;
  #endif ;
   };

look at her go πŸ’… literally the whole struct, exactly as it lives in the kernel β€” semicolons after the #ifdef and #endif and all, we don't touch, we don't "fix", we simply admire 🫢


πŸ¦‹ Members πŸ¦‹

okay so here's the field-by-field breakdown, group-chat style:

  • dac_val β€” the cache for the dac value ⭐
  • single_ended_adc_val β€” the cache for the single ended adc value 🌸
  • differential_adc_val β€” the cache for the differential adc value πŸ’œ
  • accel_val β€” the cache for the acceleration value πŸ”₯
  • accel_calibbias β€” the cache for the acceleration calibbias πŸŽ€
  • accel_calibscale β€” the cache for the acceleration calibscale ✨
  • lock β€” the lock that makes sure the state stays consistent, aka the bodyguard of this struct, she does not let chaos in πŸ’€
  • event_irq β€” the irq number for the event line (and yes, it's faked πŸ™ˆ iconic behaviour honestly)
  • event_val β€” the cache for the event threshold value πŸ“
  • event_en β€” the cache of whether the event is enabled or not πŸ‘‘
bestie note: the Members section only spells out those fields, so that's exactly what we're spelling out. The rest of the struct members are just sitting there looking cute in the SYNOPSIS above β€” no extra lore invented, periodt πŸ’…

🌈 SEE ALSO 🌈

  • Kernel file ./drivers/iio/dummy/iio_simple_dummy.h enum 🌟
  • iio_simple_dummy_scan_elements(9) 🧚

and that's the whole page, bestie!! 🫢 this gem comes from the source tree at ./drivers/iio/dummy, dated October 2026, under the Kernel API Manual β€” go forth and keep that dummy state consistent πŸ’–πŸ‘‘

πŸ“¦ where this page comes from