Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1834903yba; Fri, 17 May 2019 06:15:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqwBFaieJrqka3fUwHK2BlMqUu9RRHgFDBL4yDr1QMzx+bYSgYDWchQeT19HHkIPe+INBWnf X-Received: by 2002:a62:7689:: with SMTP id r131mr62597598pfc.181.1558098944333; Fri, 17 May 2019 06:15:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558098944; cv=none; d=google.com; s=arc-20160816; b=O0Zd6zAyINtDd28lsYAfcE1/hwfx9QFI3xe3Si7ALpVq+uj5qYtSSnxvGRSrbL2UQW V+CwWP3/YnZWyGqVi1jbAphe1cQLd+SqLeDTWNIRY4LMtrMUvXIw+Byf+LLGtLgk6F5r gQQvHO98jzuLKjqmhD1l6UY/ZOxBgs50fFUg1nwRmEg8MwFZntMTcJWQtbCLYySqitwU 1dxY5PQ2zyzYerlChWhWmxXs3RbpnVVhIXOLVQNhi7vAecbiDoK+VuwdIDLFjOC9ThRE XGI2zevQbeeVMdAzl4Iq9WGmIkP8hIDXWs4sQOaqRY/Qgs/A2KSykxDtJVOSkfCyuZyj 4Uxw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=SeFOmzREg76ZG58RfAR8jB6TwSzhC984BntPlNv10bM=; b=wECALdWsqoq4xgJLapjIlcUEQPfy6eRBVvwysrRgErv1FiirELmsmxBFFgVlUTfUFg OKBvqwJCGxb37SExFncyuEUw6Tu1zQNLMdUwLKRylD5I0NkWKzw+VatwgU+uI7wT1QOW px9IvQaU6wVQi/Esi/FZXUidphePPsyNWY/8bCH/V5OU7YgCn3RsAe+rA5TbMzdF/HNV AVtlhS+yh841SKnvQX4Il95Li6hUJRD7Kg53Iz1+ru0B61H5/EDvNTTZyPxrEjBkNmZ+ 78fR1Gl15ZWm47NlzlJUyoQbsz1EHUa6OAjWKpgIOIbkJkQIsoNB6GxtQD8lgJ2ZXw57 ibSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass (test mode) header.i=@ysoft.com header.s=20160406-ysoft-com header.b=QYgNXO0z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ysoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i95si8230495plb.344.2019.05.17.06.15.28; Fri, 17 May 2019 06:15:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass (test mode) header.i=@ysoft.com header.s=20160406-ysoft-com header.b=QYgNXO0z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=ysoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728766AbfEQNN0 (ORCPT + 99 others); Fri, 17 May 2019 09:13:26 -0400 Received: from uho.ysoft.cz ([81.19.3.130]:33838 "EHLO uho.ysoft.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728430AbfEQNNN (ORCPT ); Fri, 17 May 2019 09:13:13 -0400 Received: from iota-build.ysoft.local (unknown [10.1.5.151]) by uho.ysoft.cz (Postfix) with ESMTP id 817EFA06FD; Fri, 17 May 2019 15:13:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ysoft.com; s=20160406-ysoft-com; t=1558098789; bh=SeFOmzREg76ZG58RfAR8jB6TwSzhC984BntPlNv10bM=; h=From:To:Cc:Subject:Date:From; b=QYgNXO0z3mbMZLwSxTaPCadqJb7wRdFaCikV95bZqGRf5GmBqVL1WOCHDhnlaePWa RhAUBOMmXCVuR43wOkQwjMGCltznVMdofbGWENgHMdwlf+rx0EZGxil0LdsU7OQMkV EJWLW3z9GOaJkNWSSVqMwpXkKDeyBMGWWNOHNAVw= From: =?UTF-8?q?Michal=20Vok=C3=A1=C4=8D?= To: Dmitry Torokhov , Rob Herring Cc: Mark Rutland , Shawn Guo , Sascha Hauer , Fabio Estevam , linux-input@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Pengutronix Kernel Team , =?UTF-8?q?Michal=20Vok=C3=A1=C4=8D?= Subject: [RFC PATCH v2 0/4] Input: mpr121-polled: Add polled driver for MPR121 Date: Fri, 17 May 2019 15:12:49 +0200 Message-Id: <1558098773-47416-1-git-send-email-michal.vokac@ysoft.com> X-Mailer: git-send-email 2.1.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, I have to deal with a situation where we have a custom i.MX6 based platform in production that uses the MPR121 touchkey controller. Unfortunately the chip is connected using only the I2C interface. The interrupt line is not used. Back in 2015 (Linux v3.14), my colleague modded the existing mpr121_touchkey.c driver to use polling instead of interrupt. For quite some time yet I am in a process of updating the product from the ancient Freescale v3.14 kernel to the latest mainline and pushing any needed changes upstream. The DT files for our imx6dl-yapp4 platform already made it into v5.1-rc. I rebased and updated our mpr121 patch to the latest mainline. It is created as a separate driver, similarly to gpio_keys_polled. The I2C device is quite susceptible to ESD. An ESD test quite often causes reset of the chip or some register randomly changes its value. The [PATCH 3/4] adds a write-through register cache. With the cache this state can be detected and the device can be re-initialied. The main question is: Is there any chance that such a polled driver could be accepted? Is it correct to implement it as a separate driver or should it be done as an option in the existing driver? I can not really imagine how I would do that though.. There are also certain worries that the MPR121 chip may no longer be available in nonspecifically distant future. In case of EOL I will need to add a polled driver for an other touchkey chip. May it be already in mainline or a completely new one. I will appreciate any comments. Thank you in advance, Michal Michal Vokáč (4): dt-bindings: input: Add support for the MPR121 without interrupt line Input: mpr121-polled: Add polling variant of the MPR121 touchkey driver Input: mpr121-polled: Add write-through cache to detect corrupted registers ARM: dts: imx6dl-yapp4: Enable MPR121 touch keypad on Hydra .../bindings/input/mpr121-touchkey-polled.txt | 26 ++ arch/arm/boot/dts/imx6dl-yapp4-common.dtsi | 12 + arch/arm/boot/dts/imx6dl-yapp4-hydra.dts | 4 + drivers/input/keyboard/Kconfig | 13 + drivers/input/keyboard/Makefile | 1 + drivers/input/keyboard/mpr121_touchkey_polled.c | 493 +++++++++++++++++++++ 6 files changed, 549 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/mpr121-touchkey-polled.txt create mode 100644 drivers/input/keyboard/mpr121_touchkey_polled.c -- 2.1.4