From patchwork Fri Oct 30 13:15:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jungrae Kim X-Patchwork-Id: 11869583 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1E9C561C for ; Fri, 30 Oct 2020 13:15:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D60902075E for ; Fri, 30 Oct 2020 13:15:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="p9KgwYMv" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726078AbgJ3NP6 (ORCPT ); Fri, 30 Oct 2020 09:15:58 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:46825 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725939AbgJ3NP6 (ORCPT ); Fri, 30 Oct 2020 09:15:58 -0400 Received: from epcas1p1.samsung.com (unknown [182.195.41.45]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20201030131555epoutp03ea60ef073e8096cc253ea994606818c0~Cx3ygA1Hp0116201162epoutp03i for ; Fri, 30 Oct 2020 13:15:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20201030131555epoutp03ea60ef073e8096cc253ea994606818c0~Cx3ygA1Hp0116201162epoutp03i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1604063755; bh=oXFaU4arpGJFODjHsgMzxQHN9yeh1j4UjTLjwzWIZiI=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=p9KgwYMvja9fbZjjB4yLldZiXqHu6XC3M2s7uq1FFsLT+5ibeo5YQPrcPHVXwvrlv 9n+coYiY8LDr7ePAo94hJf2gnTUFXjsT4RjewC10ocVDN96/kg4eGB49nuCSgwtzr7 UCP7RhiJ19+cUIxw0JQnymBeTpM8mV/WCrJsEgDo= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20201030131555epcas1p27df81941e6f80cd353240286b5540550~Cx3yL5n0X0445804458epcas1p2L; Fri, 30 Oct 2020 13:15:55 +0000 (GMT) Received: from epsmges1p5.samsung.com (unknown [182.195.40.161]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4CN2qt3GChzMqYlr; Fri, 30 Oct 2020 13:15:54 +0000 (GMT) X-AuditID: b6c32a39-c13ff70000002569-d6-5f9c1209c5ee Received: from epcas1p4.samsung.com ( [182.195.41.48]) by epsmges1p5.samsung.com (Symantec Messaging Gateway) with SMTP id D5.51.09577.9021C9F5; Fri, 30 Oct 2020 22:15:53 +0900 (KST) Mime-Version: 1.0 Subject: [PATCH] Input: add SW_COVER_ATTACHED and SW_EXT_PEN_ATTACHED Reply-To: jryu.kim@samsung.com Sender: Jungrae Kim From: Jungrae Kim To: Jungrae Kim , "gregkh@linuxfoundation.org" CC: HyungJae Im , "manivannan.sadhasivam@linaro.org" , "linux-kernel@vger.kernel.org" , "linux-input@vger.kernel.org" , "rydberg@bitmath.org" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20201030115918epcms1p4aaae97a4549a1b3e505709fed3d91ecb@epcms1p4> X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <20201030131552epcms1p2cfe412ede3d3b2c5286d2fff4260300c@epcms1p2> Date: Fri, 30 Oct 2020 22:15:52 +0900 X-CMS-MailID: 20201030131552epcms1p2cfe412ede3d3b2c5286d2fff4260300c X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpjk+LIzCtJLcpLzFFi42LZdljTQ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nSZ9US2tNr5Islf8T6TGg1Vq7tE/HQUf G4VN29LaO1V03ifFL5+kenbL/zi48flBbZ+An8djrRkLQ5QOO+xjMNu1e97TLUFNe1/mZfDe 3HMrzlamYk3Pi0IlluKMREMt5qLiRACeaFXeGQQAAA== DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20201029132747epcms1p8fae559dff47bf0eebdcc9f94efd9a1bf References: <20201030115918epcms1p4aaae97a4549a1b3e505709fed3d91ecb@epcms1p4> <20201030114142.GA2409436@kroah.com> <20201030104628.GB2395528@kroah.com> <20201029135715.GB3470996@kroah.com> <20201029132747epcms1p8fae559dff47bf0eebdcc9f94efd9a1bf@epcms1p8> <20201030043916epcms1p3b289ca5cd902883a97e7d13ceb5c1efb@epcms1p3> <20201030112812epcms1p7d031bb4949b319135e48dfac9409743b@epcms1p7> Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org From 23aed4567e234b7e108c31abadb9f3a3ccccf7d2 Mon Sep 17 00:00:00 2001 From: Jungrae Kim 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 --- 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) /*