devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] Add SW_MACHINE_COVER key
@ 2020-02-14 13:02 Merlijn Wajer
  2020-02-14 13:02 ` [RFC PATCH 1/2] Input: add `SW_MACHINE_COVER` Merlijn Wajer
  2020-02-14 13:02 ` [RFC PATCH 2/2] ARM: dts: n900: remove mmc1 card detect gpio Merlijn Wajer
  0 siblings, 2 replies; 9+ messages in thread
From: Merlijn Wajer @ 2020-02-14 13:02 UTC (permalink / raw)
  To: merlijn
  Cc: Benoît Cousson, Tony Lindgren, Rob Herring, Mark Rutland,
	Dmitry Torokhov, Mattias Jacobsson, Darren Hart (VMware),
	linux-omap, devicetree, linux-kernel, linux-input

This series adds the SW_MACHINE_COVER key, and changes the Nokia N900 dts to
expose the key via gpio-keys.

Before, this gpio was used as card detect GPIO, causing the card not to show up
if the phone was booted without cover, see this thread on linux-omap:

    N900: Remove mmc1 "safety feature"? (was: Re: mmc0 on Nokia N900 on Linux 5.4.18)

Since there is no realistic use for using this gpio as card detect, instead
expose it to userspace via gpio-keys. There are no event type for machine covers
yet, so add that first.

The key should be 1 when the cover is closed, and 0 when the cover is open.

Starting the Nokia N900 with the cover removed, putting the cover in place:

    Event: time 1581684523.415296, type 5 (EV_SW), code 16 (?), value 1

Removing the cover again, exposing mmc1 and the battery:

    Event: time 1581684529.413706, type 5 (EV_SW), code 16 (?), value 0

Merlijn Wajer (2):
  Input: add `SW_MACHINE_COVER`
  ARM: dts: n900: remove mmc1 card detect gpio

 arch/arm/boot/dts/omap3-n900.dts       | 12 ++++++++----
 include/linux/mod_devicetable.h        |  2 +-
 include/uapi/linux/input-event-codes.h |  3 ++-
 3 files changed, 11 insertions(+), 6 deletions(-)

-- 
2.23.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2020-02-15  9:12 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-14 13:02 [RFC PATCH 0/2] Add SW_MACHINE_COVER key Merlijn Wajer
2020-02-14 13:02 ` [RFC PATCH 1/2] Input: add `SW_MACHINE_COVER` Merlijn Wajer
2020-02-14 14:38   ` Sebastian Reichel
2020-02-15  9:09     ` Merlijn Wajer
2020-02-14 19:16   ` Ladislav Michl
2020-02-15  9:03     ` Merlijn Wajer
2020-02-14 13:02 ` [RFC PATCH 2/2] ARM: dts: n900: remove mmc1 card detect gpio Merlijn Wajer
2020-02-14 14:49   ` Sebastian Reichel
2020-02-15  9:13     ` Merlijn Wajer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).