Day38 Log - IIO Sysfs Control¶
📅 Summary¶
Implemented sysfs control interface for IIO driver.
✅ Achievements¶
- Added
sampling_frequencyvia IIO standard API - Added
fifo_enableas private attribute - Added
watermarkas private attribute - Replaced module parameter usage
- Verified read/write from user-space
🔍 Observations¶
Sysfs Nodes¶
Valid Writes¶
- FIFO enable toggled correctly
- Watermark updated correctly
- Sampling frequency applied
Invalid Writes¶
- Out-of-range values rejected
- Kernel returned
-EINVAL
Runtime Protection¶
- Changes rejected during streaming
-EBUSYcorrectly returned
⚠️ Issues / Notes¶
- FIFO disabled by default (intentional)
- DRDY mode not implemented
- FIFO disable does not switch acquisition mode
🧠 Learnings¶
- IIO control plane uses sysfs, not ioctl
- Helper functions should not perform locking
- State consistency requires write-through design
- Separation of control plane and data path is critical
🚀 Next Steps¶
- Expose available ranges (sampling_frequency_available)
- Define explicit acquisition modes (FIFO vs DRDY)
- Move watermark to buffer subsystem (optional)