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?
666 views Asked by z470 At
2
There are 2 answers
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
- Is there some way to use printf to print a horizontal list of decrementing hex digits in NASM assembly on Linux
- Why does Hugo generate different taxonomy-related HTML on different OS's?
- Writes in io_uring do not advance the file offset
- Why `set -o pipefail` gives different output even though the pipe is not failing
- what really controls the permissions: UID or eUID?
- Compiling eBPF program in Docker fails due to missing '__u64' type
- Docker container unable to make HTTPS requests to external API
- Whow to use callback_query_handler in Python 3.10
- Create kea runtime directory at startup in Yocto image
- Problem on CPU scheduling algorithms in OS
- How to copy files into the singularity sandbox?
- Android kernel error: undefined reference to `get_hw_version_platform'
- Is there a need for BPF Linux namespace?
- Error when trying to execute a binary compiled in a Kali Linux machine on an Ubuntu system
- Issue with launching application after updating ElectronJs to version 28.0.0 on Windows and Linux
Related Questions in DRIVER
- How to setup SLI on two GTX 560Ti's
- How can I set an uncommon screen resolution on GNU/Linux with an Arc 380 GPU and X11?
- Bluetooth Driver file corrupt or replaced
- Simba Driver Upgrade on Windows
- OpcUA The user identity token is not valid
- RPi Linux Audio driver for 8 channels Codec
- ORA-61754: Using JSON type collections on Oracle Database release 23c or later requires a SODA driver for Oracle Database release 23c or later
- create_ap wlan0: Could not connect to kernel driver
- How to fix Linux CMA on x86 with internal graphic card i915/hda_intel ioremap error?
- How to enable Swap APO in SYSVAD sample driver without enhancement tab in windows 11?
- RT linux isr routine
- I sent a bundle of data by using bulkTransfer, but received data in pieces
- Trying to do sudo make for linux driver
- Erreur "java.lang.ClassNotFoundException: org.postgresql.Driver"
- In Windows 10/11 is there a way to script a device to use a specific driver, even if its not marked as compatible?
Related Questions in SYSFS
- how to add sysfs attributes to netdevice driver
- Making a few charecter device in linux
- Does the first column of /sys/block/<dev>/stat refer to the number of read system calls?
- nodejs fs.writeFile to sysfs (/sys) doesn't seem to work
- How to output a list of block devices from /sys/block to the kernel log?
- How to create a sysfs attribute_group under an existing sysfs directory?
- Use poll() with POLLIN for waiting changes in file
- Improve read speed of a virtual filesystem
- How to create a link to sysfs attribute
- How this code line is reading power consumption information?
- How to ensure my LEDs are disabled on startup with sysfs on my SBC
- Why I get permission denied when trying to read ROM from a device in sysfs?
- Errors while controlling PWM with sysfs
- Raspberry pi GPIO sysfs, fopen: Permission denied
- For Linux device driver programming, why I can use APIs like `sysfs_create_group` without `linux/sysfs.h` header?
Related Questions in IIO
- Why I get Raspberry Pi MCP3008 C++ error?
- Using Analog Devices Inc. AD7091R ADC on Raspberry Pi (driver availible: AD7476), using ADI-Kuiper-Linux, how to create a linux device tree file
- GPIO library for DHT11
- BH1750 I2C Python Fails on Raspberry Pi
- Risc-V Linux, DTS interrupt PIN for MPU6050 driver
- have any one used plutoSDR via python
- i2c_smbus_write_byte_data not working on the Raspberry Pi 3
- Why do I get an "sh: write error: Invalid argument" when configuring the current_trigger for an iio_sysfs_trigger?
- How to include MPU6050 driver into Yocto image from kernel-space?
- Linux permission issue, when accessing I2C - Jetson Nano
- Incorrect BME688 Gas reistance values
- Issue in Reading data from already created device under iio for st_lsm6dsox for step count
- Raspberry Python & Java - No input MISO
- Linux MAX11122 SPI driver - extra 300uS delay before pulling up CS
- Can I modify regmap_config parameters, such as the .val_bits of regmap_config, in userspace?
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?
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)
Found a solution.
I used the sysfs device attribute stuff as seen here:
https://www.kernel.org/doc/Documentation/driver-model/device.txt