linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jungrae Kim <jryu.kim@samsung.com>
To: Jungrae Kim <jryu.kim@samsung.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: HyungJae Im <hj2.im@samsung.com>,
	"manivannan.sadhasivam@linaro.org"
	<manivannan.sadhasivam@linaro.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-input@vger.kernel.org" <linux-input@vger.kernel.org>,
	"rydberg@bitmath.org" <rydberg@bitmath.org>
Subject: [PATCH] Input: add SW_COVER_ATTACHED and SW_EXT_PEN_ATTACHED
Date: Fri, 30 Oct 2020 22:15:52 +0900	[thread overview]
Message-ID: <20201030131552epcms1p2cfe412ede3d3b2c5286d2fff4260300c@epcms1p2> (raw)
In-Reply-To: <20201030115918epcms1p4aaae97a4549a1b3e505709fed3d91ecb@epcms1p4>

From 23aed4567e234b7e108c31abadb9f3a3ccccf7d2 Mon Sep 17 00:00:00 2001
From: Jungrae Kim <jryu.kim@samsung.com>
Date: Fri, 30 Oct 2020 21:23:12 +0900
Subject: [PATCH] Input: add SW_COVER_ATTACHED and SW_EXT_PEN_ATTACHED

SW_COVER_ATTACHED represents the connected state of a removable cover
of a device. Value 0 means cover was attached with device, value 1 means
removed it.
SW_EXT_PEN_ATTACHED represents the state of the pen.
Some device have internal pen slot. but other some device have external pen
slot. These two cases has different use case in userspace. So need to
separate a event. Value 0 means pen was detach on external pen slot on
device, value 1 means pen was attached external pen slot on device.

Signed-off-by: Jungrae Kim <jryu.kim@samsung.com>
---
 include/linux/mod_devicetable.h        | 2 +-
 include/uapi/linux/input-event-codes.h | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 5b08a473cdba..897f5a3e7721 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -320,7 +320,7 @@ struct pcmcia_device_id {
 #define INPUT_DEVICE_ID_LED_MAX                0x0f
 #define INPUT_DEVICE_ID_SND_MAX                0x07
 #define INPUT_DEVICE_ID_FF_MAX         0x7f
-#define INPUT_DEVICE_ID_SW_MAX         0x10
+#define INPUT_DEVICE_ID_SW_MAX         0x12
 #define INPUT_DEVICE_ID_PROP_MAX       0x1f

 #define INPUT_DEVICE_ID_MATCH_BUS      1
diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
index ee93428ced9a..a0506369de6d 100644
--- a/include/uapi/linux/input-event-codes.h
+++ b/include/uapi/linux/input-event-codes.h
@@ -893,7 +893,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_COVER_ATTACHED      0x11  /* set = cover attached */
+#define SW_EXT_PEN_ATTACHED    0x12  /* set = external pen attached */
+#define SW_MAX                 0x12
 #define SW_CNT                 (SW_MAX+1)

 /*
-- 
2.17.1

  parent reply	other threads:[~2020-10-30 13:15 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20201029132747epcms1p8fae559dff47bf0eebdcc9f94efd9a1bf@epcms1p8>
2020-10-29 13:27 ` [PATCH v2] input: add 2 kind of switch HyungJae Im
2020-10-29 13:41   ` Barnabás Pőcze
2020-10-29 13:54     ` gregkh
2020-10-29 14:36       ` Barnabás Pőcze
2020-10-29 13:57   ` gregkh
2020-10-29 17:45     ` Dmitry Torokhov
     [not found]   ` <CGME20201029132747epcms1p8fae559dff47bf0eebdcc9f94efd9a1bf@epcms1p3>
2020-10-30  4:39     ` HyungJae Im
2020-10-30 10:46       ` (2) " gregkh
     [not found]       ` <CGME20201029132747epcms1p8fae559dff47bf0eebdcc9f94efd9a1bf@epcms1p7>
2020-10-30 11:28         ` (3) " Jungrae Kim
2020-10-30 11:41           ` gregkh
     [not found]           ` <CGME20201029132747epcms1p8fae559dff47bf0eebdcc9f94efd9a1bf@epcms1p4>
2020-10-30 11:59             ` Jungrae Kim
2020-10-30 12:19               ` gregkh
     [not found]           ` <CGME20201029132747epcms1p8fae559dff47bf0eebdcc9f94efd9a1bf@epcms1p2>
2020-10-30 13:15             ` Jungrae Kim [this message]
2020-10-30 15:41               ` [PATCH] Input: add SW_COVER_ATTACHED and SW_EXT_PEN_ATTACHED Sebastian Reichel
2020-10-30 15:54     ` Jungrae Kim
2020-11-02 12:35   ` [PATCH v2] input: add 2 kind of switch kernel test robot

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=20201030131552epcms1p2cfe412ede3d3b2c5286d2fff4260300c@epcms1p2 \
    --to=jryu.kim@samsung.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=hj2.im@samsung.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=rydberg@bitmath.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 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).