Received: by 2002:a05:622a:1442:b0:3a5:28ea:c4b9 with SMTP id v2csp757433qtx; Mon, 31 Oct 2022 13:09:24 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5ZZ25sdzFd0or37AoLDv3M+AiVDblL9uqJ4RiNY8lNufUxZSVlU+pOKH+6WFY2bcGKTqgE X-Received: by 2002:a17:903:22c6:b0:187:1d13:c5f3 with SMTP id y6-20020a17090322c600b001871d13c5f3mr8309645plg.66.1667246963724; Mon, 31 Oct 2022 13:09:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667246963; cv=none; d=google.com; s=arc-20160816; b=LGjC3u9yMCg9YBFc8/Zl0WmHow/msNSZHOK6I5CRpaMAqdTRMoOTAD2ysQ6JELv7xi qfWhz5vzzKOMG+WCSzQxnkxs2dgSOHoA32rpOizoHcc2OoNkKfIcI9riWhXFbZZfYaFV Vq9RHC7Xcf092QfVcOGA2X2VdJhvHAa4MW104mFWKlCqCj1xjQvMPXbYphw2CERFjagk tokPTUMwp5szIEeyW30p8H2SyJzjo3UpL35RAC2zqAs908UsCHGCSxh5vkLK8riJuyCv xmEV2m5B8qt1oCCpMgzUqbVt9cgJkUZZBnOE+ih3xPaTT9PBJvNZWrxaj25ZtZLAxuvF Ib1w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:content-transfer-encoding:mime-version :message-id:date:subject:cc:from:dkim-signature; bh=MAKY7AptcCVQIhtmA9wqKe7QLZb3fkZHYHjCZEkjfqI=; b=lx1TwbZZZ1oQIdn+GfFcoFNLgJTwoSebxHPkRH7AK2yTUb3K7PC7Oc/Pvm9JKC/Rlr SB+lhPymCLjkjga4OMMTTOWGsBbyVDy7UaUzwbGyIXBzhXcEdcLmGGL5e4RUF/9DW4W+ gDSNQ742m4wg9demdR+2q6FrczdxyxQKDKKsFZ84mWI3nkSIvfVXuPgmycpSc0QA5ZhF 9Itfd8x3wpEY1wJpQIWd35pf2pNUubY8hmC5QAz3PxekZR9XFJR5TuUrY2VnBmkWCj3r jeYIIhTuTHDCS4uN+Dirts5LUeG53WjCYLo8eBvzb1MPyOcgWIxolSIopVMdRmF6Z82o IjSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20210112 header.b=eBYn5yVs; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c3-20020a056a00248300b00535fa14ffaasi10897872pfv.116.2022.10.31.13.09.11; Mon, 31 Oct 2022 13:09:23 -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=fail header.i=@gmail.com header.s=20210112 header.b=eBYn5yVs; 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=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229916AbiJaTCf (ORCPT + 98 others); Mon, 31 Oct 2022 15:02:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59636 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbiJaTCd (ORCPT ); Mon, 31 Oct 2022 15:02:33 -0400 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 734E79589; Mon, 31 Oct 2022 12:02:32 -0700 (PDT) Received: by mail-wm1-x336.google.com with SMTP id a11-20020a05600c2d4b00b003cf6f5fd9f1so2420513wmg.2; Mon, 31 Oct 2022 12:02:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=MAKY7AptcCVQIhtmA9wqKe7QLZb3fkZHYHjCZEkjfqI=; b=eBYn5yVs3gG4F0A2V+BGvTOlxeDyXHO7zxEKqyxQzgq0MRpwiVlymwpZVQsOpyWjGj 2NfEagpA+IG5N0tWUz9phvK46FAKiPHrQKUFrjtnQGDEtjwMZffZcSTBpcSB7M3Xfhtp Y11i7ZqwOpMwNbJl/TD0JnJ2NnZO/1H0/6+tLZjl2mfRlZQLHpvzXNoPQ/K9UXoIXPNy ylg676C2UDbxJZFgEl3zmI/Ug6VihVYv+6uEDwun5raEVjT+8gSO13UukiaaQ+WQr89c GzdhAApmFOP32ukb2kPk1B3b8bfirxlZyFgPXZDlPFZmcpOcqDzfmgfTgxFc8Poyuj48 JZDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=MAKY7AptcCVQIhtmA9wqKe7QLZb3fkZHYHjCZEkjfqI=; b=hoZ67oNf4M58UC1QLyk6WhNpkeCqrTvXE27rkts+83wQQnNLh3jNqVhPt3LyuC3dwc 2YXnf/yUtkFJtbobl02+oGrqRDTOBgHWxtBrAXzUq6UI55HlQuUNawbqm2V4JlZ50MxM HEK6hoSZgxs2CFLA3N3OGklQeBQh/mQks5ndB/RrZHkboI3hpCCGWpgC1r10YmlFSx78 +BKTJ3PVILr/8WGwfymEHYNPKGcQjGveMA97h1XFJLu8aZCBXk2hmoGOxX+4R4voOfil 7hMPT3TSwQJ2TV8J4mSE0SiniubjNDrdwm7lnWrd3DOiMAjNC0JVYMZG8V3pPE//TtXu td9A== X-Gm-Message-State: ACrzQf2ZFnGQEICG/sFvHkaNStM0JqCuBCWg57a8l1n/nESal7wNpA40 AKE0I6Gko1GG+HsbraORE3o/nIWYm4Naj48b X-Received: by 2002:a05:600c:3b82:b0:3cf:6cc7:5b7b with SMTP id n2-20020a05600c3b8200b003cf6cc75b7bmr5721776wms.126.1667242950941; Mon, 31 Oct 2022 12:02:30 -0700 (PDT) Received: from hp-power-15.localdomain (mm-167-8-212-37.vitebsk.dynamic.pppoe.byfly.by. [37.212.8.167]) by smtp.gmail.com with ESMTPSA id l13-20020a05600c2ccd00b003a2f2bb72d5sm9141750wmc.45.2022.10.31.12.02.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Oct 2022 12:02:30 -0700 (PDT) From: Siarhei Volkau Cc: Paul Cercueil , Siarhei Volkau , Dmitry Torokhov , Rob Herring , Krzysztof Kozlowski , Artur Rojek , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RFC PATCH 0/2] Input: adc-joystick: add detachable devices support Date: Mon, 31 Oct 2022 22:01:57 +0300 Message-Id: <20221031190159.1341027-1-lis8215@gmail.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net To: unlisted-recipients:; (no To-header on input) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org For detachable or lock-able joysticks the ADC lanes might be biased to GND or AVDD when the joystick is detached/locked. One such kind of joystick is found in the Ritmix RZX-50 handheld. The joystick is non-detachable, although ADC lane biased to power supply when the "Hold" switch is activated. To avoid reporting old/broken measurements valid-range is introduced. When measured value is outside valid-range the driver reports safe center position for corresponding axis. Siarhei Volkau (2): dt-bindings: adc-joystick: add valid-range Input: adc-joystick - add detachable devices support .../bindings/input/adc-joystick.yaml | 62 +++++++++++++++++++ drivers/input/joystick/adc-joystick.c | 58 ++++++++++++++++- 2 files changed, 119 insertions(+), 1 deletion(-) -- 2.36.1