Received: by 2002:a05:6358:e9c4:b0:b2:91dc:71ab with SMTP id hc4csp3872960rwb; Sun, 7 Aug 2022 09:09:25 -0700 (PDT) X-Google-Smtp-Source: AA6agR5PlAZZmi9Kukd0iYOkOs7Uplh5m5VZa8nRD/stkSpxu/tqjCV1nem99Fu5Yz4Oe0WJ78PJ X-Received: by 2002:a17:906:8a63:b0:730:9e5c:b456 with SMTP id hy3-20020a1709068a6300b007309e5cb456mr10928360ejc.571.1659888565376; Sun, 07 Aug 2022 09:09:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659888565; cv=none; d=google.com; s=arc-20160816; b=iTaNHaZ7LOuE4kDRLOM3w4Cg6u+JZOaQR2cY9TQZjf9Wi1PjAxGKXamDc8MJdSVIIC fWzlBWRX8oGQDKkaT4Iv9sHcCUsVE0E7F4icJgVM5CbIuGjWWBCccF48MJ7M2XJ4lpVK gaFK56aYzNXcWwDzwDuUvNgsrUi6DYx+s2klHZu1FtFlKQUlHyY0LjXpsPoMgLRJZBW2 XVBt1bswwIO7vWNfbkZrcywPrASeh9qnd8p7kX6YZtN6a753y+WFKldnRXUpBQub2it5 6fjbpV1dZAM2u5OZT3Mj45yCJUTCaRpkbDjAryNb2aNBBy53kPrG+sJrEdq034PKIAta +g7g== 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:references:in-reply-to:message-id:subject:reply-to:cc :from:to:dkim-signature:date; bh=E97y01Qgk0NfD6wZHnPXassl6h4rNnG16nJI4wW+NRo=; b=CO+HSRD2ZDoC/GuyYxWgXykDzA5Fx0ogOpm/+0KncGfod18X00+uKKXNAWlyacgCHZ bmlXZbhWDa6yncwB8TzS9aK0hByxr6+hvlyjPsGD/rzvGhkLpbNstAti3Izt0B/MQR87 vEWamWnXvshe641a8PkAg+RneitaXUXX3nXTy4OuXjfPa6966wpPpba/RolMCyp7ld78 lqtOvr8wSomneXK0LUvn1PqC1k7ZOGToJ7d/YsviRJTrtxxnMWpnO6wGJwBUFfTeDfLF knbxuXXHjNiZau4sZusJ1pdSTHlmFjNkaCCGZYbY8YI+F4oMcEmT47n1dD+cmXq5KBAB 3j8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@connolly.tech header.s=protonmail header.b=ZkIc6m0+; 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 qa20-20020a170907869400b00730bcba7f70si9200150ejc.635.2022.08.07.09.08.57; Sun, 07 Aug 2022 09:09:25 -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=ZkIc6m0+; 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 S234376AbiHGQBp (ORCPT + 99 others); Sun, 7 Aug 2022 12:01:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234249AbiHGQBo (ORCPT ); Sun, 7 Aug 2022 12:01:44 -0400 Received: from mail-40136.proton.ch (mail-40136.proton.ch [185.70.40.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B37499FF7; Sun, 7 Aug 2022 09:01:41 -0700 (PDT) Date: Sun, 07 Aug 2022 16:01:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=connolly.tech; s=protonmail; t=1659888099; x=1660147299; bh=E97y01Qgk0NfD6wZHnPXassl6h4rNnG16nJI4wW+NRo=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=ZkIc6m0+x/UKjButZsnHohuBXNA9X/KmRuQoAyH7XPiip7z6QsUyvnULofhrYrnY5 5KlIhBRSYjt+7e9ZLYfTe7o95BbEMyrYTQ+Bq9KOpLsYlGvRARy24Ow+X/SVko6VD4 ZElgqpItqi1lpV5tKX+WfKl32CdVlWvsG8CHJwxg= To: Bjorn Andersson , Dmitry Torokhov From: Caleb Connolly Cc: Andy Gross , Rob Herring , Krzysztof Kozlowski , 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 Reply-To: Caleb Connolly Subject: Re: [PATCH 1/3] input: add event codes for user programmable switch events Message-ID: <4067646c-36d2-7c05-1bdd-955f8fc69924@connolly.tech> In-Reply-To: References: <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 On 01/07/2022 00:11, Bjorn Andersson wrote: > On Mon 16 May 09:22 CDT 2022, Caleb Connolly wrote: > >> 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 > > This looks reasonable to me. > > Dmitry, what do you think? Any chance someone could take a look at this? (Sorry I really should have b= umped this a few weeks ago). > > Regards, > Bjorn > >> --- >> 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_devicet= able.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= /input-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 >> >> -- Kind Regards, Caleb