LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices


Reply
  Search this Thread
Old 11-28-2022, 01:58 PM   #1
clsgis
Member
 
Registered: Nov 2007
Posts: 37
Blog Entries: 4

Rep: Reputation: 5
Question sysfs GPIO is deprecated, /dev/gpiochipN is new, persistent output state?


The /sys/class/gpio/gpioN/value interface is gone from the Debian bookworm kernel, nightly Raspberry Pi image build.

Which is fair, it's been deprecated since kernel 5. The device interface API that replaces it is more appropriate to a multi-user, multiprocessing system. But it means I can't turn GPIO pins up and down using echo commands in crontab any more.

The CLI utilities in package gpiod are all ephemeral. When the gpioset(1) command exits, the kernel reclaims the pin and makes it an input again. It seems I will need a daemon to initialize and own the GPIO pin, and a control CLI utility to signal it with scheduled changes.

There's no daemon in the Debian gpiod package. I found this (undocumented) daemon
https://github.com/maquefel/gpiod
but as I understand the code it's only for monitoring input changes.

What am I missing? Have I overlooked the recommended tool for setting persistent output state on a GPIO pin using /dev/gpiochip0 ?

Target hosts are Raspberry Pi, Orange Pi, and amd64. Yes I know Armbian is keeping the deprecated interface until gpiod is more mature. I don't want to rely on a deprecated interface.
 
Old 12-08-2022, 11:53 AM   #2
business_kid
LQ Guru
 
Registered: Jan 2006
Location: Ireland
Distribution: Slackware, Slarm64 & Android
Posts: 16,454

Rep: Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353Reputation: 2353
Why live on a nightly image build if you want your GPIO thing to work? In fact, why live on a nightly image build unless you're testing software?

There's an obvious solution - use an older kernel until gpiod starts behaving itself. Thanks for the heads up on the issue. I always viewed the whole gpio interface as an aberration anyhow and avoided it like the plague. They're trying to use a cpu as a µController, which is a terrible idea.
 
  


Reply

Tags
daemon, device driver, interface, raspberrry pi, sysfs



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How to operate GPIO on and off in sysfs.Please help me ZH_Y Linux - Desktop 2 01-09-2021 08:28 AM
How to determine xrandr output name from sysfs output name? thinkpadboi Linux - Software 4 07-11-2018 08:29 PM
GPIO access on a Fujitsu Mini-ITX Industrial Mainboard, PCI Driver for GPIO mechatrix Linux - Embedded & Single-board computer 3 11-20-2011 03:57 PM
Persistent persistent Persistent Going Nuts Here Fcukinyahoo Linux - Newbie 6 11-17-2011 09:56 PM
Using GPIO (from kernel GPIO support) in MY application DannyGilbert Linux - Kernel 2 03-16-2009 07:52 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel

All times are GMT -5. The time now is 12:27 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration