devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Peter Rosin <peda@axentia.se>,
	Lars-Peter Clausen <lars@metafoo.de>,
	linux-kernel@vger.kernel.org
Cc: Hartmut Knaack <knaack.h@gmx.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Rob Herring <robh+dt@kernel.org>,
	Mark Rutland <mark.rutland@arm.com>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org
Subject: Re: [PATCH 0/4] IIO wrapper drivers, dpot-dac and envelope-detector
Date: Sat, 22 Oct 2016 15:31:52 +0100	[thread overview]
Message-ID: <78e23544-4db2-d69a-d1e6-64fa36864cb6@kernel.org> (raw)
In-Reply-To: <7472292a-a509-c791-4eff-5a5037ead837@axentia.se>

On 20/10/16 15:53, Peter Rosin wrote:
> On 2016-10-20 14:55, Lars-Peter Clausen wrote:
>> On 10/20/2016 11:25 AM, Peter Rosin wrote:
>>> Also, is there some agreed-upon way to dig out the maximum value from
>>> an iio channel? If so, "dpot-dac,max-ohms" can be eliminated from the
>>> dt bindings, which would have been nice...
>>
>> Yes, this is something we could really use. In a sense it exists for the
>> devices with buffer-capable channels where there is the real_bits field
>> which tells us the data width of the channel. But a dedicated mechanism for
>> querying the maximum (and minimum) valid code seems like a useful feature.
>> Not only for in-kernel clients, but also for userspace.
> 
> For the dpot I have, real_bits (if provided) would not be too great since
> the maximum value is 256 (i.e. 257 possible wiper positions). I doesn't
> feel like I'm the most qualified person to add these new min/max attributes
> though, as I'm not familiar with most parts of the iio code. I'll happily
> jump on board if they are somehow magically available, of course :-)
> 
>>> I'm also wondering if I'm somehow abusing the regulator? I only added
>>> it to get rid of a "dpot-dac,max-voltage" thing from the dt bindings.
>>> It feels right though, but maybe I should do more with it than check
>>> its voltage? What?
>>
>> Enable the regulator when it is in use?
> 
> Right, I didn't express myself all that clearly, I do in fact already
> enable the regulator in ->probe and disable it in ->remove. Anything
> else?
Nope.  This is the same thing we do with ADCs that take a reference voltage.
Sometimes we even query the voltage ever time or handle notifiers that
tell use when it changes... (only example I can immediately think of for
that is the sht15 driver in hwmon - my fault a long time ago ;)
> 
>>> There are a couple of things to be said about the envelope detector,
>>> one question is where it should live? I placed it in the adc directory,
>>> but maybe it deserves an iio directory of its own? I'm also a bit
>>> worried that the name is a wee bit too generic. But what is a good
>>> name? I don't want it to be too long like dac-comp-envelope-detector
>>> and something like dac-comp-env-det is just unreadable. Naming is
>>> difficult... And suggestions?
>>
>> Yeah, it is a bit tricky. It is a envelope detector built from discrete
>> components, but of course there are many more ways to build one. If you have
>> a codename for your platform you could use this for the DT compatible
>> string, like 'vendor,foobar-envelope-detector'.
> 
> Good idea! Then the "envelope-detector,inverted" bool can go, and be
> implied by the compatible string. If some way to rebind the irq trigger
> is later discovered that can be added as a channel attr without
> deprecating any dt bindings stuff. While at it, the other properties
> ("envelope-detector,dac-max" and "envelope-detector,comp-interval-ms")
> could also be implied from the compatible string. Would that be better?
> I think so.
> 
> But, the compatible string is one thing and the driver name is another.
> "axentia,tse850-envelope-detector" doesn't seem like the best of driver
> names...
> 
> Are there any existing examples of drivers for (generic) things built
> with discrete components like this that could perhaps provide guidance?
> 
>>> Anyway, despite all the above questions and remarks, this works for
>>> me. Please consider applying.
>>
>> In general this series looks really good, good and clear implementation as
>> well as documentation. A few minor bits here and there, but that is normal.
> 
> Thanks, appreciated!
> 
> Cheers,
> Peter
> --
> 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
> 

  parent reply	other threads:[~2016-10-22 14:31 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-20  9:25 [PATCH 0/4] IIO wrapper drivers, dpot-dac and envelope-detector Peter Rosin
     [not found] ` <1476955562-13673-1-git-send-email-peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2016-10-20  9:25   ` [PATCH 1/4] dt-bindings: iio: document dpot-dac bindings Peter Rosin
     [not found]     ` <1476955562-13673-2-git-send-email-peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2016-10-22 14:36       ` Jonathan Cameron
2016-10-20  9:26   ` [PATCH 3/4] dt-bindings: iio: document envelope-detector bindings Peter Rosin
     [not found]     ` <1476955562-13673-4-git-send-email-peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2016-10-20 11:29       ` Peter Meerwald-Stadler
2016-10-22 14:53       ` Jonathan Cameron
2016-10-20 12:55   ` [PATCH 0/4] IIO wrapper drivers, dpot-dac and envelope-detector Lars-Peter Clausen
     [not found]     ` <9b8c0789-566d-67a3-b4f5-dbe4c69f6932-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2016-10-20 14:53       ` Peter Rosin
     [not found]         ` <7472292a-a509-c791-4eff-5a5037ead837-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2016-10-20 15:29           ` Lars-Peter Clausen
     [not found]             ` <30a4b562-f553-2620-e961-c2904bce9c51-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2016-10-22 14:27               ` Jonathan Cameron
2016-10-22 14:31         ` Jonathan Cameron [this message]
2016-10-20 17:30     ` Jonathan Cameron
2016-10-20 17:37       ` Jonathan Cameron
     [not found]         ` <DB170A5C-B172-4B86-80D5-58FD53752ED4-tko9wxEg+fIOOJlXag/Snyp2UmYkHbXO@public.gmane.org>
2016-10-20 18:17           ` Peter Rosin
2016-10-21  7:17             ` jic23
     [not found]               ` <736c146284d93633a4692b1102eaadaf-tko9wxEg+fIOOJlXag/Snyp2UmYkHbXO@public.gmane.org>
2016-10-21  8:24                 ` Peter Rosin
2016-10-21 22:58                 ` Peter Rosin
     [not found]                   ` <58b9c20d-6c3c-4693-b073-e5a8f9c4cb94-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2016-10-22 14:26                     ` Jonathan Cameron
2016-10-20  9:26 ` [PATCH 2/4] iio: dpot-dac: DAC driver based on a digital potentiometer Peter Rosin
2016-10-20 11:29   ` Peter Meerwald-Stadler
     [not found]     ` <alpine.DEB.2.02.1610201254370.19919-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>
2016-10-20 13:48       ` Peter Rosin
     [not found]         ` <22d07498-860d-29f8-07ef-ae2f5df6ab25-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2016-10-20 14:08           ` Peter Meerwald-Stadler
     [not found]             ` <alpine.DEB.2.02.1610201604280.22512-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>
2016-10-20 14:51               ` Peter Rosin
     [not found]   ` <1476955562-13673-3-git-send-email-peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2016-10-22 14:47     ` Jonathan Cameron
2016-10-20  9:26 ` [PATCH 4/4] iio: envelope-detector: ADC driver based on a DAC and a comparator Peter Rosin
     [not found]   ` <1476955562-13673-5-git-send-email-peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
2016-10-22 15:03     ` Jonathan Cameron

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=78e23544-4db2-d69a-d1e6-64fa36864cb6@kernel.org \
    --to=jic23@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=peda@axentia.se \
    --cc=pmeerw@pmeerw.net \
    --cc=robh+dt@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).