From: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
To: linux-input@vger.kernel.org, Geert Uytterhoeven <geert@glider.be>,
linux-renesas-soc@vger.kernel.org
Cc: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>,
Dmitry Torokhov <dmitry.torokhov@gmail.com>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH] Input: add 'safe' user switch codes
Date: Thu, 4 Nov 2021 17:53:39 +0000 [thread overview]
Message-ID: <20211104175339.3906851-1-kieran.bingham+renesas@ideasonboard.com> (raw)
In-Reply-To: <20211025130457.935122-1-kieran.bingham+renesas@ideasonboard.com>
All existing SW input codes define an action which can be interpreted by
a user environment to adapt to the condition of the switch.
For example, switches to define the audio mute, will prevent audio
playback, and switches to indicate lid and covers being closed may
disable displays.
Many evaluation platforms provide switches which can be connected to the
input system but associating these to an action incorrectly could
provide inconsistent end user experiences due to unmarked switch
positions.
Define two custom user defined switches allowing hardware descriptions
to be created whereby the position of the switch is not interpreted as
any standard condition that will affect a user experience.
This allows wiring up custom generic switches in a way that will allow
them to be read and processed, without incurring undesired or otherwise
undocumented (by the hardware) 'default' behaviours.
Signed-off-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
---
I'd like to hear feedback from linux-input on this of course, and if
accepted I'll submit updates to the evtest utility too.
include/uapi/linux/input-event-codes.h | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
index 225ec87d4f22..84a7b3debcb3 100644
--- a/include/uapi/linux/input-event-codes.h
+++ b/include/uapi/linux/input-event-codes.h
@@ -894,7 +894,9 @@
#define SW_MUTE_DEVICE 0x0e /* set = device disabled */
#define SW_PEN_INSERTED 0x0f /* set = pen inserted */
#define SW_MACHINE_COVER 0x10 /* set = cover closed */
-#define SW_MAX 0x10
+#define SW_1 0x11 /* set = user defined */
+#define SW_2 0x12 /* set = user defined */
+#define SW_MAX 0x12
#define SW_CNT (SW_MAX+1)
/*
--
2.30.2
prev parent reply other threads:[~2021-11-04 17:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-25 13:04 [PATCH v2] arm64: dts: renesas: r8a779a0: falcon-cpu: Add SW46 switch support Kieran Bingham
2021-11-04 17:53 ` Kieran Bingham [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211104175339.3906851-1-kieran.bingham+renesas@ideasonboard.com \
--to=kieran.bingham+renesas@ideasonboard.com \
--cc=dmitry.torokhov@gmail.com \
--cc=geert@glider.be \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.