Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp3257263iob; Mon, 16 May 2022 17:20:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx1+MNUdMdSYNwoLwaSYDMleLW5ezSHEHamdgVHSriJxF9yKoyAGRHq6ET7BuElAm7mZVy9 X-Received: by 2002:a63:1d42:0:b0:3ed:6b3d:c52d with SMTP id d2-20020a631d42000000b003ed6b3dc52dmr12449544pgm.295.1652746857780; Mon, 16 May 2022 17:20:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652746857; cv=none; d=google.com; s=arc-20160816; b=HoCCUpjZKMxFb0Fqg5BSzulh8ocCviC/r7JA58saOThKdgzsdjjqPYFirpUKeMH7Bj JXk7D+mM8J6BC6NPGz1/HAxCahd+s5aaBsic0pQUlkLPFMCYYFped0UkXNGUjQvU/bcc Ju5UO9RQTpo9Tm2qiPQ7jkGPvZf+a7VzzLbIf38tJh4qn4rwhKFJ9NU5xVE1V+RxhgC0 PcgImHM1WhkQNba830BdYHCkO4GDyV/MCBNcLABbC/ib+v6M4g0s2wiQlKxnbwP+iTbe LJIPdvsFwtn0BiIte51aIupKu7B7Bmlj1ysPeNh1kwpP3mGC0XmkOn9Qjmb51VcMMXJl ZzTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :feedback-id:message-id:subject:reply-to:cc:from:to:dkim-signature :date; bh=GkePH7lDmIvIojm6pGTuooS3sc5yfWTWPTLAwIltkVs=; b=ENl4ps4Av6qySsFR/HRWCo+dR1wKVnqLuQpqVqQUPgI4gmNzpDQ1ZmOw+PUiBwpcwm SpjQF9oGakrgVjNh/Ea05vWCznmN1H/nkXk0OucQaEVK6ri6yluw5JiD3er9FzMl4eF5 05X5Gcdg/hlPL2Uw0qbTGYMfRZp0bEu/3KLUP8cytxmyAblJ9oj5L8W0tcn9pO3gYGna v9MsvJiYzLpJQ2FEmhzMHvQRjDnCYgarspdORpVcASOgiBPnxkMydSdppesoNSooW/ov LRh3QJqrpSOrGvhI1Kj89XQRcsW6MtDG5cDzVtrxjkes086JXZLeorZwGciXporeQiIw D1SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@connolly.tech header.s=protonmail header.b=Iu4UUEXz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=connolly.tech Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d4-20020a656b84000000b003db48a0c6ecsi14289857pgw.792.2022.05.16.17.20.46; Mon, 16 May 2022 17:20:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@connolly.tech header.s=protonmail header.b=Iu4UUEXz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=connolly.tech Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244505AbiEPOXN (ORCPT + 99 others); Mon, 16 May 2022 10:23:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244456AbiEPOXG (ORCPT ); Mon, 16 May 2022 10:23:06 -0400 Received: from mail-4022.proton.ch (mail-4022.proton.ch [185.70.40.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 973051EEF0; Mon, 16 May 2022 07:23:03 -0700 (PDT) Date: Mon, 16 May 2022 14:22:57 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=connolly.tech; s=protonmail; t=1652710981; bh=GkePH7lDmIvIojm6pGTuooS3sc5yfWTWPTLAwIltkVs=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:Feedback-ID:From:To: Cc:Date:Subject:Reply-To:Feedback-ID:Message-ID; b=Iu4UUEXzb8YMWcK2+IKaJRgVBCMjowcsik/ivcBKKE9FbKbVTgjgHDLjnbzsLirhI 7WNisTP4LOFJApvSQ06S8cDZ/F81SAbrmtHRzKGbkTW5nTtwQZ8A3Pr9OT0ZKhMGPN /CSpGn5iyaSI2Emx4v/X/t502l2OgCwa2m2ufueA= To: Andy Gross , Bjorn Andersson , Rob Herring , Krzysztof Kozlowski , Dmitry Torokhov , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, phone-devel@vger.kernel.org From: Caleb Connolly Cc: Caleb Connolly Reply-To: Caleb Connolly Subject: [PATCH 1/3] input: add event codes for user programmable switch events Message-ID: <20220516142158.1612109-1-caleb@connolly.tech> Feedback-ID: 10753939:user:proton MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add SW_PROG{1,2,3,4} for device switches which are handled by userspace. This can be used for devices with "generic" switches which are intended to be user-programmable, for example OnePlus phones contain a tri-state key which can be used for switching between mute/vibrate/ring, or programmed by the user to perform any arbitrary actions. These are analogous to the keys KEY_PROG{1,2,3,4} found on some keyboards. Signed-off-by: Caleb Connolly --- See the next patch in this series for an example usecase. --- include/linux/mod_devicetable.h | 2 +- include/uapi/linux/input-event-codes.h | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetabl= e.h index 5da5d990ff58..45364fbeaaf7 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h @@ -326,7 +326,7 @@ struct pcmcia_device_id { #define INPUT_DEVICE_ID_LED_MAX=09=090x0f #define INPUT_DEVICE_ID_SND_MAX=09=090x07 #define INPUT_DEVICE_ID_FF_MAX=09=090x7f -#define INPUT_DEVICE_ID_SW_MAX=09=090x10 +#define INPUT_DEVICE_ID_SW_MAX=09=090x14 #define INPUT_DEVICE_ID_PROP_MAX=090x1f #define INPUT_DEVICE_ID_MATCH_BUS=091 diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/in= put-event-codes.h index dff8e7f17074..339153886a13 100644 --- a/include/uapi/linux/input-event-codes.h +++ b/include/uapi/linux/input-event-codes.h @@ -917,7 +917,11 @@ #define SW_MUTE_DEVICE=09=090x0e /* set =3D device disabled */ #define SW_PEN_INSERTED=09=090x0f /* set =3D pen inserted */ #define SW_MACHINE_COVER=090x10 /* set =3D cover closed */ -#define SW_MAX=09=09=090x10 +#define SW_PROG1=09=090x11 /* set =3D program 1 (user defined) */ +#define SW_PROG2=09=090x12 /* set =3D program 2 (user defined) */ +#define SW_PROG3=09=090x13 /* set =3D program 3 (user defined) */ +#define SW_PROG4=09=090x14 /* set =3D program 4 (user defined) */ +#define SW_MAX=09=09=090x14 #define SW_CNT=09=09=09(SW_MAX+1) /* -- 2.36.1