2013-02-11 170 views
1

我有一个i2c芯片驱动程序作为Linux内核的一部分。我可以通过内核启动消息来验证内核中的i2c芯片驱动程序。我的问题是,这样的i2c芯片驱动程序是否会通过sysfs访问,如果是,那么如何。我的用户空间程序不会高度依赖于一个特定的驱动器如何使用用户空间的I2C驱动程序

回答

0

您可以将属性作为文件添加到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

相关问题