devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] IIO wrapper drivers, dpot-dac and envelope-detector
@ 2016-10-20  9:25 Peter Rosin
       [not found] ` <1476955562-13673-1-git-send-email-peda-koto5C5qi+TLoDKTGw+V6w@public.gmane.org>
                   ` (2 more replies)
  0 siblings, 3 replies; 26+ messages in thread
From: Peter Rosin @ 2016-10-20  9:25 UTC (permalink / raw)
  To: linux-kernel
  Cc: Peter Rosin, Jonathan Cameron, Hartmut Knaack, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Rob Herring, Mark Rutland, linux-iio,
	devicetree

Hi!

These two drivers share the fact that they wrap another iio channel,
and I use the first in combination with the second, which is why I'm
submitting them as a pair.

The first driver is a simple wrapper converting an iio dpot into an
iio dac. It only changes the unit and scale. It also does not add any
fancy iio buffer support that I don't need. I suppose that can be
added. By someone else :-)

Please look over the scale conversion, notably for the fractional log2
case that I don't need myself, so is untested. Maybe I should just
remove it?

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...

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?

The second driver (the envelope detector) is more involved. It also
explains why I need the dpot-dac driver. I wanted the envelope
detector to be generic and work with any dac, but I had a dpot...

The envelope detector was previously discussed late last year [1],
and this is what I came up with instead of that mess.

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?

Another thing is that I'm not 100% satisfied with the fact that you
have to decide at instantiation if you are going to invert the search
or not (search from below). But in order for that to be selectable
at runtime with a channel attribute of some sort, I need to be able
to rebind the interrupt to the other edge and I want to do that
without releasing the irq and grabbing it again (someone might
otherwise steal the irq, making the driver lose the irq all together).
I don't see any API to change the irq trigger condition. Is there
such a thing?

Anyway, despite all the above questions and remarks, this works for
me. Please consider applying.

Cheers,
Peter

[1] http://www.gossamer-threads.com/lists/linux/kernel/2320755

Peter Rosin (4):
  dt-bindings: iio: document dpot-dac bindings
  iio: dpot-dac: DAC driver based on a digital potentiometer
  dt-bindings: iio: document envelope-detector bindings
  iio: envelope-detector: ADC driver based on a DAC and a comparator

 .../bindings/iio/adc/envelope-detector.txt         |  65 +++++
 .../devicetree/bindings/iio/dac/dpot-dac.txt       |  43 +++
 MAINTAINERS                                        |  14 +
 drivers/iio/adc/Kconfig                            |  10 +
 drivers/iio/adc/Makefile                           |   1 +
 drivers/iio/adc/envelope-detector.c                | 305 +++++++++++++++++++++
 drivers/iio/dac/Kconfig                            |  10 +
 drivers/iio/dac/Makefile                           |   1 +
 drivers/iio/dac/dpot-dac.c                         | 219 +++++++++++++++
 9 files changed, 668 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/iio/adc/envelope-detector.txt
 create mode 100644 Documentation/devicetree/bindings/iio/dac/dpot-dac.txt
 create mode 100644 drivers/iio/adc/envelope-detector.c
 create mode 100644 drivers/iio/dac/dpot-dac.c

-- 
2.1.4

^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2016-10-22 15:03 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).