Received: by 2002:a25:86ce:0:0:0:0:0 with SMTP id y14csp550352ybm; Mon, 20 May 2019 22:38:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyzLF5QS91aOdijKbbk4EkdDP/G9xYsj9ELzq7SlcDF4kKk7ey6TRn1sNRwj//zNpADBv0z X-Received: by 2002:a63:2bd1:: with SMTP id r200mr17463786pgr.202.1558417131839; Mon, 20 May 2019 22:38:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558417131; cv=none; d=google.com; s=arc-20160816; b=sYcBxjOcyBFhuw3Fz7w9HLd59v7PRXTG6xW1m1DnN1iH5SFWtnWT1FshNMKqn2nuxT 37+4vzsKeZdHsbcUiToz/TuMqn9iUtswdiRTLrl+2MRlN9WLca35rm8tWFpS7yTrGIP5 UZyJewWbr+bCoCs7pJKu2BebgmjMy/ZtEs7DLtXS393C8jPul5s5GruXJhULrIZcpLn4 ihfpbCahO/ASiPvZjnlv4deba4cEse6LUJ+DepZxn/OXcqjnsx0emvVhwR9lD03H9s3i IrmErtPjJA3DgFQjSDf9K+X9QxX/1sGn1mlzmx2yi4iLYG0TMjwTgS5eBdYTtrgn4D1g mPuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=BZUFffhvoZ/3VV5Du2sO0r+/XHpzujtgwYRf59q1Hiw=; b=e1xkncBRXzanqCRvcKDZT0S24iAMzt7BSE+hjW8cUGKRBb1yi1sQY2Z2HR00B4wtUW QRtlvYizbWTZrynfAZYTypTxa1glbnglW4y+H2vpxc+L94OxcATnxTKpXYy2MV7GPDWQ rrrZNXHUYp73xPHZpjdb8FxeKnn2hZRvoSZTRUPsGhODt/dL8093GUX39QsvpZWpGceY z4zcSAw/VHNetTAzorryvbsGULGH+wf+ZMCOjxp1rpOhmwHoXOBO15JC+Pc513UB90wx lKLJnaDBDURDM8Tw+8ZU9wOmIKRl8irDKYxDJrMiecfkjUanAtcOayq5wKdZ5ij6Kpij QeuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=L5QsMohp; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 23si9172575pgc.469.2019.05.20.22.38.36; Mon, 20 May 2019 22:38:51 -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 header.i=@gmail.com header.s=20161025 header.b=L5QsMohp; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727814AbfEUFhJ (ORCPT + 99 others); Tue, 21 May 2019 01:37:09 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:36475 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725794AbfEUFhJ (ORCPT ); Tue, 21 May 2019 01:37:09 -0400 Received: by mail-pf1-f194.google.com with SMTP id v80so8450265pfa.3; Mon, 20 May 2019 22:37:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=BZUFffhvoZ/3VV5Du2sO0r+/XHpzujtgwYRf59q1Hiw=; b=L5QsMohpY5jUu8A6YvYaTiZm+TCX58rPXL32paqhvK7XnxN0t+Ewr6vKXTtoOaPBjV byTNG8bGdahP89ZEwxlWek0z2kWfFar5NqPSBwWeP7zk4PYsgvBOSLMdhvTe5xNzON53 hJlDfOnJdTlj653JJZ52clPD9Kb28QVtgHCwkw6WYHzFVphHDLt5MlJhoU1uDV+fYZrq MbcG9YaAuRa6+Z/Wr+UXvG4D3AO5zBvlMjvs2XhjaNAxFiL0a1rXAJBE5bbOS0LIsM41 GJKn+DmrQ7j1vuxD3zWuJQB3wMdSaPVBCFzadC1YO1tRi2e9KKn+YYUIJ40PYNm8/ESN r1zQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to:user-agent; bh=BZUFffhvoZ/3VV5Du2sO0r+/XHpzujtgwYRf59q1Hiw=; b=rtlKBKr0XnsLNlYALzsWjwxz4aeTD/A5TUZX0IqXSac0QpAuK+2/iavssb7eDl57hA 0eEWA69GSrJU9wUBmoRsgdZ6TMnH9nEX6J6p96FrNuWJzThnIDxXJwyprLS4mkehpw2P 0l+7uxcAA0ueq0d006CCXPdeOWUe4D6OZ2gn7OfEGLMuZ/R8STremRcMasbtEaz/sApw m1qQB0XnX6SGYruEjBPOUC/THAHeR7DT0f4MjGpax9rliYxFXxGIV508CGPRPUpKaCDP vDRn3s21xpTV1J/c31vL00I7OssbB6PGvYzFQd8ExpLWyhfN2GtxHeLB3TXKckriRgu+ /0Vg== X-Gm-Message-State: APjAAAV1aNFPsdOwsNKyt1fbwLfIsA+SxaA4YtR31/xBhgikMZpQeOKs C/UWV0AirJ3kkVZ4hAFuUkc= X-Received: by 2002:a65:4806:: with SMTP id h6mr5663188pgs.299.1558417027972; Mon, 20 May 2019 22:37:07 -0700 (PDT) Received: from dtor-ws ([2620:15c:202:201:3adc:b08c:7acc:b325]) by smtp.gmail.com with ESMTPSA id l21sm27768199pff.40.2019.05.20.22.37.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 20 May 2019 22:37:07 -0700 (PDT) Date: Mon, 20 May 2019 22:37:05 -0700 From: Dmitry Torokhov To: Michal =?utf-8?B?Vm9rw6HEjQ==?= Cc: Rob Herring , 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 Subject: Re: [RFC PATCH v2 0/4] Input: mpr121-polled: Add polled driver for MPR121 Message-ID: <20190521053705.GI183429@dtor-ws> References: <1558098773-47416-1-git-send-email-michal.vokac@ysoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1558098773-47416-1-git-send-email-michal.vokac@ysoft.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michal, On Fri, May 17, 2019 at 03:12:49PM +0200, Michal Vokáč wrote: > 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 think that my addition of input_polled_dev was ultimately a wrong thing to do. I am looking into enabling polling mode for regular input devices as we then can enable polling mode in existing drivers. As far as gpio-keys vs gpio-key-polled, I feel that the capabilities of polling driver is sufficiently different from interrupt-driven one, so we will likely keep them separate. Thanks. -- Dmitry