2013-02-11 71 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

相關問題