devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: "Denis, Tomislav AVL DiTEST" <Tomislav.Denis@avl.com>
Cc: "linux-iio@vger.kernel.org" <linux-iio@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>
Subject: Re: [PATCH 2/2] bindings: iio: adc: Add documentation for ADS131E0x ADC driver
Date: Sat, 2 Jan 2021 14:15:10 +0000	[thread overview]
Message-ID: <20210102141510.2f6f00bb@archlinux> (raw)
In-Reply-To: <60ea32f43ac4485db97684ad9a94cfbf@avl.com>

On Fri, 1 Jan 2021 22:41:35 +0000
"Denis, Tomislav AVL DiTEST" <Tomislav.Denis@avl.com> wrote:

> Hi Jonathan,
> 
> Thanks for great review and hints that you gave me.
> A few comments inline.
> 
> BR,
> 
> Tomislav
> 
Replies inline.

> > > +title: Texas Instruments ADS131E0x 4-, 6-, and 8-Channel ADCs  
> > 
> > Not currently supporting 6 channel variants?  
> 
> It should be working without problem! But since I don't have HW to test I've left it out. 
> 

Personally I'd just be an optimist and put it in.  Seems very unlikely
it won't work given you have variants on either side of it.


> > > +    $ref: /schemas/types.yaml#/definitions/uint32
> > > +    enum: [0, 1, 2]
> > > +    default: 0
> > > +
> > > +  ti,datarate:
> > > +    description: |
> > > +      ADC data rate in kSPS
> > > +    $ref: /schemas/types.yaml#/definitions/uint32
> > > +    enum: [1, 2, 4, 8, 16, 32, 64]
> > > +    default: 1  
> > 
> > Why is this a devicetree element rather than runtime controllable?  
> 
> Number of data bytes per channel depends on data rate. To be able to change data rate 
> dynamically would require to change scan_type.realbits also dynamically! I am not sure
> if that make sense and also if it is possible to do it?

Indeed not possible to do runtime variable resolution currently.  We have talked
about implementing it a few times, but it's rather fiddly to do hence hasn't happened
yet.

hmm. It might be better to control the channel resolution in the device
tree as that feels a bit less like something that ought to be runtime controllable.

From a quick look at the datasheet it looks like you can have the same data width
for 32 and 64 ksps (16 bits) and the same for all the other rates (24 bits)

However, given you are using the same number of storage bits anyway, you could
be more cynical and claim 24 bits for all channels and just rely on the upper
bits being 0 for the 16 bit cases.  That way this would just become a
userspace sampling frequency control with slightly missleading apparent
precision + the need to stash the realbits value you are using for scale
somewhere else. If we do this we end up with entirely standard userspace
interface and no need for this control in DT.

Jonathan

  reply	other threads:[~2021-01-02 14:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-27 19:42 [PATCH 0/2] Add support for ADS131E0x ADC family tomislav.denis
2020-11-27 19:42 ` [PATCH 1/2] iio: adc: Add driver for Texas Instruments " tomislav.denis
2020-11-28 13:02   ` Jonathan Cameron
2020-11-28 23:58   ` kernel test robot
2020-11-27 19:42 ` [PATCH 2/2] bindings: iio: adc: Add documentation for ADS131E0x ADC driver tomislav.denis
2020-11-28 12:34   ` Jonathan Cameron
2021-01-01 22:41     ` Denis, Tomislav AVL DiTEST
2021-01-02 14:15       ` Jonathan Cameron [this message]
2020-11-30 17:36   ` Rob Herring

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210102141510.2f6f00bb@archlinux \
    --to=jic23@kernel.org \
    --cc=Tomislav.Denis@avl.com \
    --cc=devicetree@vger.kernel.org \
    --cc=linux-iio@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).