sysfs

How to attach file operations to sysfs attribute in platform driver?

别说谁变了你拦得住时间么 提交于 2019-11-30 07:26:42
I wrote a platform driver for a peripheral we developed and would like to expose some configuration options to the sysfs. I have managed to create the appropriate files using attribute structs (see below) and sysfs_create_file in the probe function, but I can't figure out how to attach the show/store functions to the structs in a platform driver. Most resources I found online used a device_attribute struct or something similar to create their files, is that also appropriate here? Is there another way to do this for a platform driver? My attribute struct looks like this: struct attribute subkey

Using the Linux sysfs_notify call

人走茶凉 提交于 2019-11-30 07:26:12
I am trying to communicate asynchronously between a kernel driver and a user-space program (I know there are lots of questions here that ask for similar information, but I could find none that deal with sysfs_notify). I am leaving Vilhelm's edit here, but adding the source to both a simple driver utilizing sysfs and a user-space program to poll it. The driver works fine (I got most of it from the net; it is missing the credits, but I couldn't find them when I went back to add them). Unfortunately, the polling program does not work. It always returns success immediately. Interestingly, if I don

Using the Linux sysfs_notify call

元气小坏坏 提交于 2019-11-29 09:38:08
问题 I am trying to communicate asynchronously between a kernel driver and a user-space program (I know there are lots of questions here that ask for similar information, but I could find none that deal with sysfs_notify). I am leaving Vilhelm's edit here, but adding the source to both a simple driver utilizing sysfs and a user-space program to poll it. The driver works fine (I got most of it from the net; it is missing the credits, but I couldn't find them when I went back to add them).