All of lore.kernel.org
 help / color / mirror / Atom feed
* can gpio-keys send different codes on both rising and falling edge.
@ 2020-04-30 21:27 Dexter Travis
  0 siblings, 0 replies; only message in thread
From: Dexter Travis @ 2020-04-30 21:27 UTC (permalink / raw)
  To: linux-input

I have been able to use gpio-keys to create a key input which can
either suspend or wake my device using KEY_SLEEP and KEY_WAKEUP event
codes respectively, but not both.

I would like to use a single gpio to control this behavior.  On
falling edge the KEY_SLEEP would be emitted and the system would
suspend.  On the rising edge the KEY_WAKEUP would be emitted and the
system would resume.

Does a driver exist in input or elsewhere that can create this behavior for me?

I have not yet been able to find an existing driver for this use case.
I am considering creating a driver similar to gpio-keys that would
create this behavior.  Sleep and wake are my desired events but in a
general case one could emit any two codes on the rising/falling edges.

I examined some uses of SW_LID.  However what I found generally relied
on user space to perform the response action (suspend/resume) once the
lid event was emitted.  I would like this to be done completely in
kernel space.

Thank you,

Dexter

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-04-30 21:28 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-30 21:27 can gpio-keys send different codes on both rising and falling edge Dexter Travis

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.