Re: replacement for persistence of values written to sysfs files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 15.03.21 12:46, Rasmus Villemoes wrote:

Hi,

So how is one supposed to get the kernel to set and maintain a value for
a gpio, without having to keep a dummy process around? Also, with the
sysfs interface, another process can later change the gpio value; I
don't think that's possible with a dummy process hanging onto it.

I've got a few remaining legacy systems in the field, where I still use
the classic sysfs interface for exactly that reason: separate short-running programs (shell scripts) do certain things on the gpio and then
exit.

For newer applications, I don't use raw gpios anymore (except for rare
things like generic PLCs, where I have no influence on the actual
workloads)

So, for example, one init script we have first configures a temperature
sensor with a high-temp alert threshold, and after that value has been
written, sets a gpio that will make such an alert trigger a reset of the
board.

Bind a proper driver to it. Either IIO or hwmon (depending on what that
sensor is actually for).


--mtx

--
---
Hinweis: unverschlüsselte E-Mails können leicht abgehört und manipuliert
werden ! Für eine vertrauliche Kommunikation senden Sie bitte ihren
GPG/PGP-Schlüssel zu.
---
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@xxxxxxxxx -- +49-151-27565287



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux