lkml.org 
[lkml]   [2012]   [Oct]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/3] ti_adc: Update with IIO map interface
From
Date

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.

In the meantime, this is pretty reasonable IMO. This is only for a specific
board with known channel mappings.

I'm not out to fix IIO, I'm out to fix a single board.

Regards

-- Pantelis

\
 
 \ /
  Last update: 2012-11-01 00:21    [W:0.074 / U:0.512 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site