简体   繁体   English

Linux IIO 驱动 - 向芯片写入/读取完整配置

[英]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?如果我使用 IIO 驱动程序,向芯片写入/读取完整配置的最佳选择是什么? 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.对于“完整配置”,我的意思是一个文件(例如chip_config.cfg),其中以某种特定格式表示该芯片的所有寄存器的值。

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.设备属性 - 可以直接从 IIO 框架创建,但它只能用于一个值。 Also can read only 4096 bytes of data.也只能读取 4096 字节的数据。
  2. Open file from kernel - kernel_read_file() and similar functions, but strictly prohibited.从 kernel 打开文件 - kernel_read_file()和类似函数,但严禁使用。
  3. Firmware framework - only write.固件框架——只写。
  4. debugfs - we do not want to use this. debugfs - 我们不想使用它。

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.等等。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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