From: Tomasz Figa <tomasz.figa-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
Cc: Doug Anderson <dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org>,
Naveen Krishna Chatradhi
<ch.naveen-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>,
linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org,
Naveen Krishna
<naveenkrishna.ch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH] iio: adc: add exynos5 adc driver under iio framwork
Date: Thu, 24 Jan 2013 20:15:14 +0100 [thread overview]
Message-ID: <1523320.h6ZorTqNLc@flatron> (raw)
In-Reply-To: <51017B4D.7000105-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
Hi,
On Thursday 24 of January 2013 19:19:57 Lars-Peter Clausen wrote:
> On 01/24/2013 05:12 PM, Doug Anderson wrote:
> > Lars,
> >
> > Thank you for your comments / thoughts...
>
> Hi,
>
> > On Thu, Jan 24, 2013 at 1:54 AM, Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
wrote:
> >> adc: adc@12D10000 {
> >>
> >> #io-channel-cells = <1>;
> >> io-channel-output-names = "adc1", "adc2", ...;
> >>
> >> ncp15wb473@0 {
> >>
> >> compatible = "ntc,ncp15wb473";
> >> ...
> >> io-channels = <&adc 0>; // First ADC channel
> >
> > I'm not an expert, but I think the typical way is:
> > * No need to include a handle to &adc. It's logically our parent. In
> > a similar way i2c devices don't specify their parent bus--they are
> > just listed under it.
> > * The "0" should be specified with reg = <0>
>
> The relationship between the IIO sensor device and the consumer device
> is not always a parent child relationship. In this case it makes sense
> to have the ADC as the parent for the thermistors. But for other cases
> this may not be true. E.g. take a touchscreen or power monitoring
> platform device which uses the IIO device to do measurements.
The policy is to use children with reg property only inside a node
representing a bus controller through which the child device is being
accessed (like I2C, SPI).
I would see IIO bindings similar to what we have with GPIOs, interrupts or
regulators, so io-channels = <&iio-controller channel> seems fine (or
rather iio-channels) with the node under appropriate parent.
> > To implement this I'd imagine that we'll need a new API call, right?
> > In this case the thermistor driver won't know the name of the channel.
> >
> > It can find the ADC (the struct device and probably other things) and
> >
> > knows a channel index. Am I understanding properly?
>
> This can be done by adding a new api call, but it would be best if both
> dt and non-dt based consumers can use the same function. I outlined one
> possible solution how this can be done in the previous mail to Naveen.
In case of the solution I mentioned, implementation would be almost
identical to what is done with GPIOs (see drivers/gpio/gpiolib-of.c).
Best regards,
Tomasz
next prev parent reply other threads:[~2013-01-24 19:15 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-21 13:37 [PATCH] iio: adc: add exynos5 adc driver under iio framwork Naveen Krishna Chatradhi
2013-01-22 14:27 ` Naveen Krishna Chatradhi
2013-01-23 4:58 ` Naveen Krishna Chatradhi
2013-01-23 12:52 ` Lars-Peter Clausen
[not found] ` <50FFDD2A.9040102-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2013-01-24 0:42 ` Doug Anderson
[not found] ` <CAD=FV=VgrpPSLrwwrzFDFLBXTw+-t3C=UwnS6b53o41hxM_AyQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-24 9:54 ` Lars-Peter Clausen
[not found] ` <510104BD.2020500-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2013-01-24 14:20 ` Naveen Krishna Ch
2013-01-24 18:11 ` Lars-Peter Clausen
2013-01-24 16:12 ` Doug Anderson
[not found] ` <CAD=FV=VRKqeRxvcV1-aQCbu0FoTpMiVVXoNiVEx5SxLe3N_tgQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-01-24 18:19 ` Lars-Peter Clausen
[not found] ` <51017B4D.7000105-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2013-01-24 19:15 ` Tomasz Figa [this message]
2013-01-24 19:30 ` Lars-Peter Clausen
2013-02-12 21:07 ` Guenter Roeck
[not found] ` <20130212210732.GA8634-0h96xk9xTtrk1uMJSBkQmQ@public.gmane.org>
2013-02-13 2:48 ` Naveen Krishna Ch
[not found] ` <CAHfPSqCwqD2gzB9eiTi1hSQvRgwbsjp9NfEb3RKpy+_+DbdhzQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-13 11:05 ` Naveen Krishna Ch
2013-02-13 13:16 ` Naveen Krishna Ch
2013-02-13 13:30 ` Lars-Peter Clausen
[not found] ` <511B9575.1050506-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2013-02-13 13:53 ` Naveen Krishna Ch
2013-02-13 14:05 ` Lars-Peter Clausen
[not found] ` <CAHfPSqAJN8C6d6Oa=1UDpJ+hTXbEOGBio4Ob__ZphsKq=Rvppg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-02-13 15:51 ` Guenter Roeck
[not found] ` <1358775470-21278-1-git-send-email-ch.naveen-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-01-22 9:44 ` [PATCH] " Lars-Peter Clausen
[not found] ` <50FE5F76.7090803-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2013-01-22 14:03 ` Naveen Krishna Ch
2013-01-24 4:58 ` Naveen Krishna Chatradhi
[not found] ` <1359003514-1646-1-git-send-email-ch.naveen-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-01-26 10:57 ` Jonathan Cameron
2013-01-30 6:02 ` Naveen Krishna Ch
2013-02-14 12:11 ` [PATCH v6] iio: adc: add exynos " Naveen Krishna Chatradhi
[not found] ` <1360843890-28466-1-git-send-email-ch.naveen-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org>
2013-02-14 20:55 ` Lars-Peter Clausen
2013-02-15 6:56 ` [PATCH v7] " Naveen Krishna Chatradhi
2013-02-15 13:13 ` Lars-Peter Clausen
[not found] ` <511E346C.3060701-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2013-02-15 13:17 ` Naveen Krishna Ch
2013-02-15 13:26 ` Lars-Peter Clausen
2013-02-15 13:35 ` Naveen Krishna Ch
[not found] ` <CAHfPSqABgb8P5js8hz2_Xr2vXQ0F3OkTi2B7jZTqiDg_H6Uo4g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2013-03-03 12:16 ` Jonathan Cameron
2013-01-24 5:05 ` [PATCH] iio: adc: add exynos5 " Naveen Krishna Chatradhi
2013-02-12 1:22 ` Olof Johansson
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=1523320.h6ZorTqNLc@flatron \
--to=tomasz.figa-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=ch.naveen-Sze3O3UU22JBDgjK7y7TUQ@public.gmane.org \
--cc=dianders-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org \
--cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-samsung-soc-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=naveenkrishna.ch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.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