i2c-keywest & multiple channels
Hey Ben, I've done a little bit of work on the i2c-keywest adapter since a few people got it working under Linux (didn't think the 'fix' would be to slow it down with delays! I wonder why the delays aren't needed in Darwin... hummm ;').
Anyways the current version in CVS does label the bus according to uninorth or the other. You can see that in /proc/bus/i2c. I'd also like to get other operations going, like 'quick' so probing and other drivers will work better. I think the last update I made claimed to have quick transactions working, but I actually did smbus_byte.. and not quite correctly. It shouldn't hurt, though.
The adapter should attach to every compatible bus type reported by OF. I'm not sure if race conditions are possible or not. I have yet to notice possible side effect of such a case if it has happened, but then again, there isn't much happening on the busses yet.
Anyways, check out the CVS version and let me know if it's closer to where you wanted to go. (www.lm-sensors.nu and then go to the bottom of the download page)
Phil
Quoted 21 lines · Benjamin Herrenschmidt
Hi !
I need to improve the i2c-keywest driver to handle the fact that, at least the uninorth implementation of the chip, has more than one channel. (That is you can select on which channel a given transaction will occur). I need that to drive the thermostats of some laptops which are on different channels.
What do you suggest ? I don't find anything in the I2C API that could be used to do that. I could eventually register one interface per channel and use a mutex to avoid trying to blast on more than one channel at a time; but that would be bloat I beleive.
Also, what would be the convenient way to find the proper instance from the client driver ? A given client driver will actually know on which chip (uninorth or keylargo) and on which channel is the chip it's looking for. Maybe by building the adapter name in a known way ? (chip-name:channel).
Ben.
Signature · 3 lines
Philip Edelbrock -- IS Manager -- Edge Design, Corvallis, OR [email protected] -- http://www.netroedge.com/~phil PGP F16: 01 D2 FD 01 B5 46 F4 F0 3A 8B 9D 7E 14 7F FB 7A
Quoted 11 lines · Benjamin Herrenschmidt
Quoted 6 lines
So instead of 2 busses, there are actually 4? It's not hard to treat each as an individual bus and mark them as such in
/proc/bus/i2c. My only source of technical info was from the Darwin code. Do you have a PDF or something with better technical info which I could get a copy of?No, but it's in the darwin code (the set channel or something). I think there at at least 4 busses on uninorth, dunno about keylargo. The channel register allows for 16 channels per cell, but I don't think all of these are actually wired.
OK, I'll take another look. I might have seen what you are talking about, but dismissed it as something else at the time.
Quoted 8 lines
Quoted 5 lines
BTW- If you'd like to have CVS access to make modifications, feel free to ask. I took a wild stab at it originally, and it was modified by others to work enough to access the mixer chip. If you'd like to add some more refinements and better overall support, feel free.
No need ;) I have enough accesses here or there to get lost. I'll do work on my tree and eventually submit you a modified driver.
OK, that works too. :')
Phil
Signature · 3 lines
Philip Edelbrock -- IS Manager -- Edge Design, Corvallis, OR [email protected] -- http://www.netroedge.com/~phil PGP F16: 01 D2 FD 01 B5 46 F4 F0 3A 8B 9D 7E 14 7F FB 7A