简体   繁体   中英

Linux IIO driver - write/read complete configuration to the chip

What is the best option to write/read complete configuration to the chip, if I'm using a IIO driver? With 'complete configuration' I mean a file (eg chip_config.cfg) where are the values of all registers of that chip in some specific format.

What options do I know now:

  1. Device attribute - can be created directly from IIO framework, however it should be used only for one value. Also can read only 4096 bytes of data.
  2. Open file from kernel - kernel_read_file() and similar functions, but strictly prohibited.
  3. Firmware framework - only write.
  4. debugfs - we do not want to use this.

Thank you for every suggestion.

this should be done in two parts: a user space one that reads and parses the file, and a driver that reads and writes to the chip.

You can't use the firmware framework you mentioned above, ie write only: because you usually need to read from the device registers; to check if certain bits are set; read back values from registers you've written to; and so on.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM