All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lars-Peter Clausen <lars@metafoo.de>
To: Jonathan Cameron <jic23@kernel.org>
Cc: Hartmut Knaack <knaack.h@gmx.de>, linux-iio@vger.kernel.org
Subject: Re: [PATCH]staging:iio:ad799x make use of platform_data optional
Date: Wed, 01 Jan 2014 16:37:58 +0100	[thread overview]
Message-ID: <52C43656.2040800@metafoo.de> (raw)
In-Reply-To: <52C422D7.4030609@kernel.org>

On 01/01/2014 03:14 PM, Jonathan Cameron wrote:
> 
> 
> On 01/01/14 13:17, Hartmut Knaack wrote:
>> Jonathan Cameron schrieb:
>>> On 29/12/13 11:49, Hartmut Knaack wrote:
>>>> Setting Vref with platform_data is a neat feature, though it is
>>>> not essential for operating these devices. So make the use of
>>>> platform_data optional and set default value of 1000 mV if
>>>> nothing else is defined.
>>>>
>>>> Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
>>> Hi Hartmut,
>> Hi
>>>
>>> Why a default of 1V?  Does that correspond to anything in
>>> particular?
>> This makes it easier to calculate your real voltage, since you only
>> need to multiply with your reference voltage. Another reason: if you
>> are more interested in the relation of your input in the range
>> [0V-Vref], you can simply get the per mill value.
> Sorry, but I'm not going to take this as whilst I can see how it
> is useful for your use case, it would introduce a new non standard
> interface.

Yep, this sounds like a hack. It's definitely something that we do not want
to do as it wont work with applications that assume the standard ABI. That
said, the driver should be updated to not allow specifying the reference
voltage via platform data, but only use the regulator API, like we did for
other drivers as well. I have a more or less untested patch for this, see
https://github.com/analogdevicesinc/linux/commit/18a2c9a304fea7360b10c9041995cad122fbff07

>>>
>>> Whilst the way this is set here is clunky there is a need for this
>>> voltage to be supplied in some fashion.  Now we'd do it via a
>>> regulator to give us nice standard device tree bindings and to
>>> allow for less simplistic hardware configurations.
>>>
>>> So lets say we convert this to use a regulator, is there still a
>>> reason why one might want a default value?
>> I'm not aware of the current state of the device tree implementation
>> at the moment. My intention is to also be able to use this driver
>> without the need of compiling a custom kernel (so to use the
>> distribution of choice out of the box).
> Then it needs to be device tree enabled and the configuration done
> via that.

I think with the above patch the driver should work fine with devicetree.

- Lars

  reply	other threads:[~2014-01-01 15:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-29 11:49 [PATCH]staging:iio:ad799x make use of platform_data optional Hartmut Knaack
2014-01-01 12:55 ` Jonathan Cameron
2014-01-01 13:17   ` Hartmut Knaack
2014-01-01 14:14     ` Jonathan Cameron
2014-01-01 15:37       ` Lars-Peter Clausen [this message]
2014-01-01 23:19         ` Hartmut Knaack

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=52C43656.2040800@metafoo.de \
    --to=lars@metafoo.de \
    --cc=jic23@kernel.org \
    --cc=knaack.h@gmx.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.