New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bias compile settings #35
Comments
If your kernel version / headers are older than 5.5, then they don't support GPIO line bias. You'll either need to build with a new kernel version, or c-periphery will need to add conditional compilation for that specific gpio-cdev feature. gpio-cdev was originally introduced (without the line bias feature) in kernel version 4.8. gpio-cdev has been under a lot of flux across kernel versions, which is good for new features, but adds some complexity to libraries like c-periphery downstream. There appears to be a new v2 API coming to kernel version 5.10. It's going to take a bit of effort to seamlessly support multiple kernel versions. |
Ah, totally makes sense since I'm testing on 5.4 kernel under Armbian. I believe they stick with LTS versions only, so it will be next LTS. |
Oh, actually, there's 5.8 mainline, I will try this now... |
OK this works |
I had to use CFLAGS=-DPERIPHERY_GPIO_CDEV_SUPPORT -DGPIOHANDLE_REQUEST_BIAS_PULL_UP -DGPIOHANDLE_REQUEST_BIAS_PULL_DOWN -DGPIOHANDLE_REQUEST_BIAS_DISABLE or I'd get "Kernel version does not support configuring GPIO line bias". Is that the correct way to use bias?
The text was updated successfully, but these errors were encountered: