From: Lars-Peter Clausen <lars@metafoo.de>
To: Tomasz Figa <tomasz.figa@gmail.com>
Cc: Doug Anderson <dianders@chromium.org>,
Naveen Krishna Chatradhi <ch.naveen@samsung.com>,
linux-iio@vger.kernel.org,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
linux-samsung-soc@vger.kernel.org, gregkh@linuxfoundation.org,
Naveen Krishna <naveenkrishna.ch@gmail.com>
Subject: Re: [PATCH] iio: adc: add exynos5 adc driver under iio framwork
Date: Thu, 24 Jan 2013 20:30:15 +0100 [thread overview]
Message-ID: <51018BC7.20100@metafoo.de> (raw)
In-Reply-To: <1523320.h6ZorTqNLc@flatron>
On 01/24/2013 08:15 PM, Tomasz Figa wrote:
> 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@metafoo.de>
> 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.
IIO is a very Linux specific term, the device tree bindings should be as OS
agnostic as possible, so io-channels is probably the better term.
>
>>> 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).
Although similar to the GPIO bindings, the clk bindings are in my opinion an
even better example.
- Lars
next prev parent reply other threads:[~2013-01-24 19:28 UTC|newest]
Thread overview: 34+ 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 9:44 ` Lars-Peter Clausen
2013-01-22 14:03 ` Naveen Krishna Ch
2013-01-22 14:27 ` Naveen Krishna Chatradhi
2013-01-23 4:58 ` Naveen Krishna Chatradhi
2013-01-23 12:52 ` Lars-Peter Clausen
2013-01-24 0:42 ` Doug Anderson
2013-01-24 9:54 ` Lars-Peter Clausen
2013-01-24 14:20 ` Naveen Krishna Ch
2013-01-24 18:11 ` Lars-Peter Clausen
2013-01-24 16:12 ` Doug Anderson
2013-01-24 18:19 ` Lars-Peter Clausen
2013-01-24 19:15 ` Tomasz Figa
2013-01-24 19:30 ` Lars-Peter Clausen [this message]
2013-02-12 21:07 ` Guenter Roeck
2013-02-13 2:48 ` Naveen Krishna Ch
2013-02-13 11:05 ` Naveen Krishna Ch
2013-02-13 13:16 ` Naveen Krishna Ch
2013-02-13 13:30 ` Lars-Peter Clausen
2013-02-13 13:53 ` Naveen Krishna Ch
2013-02-13 14:05 ` Lars-Peter Clausen
2013-02-13 15:51 ` Guenter Roeck
2013-01-24 4:58 ` [PATCH] " Naveen Krishna Chatradhi
2013-01-26 10:57 ` Jonathan Cameron
2013-01-24 5:05 ` Naveen Krishna Chatradhi
2013-02-12 1:22 ` Olof Johansson
2013-02-14 12:11 ` [PATCH v6] iio: adc: add exynos " Naveen Krishna Chatradhi
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
2013-02-15 13:17 ` Naveen Krishna Ch
2013-02-15 13:26 ` Lars-Peter Clausen
2013-02-15 13:35 ` Naveen Krishna Ch
2013-03-03 12:16 ` 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=51018BC7.20100@metafoo.de \
--to=lars@metafoo.de \
--cc=ch.naveen@samsung.com \
--cc=dianders@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=naveenkrishna.ch@gmail.com \
--cc=tomasz.figa@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;
as well as URLs for NNTP newsgroup(s).