From: Lars-Peter Clausen <lars-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
To: Pantelis Antoniou
<panto-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>
Cc: Jonathan Cameron <jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org>,
"Patil, Rachna" <rachna-l0cyMroinI0@public.gmane.org>,
linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Koen Kooi
<koen-QLwJDigV5abLmq1fohREcCpxlwaOVQ5f@public.gmane.org>,
Matt Porter <mporter-l0cyMroinI0@public.gmane.org>,
Russ Dill <Russ.Dill-l0cyMroinI0@public.gmane.org>,
linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH 1/3] ti_adc: Update with IIO map interface
Date: Wed, 31 Oct 2012 19:36:18 +0100 [thread overview]
Message-ID: <50916FA2.2000802@metafoo.de> (raw)
In-Reply-To: <C105B6BF-8407-4484-826A-A979E16B6B44-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>
On 10/31/2012 07:12 PM, Pantelis Antoniou wrote:
>
> On Oct 31, 2012, at 8:07 PM, Lars-Peter Clausen wrote:
>
>> On 10/31/2012 06:55 PM, Pantelis Antoniou wrote:
>>> [...]
>>>>> }
>>>>>
>>>>> indio_dev->channels = chan_array;
>>>>> + indio_dev->num_channels = channels;
>>>>> +
>>>>> + size = (channels + 1) * sizeof(struct iio_map);
>>>>> + adc_dev->map = kzalloc(size, GFP_KERNEL);
>>>>> + if (adc_dev->map == NULL) {
>>>>> + kfree(chan_array);
>>>>> + return -ENOMEM;
>>>>> + }
>>>>> +
>>>>> + for (i = 0; i < indio_dev->num_channels; i++) {
>>>>> + adc_dev->map[i].adc_channel_label = chan_array[i].datasheet_name;
>>>>> + adc_dev->map[i].consumer_dev_name = "any";
>>>>> + adc_dev->map[i].consumer_channel = chan_array[i].datasheet_name;
>>>>> + }
>>>>> + adc_dev->map[i].adc_channel_label = NULL;
>>>>> + adc_dev->map[i].consumer_dev_name = NULL;
>>>>> + adc_dev->map[i].consumer_channel = NULL;
>>>>
>>>> The map should be passed in via platform data or similar. All the fields of
>>>> the map depend on the specific user, so you can't use a generic map. In fact
>>>> if we were able to use a generic map, we wouldn't need a map at all.
>>>
>>> There's no platform data in the board I'm using. It's board-generic using
>>> device tree only.
>>
>> That's the 'or similar' ;) Unfortunately we do not have a device tree
>> binding for IIO yet. But I think we should aim at a interface similar like
>> we have in other subsystems like the clk, regulator or dma framework.
>>
>> - Lars
>
> So in the meantime no-one can use IIO ADC in any OF only platform.
Yes, nobody can use it until somebody implements it. So far nobody needed
it, so that's why it hasn't been implemented yet. The whole in kernel
consumer API for IIO is still very young and only a very few drivers support
it yet.
>
> In the meantime, this is pretty reasonable IMO. This is only for a specific
> board with known channel mappings.
Unfortunately it is not. It is adding a device specific hack to a generic
driver and it is also completely misusing the API.
>
> I'm not out to fix IIO, I'm out to fix a single board.
>
It's not about fixing IIO, it's about extending IIO to be able to serve your
needs. See, the issue is if everybody would work around the lack of DT
bindings we'll never have DT bindings for IIO, so the right thing to do is
to implement them instead of working around the lack of.
- Lars
next prev parent reply other threads:[~2012-10-31 18:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-01 15:24 [PATCH 1/3] ti_adc: Update with IIO map interface Pantelis Antoniou
2012-10-31 17:52 ` Lars-Peter Clausen
2012-10-31 17:55 ` Pantelis Antoniou
2012-10-31 18:07 ` Lars-Peter Clausen
[not found] ` <509168EF.9040000-Qo5EllUWu/uELgA04lAiVw@public.gmane.org>
2012-10-31 18:12 ` Pantelis Antoniou
[not found] ` <C105B6BF-8407-4484-826A-A979E16B6B44-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>
2012-10-31 18:36 ` Lars-Peter Clausen [this message]
2012-10-31 18:43 ` Pantelis Antoniou
[not found] ` <67596D26-26EC-483A-A83A-8A7F43BDE466-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>
2012-10-31 19:10 ` Lars-Peter Clausen
[not found] ` <F29A4A48-CDFA-4058-BED1-C09242B23326-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>
2012-10-31 18:16 ` Porter, Matt
2012-11-01 15:24 ` [PATCH 2/3] ti_tscadc: Match mfd sub devices to regmap interface Pantelis Antoniou
[not found] ` <1351783496-11557-2-git-send-email-panto-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org>
2012-11-02 9:36 ` Jonathan Cameron
2012-11-01 15:24 ` [PATCH 3/3] ti_tscadc: Deal with non activation of all the devices Pantelis Antoniou
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=50916FA2.2000802@metafoo.de \
--to=lars-qo5elluwu/uelga04laivw@public.gmane.org \
--cc=Russ.Dill-l0cyMroinI0@public.gmane.org \
--cc=jic23-KWPb1pKIrIJaa/9Udqfwiw@public.gmane.org \
--cc=koen-QLwJDigV5abLmq1fohREcCpxlwaOVQ5f@public.gmane.org \
--cc=linux-iio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=mporter-l0cyMroinI0@public.gmane.org \
--cc=panto-wVdstyuyKrO8r51toPun2/C9HSW9iNxf@public.gmane.org \
--cc=rachna-l0cyMroinI0@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;
as well as URLs for NNTP newsgroup(s).