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 6FFCAC6FD1B for ; Mon, 6 Mar 2023 18:26:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230133AbjCFS0h convert rfc822-to-8bit (ORCPT ); Mon, 6 Mar 2023 13:26:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230096AbjCFS0d (ORCPT ); Mon, 6 Mar 2023 13:26:33 -0500 Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 00BC174A47; Mon, 6 Mar 2023 10:26:03 -0800 (PST) Received: from lhrpeml500005.china.huawei.com (unknown [172.18.147.200]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4PVkTq6Jy8z6J7Kr; Tue, 7 Mar 2023 00:26:07 +0800 (CST) Received: from localhost (10.202.227.76) 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.21; Mon, 6 Mar 2023 16:26:33 +0000 Date: Mon, 6 Mar 2023 16:26:32 +0000 From: Jonathan Cameron To: CC: , , , , , , Subject: Re: [PATCH v1 1/2] dt-bindings: iio: adc: adding dt-bindings for PAC193X Message-ID: <20230306162632.00005edd@Huawei.com> In-Reply-To: <2f1a14522a7a8d46e3b037a285af4c3dd9b17cbc.camel@microchip.com> References: <20230220123232.413029-1-marius.cristea@microchip.com> <20230220123232.413029-2-marius.cristea@microchip.com> <20230225171723.15e822ec@jic23-huawei> <2f1a14522a7a8d46e3b037a285af4c3dd9b17cbc.camel@microchip.com> 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="ISO-8859-1" Content-Transfer-Encoding: 8BIT X-Originating-IP: [10.202.227.76] 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 Mon, 6 Mar 2023 13:53:27 +0000 wrote: > Hi Jonathan, > > Thank you so much! I'm happy to contribute to IIO. > > I will remove some section because I agree with the propose solution. > For the rest I will comment below.. > > > > On Sat, 2023-02-25 at 17:17 +0000, Jonathan Cameron wrote: > > > > + > > > > +? microchip,samp-rate: > > > > +??? $ref: /schemas/types.yaml#/definitions/uint32 > > > > +??? description: Sampling rate for all device's channels. > > > > > > What are the units? rate is usually in hz, which should be > > > expressed in > > > unit suffix (property name)] > > > > It's unusual for sampling rate to be a property of the hardware and > > hence > > suitable for DT binding. Normally we make this a userspace control > > instead. > > If there is a reason for doing it from DT, that wants to be mentioned > > here. > > > > Here I could change it into the datarate (as in > iio/adc/ti,ads1015.yaml). The units are samples per second. My > intention was to be alingned with the datasheet. > > My intention was to let the user configure the sample rate as soon as > posile during the startup (the PAC device's own power consumtion will > increase with the sampling rate - default the chip will start with the > maximum samples per second). Feel free to have the driver set it to the minimum frequency unconditionally in probe. > > > > > > > > > > > > > > + > > > > +????? microchip,bi-directional: > > > > +??????? description: Whether the channel is bi-directional. > > > > > > Describe here what is a "bi-directional" channel for ADC... Maybe > > > it is > > > obvious, maybe not. For me it is not and none of other devices have > > > it. > > > > > From datasheet this seems to be a novel description of whether the > > ADC > > is measuring just positive or allows for negative voltage as well > > (i.e. > > the current through the shut resistor is going on the other > > direction). > > Can we relate this to a biopolar / unipolar decision on a simple > > voltage ADC? > > For that we have standard DT bindings in iio/adc/adc.yaml > > > > Yes, the PAC device can measure voltages as unipolar or bipolar but > also current as unidirectional or bidirectional (we are measuring the > voltage across a shunt resistor). We are also reporting power and is > not a "usual" thing to report power as unipolar or bipolar. Bi- > directional power makes more sens if you are thinking to monitor a > charge discharge cycle for a battery pack. I'm still a little confused. If you are bipolar and hence can measure postive and negative voltage between two pins, how is that different to bidirectional? Other than for bidirection we are talking current rather than voltage. > > > > Thanks, > Marius