Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2502990pxb; Tue, 9 Mar 2021 04:20:07 -0800 (PST) X-Google-Smtp-Source: ABdhPJwRih/NY7UaaaWRFC5qRSpDMj4KI/7NQhZ9ncW+L8+BEJN5I638lYChDIU1yOl1FbaY5O9C X-Received: by 2002:a50:8f42:: with SMTP id 60mr3731817edy.168.1615292407361; Tue, 09 Mar 2021 04:20:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615292407; cv=none; d=google.com; s=arc-20160816; b=TjJ9YroVoPf80xrHMwWr4PGgzORorwKVAoEeHjBcghrV7FIAS7YChchtKDKeeBVsNO abM6BoARoq6uNDJGkofMc8rRlTHYXWTuEE3zt0V2nHtpsg8TsPtWw2P4umQ6guyr9O6z BVJJai48eDkiIxuh0X2sSsbqHKq+k6sb+N/XNE8C9w40+18YdXj/zSPaPrqkGStMxTY+ karzGOftyiW33O6oFEwsyqw4GuCQSy0keIlHO5q/3Nf9tTzQt98cYTSiBPvtndiBaFmC tD0+DtYp/XXyMrklUG5wh0fuDvYvBxqfaCwRkzZIADZ9VQfO49HYW+6inM1VKgDdsUOc 8DOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=xVYFybhfF7pBZWHG4K5XEQKL8V7XQkxUngcsyddmwug=; b=qZPVU6qvUfQcmx6gRBl+9dCvaK1GR8txHMtlKq1Nm4IBgaRNULzhCbTooMpY+WTKO3 dpaxXSU6J3Rf5ABF+G8u+Ow/Pq8teC94hKaIdWtrk7uoz+w2STyZOHc+5EZd3Qx9/osX 5SGlWgJwCaLyNhLRP2gURJOhzi+mTIMJwdmi9KzdpPxpe/nv9vsZbkaXJqIM3gWR3iFr jCr+EEVOmbyzJ7HHhG5ZDVR+OHxRu+f5Q26hSUVq+YH4XUYs5kyGE3kvGb7bAxItq4fo fPPQ+Z/MpamHvPNkrJ/omI9rEtx8hIVAq/ArRj3jo7u2lxsoSkCUccZzhtFXzd9xDE+k saUA== ARC-Authentication-Results: i=1; mx.google.com; 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 o7si8728297edr.131.2021.03.09.04.19.45; Tue, 09 Mar 2021 04:20:07 -0800 (PST) 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; 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 S230386AbhCIMSt (ORCPT + 99 others); Tue, 9 Mar 2021 07:18:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230458AbhCIMSb (ORCPT ); Tue, 9 Mar 2021 07:18:31 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DE00BC06174A for ; Tue, 9 Mar 2021 04:18:30 -0800 (PST) Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lJbJd-0005bo-DE; Tue, 09 Mar 2021 13:18:21 +0100 Received: from ore by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1lJbJb-000860-AO; Tue, 09 Mar 2021 13:18:19 +0100 Date: Tue, 9 Mar 2021 13:18:19 +0100 From: Oleksij Rempel To: Andy Shevchenko Cc: devicetree , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio , Robin van der Gracht , David Jander , Linux Kernel Mailing List , Rob Herring , Pengutronix Kernel Team , Jonathan Cameron , Dmitry Torokhov , Jonathan Cameron Subject: Re: [PATCH v1 2/2] iio: adc: add ADC driver for the TI TSC2046 controller Message-ID: <20210309121819.yzvta7tyrslnepts@pengutronix.de> References: <20210305133813.27967-1-o.rempel@pengutronix.de> <20210305133813.27967-3-o.rempel@pengutronix.de> <20210305190239.000075fe@Huawei.com> <20210309114150.lubvvtqblw2y5zlk@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 13:03:28 up 97 days, 2:09, 44 users, load average: 0.04, 0.08, 0.05 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 09, 2021 at 01:46:55PM +0200, Andy Shevchenko wrote: > On Tue, Mar 9, 2021 at 1:42 PM Oleksij Rempel wrote: > > On Tue, Mar 09, 2021 at 01:05:27PM +0200, Andy Shevchenko wrote: > > > On Fri, Mar 5, 2021 at 9:05 PM Jonathan Cameron > > > wrote: > > > > > > > > On Fri, 5 Mar 2021 14:38:13 +0100 > > > > Oleksij Rempel wrote: > > > > > > > > > Basically the TI TSC2046 touchscreen controller is 8 channel ADC optimized for > > > > > the touchscreen use case. By implementing it as IIO ADC device, we can > > > > > make use of resistive-adc-touch and iio-hwmon drivers. > > > > > > > > > > So far, this driver was tested with custom version of resistive-adc-touch driver, > > > > > since it need to be extended to make use of Z1 and Z2 channels. The X/Y > > > > > are working without additional changes. > > > > > > > > > > Signed-off-by: Oleksij Rempel > > > > > > > > Hi Oleksij, > > > > > > > > To consider this as a possible long term route instead of just making this > > > > a touchscreen driver, we'll want to see those mods to the resistive-adc-touch. > > > > Of course that doesn't stop review of this in the meantime. > > > > > > > > There are quite a few things in here that feel pretty specific to the touchscreen > > > > usecase. That makes me wonder if this is a sensible approach or not. > > > > > > I'm wondering if this has any similarities with existing drivers under > > > drivers/input/touchscreen. > > > > Yes, for example: drivers/input/touchscreen/ads7846.c > > Then I have a few questions here: > 1/ why the above mentioned driver can't be extended to cover this? It is not possible to keep old device tree binding compatible with the new driver at least not for currently existing abstraction: ADC + touchscreen node. It is too expensive to overwrite the old driver, we do not have enough time and resource to do it. I lardy spend some weeks to do it and I would need a many more weeks to make it by tiny slices without solving actual problem. Many resistive touchscreen driver should share a lot of code. Since there is already existing IIO based components, it seems to me better to spend available resource and making it properly in a way, which reflect modern best practices. > 2/ or why is the proposed driver named after the touchscreen instead > of the real AD/C chip behind it? I do not understand this question. The proposed driver is named after the chip which provides ADC functionality, In this case, it is TSC2046. The touchscreen is a separate physical module. The idea of this proposition is to keep physically separate components separately on the kernel side. > 3/ maybe we can introduce a simple AD/C driver under IIO for that? There are already simple ADC drivers for that: iio-hwmon: drivers/hwmon/iio_hwmon.c resistive-adc-touch: drivers/input/touchscreen/resistive-adc-touch.c This two driver + the proposed one, will replace functionality of ads7846.c Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |