Skip to content
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

Closed
sgjava opened this issue Nov 5, 2020 · 4 comments
Closed

Bias compile settings #35

sgjava opened this issue Nov 5, 2020 · 4 comments

Comments

@sgjava
Copy link

sgjava commented Nov 5, 2020

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?

@vsergeev
Copy link
Owner

vsergeev commented Nov 7, 2020

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.

@sgjava
Copy link
Author

sgjava commented Nov 7, 2020

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.

@sgjava sgjava closed this as completed Nov 7, 2020
@sgjava
Copy link
Author

sgjava commented Nov 7, 2020

Oh, actually, there's 5.8 mainline, I will try this now...

@sgjava sgjava reopened this Nov 7, 2020
@sgjava
Copy link
Author

sgjava commented Nov 7, 2020

OK this works Linux nanopiduo 5.8.16-sunxi #20.08.14 SMP Tue Oct 20 22:15:32 CEST 2020 armv7l armv7l armv7l GNU/Linux even though the Duo doesn't have PUDs :) At least the kernel error went away.

@sgjava sgjava closed this as completed Nov 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants