Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1930141pxb; Thu, 4 Nov 2021 10:57:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiyLX6Z0TDpx6EFUiulyw9VTm/tgCrWEttkqfq+VKWMJ0l1lI9ySIBFcEPxIvuBiW4YW+k X-Received: by 2002:a05:6638:22c8:: with SMTP id j8mr5086206jat.46.1636048629256; Thu, 04 Nov 2021 10:57:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636048629; cv=none; d=google.com; s=arc-20160816; b=j8MP93j9rTvYLk7XNaiUrRBJMevC9bidhpsU84QwxQrRiAnn5dE1u71HJFNVpmR0Bj wjbquYIbSKgQ7dkdH6SrLEit/E3EpyiYKRxPqVLg1M38J+MRa1h/0X0aVREGtZ+W4xIM OREkQxhCN9kh3A96UVBlIuA6ohVQx9WCFOSVg8mf/j949x2l4WHjXdMZ9wXZFSBX//UP /9RrpNQRi9e83R5AMnCQlUgb6O74mtW0ZnAX5M3GMa6U7iv00llJyjHiVbb+q+tn+Gk/ xI3wVvfQIdGmB1/5kLsxvqBfQF8cX8fwEmpzFw7gfjPDtLSmjDf5TLwB9wOqN4Q5GdnO 5PhQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=TSevRi5RWZcwUQVcReTqLMlM7HOjp456XK3UY1BLhAs=; b=hVL/ddSL9j/kbUUqVhQBCt1S91nrZHqX0ORzuAcpo+kWmHand2D302W1C3jA4uK5yw UBjGaE6Ps3xBRga0h8T1cxSSVyxGET0PFao+WR2PF5dz+l1kiPECTYeQeEHBZnW52Z3r wJZnkABhVs/AxC9Q6z4jlrzEdvYUyvJe/lyda9FcgUyX123VXXg0PzBQIZUhM/aiXRUv qHpFg//R6O5sMuLivdlV9dsyzt69LaexUkPE35o7auMq5L1lCGUtUbPgMyyQLG7GvP8q 9fUH8DutZa/ifI6ex30r9KFIRjmB1iSGyqJNUPrid61j4J+fxrEjFoSfs+D7pimWXyvA EXBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=epZS5N3b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y6si11186772ilu.49.2021.11.04.10.56.55; Thu, 04 Nov 2021 10:57:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ideasonboard.com header.s=mail header.b=epZS5N3b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233905AbhKDR4h (ORCPT + 99 others); Thu, 4 Nov 2021 13:56:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231742AbhKDR4g (ORCPT ); Thu, 4 Nov 2021 13:56:36 -0400 Received: from perceval.ideasonboard.com (perceval.ideasonboard.com [IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A47F4C061714; Thu, 4 Nov 2021 10:53:58 -0700 (PDT) Received: from Monstersaurus.ksquared.org.uk.beta.tailscale.net (cpc89244-aztw30-2-0-cust3082.18-1.cable.virginm.net [86.31.172.11]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id A11F91C18; Thu, 4 Nov 2021 18:53:55 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1636048435; bh=qGSuuTnM3mb4rnj/RSz/PrRrWVygP1aCNwH3RPQW22E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=epZS5N3bJxC9UzAyp64zLc0C1SJD8BQA06Sg6cSngLDnFsloHxIq8pw7ZkbPdHx1/ 2/s2n9i42K/6NX7TYeyDj3UQyNHWloGHH0N7TQiSCN+0jRT4a3x9IdZEIBvn2hnvsI FOOHfYE48SXTEA5MUbgldcLLBc7dm8fLTBctqW9c= From: Kieran Bingham To: linux-input@vger.kernel.org, Geert Uytterhoeven , linux-renesas-soc@vger.kernel.org Cc: Kieran Bingham , Dmitry Torokhov , linux-kernel@vger.kernel.org (open list) Subject: [PATCH] Input: add 'safe' user switch codes Date: Thu, 4 Nov 2021 17:53:39 +0000 Message-Id: <20211104175339.3906851-1-kieran.bingham+renesas@ideasonboard.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20211025130457.935122-1-kieran.bingham+renesas@ideasonboard.com> References: <20211025130457.935122-1-kieran.bingham+renesas@ideasonboard.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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