drivers/iio/dummy/iio_simple_dummy.h
Source file repositories/reference/linux-study-clean/drivers/iio/dummy/iio_simple_dummy.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/iio/dummy/iio_simple_dummy.h- Extension
.h- Size
- 3707 bytes
- Lines
- 127
- Domain
- Driver Families
- Bucket
- drivers/iio
- Inferred role
- Driver Families: implementation source
- Status
- source implementation candidate
Why This File Exists
Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/kernel.h
Detected Declarations
struct iio_dummy_accel_calibscalestruct iio_dummy_regsstruct iio_dummy_statestruct iio_devenum iio_simple_dummy_scan_elementsfunction iio_simple_dummy_events_registerfunction iio_simple_dummy_events_unregisterfunction iio_simple_dummy_configure_bufferfunction iio_simple_dummy_unconfigure_buffer
Annotated Snippet
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 /* CONFIG_IIO_SIMPLE_DUMMY_EVENTS */
};
#ifdef CONFIG_IIO_SIMPLE_DUMMY_EVENTS
struct iio_dev;
int iio_simple_dummy_read_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir);
int iio_simple_dummy_write_event_config(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir,
bool state);
int iio_simple_dummy_read_event_value(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir,
enum iio_event_info info, int *val,
int *val2);
int iio_simple_dummy_write_event_value(struct iio_dev *indio_dev,
const struct iio_chan_spec *chan,
enum iio_event_type type,
enum iio_event_direction dir,
enum iio_event_info info, int val,
int val2);
int iio_simple_dummy_events_register(struct iio_dev *indio_dev);
void iio_simple_dummy_events_unregister(struct iio_dev *indio_dev);
#else /* Stubs for when events are disabled at compile time */
static inline int
iio_simple_dummy_events_register(struct iio_dev *indio_dev)
{
return 0;
}
static inline void
iio_simple_dummy_events_unregister(struct iio_dev *indio_dev)
{}
#endif /* CONFIG_IIO_SIMPLE_DUMMY_EVENTS*/
/**
* enum iio_simple_dummy_scan_elements - scan index enum
* @DUMMY_INDEX_VOLTAGE_0: the single ended voltage channel
* @DUMMY_INDEX_DIFFVOLTAGE_1M2: first differential channel
* @DUMMY_INDEX_DIFFVOLTAGE_3M4: second differential channel
* @DUMMY_INDEX_ACCELX: acceleration channel
*
* Enum provides convenient numbering for the scan index.
*/
enum iio_simple_dummy_scan_elements {
DUMMY_INDEX_VOLTAGE_0,
DUMMY_INDEX_DIFFVOLTAGE_1M2,
DUMMY_INDEX_DIFFVOLTAGE_3M4,
DUMMY_INDEX_ACCELX,
};
#ifdef CONFIG_IIO_SIMPLE_DUMMY_BUFFER
int iio_simple_dummy_configure_buffer(struct iio_dev *indio_dev);
void iio_simple_dummy_unconfigure_buffer(struct iio_dev *indio_dev);
#else
static inline int iio_simple_dummy_configure_buffer(struct iio_dev *indio_dev)
{
Annotation
- Immediate include surface: `linux/kernel.h`.
- Detected declarations: `struct iio_dummy_accel_calibscale`, `struct iio_dummy_regs`, `struct iio_dummy_state`, `struct iio_dev`, `enum iio_simple_dummy_scan_elements`, `function iio_simple_dummy_events_register`, `function iio_simple_dummy_events_unregister`, `function iio_simple_dummy_configure_buffer`, `function iio_simple_dummy_unconfigure_buffer`.
- Atlas domain: Driver Families / drivers/iio.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.