我有一个i2c芯片驱动程序作为linux内核的一部分。我可以从内核启动消息中验证i2c芯片驱动程序是否在内核中。我的问题是,这样的i2c芯片驱动程序是否应该通过sysfs访问,如果是,那么如何访问。我的用户空间程序不会高度依赖于一个特定的驱动器吗?
发布于 2013-02-19 02:25:47
您可以将属性作为文件添加到sysfs条目中,并写入具有读/写访问权限的方法。
1. create attributes using `DEVICE_ATTR`. It is a preprocessor derivative.
2. After creating the attributes create files in the same name which you gave while creating attributes.
Once done, you can access your i2c driver.请参阅此材料以获得进一步的参考:给定非常清晰的http://www.kernel.org/pub/linux/kernel/people/mochel/doc/papers/ols-2005/mochel.pdf
https://stackoverflow.com/questions/14806401
复制相似问题