Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3568508pxb; Fri, 5 Nov 2021 18:35:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZzFDXK5b/dwpU/M2s89btXDoAls+xBBwiCtS4dcV8FkhMBWcJIQ6W3JXH5VlUho6tEeqF X-Received: by 2002:a05:6e02:1b85:: with SMTP id h5mr13659348ili.112.1636162525281; Fri, 05 Nov 2021 18:35:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1636162525; cv=none; d=google.com; s=arc-20160816; b=Of6FBbyjYESwlKo/hlrGWUWon49w3C2PO83Z5o0vZ12GyuN9Df52gjUUL6nAwNBDo1 Mq0mgMPXUD4eWtBe4VaLeVTOOlEL42RSiA9teWQK+V2wm86Q0pjK5TlWM3n6MS2vjahh 4zMDfq5Brc3F8nK7kSoKmgvRkp4apGqW2ZWQK4GKAHxFRcBE5YUY/1cqm/7homBKdO0p R2kQ0yF2x7v6ieX/Nyg1rrbrB9LLDMjjKF7hX4N2H7GQSA/xXsEWVN6J/B470z2+a1Vw LkyAft4egfRhonmKlnSfOHmvkC37NAhnySTo1NFnd7qcEhs0LTYOjQ70XclOk+9fqN63 hzFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mLpj0IWmQy+qHP6id8yi4q2C/7CSHG0Ef5TY0V38uHo=; b=b7ckLF2nSxyQRaWcqC0Lm41ru5VX6W9oQ7HzvdfCuzS9Bk0o5IKCVPLg4TdgiMMx6M ZM7hxOVVcKMFNCb9dnEWts+RYlXLeIJdgmF9TrI7J79Ar6307n+XKsuKUoLjTuGFAHEV mt9bHPOBL/PMPld9TdMCumC+g7x45pKWFQf8IP+3FaCJ4aXVQ21EeWUjMdsKcTCk0zSu y57cn38rnTtnMI8qHLx8jgKdGvsaE0zek9YLboM9nH1Bqxs96d492Tafew+Es0OKYqBo adYKNhc1itfK1SquXZYUXG59WOinLUukas3Mm5QT+vORVBuanzDXnQui6ji1niMRqfEo XBMA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=gGnuyysL; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z17si21828860ioq.55.2021.11.05.18.35.10; Fri, 05 Nov 2021 18:35:25 -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 header.i=@gmail.com header.s=20210112 header.b=gGnuyysL; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232043AbhKEXHI (ORCPT + 99 others); Fri, 5 Nov 2021 19:07:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230331AbhKEXHH (ORCPT ); Fri, 5 Nov 2021 19:07:07 -0400 Received: from mail-pl1-x635.google.com (mail-pl1-x635.google.com [IPv6:2607:f8b0:4864:20::635]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2BF4C061570; Fri, 5 Nov 2021 16:04:27 -0700 (PDT) Received: by mail-pl1-x635.google.com with SMTP id t11so11910970plq.11; Fri, 05 Nov 2021 16:04:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=mLpj0IWmQy+qHP6id8yi4q2C/7CSHG0Ef5TY0V38uHo=; b=gGnuyysLOjn74YheWLVOOvB91aEDyv98a5sjftQC6Q+xFJi7KlA5ry6s5GpNLCbD0i UklDrKpPtmTRk734CRE21u1TEvGwSalDHrGdYOBinXcemCjF3R1o1d5isaqQGzEbmsb9 adEnVYojuNOUvXMOGz/hNrbzIVTM3oiUo00x19scAPafqpW1J1hx/weOcIj1TpWiMpoJ tHCDhFFffImJHP+24so2WY1qSkgE747iS64fDG1FOPLzi+C85vI5E2ZEs0craW3qcaIv VNROOWbkjbrbzuFxDfOLMFQ7BYLskN7K/0asQCb3eawbdy4LWX2m9hdgRqCwQ/gdkCqf 1XDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=mLpj0IWmQy+qHP6id8yi4q2C/7CSHG0Ef5TY0V38uHo=; b=7LRqYzzdIFcFuVFEjuxIQvVFngx8ogUYWibXUizZU24inaL9gPEVctZQ5kKmhFsXz3 DOPFLSZRKoO88/URLZfHOhB+iROvmNzDOf8nh9FE8i7M5DBL7P2gg7mT52hHDIFLdjkr N11mf3VF/PYRF7NLoS7ffe0wWlawxWD6Dg4ihUyUuONDdeKzQtXvAsjP4vIX0GF0AMxr 2EFyEWDDZHv/gnnQpxqDUfYiuH7SjsXyltDxPjwKAUcwixXUv+oqxlDZt8xQpGK+9y0L 6DTS3bonzjjc1p1xhVjipQ+ZSZNEFkGMxW4mq7yPs5kB0ypwUAgi+mOYrsXBp42DzwQZ HieQ== X-Gm-Message-State: AOAM533gIJNIYokT2XjTmzF4UDwZCiPa9T6jQ5DKki6dG7eY+9ZvbcJ4 bGUCqh4dVJzahqIbrBI8TGc= X-Received: by 2002:a17:90b:1241:: with SMTP id gx1mr33623659pjb.164.1636153467201; Fri, 05 Nov 2021 16:04:27 -0700 (PDT) Received: from google.com ([2620:15c:202:201:837c:e765:475f:22d3]) by smtp.gmail.com with ESMTPSA id c5sm3757408pjm.52.2021.11.05.16.04.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 Nov 2021 16:04:25 -0700 (PDT) Date: Fri, 5 Nov 2021 16:04:23 -0700 From: Dmitry Torokhov To: Jeff LaBundy Cc: Kieran Bingham , linux-input@vger.kernel.org, Geert Uytterhoeven , linux-renesas-soc@vger.kernel.org, Max Gurtovoy , Hans de Goede , Wu Hao , Bjorn Helgaas , Dan Williams , Dave Ertman , Maximilian Luz , Stephan Gerhold , Xu Yilun , open list Subject: Re: [PATCH v2] Input: add 'safe' user switch codes Message-ID: References: <20211105103508.4153491-1-kieran.bingham+renesas@ideasonboard.com> <20211105170037.GA65511@nixie71> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211105170037.GA65511@nixie71> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Jeff, Kieran, On Fri, Nov 05, 2021 at 12:00:37PM -0500, Jeff LaBundy wrote: > Hi Kieran, > > On Fri, Nov 05, 2021 at 10:35:07AM +0000, Kieran Bingham wrote: > > 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 > > --- > > > > Sigh, a compile test might have at least saved the buildbots the trouble > > of notifying me I also need to update the INPUT_DEVICE_ID_SW_MAX. But > > even so - I'm really looking for a discussion on the best ways to > > describe a non-defined switch in device tree. > > > > Here's a compiling v2 ;-) But the real questions are : > > > > - Should an existing feature switch be used for generic switches? > > - Should we even have a 'user' defined switch? > > - If we add user switches, how many? > > > > This is merely my opinion, but if a hardware switch does not have a defined > purpose, it does not seem necessary to represent it with an input device. Yes, exactly. For input core we are trying to avoid generic events with no defined meaning. What are these switches? GPIOs? Maybe it would be better to use GPIO layer to test the state for them? Thanks. -- Dmitry