[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4E9C201D.30905@cam.ac.uk>
Date: Mon, 17 Oct 2011 13:31:25 +0100
From: Jonathan Cameron <jic23@....ac.uk>
To: Mark Brown <broonie@...nsource.wolfsonmicro.com>
CC: Linus Walleij <linus.ml.walleij@...il.com>,
linux-kernel@...r.kernel.org, linux-iio@...r.kernel.org,
zdevai@...il.com
Subject: Re: [PATCH] staging:iio:proof of concept in kernel interface.
On 10/17/11 13:08, Mark Brown wrote:
> On Mon, Oct 17, 2011 at 12:32:25PM +0100, Jonathan Cameron wrote:
>> On 10/17/11 12:18, Mark Brown wrote:
>
>>> - Some voltage inputs hard wired to particular system supplies.
>
>> Hard wired in the pmic? (e.g. do not vary from device to device).
>> These I'm happy to see have names. If it were a normal IIO device their
>> access attributes would be something like:
>
>> in_voltage0_supply3V_raw
>> in_voltage1_supply2.8V_raw
>
> Yes, though the names are more symbolic than that (eg, "USB").
>
>> (have insist on indexing even with named channels because it is needed as
>> events codes don't want to carry a string.).
>
> This is orthogonal to the request interface, though.
No it isn't - because it will effect the numbering of the gneral purpose ones.
>
>>> - One or more temperature inputs wired to particular place (eg, chip
>>> and battery).
>
>> Not hard wired so to my mind these are just general purpose temperature inputs.
>> Hence naming doesn't make sense (at least not outside of board file or DT).
>
> No, they're hard wired - like I say they're wired to a particular place.
If it isn't physically in the pmic package then it doesn't belong in the driver.
>
>> There are some complexities to deal with that make me wonder if direct indexing
>> into a driver provided table isn't easier. The other is channel types.
>
> It's not great for usability if you've got to apply an additional layer
> of translation on top of mapping the schematic onto the hardware.
Agreed. Lets see how ti comes out.
>
>> Is it so bad to insist that the dt writer or equivalent actually looks at the
>> driver in question and picks the underlying channel index directly?
>
> We certainly can't put Linux specific channel numbers into the device
> tree.
Fine so numbering is based on Linux specific channel numbers based on the channel
type rather than a single index. Thus as a minimum we need everything given
in my last proposed structure.
Note the numbering is still going to be Linux specific just within a given type
of channel. ADC channels regularly have completely inconsistent (and/or stupid) names
in device data sheets.
0...4
1...5
AUXA....AUXD
TEMP_EXT1...TEMP_EXT5 (all of which are just normal adc channels that some
designer decided would be used only for connecting analog temperature sensors.)
All of these get mapped to 0...4. Anything else leads to totally unpredictable
guessing games when trying to find the channel.
Naming should be restricted for the rare case where it really really is physically
mounted in the same chip package and hence can never be used for anything else.
Sure if the adc has special features that mean it really is only useful for one
thing (like a resolver channel) then it is fine to mark it as a more specific type.
Jonathan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists