From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B8E87EB64DA for ; Wed, 5 Jul 2023 08:04:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232367AbjGEIEc convert rfc822-to-8bit (ORCPT ); Wed, 5 Jul 2023 04:04:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232272AbjGEIEZ (ORCPT ); Wed, 5 Jul 2023 04:04:25 -0400 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2084110DD; Wed, 5 Jul 2023 01:04:24 -0700 (PDT) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.226]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4QwsYb1fRBz67L8m; Wed, 5 Jul 2023 16:01:23 +0800 (CST) Received: from localhost (10.34.206.101) by lhrpeml500005.china.huawei.com (7.191.163.240) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 5 Jul 2023 09:04:17 +0100 Date: Wed, 5 Jul 2023 16:04:13 +0800 From: Jonathan Cameron To: George Stark CC: Martin Blumenstingl , , , , , , , , , , , , Subject: Re: [PATCH v3 5/5] meson saradc: support reading from channel 7 mux inputs Message-ID: <20230705160413.000062e7@Huawei.com> In-Reply-To: <6ee38b3a-8e2f-15d6-f7bd-06ef567d2b68@sberdevices.ru> References: <20230627224017.1724097-1-gnstark@sberdevices.ru> <20230627224017.1724097-6-gnstark@sberdevices.ru> <20230702172116.00006f33@Huawei.com> <6ee38b3a-8e2f-15d6-f7bd-06ef567d2b68@sberdevices.ru> Organization: Huawei Technologies Research and Development (UK) Ltd. X-Mailer: Claws Mail 4.1.0 (GTK 3.24.33; x86_64-w64-mingw32) MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Originating-IP: [10.34.206.101] X-ClientProxiedBy: lhrpeml500006.china.huawei.com (7.191.161.198) To lhrpeml500005.china.huawei.com (7.191.163.240) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 4 Jul 2023 04:59:51 +0300 George Stark wrote: > Hello Martin, Jonathan > > On 7/3/23 22:39, Martin Blumenstingl wrote: > > Hi Jonathan, > > > > On Sun, Jul 2, 2023 at 11:21 AM Jonathan Cameron > > wrote: > > [...] > >>> @@ -235,6 +249,27 @@ enum meson_sar_adc_channel_index { > >>> NUM_CHAN_7, > >>> NUM_CHAN_TEMP, > >>> NUM_CHAN_SOFT_TIMESTAMP, > >> Silly question... Why does this device have timestamp channels? > >> It has no buffer support so they don't 'do anything'. > >> If it had then putting other channels after that might have broken > >> things if not done very carefully (hence I went looking) > > This question is probably for me (not George). > > The answer is simple: when I wrote the Meson SAR ADC driver I looked > > at various other drivers (but can't recall which ones exactly). One of > > them probably used a soft timestamp channel so I also added that to > > meson_saradc. Since "it didn't break anything" I thought it would be > > fine. > > > > Newer SAR ADC IP blocks have buffer support, but that's not > > implemented in the driver (yet). > > So if I understand you correctly we can drop the soft timestamp > > channel (with a dedicated patch in this series)? yes. I think dropping it would be sensible. > > One short comment: newly-added channels probably won't support buffering > because physically they all are read thru channel7. We'll be able to add > buffering only to base old channels and they are still defined before > CHAN_SOFT_TIMESTAMP (if this is you're wary about). > That is a common situation. If adding buffering support any channels that are not suitable for buffered access are given scan_index = -1 at which point they are sysfs / polled in kernel access only. Jonathan > > Best regards, > > Martin >