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.
*Linux Driver Development* Is there a way to expose extra settings through sysfs using the IIO framework?
665 Views Asked by z470 At
2
There are 2 best solutions below
0
mallwright
On
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
Related Questions in LINUX
- How do I recursively find and replace only in files named index.php on Linux webserver?
- passing text with \n as one argument in shell
- kernel module does not print packet info
- How to send ESC/POS commands to thermal printer in Linux
- (x64 Nasm) Writeline function on Linux
- How do I set the Hive user to something different than the Spark user from within a Spark program?
- Default priority of thread with SCHED_FIFO
- Calling a python function with options from shell script
- How to split a directory into parts without compressing or archiving?
- Cross compile simple standard C program on Linux for Mac
- How to offload NAPI poll function to workqueue
- python netifaces - How to get currently used network interface
- Unexpected output from function
- mingw-64 conflicting declarations when cross-compiling
- Different behavior of async with Visual Studio 2013(Windows8.1) and GCC 4.9(Ubuntu14.10)
Related Questions in DRIVER
- C++ Mongodb driver, not working
- Raspberry PI Compute Module - SPI1
- Insert element into nested array in Mongodb
- Loading a Windows Driver Class other than NetService to act as an NDIS Filter
- where to find oneplus one binaries (Device tree, Vendor, Kernel) to build rom from AOSP?
- Why does this static funtion have three prefixes?
- Is it possible to limit data traffic in kernel USB drivers?
- Twain driver scanner integration in Windows 8.1
- USB3 Controller & Kinect 2
- Connecting R from JSP
- Universal Drivers will run inside Universal Apps in Windows 10?
- USB keeps disconnecting...only for mobile devices
- IoCreateDeviceSecure function denies the access from member in Administrators
- Intel OpenGL Driver bug?
- CoreMediaIO camera driver not detected until restart of application
Related Questions in SYSFS
- How to calculate the time remaining until the end of the battery charge
- Linux without sysfs/debugfs filesystem
- How to match a mounted filesystem to a USB device on Linux?
- Not able to read a sysfs file
- How can I detect a USB port being used for charging in Linux?
- Open a file as root, but drop privileges before reading from it?
- How to access devices through sysfs?
- GPIO/Analog programming for BeagleBone Black on Angstrom Linux, what compiler for cross development on Windows?
- SELinux rules for i2c files in sysfs in Android
- Improve read speed of a virtual filesystem
- Use poll() with POLLIN for waiting changes in file
- How to create a sysfs attribute_group under an existing sysfs directory?
- How to output a list of block devices from /sys/block to the kernel log?
- Restricting GPIOS to output-only or input-only through sysfs
- Linux driver access through sysfs
Related Questions in IIO
- How to compile AD9834 kernel driver
- Too many open files: /dev/spidev0.0
- Python and Rasbperry MCP3008 sampling
- Reading analog inputs fast in beaglebone black
- MSP432 Launchpad Board using the same pins for two different devices
- not able to read iio file from userspace
- cross compiling C code with external libraries
- Encountering an I2C error 121 when interfacing an MPU6050 with a Raspberry Pi using Python
- IIO device buffer always null
- IIO buffer refill time out
- reading from sensors based on softlinks
- Why is an included C-header not found when cross-compiling but well when not cc?
- *Linux Driver Development* Is there a way to expose extra settings through sysfs using the IIO framework?
- How to read data from LSM330 in /dev/iio:deviceX?
- Read a word (2 byte) without providing a register address from userspace
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Found a solution.
I used the sysfs device attribute stuff as seen here:
https://www.kernel.org/doc/Documentation/driver-model/device.txt