public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Michael Hennerich <Michael.Hennerich@analog.com>,
	Hartmut Knaack <knaack.h@gmx.de>,
	Peter Meerwald <pmeerw@pmeerw.net>,
	linux-iio@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] iio: add ad5761 DAC driver
Date: Tue, 22 Dec 2015 18:13:04 +0000	[thread overview]
Message-ID: <567992B0.5050801@kernel.org> (raw)
In-Reply-To: <CAPybu_0mp339amnPqbOddMVJ9VRqw7cWLEscyWNi7TTOYbBZTQ@mail.gmail.com>

On 20/12/15 11:19, Ricardo Ribalda Delgado wrote:
> Hello Jonthan
> 
> Thanks for your comments, I have fixed all the style problems in v2,
> so we can focus in the range parameter.
> 
> On Sat, Dec 19, 2015 at 5:31 PM, Jonathan Cameron <jic23@kernel.org> wrote:
>> Range isn't actually specified in the ABI docs.
>> Documenation\ABI\testing\sysfs-bus-iio*
>> The control interface for this is normally scale rather than range
>> (we had to pick one of the two and that is the way it fell out)  Usually
>> hardware designers care about range, but userspace programs are often
>> most directly interested in scale factors that need to be applied.
>> (and that was my most rediculously over generalized statement for the day ;)
> 
> What about a first version of the driver where the range is set via
> pdata and is not userland configurable?
> That way the four chips will be supported and we can have more
> feedback from other users about the range issue.
That would be fine.  Generally I'd imagine a given board will only want to
have one sensible choice anyway! (other than devkits at least)
> 
>>
>> I can see this is rather complex here given the random looking collection
>> of associated scales and offsets.  You would have to have _available
>> attributes to say what offsets are available at a given scale I think.
>> Also we'd have to then define a precedence order in the docs for the
>> two attributes (worth doing to make it obvious what to do when this
>> sort of setup arises).
> 
> The problem with that approach is that there will be two operations to
> set the range: one  to change the scale, and another for the offset.  The output
> voltage will change twice in this process and may have an intermediate value
> that can damage a circuit.
Fair point - I had not thought of that.  Hmm.. Could add a commit type attribute
but that's ugly too.

Even if we do allow changing the range ultimately, I think
it would need some hard restrictions in platform data on what is 'safe' for a
particular board.
> 
> I also believe that my approach with a text description is more user friendly
> (but problably because I programmed it :P)
> 
> In any case, I will implement whatever we agree ;)
For now, pdata sounds like the best plan and revisit this at a later date.

Jonathan
> 
> Best regards!
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 


  reply	other threads:[~2015-12-22 18:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-16 13:27 [PATCH] iio: add ad5761 DAC driver Ricardo Ribalda Delgado
2015-12-19 16:31 ` Jonathan Cameron
2015-12-20 11:19   ` Ricardo Ribalda Delgado
2015-12-22 18:13     ` Jonathan Cameron [this message]
2015-12-19 17:06 ` Peter Meerwald-Stadler
2015-12-20 11:24   ` Ricardo Ribalda Delgado
  -- strict thread matches above, loose matches on Subject: below --
2016-01-05 22:41 Ricardo Ribalda Delgado
2016-01-05 22:42 ` Ricardo Ribalda Delgado

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=567992B0.5050801@kernel.org \
    --to=jic23@kernel.org \
    --cc=Michael.Hennerich@analog.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=ricardo.ribalda@gmail.com \
    /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