Reputation: 411
The driver I'm developing has a number of settings I want the user to be able to change that don't really fit into the IIO framework. For example, using the IIO_CHAN_INFO_SAMP_FREQ enum in my read function exposes a variable in /sys/bus/iio/devices/iio:device0/ called "in_voltage_sampling_frequency" that allows the user to change the frequency on-the-go. I would also like to be able to pass in different modes (a string) through a similar mechanism. How would I do this? It doesn't look like the IIO interface supports ioctl calls.
Upvotes: 1
Views: 694
Reputation: 1975
Another solution to this problem may be to use module_param
which registers parameters that can be set during loading via modprobe/insmod and at runtime through sysfs:
int myint = 3;
module_param(myint, int, 0);
For more information, see: https://www.tldp.org/LDP/lkmpg/2.6/html/x323.html
Upvotes: 0
Reputation: 411
Found a solution.
I used the sysfs device attribute stuff as seen here:
https://www.kernel.org/doc/Documentation/driver-model/device.txt
Upvotes: 2