lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <05f62c0d-4088-dfd1-4a6a-f3ed308824d7@ti.com>
Date:   Tue, 3 Apr 2018 13:55:52 -0500
From:   "Andrew F. Davis" <afd@...com>
To:     Peter Rosin <peda@...ntia.se>, <linux-kernel@...r.kernel.org>
CC:     Jonathan Cameron <jic23@...nel.org>,
        Hartmut Knaack <knaack.h@....de>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Peter Meerwald-Stadler <pmeerw@...erw.net>,
        Rob Herring <robh+dt@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        "David S. Miller" <davem@...emloft.net>,
        Mauro Carvalho Chehab <mchehab@...nel.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Linus Walleij <linus.walleij@...aro.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Randy Dunlap <rdunlap@...radead.org>,
        Michael Hennerich <michael.hennerich@...log.com>,
        Phil Reid <preid@...ctromag.com.au>,
        <linux-iio@...r.kernel.org>, <devicetree@...r.kernel.org>
Subject: Re: [PATCH v2 0/2] iio: add unit converter

On 04/03/2018 01:09 PM, Peter Rosin wrote:
> On 2018-04-03 19:41, Andrew F. Davis wrote:
>> On 04/03/2018 10:36 AM, Peter Rosin wrote:
>>> Hi!
>>>
>>> This driver implements support for voltage dividers and current
>>> sense circuits. It's pretty generic and should be easily adaptable
>>> to other linear scaling purposes...
>>>
>>
>> I really like this idea, defining channel scaling / channel type
>> conversion in DT will be very useful. So much so that I would recommend
>> this not be a use specific driver but instead moved into the IIO core.
>>
>> This would allow defining these channel conversions in the device node
>> itself, so as to not need a separate node just for the converter (the
>> conversion is not a device and probably should not have it's own node
>> anyway). It would also help with enabling this support for buffered
>> readers/writers and not just devices only supporting _raw reads/writes.
> 
> In my case, the voltage dividers and the current sense circuit are very
> much real, and I can point my finger at them on the board. Sure, they
> are not ICs, but to not call them devices is wrong IMHO, and the ADC
> which is involved have very little to do with the voltage dividers and
> the fact that it is involved in sensing current. 


I would argue support resistors are still part of the "current sensing
device", even if they are physically external to the ADC IC. As you say
though, it doesn't really matter that much to this discussion.


> This is not an argument
> for not moving the functionally to the core though, but that has some
> problems AFAICT. Because you need some kind of clever and generic
> binding to make the core do its thing, and it might not be easy to come
> up with something that fits all devices? And if we do put this in the
> core, that opens the door for more complex unit converters later on
> (non-linear etc), further complicating the generic bindings.
> 


For the simple case of linear scaling of the channel input/output, and
type conversion I don't see much problem. They will not need to be
extended, new bindings can be added for more complex cases. When more
complex cases show up additional bindings will be needed either way.


> That said, I'm obviously biased since I want this to get in sooner
> rather than later...
> 


Adding this functionality to the IIO core doesn't really block this
patch-set, it will just make this patch-set unneeded in the future
if/when support goes into the core..

Andrew


> Cheers,
> Peter
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ