* [Buildroot] Lightweight method for handling external power-down request
@ 2016-04-19 18:15 Patrick Doyle
2016-04-19 19:04 ` Thomas Petazzoni
0 siblings, 1 reply; 3+ messages in thread
From: Patrick Doyle @ 2016-04-19 18:15 UTC (permalink / raw)
To: buildroot
Hello all,
I found this discussion:
http://lists.infradead.org/pipermail/linux-arm-kernel/2015-April/339919.html
on the Linux Arm Kernel mailing list archive. It is from April of
2015. Sannon Zhao started a discussion regarding how to implement
external power down for ARM. The consensus seemed to be to use ACPI.
I am wondering if there is a lighter weight (smaller code and
mindshare footprint) method for handling this.
I would like to initiate an orderly shutdown of my buildroot based
system when a GPIO signal is toggled high. I think could add
something like the following to my device tree:
gpio-keys {
compatible = "gpio-keys";
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_gpio_poweroff>;
power {
label = "Power-Key";
gpios = <&pioA 103 GPIO_ACTIVE_HIGH>;
linux,code = <KEY_POWER>;
debounce-interval = <10>;
};
};
and I believe that would result in a KEY_POWER event(?)/input key(?)
getting delivered to user-land. But I am not sure how to handle that
in user-land. So it seems that I could install acpid to handle that
somehow, but I feel this is getting more complicated than it should
be.
Alternatively, I could code up a shell script that polls my GPIO pin
and shuts down the processor when that signal goes high, but I hate
the idea of polling; I'm not thrilled about the lack of debounce
support; and I would much rather respond to the event immediately,
than have to wait the 500 to 1000ms I might have to wait for my
polling process to notice the signal.
So, how do ARM folks in Buildroot-land handle this?
--wpd
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] Lightweight method for handling external power-down request
2016-04-19 18:15 [Buildroot] Lightweight method for handling external power-down request Patrick Doyle
@ 2016-04-19 19:04 ` Thomas Petazzoni
2016-04-19 19:22 ` Patrick Doyle
0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni @ 2016-04-19 19:04 UTC (permalink / raw)
To: buildroot
Hello,
On Tue, 19 Apr 2016 14:15:10 -0400, Patrick Doyle wrote:
> So, how do ARM folks in Buildroot-land handle this?
Look at the input-event-daemon package in Buildroot.
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] Lightweight method for handling external power-down request
2016-04-19 19:04 ` Thomas Petazzoni
@ 2016-04-19 19:22 ` Patrick Doyle
0 siblings, 0 replies; 3+ messages in thread
From: Patrick Doyle @ 2016-04-19 19:22 UTC (permalink / raw)
To: buildroot
On Tue, Apr 19, 2016 at 3:04 PM, Thomas Petazzoni
<thomas.petazzoni@free-electrons.com> wrote:
> Look at the input-event-daemon package in Buildroot.
>
Thank you Thomas, that looks exactly like what I need.
--wpd
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-04-19 19:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-19 18:15 [Buildroot] Lightweight method for handling external power-down request Patrick Doyle
2016-04-19 19:04 ` Thomas Petazzoni
2016-04-19 19:22 ` Patrick Doyle
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.