Cooperate with sysfs Kernel I2C driver from C application side

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Cooperate with sysfs Kernel I2C driver from C application side

ソリューションへジャンプ
1,136件の閲覧回数
Anton_K
Contributor III

Hello, I'm using i.MX8 yocto build and able to select supported MISC I2C drivers as the Kernel driver. Actually I2C driver located on the kernel/drivers/misc/bh1770glc.c and I can see some sysfs attributes to configure and cooperate with physical I2C slave. 
My question is how am I able to write my own C application to access the sysfs control attribute from struct attribute_group list? Can someone help my to search some C API or examples of how to control I2C devices as the Kernel driver via sysfs attributes for example?
Thanks in advance, Anton!

0 件の賞賛
返信
1 解決策
1,110件の閲覧回数
Anton_K
Contributor III
Oh, I've found good solution here: https://github.com/mozcelikors/tea5767_kernel_driver

It's the way to access the files on /sys/class/i2c-dev/i2c-3/device/3-0038/bh1770glc/. All files here are the attributes of sysfs group.

元の投稿で解決策を見る

0 件の賞賛
返信
1 返信
1,111件の閲覧回数
Anton_K
Contributor III
Oh, I've found good solution here: https://github.com/mozcelikors/tea5767_kernel_driver

It's the way to access the files on /sys/class/i2c-dev/i2c-3/device/3-0038/bh1770glc/. All files here are the attributes of sysfs group.
0 件の賞賛
返信